ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
การควบคุมฟีเจอร์บริการรถยนต์
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
โดยค่าเริ่มต้น บริการรถยนต์ส่วนใหญ่จะบังคับให้เปิดใช้และเปิดอยู่เสมอ อย่างไรก็ตาม คุณสามารถกำหนดบริการรถยนต์ชุดย่อยเป็นไม่บังคับได้ เนื่องจากรถยนต์บางรุ่นอาจไม่รองรับฟีเจอร์บางอย่าง
รายการฟีเจอร์เสริม
ฟีเจอร์การควบคุมรถที่ไม่บังคับซึ่งคุณเปิดและปิดใช้ได้แสดงอยู่ในตารางด้านล่าง
ฟีเจอร์การควบคุมรถยนต์ |
ค่าสตริง |
---|
บริการ EVS ในรถยนต์ |
car_evs_service |
บริการล็อกกุญแจรถยนต์รุ่นทดลอง |
experimental_car_keyguard_service |
บริการนำทางของรถ |
car_navigation_service |
บริการเชื่อมต่อผู้ที่อยู่ในรถ |
car_occupant_connection_service |
บริการการเข้าถึงรถยนต์จากระยะไกล |
car_remote_access_service |
บริการอุปกรณ์ระยะไกลของรถยนต์ |
car_remote_device_service |
บริการวัดและส่งข้อมูลทางไกลในรถยนต์ |
car_telemetry_service |
บริการประกาศสำหรับผู้ใช้รถยนต์ |
com.android.car.user.CarUserNoticeService |
บริการสำหรับบ้านของคลัสเตอร์ |
cluster_home_service |
บริการวินิจฉัย |
diagnostic |
บริการระบบการรับรู้ว่ามีคนอยู่ |
occupant_awareness |
บริการตรวจสอบพื้นที่เก็บข้อมูล |
storage_monitoring |
บริการแผนที่ในรถยนต์ |
vehicle_map_service |
เปิดและปิดใช้ฟีเจอร์การควบคุมรถยนต์
คุณควบคุมการรองรับฟีเจอร์ในบิลด์ได้ 2 วิธี ได้แก่ การใช้การวางซ้อนทรัพยากรรันไทม์ (RRO) หรือผ่านเลเยอร์การแยกแยะฮาร์ดแวร์ของยานพาหนะ (VHAL)
ใช้ RRO
ใช้การกําหนดค่าทรัพยากรชื่อ config_allowed_optional_car_features
ซึ่งจะแสดงรายการฟีเจอร์ที่ไม่บังคับทั้งหมดที่คุณเปิดใช้ได้ เมื่อบูตรถเป็นครั้งแรก ระบบจะบันทึกฟีเจอร์เสริมของรถที่เป็นไปได้ไว้และเปิดใช้หาก VHAL ไม่ได้อยู่ในรายการที่บล็อก
ดูข้อมูลเพิ่มเติมเกี่ยวกับ RRO ได้ที่หัวข้อเปลี่ยนค่าของทรัพยากรของแอปขณะรันไทม์
ใช้ VHAL
เลเยอร์การแยกแยะฮาร์ดแวร์ของยานพาหนะ (VHAL) จะควบคุมฟีเจอร์ต่างๆ โดยทำหน้าที่เป็นรายการที่บล็อกเพื่อปิดใช้ฟีเจอร์ที่ไม่บังคับบางรายการ พร็อพเพอร์ตี้ VHAL ที่มีชื่อว่า DISABLED_OPTIONAL_FEATURES
จะแสดงฟีเจอร์ที่ไม่บังคับในการวางซ้อนที่จะปิดใช้ หากไม่มีพร็อพเพอร์ตี้นี้ ระบบจะเปิดใช้รายการฟีเจอร์ที่ไม่บังคับจาก RRO ทั้งหมด ดูข้อมูลเพิ่มเติมเกี่ยวกับ VHAL ได้ที่ภาพรวม VHAL
ใช้คำสั่ง Shell สำหรับการแก้ไขข้อบกพร่อง
วิธีที่สามในการควบคุมว่าจะเปิดหรือปิดใช้ฟีเจอร์ที่ไม่บังคับรายการใดนั้นใช้คำสั่งเชลล์ 2 รายการ ซึ่งใช้ได้เฉพาะในรุ่น user-debug
และจัดทำขึ้นเพื่อนักพัฒนาซอฟต์แวร์เท่านั้น ตารางในรายการฟีเจอร์ที่ไม่บังคับมีค่าที่จะใช้แทน <FEATURE_STRING_VALUE>
วิธีเปิดใช้ฟีเจอร์
adb root; adb shell cmd car_service enable-feature <FEATURE_STRING_VALUE>; adb reboot
วิธีปิดใช้ฟีเจอร์
adb root; adb shell cmd car_service disable-feature <FEATURE_STRING_VALUE>; adb reboot
กำหนดฟีเจอร์ที่เปิดใช้
เมื่อแก้ไขข้อบกพร่องเกี่ยวกับฟีเจอร์ที่เฉพาะเจาะจง การทราบว่าฟีเจอร์ใดเปิดใช้อยู่และเหตุผลที่เปิดใช้อาจเป็นประโยชน์ หากต้องการแสดงข้อมูล feature-related
ให้เรียกใช้คำสั่งต่อไปนี้
adb shell dumpsys car_service --services CarFeatureController
คำสั่งนี้จะแสดงรายการประเภทข้อมูลที่แสดงด้านล่าง
ค่านิยม |
คำอธิบาย |
---|
mEnabledFeatures |
ฟีเจอร์ที่เปิดใช้อยู่ในปัจจุบัน |
mDefaultEnabledFeaturesFromConfig |
ฟีเจอร์เสริมที่แสดงใน config_allowed_optional_car_features |
mDisabledFeaturesFromVhal |
ฟีเจอร์ที่ VHAL ระบุให้ปิดใช้ในพร็อพเพอร์ตี้ VHAL
DISABLED_OPTIONAL_FEATURES |
mPendingEnabledFeatures |
ฟีเจอร์ที่จะเปิดใช้เมื่อรีบูต |
mPendingDisabledFeatures |
ฟีเจอร์ที่จะปิดใช้หลังจากรีบูต |
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 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-26 UTC"],[],[],null,["# Car service feature control\n\nBy default, most car services are mandatory and are always enabled. However, you can\ndesignate a subset of car services to be *optional* because some features might not\nbe supported in every car.\n\nList of optional features\n-------------------------\n\nThe optional car control features you can enable and disable are listed in the table below.\n\n| Car control feature | String value |\n|-----------------------------------|---------------------------------------------|\n| Car EVS service | `car_evs_service` |\n| Car experimental keyguard service | `experimental_car_keyguard_service` |\n| Car navigation service | `car_navigation_service` |\n| Car occupant connection service | `car_occupant_connection_service` |\n| Car remote access service | `car_remote_access_service` |\n| Car remote device service | `car_remote_device_service` |\n| Car telemetry service | `car_telemetry_service` |\n| Car user notice service | `com.android.car.user.CarUserNoticeService` |\n| Cluster home service | `cluster_home_service` |\n| Diagnostic service | `diagnostic` |\n| Occupant awareness wervice | `occupant_awareness` |\n| Storage monitoring service | `storage_monitoring` |\n| Vehicle map service | `vehicle_map_service` |\n\nEnable and disable car control features\n---------------------------------------\n\nYou can control support for features in your builds in one of two ways, either with\nruntime resource overlays (RROs) or through the Vehicle Hardware Abstraction Layer (VHAL).\n\n### Use RROs\n\nUse the resource configuration named `config_allowed_optional_car_features`, which\nlists all the optional features you can enable. When a car is first booted up, possible\noptional car features are noted and are enabled if they're not blocklisted by the VHAL.\nTo learn more RROs, see\n[Change the value of an app's resources at runtime.](/docs/core/runtime/rros)\n\n### Use the VHAL\n\nThe Vehicle Hardware Abstraction Layer (VHAL) controls features by serving as a\nblocklist to disable specific optional features. The VHAL property named\n`DISABLED_OPTIONAL_FEATURES` lists the optional features in the overlay that\nare to be disabled. If this property doesn't exist, then the list of optional features from\nthe RROs are all enabled. To learn more about the VHAL, see the\n[VHAL overview](/docs/automotive/vhal).\n\n### Use debug shell commands\n\nA third way to control which optional features to enable or disable is through the use of a\npair of shell commands, which are available only in `user-debug` builds and are\nprovided for use by developers. The table in\n[List of optional features](#list) contains the values to use instead of\n`\u003cFEATURE_STRING_VALUE\u003e`.\n\nTo enable a feature: \n\n```\nadb root; adb shell cmd car_service enable-feature \u003cFEATURE_STRING_VALUE\u003e; adb reboot\n```\n\nTo disable a feature: \n\n```\nadb root; adb shell cmd car_service disable-feature \u003cFEATURE_STRING_VALUE\u003e; adb reboot\n```\n\nDetermine which features are enabled\n------------------------------------\n\nWhen debugging issues related to specific features, it can be helpful to know which features are\nenabled and why. To dump `feature-related` information, run: \n\n```\nadb shell dumpsys car_service --services CarFeatureController\n```\n\nThis command lists the types of information shown below.\n\n| Value | Description |\n|-------------------------------------|---------------------------------------------------------------------------------------------------|\n| `mEnabledFeatures` | Currently enabled features. |\n| `mDefaultEnabledFeaturesFromConfig` | Optional features listed in `config_allowed_optional_car_features`. |\n| `mDisabledFeaturesFromVhal` | Features specified by the VHAL to be disabled in the VHAL property, `DISABLED_OPTIONAL_FEATURES`. |\n| `mPendingEnabledFeatures` | Features to be enabled upon a reboot. |\n| `mPendingDisabledFeatures` | Features to be disabled after a reboot. |"]]