[[["容易理解","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)."]]