2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
付録 C、Car UI プラグイン API の最小互換バージョン
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
OEM は、可能な限り早く car-ui-lib-plugin-apis
の最新バージョン(1.2.0 以降)に切り替えることが求められます。以前のバージョンを使用するプラグインを搭載しないことが推奨されます。
この更新の理由
Java 8 以降の API は、Java 8 以降の API の脱糖サポートにより以前のバージョンの Android でサポートされます。不足している API の実装がアプリにコンパイルされ、APK のバイトコードが、プラットフォームのライブラリではなく、この実装を参照するよう書き換えられています。
Car UI ライブラリ プラグインから UI コンポーネントの OEM 実装を読み込むには、car-ui-lib-plugin-apis
インターフェースで定義されるメソッドの参照が必要です。これらのメソッド参照は、メソッドの署名がアプリとプラグインの実装で同一であることを前提として、ランタイムでアプリから Car UI ライブラリ プラグインに対して行われます。
一部のビルドシステムでは、特定の最小 SDK レベルの要件のため、いつでも API の脱糖が可能です。car-ui-lib-plugin-apis
インターフェースの脱糖済みメソッドの署名は、脱糖されていない OEM プラグイン実装内のものと一致しないことがあり、この場合、プラグインは読み込まれません。
その結果、内部の Google ビルドシステムでコンパイルされた一部の GAS アプリは、Car UI ライブラリ プラグインと互換性がありません。このため、脱糖を必要とする Java 8(以降)の API へのすべての依存関係を削除しました。この変更により、car-ui-lib-plugin-apis
で定義されているインターフェースの API の更新が必要となります。
OEM プラグインに必要な手順
API をアップデートする手順は次のとおりです。
最新バージョンの car-ui-lib-plugin-apis
を使用するようプラグインの実装を更新します。最新バージョン(1.2.0 以上)を入手するには、Google の Maven リポジトリをご覧ください。
PluginFactoryOEMV4
インターフェースを実装するようプラグインの実装を更新します。OEM プラグインによりコンポーネントが実装される場合は、以下の手順が必要です。以下の OEM 実装を更新します。
ToolbarControllerOEMV2
を実装するよう、ツールバーの OEM 実装を更新します。
ContentListItemOEMV2
を拡張するよう、コンテンツ リスト項目の OEM 実装を更新します。
ImeSearchInterfaceOEMV2
を拡張するよう、IME 検索結果処理の OEM 実装を更新します。
最新バージョンの Car UI ライブラリを使用するようアプリを更新します。
この更新を適用しなかった場合
このページに記載されている手順が OEM プラグインに対して適用されなかった場合、Google Automotive Services(GAS)などの脱糖アプリは Car UI ライブラリ プラグインの実装の読み込みに失敗し、プラグイン メカニズムを通して OEM のカスタマイズは適用されません。
Car UI ライブラリの既存の RRO のカスタマイズは、この問題の影響を受けず、通常どおり引き続き実行されます。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-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-03-26 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."]]