Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Set up notifications
Stay organized with collections
Save and categorize content based on your preferences.
Use the settings provided in config.xml
and integers.xml
to set up the appearance and configurations of your notifications.
Appearance
To configure the appearance of notifications, modify these settings in
config.xml
:
Purpose |
Setting |
Display the navigation as a
heads-up notification
(HUN). |
config_showNavigationHeadsup
Default: true |
Specify the background color of the notification card for the category entitled
Notification.CATEGORY_NAVIGATION |
config_enableCardBackgroundColorForCategoryNavigation
Default: false |
Set the background color of the card for notifications from system apps. |
config_enableCardBackgroundColorForSystemApp
Default: false |
Display the notification header at the top of the notifications list. |
config_showHeaderForNotifications
Default: false |
Display the notification footer at the bottom of notifications list. |
config_showFooterForNotifications
Default: true |
Change the accent color of the small icon. |
config_enableSmallIconAccentColor
Default: true |
Functionality
To configure how notifications function, update these settings in
integers.xml
:
Purpose |
Setting |
Set the maximum number of group members displayed when notification group is expanded. |
max_group_children_number
Default: 8 |
Specify the duration of HUNs in milliseconds. When this duration
elapses, HUNs are automatically dismissed until an update to an existing
HUN for which this flag is set:
Notification.FLAG_ONLY_ALERT_ONCE
Time is reset when an update is received and the HUN is displayed
for a longer duration. Should this flag be set and an update received, the time
won't be reset. |
headsup_notification_duration_ms
Default: 8000 |
Set the minimum display time (in milliseconds) for a HUN. When an app
cancels notification as soon as it's posted or within the configured time duration, the
HUN is displayed for at least this much time. |
heads_up_notification_minimum_time
Default: 2000 |
Specify the total duration (in milliseconds) needed by a fly-in animation to display a
HUN. |
headsup_total_enter_duration_ms
Default: 233 |
Set the time (in milliseconds) needed by a fly-in animation to display a
HUN for alpha. During animation, the time needed for a HUN
to transition from transparent to opaque. |
headsup_alpha_enter_duration_ms
Default: 83 |
Specify the time (in milliseconds) needed by a fly-out animation to display a heads-up
notification. |
headsup_exit_duration_ms
Default: 150 |
Define the minimum velocity (in pixels per second) used to determine that a swipe moves in
the same direction.
|
min_velocity_for_swipe_direction_detection
Default: 50 |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-08-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-26 UTC."],[],[],null,["# Set up notifications\n\nUse the settings provided in `config.xml` and `integers.xml`\nto set up the appearance and configurations of your notifications.\n\nAppearance\n----------\n\nTo configure the *appearance* of notifications, modify these settings in\n`config.xml`:\n\n| Purpose | Setting |\n|--------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|\n| Display the navigation as a [heads-up notification (HUN)](/docs/automotive/hmi/notifications/notifications). | `config_showNavigationHeadsup` Default: `true` |\n| Specify the background color of the notification card for the category entitled `Notification.CATEGORY_NAVIGATION` | `config_enableCardBackgroundColorForCategoryNavigation` Default: `false` |\n| Set the background color of the card for notifications from system apps. | `config_enableCardBackgroundColorForSystemApp` Default: `false` |\n| Display the notification header at the top of the notifications list. | `config_showHeaderForNotifications` Default: `false` |\n| Display the notification footer at the bottom of notifications list. | `config_showFooterForNotifications` Default: `true` |\n| Change the accent color of the small icon. | `config_enableSmallIconAccentColor` Default: `true` |\n\nFunctionality\n-------------\n\nTo configure how notifications *function* , update these settings in\n`integers.xml`:\n\n| Purpose | Setting |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|\n| Set the maximum number of group members displayed when notification group is expanded. | `max_group_children_number` Default: `8` |\n| Specify the duration of HUNs in milliseconds. When this duration elapses, HUNs are automatically dismissed until an update to an existing HUN for which this flag is set: \u003cbr /\u003e `Notification.FLAG_ONLY_ALERT_ONCE` \u003cbr /\u003e Time is reset when an update is received and the HUN is displayed for a longer duration. Should this flag be set and an update received, the time *won't* be reset. | `headsup_notification_duration_ms` Default: `8000` |\n| Set the minimum display time (in milliseconds) for a HUN. When an app cancels notification as soon as it's posted or within the configured time duration, the HUN is displayed for at least this much time. | `heads_up_notification_minimum_time` Default: `2000` |\n| Specify the total duration (in milliseconds) needed by a fly-in animation to display a HUN. | `headsup_total_enter_duration_ms` Default: `233` |\n| Set the time (in milliseconds) needed by a fly-in animation to display a HUN for alpha. During animation, the time needed for a HUN to transition from transparent to opaque. | `headsup_alpha_enter_duration_ms` Default: `83` |\n| Specify the time (in milliseconds) needed by a fly-out animation to display a heads-up notification. | `headsup_exit_duration_ms` Default: `150` |\n| Define the minimum velocity (in pixels per second) used to determine that a swipe moves in the same direction. | `min_velocity_for_swipe_direction_detection` Default: `50` |"]]