2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
通知のスロットリングと抑制
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
運転中の注意力散漫を減らすには、ヘッドアップ通知(HUN)を使って、ドライバーがディスプレイやモバイル デバイスに気をそらされることなく、重要な情報や関連する情報を受信できるようにします。しかし、HUN は運転の妨げとなる場合があるため、ドライバーが注意力散漫にならないよう、HUN のメリットとデメリットを理解することが重要です。
ドライバーの注意散漫を減らすため、次の Android 通知専用安全機能をお使いください。
このコンテンツでは、platform/packages/apps/Car/Notification
に関する設定とリソースについて説明します。
キューと優先順位
複数の HUN を受信した場合、キューと優先順位のメカニズムに基づいて、最も重要で関連性の高い情報がドライバーに表示されます。
キューのメカニズムを有効または無効にするには、config_suppressAndThrottleHeadsUp config
のブール値を設定します。
キューに入った HUN は、通知のカテゴリごとに優先順位が決められ、並べ替えられます。headsup_category_priority
配列を優先順位の降順で指定します。
CATEGORY_CALL
や CATEGORY_CAR_EMERGENCY
のような時間的制約のある通知は、キューの順番にかかわらず、直ちに表示されるべきです。
これらの種類の HUN を直ちに表示するには、これらのカテゴリを headsup_category_immediate_show
配列に追加します。
スロットリングとペース
ユーザーがアシスタントや電話の操作など、HUN を表示すると危険または邪魔になる恐れがあるアクションを実行している場合、HUN をスロットリングできます。
スロットリングを使用するには、対応が必要なアプリのパッケージ名を許可リスト(headsup_throttled_foreground_packages
)に追加します。これにより、指定したアプリがフォアグラウンドで実行中に、キューに新しい HUN が表示されなくなります。
ドライバーが運転に集中できるよう、各 HUN を表示する時間間隔を追加します。この時間間隔(headsup_delay_duration
)は、headsup_throttled_foreground_packages
のパッケージがバックグラウンドに移動した後に適用されます。
抑制
キューに一定時間残っている HUN は抑制できます。ドライバーにとって HUN の情報が無関係なものになると、邪魔になる場合があります。HUN をトリガーする代わりに、期限切れの通知を通知センターに送ります。運転状態と駐車状態に異なる値を指定すると、HUN の管理をカスタマイズできます。
運転状態の場合:
config_expireHeadsUpWhenDriving
を true
に設定し、通知が期限切れになる投稿時間後の時間(ミリ秒)として headsup_queue_expire_driving_duration_ms
を指定します。
駐車状態の場合:
config_expireHeadsUpWhenParked
を true
に設定し、通知が期限切れになる投稿時間後の時間(ミリ秒)として headsup_queue_expire_parked_duration_ms
を指定します。
抑制の発生後には、ドライバーに発生を通知するシステム HUN を送信します。hun_suppression_notification_title_drive
と hun_suppression_notification_title_park
の値を更新して、この通知のタイトルを変更します。
通知センターが開かれた際に、自動的に HUN のキューを閉じる場合:
config_dismissHeadsUpWhenNotificationCenterOpens
ブール値を true
に設定します。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-28 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-28 UTC。"],[],[],null,["# Throttle and suppress notifications\n\nTo reduce distraction while driving,\n[heads-up notifications](/docs/automotive/hmi/notifications/hun)\n(HUN) provide drivers with essential and relevant information **without**\ndiverting their attention to a display or mobile device. However, since HUNs\n*can* interfere with the task of driving, it's crucial to consider\nthe advantages and disadvantages of HUNs to ensure drivers are **not**\ndistracted.\n\nUse these Android notification-specific safety features to reduce driver\ndistraction:\n\n- [Queue and prioritize](#queue)\n- [Throttle and pace](#pace)\n- [Suppression](#suppress)\n\nThis content describes configurations and resources that pertain to\n`platform/packages/apps/Car/Notification`.\n\nQueue and prioritize\n--------------------\n\nWhen multiple incoming HUNs are received, the *queue and prioritize* mechanism\ndisplays the most important and relevant information to the driver.\n\nTo enable or disable the queue mechanism, set the boolean value for the\n`config_suppressAndThrottleHeadsUp config`.\n\nQueued HUNs are sorted based on priority determined by the\n[category](https://developer.android.com/reference/android/app/Notification#category)\nof the notification. Specify the `headsup_category_priority` array in a\ndescending order of priority.\n\nSome time-sensitive notifications, such as `CATEGORY_CALL` and\n`CATEGORY_CAR_EMERGENCY`, should be displayed immediately instead of queued.\n\nTo immediately display these types of HUNs, add these categories to the\n`headsup_category_immediate_show` array.\n\nThrottle and pace\n-----------------\n\nWhen a user performs an action during which it would be unsafe or distracting to\nshow HUNs, such as interacting with Assistant or Dialer, you can *throttle*\nHUNs.\n\nTo employ throttling, add the package names of apps that require attention to\nthe allowlist (`headsup_throttled_foreground_packages`). This stops the queue\nfrom displaying new HUNs while the specified apps run in the foreground.\n\nTo give drivers time to focus on driving, add a time interval between the\ndisplay of each HUN. This time interval (`headsup_delay_duration`)\napplies after packages from `headsup_throttled_foreground_packages` are\nmoved to the background.\n\nSuppression\n-----------\n\nHUNs that remain in the queue for an extended period can be *suppressed.*\nWhen HUNs become irrelevant to the driver, they can cause distraction.\nInstead of triggering a HUN, direct expired notifications to the\nNotification center.\nYou can tailor your management of HUNs by prescribing different values for the\n**Drive** and **Park** states.\n\nFor the **Drive** state:\n\n1. Set `config_expireHeadsUpWhenDriving` to `true` and specify the `headsup_queue_expire_driving_duration_ms` as the duration (in milliseconds) after the post time when the notification is to expire.\n\nFor the **Park** state:\n\n1. Set `config_expireHeadsUpWhenParked` to `true` and specify the `headsup_queue_expire_parked_duration_ms`as the duration (in milliseconds) after the post time when the notification is to expire.\n\nIn the event of a suppression, send a trailing system HUN to notify the\ndriver. Modify the title of this notification by updating the values of\n`hun_suppression_notification_title_drive` and\n`hun_suppression_notification_title_park`\n\nTo automatically dismiss the HUN queue when the Notification center is opened:\n\n1. Set the `config_dismissHeadsUpWhenNotificationCenterOpens` boolean to `true`."]]