Set feature launch flag values  |  Android Open Source Project Skip to main content Docs What's new? Release notes Latest security bulletins Latest Compatibility Definition Document (CDD) Site updates Getting Started About Start Download Builds Test Create Contribute Community Tools, build, and related reference Security Overview Bulletins Features Testing Best Practices Core Topics Architecture Audio Camera Connectivity Data Display Fonts Graphics Interaction Media Performance Permissions Power Runtime Settings Storage Tests Updates Virtualization Compatibility Compatibility Definition Document (CDD) Compatibility Test Suite (CTS) Android Devices Cuttlefish Enterprise TV Automotive Overview Software Defined Vehicle In-vehicle Infotainment Release Details Reference HIDL HAL Trade Federation Security Test Suite Android Code Search / English Deutsch Español – América Latina Français Indonesia Italiano Polski Português – Brasil Tiếng Việt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 – 简体 中文 – 繁體 日本語 한국어 Sign in Documentation What's New? Getting Started Security Core Topics Compatibility Android Devices Automotive Reference Docs More What's New? Getting Started Security Core Topics Compatibility Android Devices Automotive Reference Android Code Search Overview About AOSP overview FAQ Start Try Android development Understand terminology Set up for AOSP development (9.0 or later) Set up for AOSP development (2.3 - 8.0) Download Download the Android source Troubleshoot and fix sync issues Source control tools Build Build overview Build Android Use feature launch flags Feature launch flag overview Determine flag usage and type Declare an aconfig flag Wrap code change in feature launch flag Set feature launch flag values Change a flag's value at runtime Declare and use a build flag Test code within feature launch flags Build kernels Build Pixel kernels Convert from Make to Soong Implement Java SDK library Android Rust Introduction Android Rust modules Binary modules Library modules Test modules Fuzz modules Source generators Source generators overview Bindgen bindings modules Protobuf modules Hello Rust example Android Rust patterns Rust IDE setup Compile with Jack (6.0 - 8.1) Create Source control workflow Custom device development Add a new device type Build for 32-bit and 64-bit architectures Use reference boards Create a software bill of materials (SBOM) Configure and handle update ownership for apps Test Test a build Flash with Fastboot Flash with Android Flash Tool Test with the cuttlefish emulator Use Android Emulator virtual devices Contribute Overview Android Code Search Contributor license agreements and headers Release lifecycle Submit code changes Contribute to upstream projects Git source editor Review a change Download build artifacts Report and track bugs Code with respect AOSP Java code style for contributors API guidelines Overview Android async and nonblocking API guidelines Android API client-side caching guidelines Community Code of conduct Discussion groups, contacts, and additional resources Tools, build, and related reference Overview Android.bp file format Kernel branches and their build systems Codenames, tags, and build numbers Fastboot key combinations Repo command reference What's new? Release notes Latest security bulletins Latest Compatibility Definition Document (CDD) Site updates Getting Started About Start Download Builds Test Create Contribute Community Tools, build, and related reference Security Overview Bulletins Features Testing Best Practices Core Topics Architecture Audio Camera Connectivity Data Display Fonts Graphics Interaction Media Performance Permissions Power Runtime Settings Storage Tests Updates Virtualization Compatibility Compatibility Definition Document (CDD) Compatibility Test Suite (CTS) Android Devices Cuttlefish Enterprise TV Automotive Overview Software Defined Vehicle In-vehicle Infotainment Release Details Reference HIDL HAL Trade Federation Security Test Suite Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, use android-latest-release. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP. AOSP Docs Getting Started Set feature launch flag values Stay organized with collections Save and categorize content based on your preferences. By default, all feature launch flags are READ_WRITE and set to DISABLED. Before you can test a feature, you must override the default value used in the build by creating a flag values file for the flag. In a flag values file, you set a individual flag's state (ENABLED or DISABLED) and permission (READ_WRITE or READ_ONLY). A release configuration is a directory that contains all of the flag values files for a specific build of Android (with certain features enabled and disabled). AOSP ships with a few release configurations, such as trunk_staging. Release configuration directories are found under WORKING_DIRECTORY/build/release/aconfig/. Note: This page shows you how to add a flag to an existing release configuration as a means of teaching how release configurations work. The release configurations included in AOSP are defined by Google. Google doesn't accept contributions to update or change a configuration's feature release flags. Instead, you can define your own custom release configurations including default flag values in your forks of AOSP. For more information on release configurations, see Set feature launch flag values. When you use the lunch command to choose a target, you're also setting the release configuration for the target. For example, the following is a trunk_staging target: lunch aosp_cf_x86_64_only_phone-trunk_staging-userdebug Trunk staging is a development release configuration because Google uses it to test features before general release. This configuration uses mostly READ_WRITE flags that let you test your code with features enabled or disabled at runtime. At general release, use a release release configuration. A release release configuration mostly uses READ_ONLY flags and reflects all of the code enabled for that release. Add a flag to the trunk_staging release configuration To test a new flag, add it to the trunk_staging release configuration as follows: Navigate to WORKING_DIRECTORY/build/release/aconfig/trunk_staging/ Create a directory with the same package name as your flag, such as com.example.android.aconfig.demo.flags shown in Declare an aconfig flag for Java. Navigate to the new directory. In the directory, create a flag values file that combines the name used in the flag declaration (.aconfig) file, such as my_static_flag shown in Declare an aconfig flag for Java with _flag_values.textproto. The resulting filename is my_static_flag_flag_values.textproto. Edit the file and add a flag_value similar to the following: flag_value { package: "com.example.android.aconfig.demo.flags" name: "my_static_flag" state: DISABLED Permission: READ_WRITE } Where: package contains the same package name used in the declaration. name contains the same name used in the declaration. state is either ENABLED or DISABLED. permission is either READ_WRITE or READ_ONLY. Generally, the permission is set to READ_ONLY for flag values files that are part of a release configuration. Save the file and exit your editor. In the same directory as the flag values file, create a build file called Android.bp. This file is used to include the flag values file in the build. In the Android.bp file, create a aconfig_values section similar to: aconfig_values { name: "aconfig-values-platform_build_release-trunk-staging-com.example.android.aconfig.demo.flags-all", package: "com.example.android.aconfig.demo.flags", srcs: [ "*_flag_values.textproto", ] } Where: name is the unique name for the Soong build module. Google uses the convention of aconfig-values-platform_PATH_TO_RELEASE_CONFIG_DIR-CONFIG_NAME-package.name-all. This name must must match the name that soong auto-generates based on the aconfig_value_set declaration in the parent directory's Android.bp file. Note that PATH_TO_RELEASE_CONFIG_DIR is build_release. package contains the same package name used in the declaration. srcs is a list of all of your flag values files. Save the file and exit your editor. Navigate to the directory above the current directory (cd ..) Build Android, and run your new code to verify that it's enabled per the setting in the flag values file. 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 2026-06-17 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 2026-06-17 UTC."],[],[]] Build Android repository Requirements Downloading Preview binaries Factory images Driver binaries Connect @Android on X @AndroidDev on X Android Blog Google Security Blog Platform on Google Groups Building on Google Groups Porting on Google Groups Get help Android Help Center Pixel Help Center www.android.com Google Mobile Services Stack Overflow Issue Tracker About Android Community Legal License Privacy Site feedback Manage cookies English Deutsch Español – América Latina Français Indonesia Italiano Polski Português – Brasil Tiếng Việt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 – 简体 中文 – 繁體 日本語 한국어