हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main के बजाय android-latest-release का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
एचआईडीएल वाले वीएचएएल को एआईडीएल वाले वीएचएएल में माइग्रेट करने के लिए, IVehicleHardware इंटरफ़ेस को लागू करने के लिए, एआईडीएल रेफ़रंस लागू करने वाले स्ट्रक्चर का इस्तेमाल करें.
अगर मौजूदा एचआईडीएल लागू करने का तरीका भी एचआईडीएल रेफ़रंस लागू करने का तरीका के मुताबिक है, तो इसका मतलब है कि वेंडर ने VehicleHal क्लास लागू कर दिया है. IVehicleHardware,
VehicleHal से काफ़ी मिलता-जुलता है.
HIDL VHAL
एआईडीएल वीएचएएल
getAllPropertyConfigs()
VehicleHal.listProperties() के बराबर किराया
getValues(callback, requests)
हर अनुरोध के लिए VehicleHal.get() को कॉल कर सकता है और कॉलबैक को कॉल कर सकता है.
dump()
VehicleHal.dump() के बराबर किराया
checkHealth()
VehicleHal.get() को वापस लाया जा सकता है
registerPropertyChangeCallback()
VehicleHal.mOnHalEvent सेटिंग से मिलती-जुलती
एआईडीएल में टाइप के अंतर
HIDL VHAL से AIDL VHAL पर माइग्रेट करते समय, इन अंतरों का ध्यान रखें.
HIDL, types.hal से जनरेट किए गए सभी टाइप के लिए एक हेडर फ़ाइल (types.h) जनरेट करता है. AIDL, हर टाइप के लिए एक हेडर फ़ाइल जनरेट करता है. उदाहरण के लिए,
VehiclePropValue.aidl से VehiclePropValue.h.
इसलिए, आपको अपनी ज़रूरत के हिसाब से सभी हेडर फ़ाइलें शामिल करनी होंगी. VehicleHalUtils लाइब्रेरी में मौजूद VehicleHalTypes.h हेल्पर फ़ाइल में, आम तौर पर इस्तेमाल होने वाले ज़्यादातर टाइप शामिल होते हैं.
इसके बजाय ...
इस्तेमाल करें
hidl_vec
std::vector
hidl_string
std::string
android::sp
std::shared_ptr
android::wp
std::weak_ptr
types.hal में तय किए गए सभी टाइप, एआईडीएल में एक जैसे होते हैं. हालांकि, इनमें ये टाइप शामिल नहीं होते:
SubscribeFlags को हटा दिया गया है, क्योंकि इसका इस्तेमाल नहीं किया जाता है, क्योंकि
onPropertySet को हटा दिया गया है
UserFlags को अब UserInfo.aidl में तय किया गया है और इसे सूची के बजाय, फ़्लैग के तौर पर तय किया जाना चाहिए. उपयोगकर्ता फ़्लैग फ़ील्ड एक पूर्णांक होता है, जिसमें कई
UserInfo.USER_FLAG_XXX बिट-या एक साथ होते हैं.
VehiclePropValue में RawValue का नाम बदलकर
RawPropValue कर दिया गया है
RawValue में bytes का नाम बदलकर byteValues कर दिया गया है
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. 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,["# HIDL VHAL migration guide\n\nTo migrate an existing **HIDL** VHAL implementation to an **AIDL** VHAL,\nuse the\n[AIDL reference implementation](/docs/automotive/vhal/reference-implementation)\nstructure to implement the `IVehicleHardware` interface.\n\nIf the existing HIDL implementation also follows\n[HIDL reference implementation](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/automotive/vehicle/2.0/default/impl/vhal_v2_0),\nthe vendor has implemented the `VehicleHal` class. `IVehicleHardware` is\nvery similar to `VehicleHal`.\n| **Note:** AIDL uses different types than HIDL. Some types used in the HIDL implementation must be migrated. For detail, see [Type differences in AIDL](#aidl-diffs) below.\n\n| HIDL VHAL | AIDL VHAL |\n|------------------------------------|----------------------------------------------------------------------|\n| `getAllPropertyConfigs()` | Same as `VehicleHal.listProperties()` |\n| `getValues(callback, requests)` | Can call `VehicleHal.get()` for each request and can call callbacks. |\n| `dump()` | Same as `VehicleHal.dump()` |\n| `checkHealth()` | Can return `VehicleHal.get()` |\n| `registerPropertyChangeCallback()` | Similar to setting `VehicleHal.mOnHalEvent` |\n\nType differences in AIDL\n------------------------\n\nWhen migrating from the HIDL VHAL to the AIDL VHAL, consider these differences.\n\n1. HIDL generates one header file (`types.h`) for all types generated from `types.hal`. AIDL generates one header file for each type. For example, `VehiclePropValue.h` from `VehiclePropValue.aidl`.\n\n As a result, you must include all header files for the types you need. A helper file,\n `VehicleHalTypes.h` in the `VehicleHalUtils` library contains most of\n the common types.\n\n| Instead of ... | Use |\n|----------------|-------------------|\n| `hidl_vec` | `std::vector` |\n| `hidl_string` | `std::string` |\n| `android::sp` | `std::shared_ptr` |\n| `android::wp` | `std::weak_ptr` |\n\n2. All types defined in `types.hal` are the same in AIDL **except** for:\n - `SubscribeFlags` is removed as it's not used because `onPropertySet` is removed\n - `UserFlags` is now defined in `UserInfo.aidl` and should be defined as a flag instead of an enum. A user flag field is an integer that has multiple `UserInfo.USER_FLAG_XXX` bit-or together.\n - `RawValue` in `VehiclePropValue` is renamed as `RawPropValue`\n - `bytes` in `RawValue` is renamed as `byteValues`"]]