Contributor license agreements and headers

This page covers two important contributor tasks: signing contributor license agreements and ensuring correct use of licensing headers in your code.

Sign contributor license agreements

All individual contributors (those making contributions only on their own behalf) of ideas, code, or documentation to Android Open Source Project (AOSP) are required to complete, sign, and submit an Individual Contributor License Agreement. You can execute this agreement online through the code review tool. The agreement defines the terms for contributing intellectual property to AOSP. This license is for your protection as a contributor as well as the protection of the project; it doesn't change your rights to use your own contributions for any other purpose.

The Corporate Contributor License Agreement is available for a corporation (or other entity) with employees working on AOSP. This version of the agreement lets a corporation authorize contributions submitted by its designated employees and grant copyright and patent licenses.

Google bases their contributor license agreements on those used by the Apache Software Foundation, which can be found on the Apache website.

Include license headers

The Android Open Source Project (AOSP) uses a few open source initiative approved open source licenses for our software.

Apache License, Version 2.0 (Apache 2.0) is the preferred license for AOSP, and the majority of Android software is licensed with Apache 2.0. While the project strives to adhere to the preferred license, there are exceptions, which are handled on a case-by-case basis. For example, the Linux kernel patches are under the GPLv2 license with system exceptions, which can be found on The Linux Kernel Archives.

For userspace (nonkernel) software, Google prefer Apache 2.0 (and similar licenses such as BSD and MIT) over other licenses such as the GNU Lesser General Public License (LGPL). Here's why:

  • Android is about freedom and choice. The purpose of Android is to promote openness in the mobile world, and Google can't predict or dictate all of the uses for our software. So, while Google encourages everyone to make open and modifiable devices, we don't think it's our place to force them to do so. Using LGPL libraries could be restrictive. Here are some of our specific concerns:

    • In simplified terms, LGPL requires shipping of source to the application; a written offer for source; or linking the LGPL-ed library dynamically and allowing users to manually upgrade or replace the library. Android software is typically shipped as a static system image, so complying with these requirements restricts device manufacturer designs. For example, it's difficult for a user to replace a library on read-only flash storage.

    • LGPL requires the allowance of customer modification and reverse engineering for debugging those modifications. Most device makers don't want to be bound by these terms.

    • Historically, LGPL libraries have been the source of many compliance problems for downstream device makers and app developers. Educating engineers on these issues is difficult and time consuming. It's critical to Android's success that device makers can easily comply with the licenses.

These concerns aren't criticisms of LGPL or other licenses. Google appreciates all free and open source licenses, and respect others' license preferences. Google has decided that Apache 2.0 is the best fit for our goals.

When submitting code to be included in AOSP, you must ensure proper use of license headers. The following sections explains how to handle license headers for new files and existing code.

Follow these best practices for copyright and license header:

  • Don't modify an existing copyright. For example, if you want to contribute a file to AOSP that contains code that originated in a file with a its own copyright notice, you must retain that copyright notice from the original file.

  • If you add a wholly new source file, use the default AOSP copyright and the following license header, unless the project you're contributing to has a different predefined license:

    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.