diff options
| -rw-r--r-- | packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java index bef769d7ba10..bcb76d7169ec 100644 --- a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +++ b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java @@ -562,15 +562,7 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt mCarUxRestrictionManagerWrapper = new CarUxRestrictionManagerWrapper(); mNotificationDataManager = new NotificationDataManager(); - mNotificationDataManager.setOnUnseenCountUpdateListener( - () -> { - if (mNotificationDataManager != null) { - boolean hasUnseen = - mNotificationDataManager.getUnseenNotificationCount() > 0; - mCarNavigationBarController.toggleAllNotificationsUnseenIndicator( - mDeviceProvisionedController.isCurrentUserSetup(), hasUnseen); - } - }); + mNotificationDataManager.setOnUnseenCountUpdateListener(this::onUnseenCountUpdate); mEnableHeadsUpNotificationWhenNotificationShadeOpen = mContext.getResources().getBoolean( R.bool.config_enableHeadsUpNotificationWhenNotificationShadeOpen); @@ -692,6 +684,18 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt } /** + * This method is called whenever there is an update to the number of unseen notifications. + * This method can be extended by OEMs to customize the desired logic. + */ + protected void onUnseenCountUpdate() { + if (mNotificationDataManager != null) { + boolean hasUnseen = mNotificationDataManager.getUnseenNotificationCount() > 0; + mCarNavigationBarController.toggleAllNotificationsUnseenIndicator( + mDeviceProvisionedController.isCurrentUserSetup(), hasUnseen); + } + } + + /** * @return true if the notification panel is currently visible */ boolean isNotificationPanelOpen() { |