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.
Notification history
Stay organized with collections
Save and categorize content based on your preferences.
Notification history is a device screen where users can see snoozed
notifications, a handful of recently dismissed notifications, and a history of
the last day of notifications. It is an optional feature for OEMs to implement.
There's no impact on SoCs or carriers.
Notification history is meant to address these use cases:
- Accidental dismissal: You accidentally dismissed a
notification and want to get a quick look at what it was.
- Snoozed notifications: You snoozed a notification but want
to see it before the snooze period is over.
- Troubleshooting: You think you missed a notification. You
check the notification history to see whether there was a notification and
whether it buzzed. If you don't find it, you check whether a notification was
blocked. You can change notification settings in notification history.
- Notification management: You want to change how
interruptive notifications are, so you use notification history because it
offers a realistic slice of daily notification load, which makes it easy to
understand the scope of your changes to alerting, blocking. etc.
Reference implementations of these components of Notification History are
available:
- Settings:
packages/apps/Settings/src/com/android/settings/notification/history
- System server:
com.android.server.notification.NotificationHistory.*.java
These are the major steps to implement Notification History:
- Write notification events to the log.
- Add entry points to the log and the setting to turn it on and off.
- Implement the Notification History screen.
Users can turn Notification History off. When it's off, all history items are
deleted and no items are written to the log.
You can set the number of days notifications appear in the Notification
History using the HISTORY_RETENTION_DAYS
constant in the
NotificationHistoryDatabase
class. You can also modify which
sections appear in the Notification History screen and how the data is
presented.
The default notification history retention period is 24 hours.
These unit tests are provided for each component of the code:
- System server unit tests:
FrameworksUiServicesTests
- Settings unit tests:
make -j64 RunSettingsRoboTests
ROBOTEST_FILTER="com.android.settings.notification"
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 2025-08-29 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 2025-08-29 UTC."],[],[],null,["# Notification history is a device screen where users can see snoozed\nnotifications, a handful of recently dismissed notifications, and a history of\nthe last day of notifications. It is an optional feature for OEMs to implement.\nThere's no impact on SoCs or carriers.\n\nNotification history is meant to address these use cases:\n\n- **Accidental dismissal**: You accidentally dismissed a notification and want to get a quick look at what it was.\n- **Snoozed notifications**: You snoozed a notification but want to see it before the snooze period is over.\n- **Troubleshooting**: You think you missed a notification. You check the notification history to see whether there was a notification and whether it buzzed. If you don't find it, you check whether a notification was blocked. You can change notification settings in notification history.\n- **Notification management**: You want to change how interruptive notifications are, so you use notification history because it offers a realistic slice of daily notification load, which makes it easy to understand the scope of your changes to alerting, blocking. etc.\n\nReference implementations of these components of Notification History are\navailable:\n\n- **Settings** : `packages/apps/Settings/src/com/android/settings/notification/history`\n- **System server** : `com.android.server.notification.NotificationHistory.*.java`\n\nThese are the major steps to implement Notification History:\n\n- Write notification events to the log.\n- Add entry points to the log and the setting to turn it on and off.\n- Implement the Notification History screen.\n\nUsers can turn Notification History off. When it's off, all history items are\ndeleted and no items are written to the log.\n\nYou can set the number of days notifications appear in the Notification\nHistory using the `HISTORY_RETENTION_DAYS` constant in the\n`NotificationHistoryDatabase` class. You can also modify which\nsections appear in the Notification History screen and how the data is\npresented.\n\nThe default notification history retention period is 24 hours.\n\nThese unit tests are provided for each component of the code:\n\n- **System server unit tests** : `FrameworksUiServicesTests`\n- **Settings unit tests** : `make -j64 RunSettingsRoboTests\n ROBOTEST_FILTER=\"com.android.settings.notification\"`"]]