2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、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 |
vehicle_map_service |
自動車制御機能を有効または無効にする
ランタイム リソース オーバーレイ(RRO)か、Vehicle Hardware Abstraction Layer(VHAL)のいずれかを使用して、ビルド内の機能のサポートをコントロールできます。
RRO を使用する
有効にできるすべてのオプション機能をリストする config_allowed_optional_car_features
というリソース構成を使用します。車が最初に起動される際に、可能な車のオプション機能が表示され、VHAL によってブロックリストに登録されていなければ有効になります。RRO について詳しくは、実行時にアプリのリソースの値を変更するをご覧ください。
VHAL を使用する
Vehicle Hardware Abstraction Layer(VHAL)は、特定のオプション機能を無効にするブロックリストとして、機能を制御します。DISABLED_OPTIONAL_FEATURES
という VHAL プロパティは、無効にするオーバーレイのオプション機能をリストします。このプロパティが存在しない場合、RRO からのオプション機能のリストはすべて有効になります。VHAL について詳しくは、VHAL の概要をご覧ください。
デバッグ シェルコマンドを使う
どのオプション機能を有効または無効にするかを制御する 3 つ目の方法は、シェルコマンドのペアの使用です。これは、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 プロパティ DISABLED_OPTIONAL_FEATURES で、無効になるように VHAL に指定された機能。 |
mPendingEnabledFeatures |
再起動時に有効になる機能。 |
mPendingDisabledFeatures |
再起動時に無効になる機能。 |
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。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,["# 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. |"]]