از 27 مارس 2025، توصیه می کنیم از android-latest-release
به جای aosp-main
برای ساختن و کمک به AOSP استفاده کنید. برای اطلاعات بیشتر، به تغییرات AOSP مراجعه کنید.
سابقه اعلان
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
تاریخچه اعلان یک صفحه دستگاه است که در آن کاربران می توانند اعلان های به تعویق افتاده، تعداد انگشت شماری از اعلان های اخیراً رد شده و تاریخچه آخرین روز اعلان ها را ببینند. این یک ویژگی اختیاری برای OEM ها برای پیاده سازی است. هیچ تاثیری روی 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"
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-29 بهوقت ساعت هماهنگ جهانی."],[],[],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\"`"]]