Notifications provide drivers with short, timely information about events from
your app while it's not in use. Notifications can appear in the
Notification Center, and some notifications can also appear as
heads-up notifications on the display. To create notifications for
Android Automotive OS, you use the same
that you use for other devices. However, to ensure the safety of drivers and
minimize distraction, some API methods and classes are
restricted or behave differently.
How notifications differ in cars
To create a safe driving environment that is free from distractions, notifications on Android Automotive OS differ from notifications on other devices in the following ways:
- Simplified user interaction
- UX restrictions based on drive state
Simplified user interaction
To ensure that drivers can focus on the road, notifications in the car have a simplified user interaction model with the following features:
No complex controls
Notifications do not allow complex controls, such as tapping to expand a notification, long pressing a notification for additional options, or using controls based on swipe-length gestures.
Notifications only play a sound if they trigger a heads-up notification.
Automatic play and mute buttons for messaging notifications
Android Automotive OS automatically adds Play and Mute buttons to all car-compatible messaging notifications.
- Play: Reads the notification to the driver using the user's default digital assistant (such as the Google Assistant) or the vehicle's default text-to-speech system.
Mute: Prevents heads-up notifications from appearing for any future messages in the conversation for the remainder of the drive. Message notifications from a muted conversation still appear in the Notification Center, and the driver can also unmute the conversation from the Notification Center.
Simplified notification display options
and custom content views are not supported. In addition, the following
notification styles are not supported:
If your app sends a notification to Android Automotive OS using one of these notification styles, only summary text is shown.
UX restrictions based on drive state
Android Automotive OS includes a UX Restrictions Engine. Car manufacturers can use this engine to restrict notifications based on the car's drive state in the following ways:
- Truncating notification strings at a specific character length
- Hiding message summaries for
- Limiting the number of notifications that the Notification Center can display
Supported resource types
By default, Android Automotive OS supports a limited subset of the resource types that can be used for notifications on other devices. This subset includes the following resource types:
Compatibility requirements for messaging notifications
To provide a consistent and minimally distracting user experience, messaging notifications have special requirements on Android Automotive OS.
A messaging notification is car-compatible if it fulfills the following requirements:
- Belongs to the
- Uses the
- Should include only unread messages.
Has a mark-as-read
Actionthat fulfills the following requirements:
- The semantic action must be set to
Actionmust indicate that it will not show any user interface when fired.
- The semantic action must be set to
If the notification has a reply
Action, then the
Actionfulfills the following requirements:
Almost all notifications appear in the Notification Center, even if those notifications were also triggered as heads-up notifications. Notifications persist in the Notification Center for the duration of a drive.
Drivers can interact with notifications in the Notification Center. Depending on the car's manufacturer, drivers access the Notification Center in one or both of the following ways:
- Swiping down from the top of the screen (similar to the notification drawer on other devices)
- Tapping a button in the system interface
are automatically grouped together in the Notification Center,
like in the notification drawer on other devices. However, when a
driver taps the summary for a group in the Notification Center, instead of
the group expands to show all of its notifications.
Notifications that do not appear in the Notification Center
The following notifications do not appear in the Notification Center:
- Media playback notifications for
CATEGORY_TRANSPORT. Information about ongoing media playback is gathered by Android Automotive OS and displayed in a dedicated place in the user interface.
- Turn-by-turn navigation notifications for
- Foreground service notifications for system privileged apps and apps that
are signed with the platform key that have an importance level lower than
Heads-up notifications appear as a notification card on top of the screen. Because a heads-up notification draws the driver's attention, apps should only trigger a heads-up notification when the information is drive-critical, time-sensitive, and actionable. Only certain categories of notifications can trigger a heads-up notification.
Car manufacturers can decide whether or not to allow heads-up notifications to appear while the Notification Center is open.
How apps trigger heads-up notifications
Apps have different requirements for triggering a heads-up notification, depending on whether they have system privileges or not.
- For system-privileged apps and apps that are signed with the platform key
- The app can trigger a heads-up notification by setting the notification
channel importance to
- For all other apps
To trigger a heads-up notification, the app sets the notification channel importance to
IMPORTANCE_HIGHor higher and ensures that the notification belongs to one of the following categories:
Life of a heads-up notification
After an app triggers a heads-up notification, the notification appears immediately on the car's screen. If the driver takes no action, the heads-up notification is dismissed automatically after 8 seconds (configurable by car manufacturers), except in the following cases:
Heads-up notifications for certain incoming calls cannot be dismissed, and the heads-up notification remains until either the driver accepts the call, or the call is terminated. To qualify as an undismissable heads-up notification for an incoming call, a notification must fulfill the following requirements:
Heads-up notifications remain if an app updates the notification within the 8-second time window.
When a heads-up notifications is dismissed, the notification is listed in the
Notification Center unless it is a
Notification API changes and restrictions for cars
This section summarizes the differences for each class where the Notifications API behaves differently or has restrictions for Android Automotive OS.
The following tables describe the API changes and restrictions in the
Table 1. Changes to public methods for
||No-op||Notification badges are not supported.|
||No-op||Countdown timers are not supported.|
Platform-signed apps: Configurable; allowed by default.
System-privileged apps: Configured by platform; disallowed by default.
All other apps: Configured by platform; disallowed by default.
||Behavior changed||Does not auto-launch the intent.|
||Behavior changed||Large icons are shown on the right-hand side of the notification.|
||No-op||Android Automotive OS devices do not have LED indicator lights.|
Behavior is different when the notification is also triggering a heads-up notification.
Only makes the heads-up notification undismissable if the heads-up notification is for an incoming call. To qualify as an undismissable heads-up notification for an incoming call, a notification must fulfill the following requirements:
Drivers can dismiss all other types of heads-up notifications.
||No-op||Private mode is not supported.|
||No-op||Notifications do not support affordances that link to app settings. Drivers access app settings through the app instead.|
||No-op||Ticker text is not supported.|
Table 2. Changes to nested classes for
||Not used||Only summary text will show. Detailed notifications for these styles are not supported.|
||Not used||Bubbles are not supported.|
||Hidden||Notifications with this style are hidden. Android Automotive OS manages user interface interactions for media notifications and playback.|
Notifications with this style have the following differences:
||Not used||Extenders are not supported.|
The following table describes the API changes and restrictions in the
Table 3. Changes to public methods for
|Public constructors||Behavior changed||Icons specified in public constructors are ignored.|
||Behavior changed||To minimize driver distraction, a digital assistant (such as the Google Assistant) inserts the response to a message for the user. Users are not allowed to type messages.|
||No-op||Smart Reply is not supported.|