החל מ-27 במרץ 2025, מומלץ להשתמש ב-android-latest-release
במקום ב-aosp-main
כדי ליצור תרומות ל-AOSP. מידע נוסף זמין במאמר שינויים ב-AOSP.
היסטוריית ההתראות
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
היסטוריית ההתראות היא מסך במכשיר שבו המשתמשים יכולים לראות התראות שהועברו למצב נודניק, כמה התראות שנדחו לאחרונה והיסטוריה של ההתראות מהיום האחרון. זו תכונה אופציונלית שיצרני ציוד מקורי יכולים להטמיע.
אין לכך השפעה על מעבדי SoC או על ספקי שירותי סלולר.
היסטוריית ההתראות מיועדת לטיפול בתרחישי השימוש הבאים:
- סגירה בטעות: סגרתם בטעות התראה ואתם רוצים לראות במהירות מה הייתה.
- התראות מושהות: העברת התראה למצב נודניק אבל רוצים לראות אותה לפני שפג תוקף הנודניק.
- פתרון בעיות: לדעתכם פספסתם התראה. בודקים בהיסטוריית ההתראות אם התקבלה התראה והאם הייתה רטט. אם היא לא מופיעה, צריך לבדוק אם התראה מסוימת חסומה. אפשר לשנות את הגדרות ההתראות בהיסטוריית ההתראות.
- ניהול התראות: אתם רוצים לשנות את מידת ההפרעה של ההתראות, ולכן אתם משתמשים בהיסטוריית ההתראות כי היא מציגה תמונת מצב מציאותית של עומס ההתראות היומי, ומאפשרת לכם להבין בקלות את היקף השינויים שביצעתם בהתראות, בחסימות וכו'.
יש הטמעות ייחוס של המרכיבים האלה של היסטוריית ההתראות:
- הגדרות:
packages/apps/Settings/src/com/android/settings/notification/history
- שרת המערכת:
com.android.server.notification.NotificationHistory.*.java
אלה השלבים העיקריים להטמעת היסטוריית ההתראות:
- כתיבת אירועי התראות ביומן.
- מוסיפים נקודות כניסה ליומן ואת ההגדרה להפעלה ולהשבתה שלו.
- הטמעת המסך 'היסטוריית ההתראות'.
המשתמשים יכולים להשבית את היסטוריית ההתראות. כשהיא מושבתת, כל הפריטים בהיסטוריה נמחקים ואין כתיבה של פריטים ביומן.
אפשר להגדיר את מספר הימים שבהם התראות יופיעו בהיסטוריית ההתראות באמצעות הקבוע HISTORY_RETENTION_DAYS
בכיתה NotificationHistoryDatabase
. אתם יכולים גם לשנות את הקטעים שיופיעו במסך 'היסטוריית ההתראות' ואת אופן הצגת הנתונים.
תקופת השמירה של היסטוריית ההתראות מוגדרת כברירת מחדל ל-24 שעות.
בדיקות היחידות האלה מוצגות לכל רכיב בקוד:
- בדיקות יחידה של שרת המערכת:
FrameworksUiServicesTests
- בדיקות יחידה של הגדרות:
make -j64 RunSettingsRoboTests
ROBOTEST_FILTER="com.android.settings.notification"
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 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\"`"]]