اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release بدلاً من aosp-main لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
طبقة تجريد الأجهزة (HAL) هي نوع من طبقات التجريد التي تتضمّن واجهة
عادية لمورّدي الأجهزة لتنفيذها. تسمح واجهة HAL لمورّدي الأجهزة بتنفيذ ميزات من المستوى الأدنى خاصة بالأجهزة بدون التأثير في الرمز البرمجي أو تعديله في الطبقات ذات المستوى الأعلى.
الأحكام المطلوبة
في ما يلي قائمة بتعريفات المصطلحات المستخدَمة في هذا القسم من الادّعاءات:
لغة تعريف واجهة Android (AIDL)
لغة مشابهة لـ Java تُستخدَم لتحديد الواجهات بطريقة مستقلة عن
لغة البرمجة المستخدَمة. يسمح AIDL بالتواصل بين
عملاء HAL وخدمات HAL.
HAL المرتبط
HAL الذي يتواصل مع العمليات الأخرى
باستخدام
طلبات التواصل بين العمليات (IPC)
يتم تشغيل HAL المُجمَّعة في عملية منفصلة عن العميل الذي يستخدمها.
يتم تسجيل HALs المُجمَّعة في مدير خدمة حتى يتمكّن العملاء من
الوصول إلى إمكاناتها. يتم ربط واجهات HAL المكتوبة لنظام التشغيل Android 8 والإصدارات الأحدث.
HAL client
العملية التي تصل إلى خدمة HAL
واجهة HAL
الواجهة المشتركة التي يستخدمها كلّ من برنامج HAL للعميل والخدمة للتواصل
خدمة HAL
الرمز المخصّص للأجهزة، مثل الرمز الذي يتعامل مع كاميرا
جهازك المحدّد يجب تنفيذ جميع HALs المطلوبة الواردة في مصفوفة التوافق للإصدار الذي تستهدفه في قسم البائع.
لمزيد من المعلومات حول مصفوفات التوافق، يُرجى الاطّلاع على
مصفوفات التوافق.
يمكنك أيضًا إنشاء واجهة HAL جديدة أو توسيع واجهة HAL لتوفير ميزات فريدة لجهازك.
لغة تعريف واجهة الأجهزة (HIDL)
لغة تُستخدَم لتحديد الواجهات بطريقة مستقلة عن
لغة البرمجة المستخدَمة يتيح HIDL التواصل بين
عملاء HAL وخدمات HAL.
HAL للعملية نفسها (SP)
مجموعة محدودة من واجهات HAL المُغلفة تتحكّم Google في إمكانية الانضمام إلى المجموعة. تشمل واجهات برمجة التطبيقات لخدمات الشركاء ما يلي:
الإصدار الثابت من حزمة HAL لبرنامج C mapper 5
OpenGL
Vulkan
android.hidl.memory@1.0 (يوفّره نظام Android، ويتم تغليفه دائمًا)
android.hardware.renderscript@1.0
HAL المُغلف
خدمة HAL تم إنشاؤها قبل الإصدار 8 من نظام التشغيل Android، ولكن تم تغليفها في ملف ملف برمجي
AIDL أو HIDL لتعمل مع الإصدار 8 من نظام التشغيل Android والإصدارات الأحدث
ما هي الخطوات التالية؟
للتعرّف على كيفية تنفيذ خدمة HAL، يمكنك الرجوع إلى
AIDL لخدمات HAL.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Hardware abstraction layer (HAL) overview\n\nA *hardware abstraction layer (HAL)* is type of abstraction layer with a\nstandard interface for hardware vendors to implement. A HAL allows hardware\nvendors to implement lower-level, device-specific features without affecting or\nmodifying code in higher-level layers.\n| **Note:** HALs existed before Android 8. However, Android 8 ensured each HAL had a standard interface. For an explanation of HAL architecture before Android 8, refer to [Legacy HALs](/docs/core/architecture/hal/archive).\n\nRequired terms\n--------------\n\nFollowing is a list of definitions for terms used in this section of\ndocumentation:\n\n*Android Interface Definition Language (AIDL)*\n: A Java-like language used to define interfaces in a way that is independent of\n the programming language being used. AIDL allows communication between\n HAL clients and HAL services.\n\n*Binderized HAL*\n: A HAL that communicates with other processes\n using\n [binder inter-process communication (IPC)](/docs/core/architecture/hidl/binder-ipc)\n calls. Binderized HALs run in a separate process from the client that uses them.\n Binderized HALs are registered with a service manager so that clients can\n access their capabilities. HALs written for Android 8 and higher are\n binderized.\n\n*HAL client*\n: The process that accesses the HAL service.\n\n*HAL interface*\n: The common interface used by both the HAL client and service to communicate.\n\n*HAL service*\n\n: The hardware-specific code, such as the code that talks to your specific\n device's camera. You must implement all required HALs listed in the\n compatibility matrix for the release you target in your vendor partition.\n For further information on compatibility matrixes, see\n [Compatibility matrixes](/docs/core/architecture/vintf/comp-matrices).\n\n You can also create a new HAL interface, or extend the interface of a HAL, to\n support your hardware's unique capabilities.\n\n*Hardware Interface Definition Language (HIDL)*\n\n: A language used to define interfaces in a way that is independent of the\n programming language being used. HIDL enables communication between\n HAL clients and HAL services.\n\n | **Note:** As of Android 13, HIDL has been deprecated. Instead of HIDL, you should use Android Interface Definition Language (AIDL) for HALs. HALs previously written using [HIDL](/docs/core/architecture/hidl) are supported.\n\n*Same Process (SP) HAL*\n\n: A restricted set of wrapped HALs. Membership in the set is controlled by\n Google. SP HALs include:\n\n - Stable C mapper 5 HAL\n - OpenGL\n - Vulkan\n - android.hidl.memory@1.0 (provided by the Android system, always wrapped)\n - android.hardware.renderscript@1.0\n\n | **Note:** Some HAL implementations wrap legacy interfaces, such as those in `libhardware`, in an AIDL or HIDL wrapper.\n\n*Wrapped HAL*\n\n: A HAL service that was created before Android 8, but has been wrapped in an\n AIDL or HIDL wrapper to work with Android 8 and higher.\n\nWhat's next?\n------------\n\n- To learn how to implement a HAL service, refer to [AIDL for HALs](/docs/core/architecture/aidl/aidl-hals).\n- To learn how to create or extend an existing HAL, refer to [Attached extended interfaces](/docs/core/architecture/aidl/aidl-hals#attached-extensions)."]]