Stay organized with collections
Save and categorize content based on your preferences.
When adding code into AOSP, use feature launch flags to isolate
untested code from tested code. Enable feature launch flags to execute and
test your code.
Conversely, disable feature launch flags to ensure untested code doesn't
execute.
Feature launch flags are used primarily in these two ways:
If you're contributing to AOSP, you might be asked by your change's reviewer
to implement a feature launch flag so that the feature is tested properly. For
further information on branches, see
Release lifecycle.
Google uses feature launch flags to ensure the external development branch
(main) and release branch are stable for everyone. If your company keeps a
mirror of AOSP and works from that mirror, use feature launch flagging to keep
your mirror of AOSP code stable for your development team.
The high-level steps for implementing feature launch flagging are:
For a given code change, determine if you need a flag and, if so, determine
the flag type.
Declare the flag.
Wrap your code change in the flag.
Set the flag's value.
Build and test your code.
Change flag values at runtime.
Test code that uses feature release flags
The pages in this section teach you how to perform each of these steps.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-12-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-18 UTC."],[],[]]