اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release بدلاً من aosp-main لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوفّر AOSP الخيارات التالية لتخزين معلومات الضبط على
الجهاز:
خصائص النظام
خصائص طبقة تجريد الأجهزة (HAL)
ملفات XML لإعدادات النظام
تراكب الموارد (الثابتة ووقت التشغيل)
خصائص النظام
خصائص النظام هي أزواج مفتاح/قيمة من سلاسل يتم تخزينها في القاموس الشامل build.prop. خصائص النظام هي موارد على مستوى النظام يسهل
استخدامها وتؤدي إلى انخفاض الأداء. عند استخدام سمات النظام، لا تحتاج
إلى استخدام تقنية "التواصل بين العمليات" (IPC) حتى إذا تمت مشاركة سمة نظام
على مستوى عمليات متعددة. ومع ذلك، تشبه سمات النظام المتغيّرات
العموميّة ويمكن أن تكون ضارة عند إساءة استخدامها. يمكن أن يؤدي إساءة استخدام ملفات تعريف النظام إلى
حدوث مشاكل، مثل ثغرات أمنية وعدم تمكّن المستخدمين من استخدام التطبيقات. قبل استخدام خصائص النظام لتخزين معلومات الإعداد،
ننصحك بالاطّلاع على خيارات الإعداد الأخرى.
لمزيد من المعلومات عن سمات النظام، يُرجى الاطّلاع على مقالة إضافة سمات النظام.
سمات HAL
عندما يكون مصدر المعلومات الصحيحة لإعدادات معيّنة من عنصر أجهزة على
الجهاز، يجب أن يوفّر HAL للأجهزة المعلومات المتعلّقة
بهذا العنصر. حدِّد طريقة HAL جديدة في HAL الحالية للوصول إلى
الإعدادات. لمزيد من المعلومات حول تطوير HAL، يُرجى الاطّلاع على
AIDL لواجهة HAL.
ملفات XML لإعدادات النظام
عندما تكون بيانات الضبط ثابتة ولكنّها معقّدة (منظَّمة)، ننصحك باستخدام
تنسيق XML أو تنسيقات أخرى مشابهة لبيانات الضبط. تأكَّد من أنّ
مخطّط الملف يظل ثابتًا. بالنسبة إلى ملفات XML، يمكنك استخدام
xsd_config
للحفاظ على ثبات المخطّط والاستفادة من معالج تحليل XML
التلقائي.
تراكب الموارد
يمكنك استخدام تراكب الموارد لتخصيص منتج. هناك نوعان من
العناصر التي تظهر فوق الموارد:
تراكب الموارد العادي المستخدَم لتخصيص منتج في وقت الإنشاء للحصول على
معلومات عن تراكب الموارد العادية، يُرجى الاطّلاع على
تخصيص الإصدار باستخدام تراكب الموارد.
يُستخدَم تداخل الموارد أثناء التشغيل (RRO) لتغيير قيم الموارد
للحزمة المستهدَفة أثناء التشغيل. على سبيل المثال، قد يغيّر تطبيق مثبَّت على ملف system
image سلوكه استنادًا إلى قيمة أحد الموارد. بدلاً من
ترميز قيمة المورد بشكلٍ ثابت في وقت الإنشاء، يمكن أن يؤدي تثبيت حزمة RRO على فسيفساء مختلف
إلى تغيير قيم موارد التطبيق أثناء التشغيل. لمزيد من
المعلومات عن عمليات إعادة الربط الديناميكية، يُرجى الاطّلاع على
تغيير قيمة موارد التطبيق أثناء التشغيل.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Configuration overview\n\nAOSP offers the following options for storing configuration information on a\ndevice:\n\n- System properties\n- Hardware abstraction layer (HAL) properties\n- System config XML files\n- Resource overlays (static and runtime)\n\nSystem properties\n-----------------\n\n*System properties* are string key/value pairs stored in the `build.prop`\nglobal dictionary. System properties are system-wide resources that are easy to\nuse and have a low performance overhead. When using system properties, you don't\nneed to use interprocess communication (IPC) even if a system property is shared\nacross multiple processes. However, system properties are similar to global\nvariables and can be harmful when misused. The misuse of system properties can\nresult in issues such as security vulnerabilities and apps becoming inaccessible\nto users. Before using system properties to store configuration information,\nconsider the other configuration options.\n\nFor further information on system properties, see\n[Add system properties](/docs/core/architecture/configuration/add-system-properties)\n| **Note:** Previous to Android 10, AOSP used a ConfigStore HAL to store system properties. ConfigStore HAL is deprecated and should no longer be used. For information on the ConfigStore HAL, refer to [ConfigStore HAL](/docs/core/architecture/configuration/archive).\n\nHAL properties\n--------------\n\nWhen the source of truth for a configuration is from a hardware component on a\ndevice, the HAL for the hardware must provide the information for that\ncomponent. Define a new HAL method in the existing HAL for accessing the\nconfiguration. For further information on developing a HAL, see\n[AIDL for HALs](/docs/core/architecture/aidl/aidl-hals).\n| **Note:** Don't configure the HAL to use system properties as a side-channel communication mechanism for HALs.\n\nSystem config XML files\n-----------------------\n\nWhen the configuration data is static but complicated (structured), consider\nusing XML or other such formats for the configuration data. Ensure that the\nfile schema remains stable. For XML files, you can use\n[`xsd_config`](/docs/core/architecture/config-file-schema-api#config-build-rule)\nto keep the schema stable, and to take advantage of an autogenerated XML\nparser.\n\nResource overlay\n----------------\n\nYou can use resource overlays to customize a product. There are two types of\nresource overlays:\n\n- *Standard resource overlay* used to customize a product at build time. Foris\n information on standard resource overlays, see\n [Customizing the build with resource overlays](/docs/setup/create/new-device#use-resource-overlays).\n\n- *Runtime resource overlay (RRO)* is used to change the resource values\n of a target package at runtime. For example, an app installed on the system\n image might change its behavior based upon the value of a resource. Rather than\n hardcoding the resource value at build time, an RRO installed on a different\n partition can change the values of the app's resources at runtime. For more\n information on RROs, see\n [Change the value of an app's resources at runtime](/docs/core/runtime/rros)."]]