diff options
| author | 2019-12-11 10:54:32 -0800 | |
|---|---|---|
| committer | 2019-12-11 13:14:33 -0800 | |
| commit | bbaf8493e3bb2a3185a8875d2688cd97ff75c27f (patch) | |
| tree | 668cc3de062a50511e1ae400a876bf329dad09af | |
| parent | 5aa92326c42dde8d679005a4e70a0f3941ae076f (diff) | |
Make fixes to make sysui more customizable
Includes:
1. add num of unseen notification to interface
Bug: 144567659
Test: manual
Change-Id: I66a0a7794ecfcdddd47d28ee681c904f799c5928
| -rw-r--r-- | packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java | 21 |
1 files changed, 12 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 c8532e006489..b9132138899f 100644 --- a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +++ b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java @@ -558,7 +558,12 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt mCarUxRestrictionManagerWrapper = new CarUxRestrictionManagerWrapper(); mNotificationDataManager = new NotificationDataManager(); - mNotificationDataManager.setOnUnseenCountUpdateListener(this::onUnseenCountUpdate); + + mNotificationDataManager.setOnUnseenCountUpdateListener(() -> { + if (mNotificationDataManager != null) { + onUseenCountUpdate(mNotificationDataManager.getUnseenNotificationCount()); + } + }); mEnableHeadsUpNotificationWhenNotificationShadeOpen = mContext.getResources().getBoolean( R.bool.config_enableHeadsUpNotificationWhenNotificationShadeOpen); @@ -680,15 +685,13 @@ 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. + * This method is automatically 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); - } + protected void onUseenCountUpdate(int unseenNotificationCount) { + boolean hasUnseen = unseenNotificationCount > 0; + mCarNavigationBarController.toggleAllNotificationsUnseenIndicator( + mDeviceProvisionedController.isCurrentUserSetup(), hasUnseen); } /** |