AOSP에 코드를 추가할 때는 기능 실행 플래그를 사용하여 테스트되지 않은 코드를 테스트된 코드와 격리합니다. 기능 출시 플래그를 사용 설정하여 코드를 실행하고 테스트합니다.
반대로 기능 실행 플래그를 사용 중지하여 테스트되지 않은 코드가 실행되지 않도록 합니다.
기능 출시 플래그는 주로 다음 두 가지 방식으로 사용됩니다.
AOSP에 기여하는 경우 변경사항 검토자가 기능이 제대로 테스트될 수 있도록 기능 출시 플래그를 구현하도록 요청할 수 있습니다.
브랜치에 관한 자세한 내용은 출시 수명 주기를 참고하세요.
Google은 기능 출시 플래그를 사용하여 Android 최신 출시 브랜치(android16-release)가 모든 사용자에게 안정적일 수 있도록 합니다. 회사에서 AOSP 미러를 유지하고 해당 미러에서 작업하는 경우 기능 출시 플래그를 사용하여 개발팀을 위해 AOSP 코드 미러를 안정적으로 유지하세요.
기능 출시 신고를 구현하기 위한 대략적인 단계는 다음과 같습니다.
특정 코드 변경사항의 경우 플래그가 필요한지 확인하고 필요한 경우 플래그 유형을 결정합니다.
플래그를 선언합니다.
코드 변경사항을 플래그로 래핑합니다.
플래그 값을 설정합니다.
코드를 빌드하고 테스트합니다.
런타임 시 플래그 값을 변경합니다.
기능 출시 플래그를 사용하는 테스트 코드
이 섹션의 페이지에서는 이러한 각 단계를 실행하는 방법을 설명합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Feature launch flag overview\n\nWhen adding code into AOSP, use *feature launch flags* to isolate\nuntested code from tested code. Enable feature launch flags to execute and\ntest your code.\nConversely, disable feature launch flags to ensure untested code doesn't\nexecute.\n\nFeature launch flags are used primarily in these two ways:\n\n- 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](/docs/setup/contribute/release-lifecycle).\n- Google uses feature launch flags to ensure the Android latest release branch (`android16-release`) is 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.\n\n| **Note:** Feature launch flagging is part of a new development process called *Trunk Stable* whereby all official AOSP releases are snapped from a single internal main development branch. To achieve this goal, the main development branch must remain stable at all time. Trunk Stable requires all updates and new features to be flagged so they can, on a case-by-case basis, be included or excluded from the internal main branch before snapping a release. For more on the AOSP release process, see [Release\n| lifecycle](/docs/setup/contribute/release-lifecycle).\n\nThe high-level steps for implementing feature launch flagging are:\n\n1. For a given code change, determine if you need a flag and, if so, determine the flag type.\n2. Declare the flag.\n3. Wrap your code change in the flag.\n4. Set the flag's value.\n5. Build and test your code.\n6. Change flag values at runtime.\n7. Test code that uses feature release flags\n\nThe pages in this section teach you how to perform each of these steps."]]