Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release thay vì aosp-main để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trang này trình bày hai nhiệm vụ quan trọng đối với người đóng góp: ký thoả thuận cấp phép cho người đóng góp và đảm bảo sử dụng đúng tiêu đề cấp phép trong mã của bạn.
Ký thoả thuận cấp phép cho cộng tác viên
Tất cả cá nhân đóng góp (những người chỉ đóng góp thay mặt cho chính họ) ý tưởng, mã hoặc tài liệu cho Dự án nguồn mở Android (AOSP) đều phải hoàn tất, ký và gửi Thoả thuận cấp phép cho cá nhân đóng góp.
Bạn có thể thực thi thoả thuận này trên mạng thông qua công cụ xem xét mã.
Thoả thuận này xác định các điều khoản để đóng góp tài sản trí tuệ vào AOSP. Giấy phép này nhằm bảo vệ bạn với tư cách là người đóng góp cũng như bảo vệ dự án; giấy phép này không thay đổi quyền của bạn trong việc sử dụng nội dung đóng góp của riêng bạn cho bất kỳ mục đích nào khác.
Thoả thuận cấp phép cho người đóng góp là pháp nhân dành cho một công ty (hoặc pháp nhân khác) có nhân viên làm việc trên AOSP.
Phiên bản thoả thuận này cho phép một công ty uỷ quyền cho các nhân viên được chỉ định đóng góp nội dung và cấp giấy phép bản quyền cũng như giấy phép phát minh.
Google dựa vào các thoả thuận cấp phép dành cho cộng tác viên mà Quỹ phần mềm Apache sử dụng. Bạn có thể tìm thấy các thoả thuận này trên trang web của Apache.
Thêm tiêu đề giấy phép
Dự án nguồn mở Android (AOSP) sử dụng một số dự án nguồn mở đã phê duyệt giấy phép nguồn mở cho phần mềm của chúng tôi.
Giấy phép Apache, Phiên bản 2.0 (Apache 2.0) là giấy phép ưu tiên cho AOSP và phần lớn phần mềm Android được cấp phép theo Apache 2.0. Mặc dù dự án sẽ cố gắng tuân thủ giấy phép ưu tiên, nhưng có thể có những tình huống ngoại lệ. Khi đó, chúng tôi sẽ xử lý theo từng trường hợp. Ví dụ: các bản vá nhân Linux thuộc giấy phép GPLv2 với các ngoại lệ hệ thống, bạn có thể tìm thấy các bản vá này trên The Linux Kernel Archives (Bản lưu trữ nhân Linux).
Đối với phần mềm không phải hạt nhân (không phải không gian người dùng), Google ưu tiên Apache 2.0 (và các giấy phép tương tự như BSD và MIT) hơn các giấy phép khác như GNU Lesser General Public License (LGPL). Dưới đây là lý do:
Android là về sự tự do và lựa chọn. Mục đích của Android là thúc đẩy tính mở trong thế giới di động và Google không thể dự đoán hoặc chỉ định tất cả các cách sử dụng phần mềm của chúng tôi. Vì vậy, mặc dù Google khuyến khích mọi người tạo thiết bị mở và có thể sửa đổi, nhưng chúng tôi không cho rằng mình có quyền buộc họ làm như vậy. Việc sử dụng thư viện LGPL có thể bị hạn chế. Sau đây là một số mối lo ngại cụ thể của chúng tôi:
Nói một cách đơn giản, LGPL yêu cầu vận chuyển nguồn đến ứng dụng; một ưu đãi bằng văn bản cho nguồn; hoặc liên kết thư viện được cấp phép theo LGPL một cách linh động và cho phép người dùng nâng cấp hoặc thay thế thư viện theo cách thủ công. Phần mềm Android thường được phân phối dưới dạng hình ảnh hệ thống tĩnh, vì vậy, việc tuân thủ các yêu cầu này sẽ hạn chế thiết kế của nhà sản xuất thiết bị. Ví dụ: người dùng khó thay thế thư viện trên bộ nhớ flash chỉ có thể đọc.
LGPL yêu cầu cho phép khách hàng sửa đổi và kỹ thuật đảo ngược để gỡ lỗi các sửa đổi đó. Hầu hết nhà sản xuất thiết bị không muốn bị ràng buộc bởi các điều khoản này.
Trước đây, các thư viện LGPL đã gây ra nhiều vấn đề về việc tuân thủ đối với các nhà sản xuất thiết bị và nhà phát triển ứng dụng ở hạ nguồn. Việc đào tạo kỹ sư về những vấn đề này rất khó khăn và tốn thời gian. Điều quan trọng đối với sự thành công của Android là nhà sản xuất thiết bị có thể dễ dàng tuân thủ các giấy phép.
Những mối lo ngại này không phải là sự chỉ trích LGPL hoặc các giấy phép khác. Google trân trọng tất cả giấy phép nguồn mở và miễn phí, đồng thời tôn trọng lựa chọn ưu tiên về giấy phép của người khác.
Google đã quyết định rằng Apache 2.0 là phiên bản phù hợp nhất với các mục tiêu của chúng tôi.
Khi gửi mã để đưa vào AOSP, bạn phải đảm bảo sử dụng đúng tiêu đề giấy phép. Các phần sau đây giải thích cách xử lý tiêu đề giấy phép cho các tệp mới và mã hiện có.
Làm theo các phương pháp hay nhất về giấy phép và bản quyền
Hãy làm theo các phương pháp hay nhất sau đây đối với tiêu đề bản quyền và giấy phép:
Không sửa đổi bản quyền hiện có. Ví dụ: nếu muốn đóng góp một tệp cho AOSP chứa mã bắt nguồn từ một tệp có thông báo bản quyền riêng, bạn phải giữ lại thông báo bản quyền đó trong tệp gốc.
Nếu bạn thêm một tệp nguồn hoàn toàn mới, hãy sử dụng bản quyền AOSP mặc định và tiêu đề giấy phép sau, trừ phi dự án mà bạn đang đóng góp có một giấy phép được xác định trước khác:
Copyright (C) yyyy The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Contributor license agreements and headers\n\nThis page covers two important contributor tasks: signing contributor license\nagreements and ensuring correct use of licensing headers in your code.\n\nSign contributor license agreements\n-----------------------------------\n\nAll individual contributors (those making contributions only on their own\nbehalf) of ideas, code, or documentation to Android Open Source Project (AOSP)\nare required to complete, sign, and submit an\n[Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual).\nYou can execute this agreement online through the\n[code review tool](https://android-review.googlesource.com/#/settings/agreements).\nThe agreement defines the terms for contributing intellectual property\nto AOSP. This license is for your protection as a contributor as well as the\nprotection of the project; it doesn't change your rights to use your own\ncontributions for any other purpose.\n\nThe [Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate)\nis available for a corporation (or other entity) with employees working on AOSP.\nThis version of the agreement lets a corporation authorize contributions\nsubmitted by its designated employees and grant copyright and patent\nlicenses.\n| **Note:** A Corporate Contributor License Agreement doesn't remove the need for a developer to sign their own Individual Contributor License Agreement as an individual. The individual agreement is needed to cover any of their contributions that are *not* owned by the corporation signing the Corporate Contributor License Agreement.\n\nGoogle bases their contributor license agreements on those used by the\n[Apache Software Foundation](http://www.apache.org), which can\nbe found on the\n[Apache website](http://www.apache.org/licenses/).\n\nInclude license headers\n-----------------------\n\nThe Android Open Source Project (AOSP) uses a few\n[open source initiative](http://www.opensource.org/) approved open source\nlicenses for our software.\n\n[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n(Apache 2.0) is the preferred license for AOSP, and the majority of Android\nsoftware is licensed with Apache 2.0. While the project strives to adhere to the\npreferred license, there are exceptions, which are handled on a case-by-case\nbasis. For example, the Linux kernel patches are under the GPLv2 license with\nsystem exceptions, which can be found on\n[The Linux Kernel Archives](http://www.kernel.org/pub/linux/kernel/COPYING).\n\nFor userspace (nonkernel) software, Google prefer Apache 2.0 (and similar\nlicenses such as BSD and MIT) over other licenses such as the GNU Lesser General\nPublic License (LGPL). Here's why:\n\n- Android is about freedom and choice. The purpose of Android is to promote\n openness in the mobile world, and Google can't predict or dictate all of the\n uses for our software. So, while Google encourages everyone to make open and\n modifiable devices, we don't think it's our place to force them to do so. Using\n LGPL libraries could be restrictive. Here are some of our specific concerns:\n\n - In simplified terms, LGPL requires shipping of source to the application; a\n written offer for source; or linking the LGPL-ed library dynamically and\n allowing users to manually upgrade or replace the library. Android software is\n typically shipped as a static system image, so complying with these\n requirements restricts device manufacturer designs. For example, it's\n difficult for a user to replace a library on read-only flash storage.\n\n - LGPL requires the allowance of customer modification and reverse engineering\n for debugging those modifications. Most device makers don't want to be bound\n by these terms.\n\n - Historically, LGPL libraries have been the source of many compliance\n problems for downstream device makers and app developers. Educating\n engineers on these issues is difficult and time consuming. It's critical to\n Android's success that device makers can easily comply with the licenses.\n\nThese concerns aren't criticisms of LGPL or other licenses. Google appreciates\nall free and open source licenses, and respect others' license preferences.\nGoogle has decided that Apache 2.0 is the best fit for our goals.\n\nWhen submitting code to be included in AOSP, you must ensure proper use of\nlicense headers. The following sections explains how to handle\nlicense headers for new files and existing code.\n\n### Follow license and copyright best practices\n\nFollow these best practices for copyright and license header:\n\n- Don't modify an existing copyright. For example, if you want to contribute a\n file to AOSP that contains code that originated in a file with a its own\n copyright notice, you must retain that copyright notice from the original file.\n\n- If you add a wholly new source file, use the default AOSP copyright and the\n following license header, unless the project you're contributing to has a\n different predefined license:\n\n Copyright (C) \u003cvar translate=\"no\"\u003eyyyy\u003c/var\u003e The Android Open Source Project\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n | **Note:** \u003cvar translate=\"no\"\u003eyyyy\u003c/var\u003e refers to the year that the file is added."]]