Hardware Abstraction Layer(HAL)は抽象化レイヤの種類のひとつであり、ハードウェア ベンダーが実装を行うための標準のインターフェースを備えています。ハードウェア ベンダーは HAL を使用して、高レベルのレイヤにあるコードに影響を与えたり修正を加えたりすることなく、低レベル、デバイス固有の機能を実装できるようになります。
必要な用語
以下は、ドキュメントのこのセクションで使用される用語の定義の一覧です。
Android インターフェース定義言語(AIDL)
Java に似た言語です。使用されるプログラミング言語とは独立した形でインターフェースを定義するために使用されます。AIDL は、HAL クライアントと HAL サービス間の通信を可能にします。
バインダ化された HAL
バインダ プロセス間通信(IPC)呼び出しを使用して他のプロセスとのやり取りを行う HAL です。バインダ化された HAL は、それを使用するクライアントとは別のプロセスで実行されます。バインダ化された HAL はサービス マネージャーに登録され、クライアントはその機能にアクセスできるようになります。Android 8 以降で記述される HAL はバインダ化されています。
HAL クライアント
HAL サービスにアクセスするプロセスです。
HAL インターフェース
HAL クライアントとサービスの両方がやり取りを行うために使用する、共通のインターフェースです。
HAL サービス
特定のデバイスのカメラとやり取りするためのコードなど、ハードウェア固有のコードです。ベンダー パーティションでターゲットにするリリースの互換性マトリックスに記載されている、すべての必須の HAL を実装する必要があります。互換性マトリックスについて詳しくは、互換性マトリックスをご覧ください。
また、新しい HAL インターフェースの作成や HAL のインターフェースの拡張を行い、ハードウェアの独自の要件に対応することもできます。
ハードウェア インターフェース定義言語(HIDL)
使用されるプログラミング言語とは独立した形でインターフェースを定義するために使用される言語です。HIDL は、HAL クライアントと HAL サービス間の通信を可能にします。
Same Process HAL(SP-HAL)
ラップされた HAL の制限のあるセットです。このセットのメンバーシップは Google により管理されます。SP HAL には以下が含まれています。
[[["わかりやすい","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-03-12 UTC。"],[],[],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)."]]