2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
알림 기록
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
알림 기록은 사용자가 일시중지된 알림, 최근에 닫은 알림, 마지막 알림 날짜 기록을 확인할 수 있는 기기 화면입니다. OEM에서 선택적으로 구현하는 기능입니다.
SoC나 이동통신사에는 영향을 미치지 않습니다.
알림 기록은 다음과 같은 사용 사례를 해결하기 위한 것입니다.
- 실수로 닫은 알림: 실수로 알림을 닫았으며 알림 내용을 간단하게 확인하고 싶습니다.
- 일시중지된 알림: 알림을 일시중지했지만 일시중지 기간이 끝나기 전에 확인하고 싶습니다.
- 문제 해결: 알림을 받지 못한 것 같습니다. 알림 기록에서 알림이 있었는지 알림음이 울렸는지 확인합니다. 찾을 수 없으면 알림이 차단되었는지 확인합니다. 알림 기록에서 알림 설정을 변경할 수 있습니다.
- 알림 관리: 알림이 방해되지 않도록 하려면 알림 기록을 사용하면 됩니다. 알림, 차단 등의 변경 범위를 쉽게 파악할 수 있는 일일 알림 양의 현실적인 수치를 제공하기 때문입니다.
다음 알림 기록 구성요소의 참조 구현을 사용할 수 있습니다.
- 설정:
packages/apps/Settings/src/com/android/settings/notification/history
- 시스템 서버:
com.android.server.notification.NotificationHistory.*.java
다음은 알림 기록을 구현하는 주요 단계입니다.
- 알림 이벤트를 로그에 기록합니다.
- 로그 및 설정에 진입점을 추가하여 사용 설정하거나 사용 중지합니다.
- 알림 기록 화면을 구현합니다.
사용자는 알림 기록을 사용 중지할 수 있습니다. 사용 중지되면 모든 기록 항목이 삭제되고 로그에 항목이 기록되지 않습니다.
NotificationHistoryDatabase
클래스의 HISTORY_RETENTION_DAYS
상수를 사용하여 알림 기록에 알림이 표시되는 일수를 설정할 수 있습니다. 알림 기록 화면에 표시되는 섹션과 데이터 표시 방식을 수정할 수도 있습니다.
기본 알림 기록 보관 기간은 24시간입니다.
다음 단위 테스트가 코드의 각 구성요소에 제공됩니다.
- 시스템 서버 단위 테스트:
FrameworksUiServicesTests
- 설정 단위 테스트:
make -j64 RunSettingsRoboTests
ROBOTEST_FILTER="com.android.settings.notification"
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 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\"`"]]