Notifications on Android Automotive OS

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 NotificationBuilder API 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.

Notification sounds

Notifications only play a sound if they trigger a heads-up notification.

Automatic play and mute actions for messaging notifications

Android Automotive OS automatically adds a Play and Mute action to all CATEGORY_MESSAGE notifications.

  • Play: Reads the notification to the driver using 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

RemoteViews and custom content views are not supported. In addition, the following notification styles are not supported:

  • BigPictureStyle
  • BigTextStyle
  • InboxStyle

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 CATEGORY_MESSAGE notifications
  • Limiting the number of notifications that the Notification Center can display

Notification Center

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

Grouped notifications

Related notifications 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 launching a PendingIntent, 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 CATEGORY_NAVIGATION, if the car manufacturer has configured their system to hide these notifications. Car manufacturers typically do this when they have a dedicated screen for displaying navigation information.
  • Foreground service notifications for system privileged apps and apps that are signed with the platform key that have an importance level lower than IMPORTANCE_DEFAULT.

Heads-up notifications

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.

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 IMPORTANCE_HIGH or higher.
For all other apps

To trigger a heads-up notification, the app sets the notification channel importance to IMPORTANCE_HIGH or 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 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 CATEGORY_NAVIGATION notification and the car manufacturer has configured their system to hide CATEGORY_NAVIGATION notifications from the Notification Center.

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.

Notification.Builder

The following tables describe the API changes and restrictions in the Notification.Builder class.

Table 1. Changes to public methods for Notification.Builder

Public methods Effect Description

createBigContentView()

createContentView()

createHeadsUpContentView()

setContent()

setCustomBigContentView()

setCustomContentView()

setCustomHeadsUpContentView()

No-op RemoteViews and custom content views are not supported.

setBadgeIconType()

setNumber()

No-op Notification badges are not supported.

setChronometerCountDown()

setUsesChronometer()

No-op Countdown timers are not supported.
setColorized() Constraints changed

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.

setFullScreenIntent() Behavior changed Does not auto-launch the intent.
setLargeIcon() Behavior changed Large icons are shown on the right-hand side of the notification.
setLights() No-op Android Automotive OS devices do not have LED indicator lights.
setOngoing() Behavior changed

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.

setPublicVersion()

setVisibility()

No-op Private mode is not supported.
setSettingsText() No-op Notifications do not support affordances that link to app settings. Drivers access app settings through the app instead.
setTicker() No-op Ticker text is not supported.

Table 2. Changes to nested classes for Notification.Builder

Nested classes Effect Description

Notification.BigPictureStyle

Notification.BigTextStyle

Notification.InboxStyle

Not used Only summary text will show. Detailed notifications for these styles are not supported.
Notification.BubbleMetadata Not used Bubbles are not supported.
Notification.MediaStyle Hidden Notifications with this style are hidden. Android Automotive OS manages user interface interactions for media notifications and playback.
Notification.MessagingStyle Behavior changed

Notifications with this style only show the last message from a conversation when using addMessage().

Additionally, Android Automotive OS automatically adds play and mute actions to messaging notifications.

Notification.CarExtender

Notification.WearableExtender

Not used Extenders are not supported.

Notification.Action.Builder

The following table describes the API changes and restrictions in the Notification.Action.Builder class.

Table 3. Changes to public methods for Notification.Action.Builder

Public methods Effect Description
Public constructors Behavior changed Icons specified in public constructors are ignored.
addRemoteInput Behavior changed The Google Assistant handles remote input. The input box does not show.
setAllowGeneratedReplies No-op Smart Reply is not supported.