Mulai 27 Maret 2025, sebaiknya gunakan android-latest-release
, bukan aosp-main
, untuk mem-build dan berkontribusi pada AOSP. Untuk mengetahui informasi selengkapnya, lihat Perubahan pada AOSP.
Histori notifikasi
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Histori notifikasi adalah layar perangkat tempat pengguna dapat melihat notifikasi
yang ditunda, beberapa notifikasi yang baru-baru ini ditutup, dan histori
notifikasi hari terakhir. Ini adalah fitur opsional yang dapat diterapkan OEM.
Tidak ada dampak pada SoC atau operator.
Histori notifikasi dimaksudkan untuk mengatasi kasus penggunaan berikut:
- Penonaktifan tidak disengaja: Anda tidak sengaja menutup
notifikasi dan ingin melihatnya sekilas.
- Notifikasi yang ditunda: Anda menunda notifikasi, tetapi ingin
melihatnya sebelum periode penundaan berakhir.
- Pemecahan masalah: Anda merasa melewatkan notifikasi. Anda
akan memeriksa histori notifikasi untuk melihat apakah ada notifikasi dan
apakah notifikasi tersebut berbunyi. Jika tidak menemukannya, periksa apakah notifikasi telah diblokir. Anda dapat mengubah setelan notifikasi di histori notifikasi.
- Pengelolaan notifikasi: Anda ingin mengubah cara kerja
notifikasi yang mengganggu, jadi Anda menggunakan histori notifikasi karena
menawarkan potongan beban notifikasi harian yang realistis, yang memudahkan
pahami cakupan perubahan Anda untuk pemberitahuan, pemblokiran, dll.
Implementasi referensi komponen Histori Notifikasi ini
tersedia:
- Setelan:
packages/apps/Settings/src/com/android/settings/notification/history
- Server sistem:
com.android.server.notification.NotificationHistory.*.java
Berikut adalah langkah-langkah utama untuk menerapkan Histori Notifikasi:
- Menulis peristiwa notifikasi ke log.
- Tambahkan titik entri ke log dan setelan untuk mengaktifkan dan menonaktifkannya.
- Terapkan layar Histori Notifikasi.
Pengguna dapat menonaktifkan Histori Notifikasi. Jika dinonaktifkan, semua item histori akan
dihapus dan tidak ada item yang ditulis ke log.
Anda dapat menetapkan jumlah hari notifikasi muncul di Histori Notifikasi
menggunakan konstanta HISTORY_RETENTION_DAYS
di
class NotificationHistoryDatabase
. Anda juga dapat mengubah bagian
yang muncul di layar Histori Notifikasi dan cara data
ditampilkan.
Periode retensi histori notifikasi default adalah 24 jam.
Pengujian unit ini disediakan untuk setiap komponen kode:
- Pengujian unit server sistem:
FrameworksUiServicesTests
- Pengujian unit setelan:
make -j64 RunSettingsRoboTests
ROBOTEST_FILTER="com.android.settings.notification"
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-27 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\"`"]]