ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
ภาคผนวก ค. เวอร์ชันที่เข้ากันได้ขั้นต่ำสำหรับ Car UI Plugin API
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
OEM ควรเปลี่ยนไปใช้ car-ui-lib-plugin-apis
เวอร์ชันล่าสุด (1.2.0 ขึ้นไป) โดยเร็วที่สุด ตามหลักการแล้ว OEM ไม่ควรจัดส่งปลั๊กอินที่ใช้เวอร์ชันเก่า
เหตุผลในการอัปเดตนี้
Android เวอร์ชันเก่ารองรับ API ของ Java 8 ขึ้นไป ผ่านการรองรับการแปลง Sugar ออกจาก API ของ Java 8 ขึ้นไป
ระบบจะคอมไพล์การใช้งาน API ที่ขาดหายไปลงในแอป และเขียนไบต์โค้ดของ APK ใหม่เพื่ออ้างอิงการใช้งานแทนไลบรารีบนแพลตฟอร์ม
การโหลดการใช้งานคอมโพเนนต์ UI ของ OEM จากปลั๊กอินไลบรารี UI ของรถต้องใช้การอ้างอิงเมธอดที่กําหนดโดยอินเทอร์เฟซ car-ui-lib-plugin-apis
การอ้างอิงเมธอดเหล่านี้สร้างขึ้นจากแอปไปยังปลั๊กอินไลบรารี UI ของรถขณะรันไทม์ โดยคาดหวังว่าลายเซ็นเมธอดจะเหมือนกันในการใช้งานแอปและปลั๊กอิน
ระบบบิลด์บางระบบจะเปิดใช้การกรองโค้ด API ออกทุกครั้งเนื่องจากข้อกำหนดของระดับ SDK ขั้นต่ำที่เฉพาะเจาะจง ลายเซ็นเมธอดที่กรอง Sugar ออกแล้วสำหรับอินเทอร์เฟซ car-ui-lib-plugin-apis
อาจไม่ตรงกับลายเซ็นในการใช้งานปลั๊กอิน OEM ที่ยังไม่ได้กรอง Sugar ออก ซึ่งส่งผลให้ปลั๊กอินโหลดไม่สำเร็จ
ด้วยเหตุนี้ แอป GAS บางแอปที่คอมไพล์ด้วยระบบบิลด์ภายในของ Google จึงใช้ร่วมกับปลั๊กอินไลบรารี UI ของรถไม่ได้ เราจึงนําการพึ่งพา API ของ Java 8 (และเวอร์ชันที่ใหม่กว่า) ทั้งหมดที่จําเป็นต้องมีการถอด Sugar ออกออก การเปลี่ยนแปลงนี้จำเป็นต้องมีการอัปเดต API ของอินเทอร์เฟซที่ระบุโดย car-ui-lib-plugin-apis
ขั้นตอนที่จำเป็นสำหรับปลั๊กอิน OEM
ทําตามขั้นตอนต่อไปนี้เพื่ออัปเดต API
อัปเดตการติดตั้งใช้งานปลั๊กอินเพื่อใช้ car-ui-lib-plugin-apis
เวอร์ชันล่าสุด หากต้องการรับเวอร์ชันล่าสุด (1.2.0 ขึ้นไป) ให้ดูที่เก็บ Maven ของ Google
อัปเดตการติดตั้งใช้งานปลั๊กอินเพื่อใช้อินเทอร์เฟซ PluginFactoryOEMV4
การเปลี่ยนแปลงนี้ต้องใช้ขั้นตอนต่อไปนี้เมื่อปลั๊กอิน OEM ติดตั้งใช้งานคอมโพเนนต์ อัปเดตการใช้งาน OEM ของสิ่งต่อไปนี้
แถบเครื่องมือ เพื่อติดตั้งใช้งาน ToolbarControllerOEMV2
รายการในลิสต์เนื้อหาเพื่อขยาย ContentListItemOEMV2
การจัดการผลการค้นหา IME เพื่อขยาย ImeSearchInterfaceOEMV2
อัปเดตแอปเพื่อใช้ไลบรารี UI ของรถเวอร์ชันล่าสุด
จะเกิดอะไรขึ้นหากไม่ใช้การอัปเดตนี้
หากไม่ทำตามขั้นตอนที่ระบุไว้ในหน้านี้สำหรับปลั๊กอิน OEM แอปที่ผ่านการกรอง Sugar ออกแล้ว เช่น Google Automotive Services (GAS) จะโหลดการติดตั้งใช้งานปลั๊กอิน Car UI Library ไม่ได้ และจะไม่มีการใช้การปรับแต่ง OEM ผ่านกลไกปลั๊กอิน
การปรับแต่ง RRO ที่มีอยู่สำหรับไลบรารี UI ของรถจะไม่ได้รับผลกระทบจากปัญหานี้และจะยังคงทำงานต่อไปตามปกติ
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-06-12 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-06-12 UTC"],[],[],null,["# Appendix C, minimum compatible version for Car UI Plugin API\n\nOEMs are expected to switch to the newest version of `car-ui-lib-plugin-apis`\n(1.2.0 or higher) as soon as possible. Ideally, OEMs shouldn't ship any plugin\nthat uses an older version.\n\nWhy this update?\n----------------\n\n[Java 8+](https://developer.android.com/studio/write/java8-support-table) APIs\nare supported for previous versions of Android through [Java 8+ API desugaring\nsupport](https://developer.android.com/studio/write/java8-support#library-desugaring).\nImplementations of missing APIs are compiled into apps and the byte code of APKs\nare rewritten to reference the implementations instead of the libraries on the\nplatform.\n\nLoading OEM implementations of UI components from a Car UI Library plugin\nrequires the referencing of methods defined by `car-ui-lib-plugin-apis`\ninterfaces. These method references are made from apps to Car UI Library plugins\nat runtime with the expectation that method signatures are identical in app and\nplugin implementations.\n\nSome build systems enable API desugaring at all times due to requirements of a\nspecific minimum SDK level. Desugared method signatures for\n`car-ui-lib-plugin-apis` interfaces may not match those in an OEM plugin\nimplementation that has not been desugared, which results in plugins failing to\nload.\n\nAs a result, some GAS apps compiled with the internal Google build system are\nincompatible with the Car UI Library plugin. Therefore, we've removed all\ndependencies on Java 8 (and higher) APIs that require desugaring. This change\nrequires updates to the API of the interfaces defined by\n`car-ui-lib-plugin-apis`.\n\nRequired steps for OEM plugins\n------------------------------\n\nFollow these steps to update your API:\n\n1. Update the plugin implementation to use the latest version of\n `car-ui-lib-plugin-apis`. To get the latest version of (1.2.0 or higher),\n see [Google's Maven\n Repository](https://maven.google.com/web/index.html#com.android.car.ui:car-ui-lib-plugin-apis).\n\n2. Update the plugin implementation to implement the `PluginFactoryOEMV4`\n interface. This change requires the following steps when a component is\n implemented by the OEM plugin. Update the OEM implementation of:\n\n 1. Toolbar, to implement `ToolbarControllerOEMV2`.\n\n 2. Content list items, to extend `ContentListItemOEMV2`.\n\n 3. IME search results handing, to extend `ImeSearchInterfaceOEMV2`.\n\n3. Update the app to use the latest version of the Car UI Library.\n\nWhat happens if this update is not applied?\n-------------------------------------------\n\nIf the steps provided on this page aren't completed for an OEM plugin, desugared\napps, such as the Google Automotive Services (GAS), fail to load implementations\nof the Car UI Library plugin and no OEM customizations are applied through the\nplugin mechanism.\n\nExisting RRO customizations for the Car UI Library are not affected by this\nissue and continue to perform as usual."]]