From 52ea5d8b7c0321d44169afb428585af556f38e66 Mon Sep 17 00:00:00 2001 From: Yining Liu Date: Mon, 31 Oct 2022 21:52:00 +0000 Subject: [PATCH] Increase the number of notification items that can be shown in Notification history - Recently dismissed Increase the max number of items shown in 'Notification history - Recently dismissed' from 6 to 50. Bug: 255784319 Test: Manual: Dismiss 6 or more notifications, open Settings-Notifications-Notification History, the max item count under `Recently dismissed` should be 50. Change-Id: Ia13158ae1ebca448d43bf4c6f6037758b3f40615 --- .../notification/history/NotificationHistoryActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/notification/history/NotificationHistoryActivity.java b/src/com/android/settings/notification/history/NotificationHistoryActivity.java index 4fecfc9b722..1f83cc72896 100644 --- a/src/com/android/settings/notification/history/NotificationHistoryActivity.java +++ b/src/com/android/settings/notification/history/NotificationHistoryActivity.java @@ -73,6 +73,10 @@ import java.util.concurrent.TimeUnit; public class NotificationHistoryActivity extends CollapsingToolbarBaseActivity { private static String TAG = "NotifHistory"; + // MAX_RECENT_DISMISS_ITEM_COUNT needs to be less or equals than + // R.integer.config_notificationServiceArchiveSize, which is the Number of notifications kept + // in the notification service historical archive + private static final int MAX_RECENT_DISMISS_ITEM_COUNT = 50; private ViewGroup mHistoryOn; private ViewGroup mHistoryOff; @@ -388,7 +392,8 @@ public class NotificationHistoryActivity extends CollapsingToolbarBaseActivity { snoozed = getSnoozedNotifications(); dismissed = mNm.getHistoricalNotificationsWithAttribution( NotificationHistoryActivity.this.getPackageName(), - NotificationHistoryActivity.this.getAttributionTag(), 6, false); + NotificationHistoryActivity.this.getAttributionTag(), + MAX_RECENT_DISMISS_ITEM_COUNT, false); } catch (SecurityException | RemoteException e) { Log.d(TAG, "OnPaused called while trying to retrieve notifications"); }