हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main के बजाय android-latest-release का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Google, सुविधा लॉन्च फ़्लैग का इस्तेमाल, कोड की स्थिर शाखाओं को पक्का करने के लिए करता है. AOSP में कुछ खास तरह के योगदान देने के लिए भी ये फ़्लैग ज़रूरी हैं. सुविधा लॉन्च करने के लिए फ़्लैग करने की सुविधा लागू करने से पहले, यह तय करें कि आपके बदलाव के लिए फ़्लैग ज़रूरी है या नहीं. अगर फ़्लैग ज़रूरी है, तो आपको यह तय करना चाहिए कि किस तरह का फ़्लैग इस्तेमाल करना है.
फ़्लैग के इस्तेमाल का पता लगाना
सुविधा लॉन्च करने के फ़्लैग का इस्तेमाल कब करना है, यह तय करने के लिए इन दिशा-निर्देशों का पालन करें:
अगर कोई ऐसा बदलाव किया जा रहा है जिसकी वजह से AOSP कोडबेस अस्थिर हो सकता है, तो सुविधा लॉन्च करने के लिए फ़्लैग का इस्तेमाल करें. जैसे, कोई नई सुविधा जोड़ना या किसी खास तरह के गड़बड़ी को ठीक करना.
इसके उलट, अगर कोड में कोई ऐसा बदलाव किया जा रहा है जिससे कोडबेस अस्थिर न हो, जैसे कि टिप्पणियों में बदलाव करना, तो आपको सुविधा लॉन्च करने के लिए फ़्लैग का इस्तेमाल करने की ज़रूरत नहीं है.
फ़्लैग का टाइप तय करना
फ़्लैग दो तरह के होते हैं: aconfig फ़्लैग और बिल्ड फ़्लैग.
Aconfig फ़्लैग
Aconfig फ़्लैग का इस्तेमाल, टेस्टिंग और रिलीज़ की प्रोसेस के दौरान, रिलीज़ नहीं किए गए कोड को रिलीज़ किए गए कोड से अलग करने के लिए किया जाता है. Aconfig फ़्लैग, रीड-राइट या रीड-ओनली हो सकते हैं:
रीड-राइट aconfig फ़्लैग, बूलियन वैरिएबल होते हैं. इन्हें रनटाइम पर चालू (true पर सेट करें) या बंद (false पर सेट करें) किया जा सकता है. मुख्य शाखा के स्टेबिलिटी पर असर डाले बिना, बदलावों को टेस्ट करने और रिलीज़ करने के लिए, रीड-राइट फ़्लैग का इस्तेमाल करें.
रीड-ओनली aconfig फ़्लैग, बूलियन कॉन्स्टेंट होते हैं. इन्हें रनटाइम के दौरान बदला नहीं जा सकता. रिड-राइट aconfig फ़्लैग को सिर्फ़ पढ़ने के लिए उपलब्ध aconfig फ़्लैग में बदला जा सकता है. ऐसा, ऐसे कोड के लिए किया जा सकता है जो स्थिर है और रिलीज़ के लिए तैयार है.
इसके अलावा, इस्तेमाल किए जा रहे कंपाइलर के हिसाब से, रीड-ओनली फ़्लैग का इस्तेमाल करने पर, हो सकता है कि जिस कोड को लागू नहीं किया गया है उसे बिल्ड से बाहर रखा जाए. इसलिए, रीड-ओनली फ़्लैग का इस्तेमाल करके, किसी भी ऐसे कोड को छिपाया जा सकता है जो रिलीज़ का हिस्सा नहीं है.
फ़्लैग बनाना
बिल्ड फ़्लैग, बिल्ड के समय के कॉन्स्टेंट (स्ट्रिंग) होते हैं. इन्हें रनटाइम के दौरान बदला नहीं जा सकता. इन फ़्लैग का इस्तेमाल उन स्थितियों में करें जहां aconfig फ़्लैग का इस्तेमाल नहीं किया जा सकता. जैसे:
आपके पास पहले से कंपाइल किया गया या पहले से बना कोड है, जिसे आपको बिल्ड में शामिल करना है.
आपको बिल्ड सिस्टम में बदलाव करने हैं.
आपको कोड के साइज़ को मैनेज करने के लिए, डिपेंडेंसी के आस-पास फ़्लैग लगाने हैं.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, 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,["# Determine flag usage and type\n\nFeature launch flags are used by Google as an approach to ensuring stable\ncode branches. These flags are also required for certain types of contributions\nto AOSP. Before implementing feature launch flagging, determine if\na flag is necessary for your change. And, if a flag is necessary, you should\ndetermine the type of flag to use.\n\nDetermine flag usage\n--------------------\n\nTo determine when to use a feature launch flag, follow these guidelines:\n\n- If you are making a change that could cause the AOSP codebase to be unstable,\n such as adding a new feature or fixing a particularly complex bug, use a feature\n launch flag.\n\n- Conversely, if you are making a code change that isn't apt to cause the\n codebase to be unstable, such as modifying comments, you don't need to use a\n feature launch flag.\n\nDetermine flag type\n-------------------\n\nThere are two types of flags: *aconfig flags* and *build flags*.\n\n### Aconfig flags\n\nAconfig flags are used to separate the execution of unreleased code from\nreleased code during the testing and release process. Aconfig flags can be\nread-write or read-only:\n\n- *Read-write aconfig flags* are boolean variables that you can enable (set to\n `true`) or disable (set to `false`) at runtime. Use a read-write flag to test\n and release changes without affecting the stability of a main branch.\n\n- *Read-only aconfig flags* are boolean constants that you can't change at\n runtime. You can convert read-write aconfig flags to read-only aconfig flags\n for code that is stable and ready to release.\n\n Additionally, depending on the compiler you're using, when a read-only flag\n is used, the code that isn't executed might be excluded\n from the build. Therefore, you can use read-only flags to hide any code that\n isn't ready to be part of a release.\n\n### Build flags\n\nBuild flags are build-time constants (strings) and you can't change them during\nruntime. Use these flags in circumstances where you can't use aconfig flags,\nsuch as:\n\n- You have a precompiled or prebuilt piece of code that you want to include in the build.\n- You want to make changes to build system itself.\n- You want to put flags around dependencies to manage code size.\n\n| **Note:** Build flags have special encodings for boolean values (`false: {empty string}, true: \"true\"`)."]]