Implement pending notification indicator

Bug: 131262206
Test: Manual.

Change-Id: I25a2892b55ea9761823dee1596cbf5d189b95dd7
(cherry picked from commit 61d832588a575a108cc86709edca5a4e8a512aad)
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 9105346..febf8b8 100644
--- a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
+++ b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
@@ -423,6 +423,14 @@
                 new CarUxRestrictionManagerWrapper();
         carUxRestrictionManagerWrapper.setCarUxRestrictionsManager(carUxRestrictionsManager);
         NotificationDataManager notificationDataManager = new NotificationDataManager();
+
+        notificationDataManager.setOnUnseenCountUpdateListener(
+                () -> {
+                    // TODO: Update Notification Icon based on unseen count
+                    Log.d(TAG, "unseen count: " +
+                            notificationDataManager.getUnseenNotificationCount());
+                });
+
         CarHeadsUpNotificationManager carHeadsUpNotificationManager =
                 new CarSystemUIHeadsUpNotificationManager(mContext, clickHandlerFactory,
                         notificationDataManager);
@@ -433,6 +441,7 @@
         mNotificationView = mStatusBarWindow.findViewById(R.id.notification_view);
         View glassPane = mStatusBarWindow.findViewById(R.id.glass_pane);
         mNotificationView.setClickHandlerFactory(clickHandlerFactory);
+        mNotificationView.setNotificationDataManager(notificationDataManager);
 
         // The glass pane is used to view touch events before passed to the notification list.
         // This allows us to initialize gesture listeners and detect when to close the notifications
@@ -518,7 +527,8 @@
                 mNotificationView,
                 PreprocessingManager.getInstance(mContext),
                 carNotificationListener,
-                carUxRestrictionManagerWrapper);
+                carUxRestrictionManagerWrapper,
+                notificationDataManager);
         mNotificationViewController.enable();
     }
 
@@ -538,7 +548,6 @@
         mNotificationList.scrollToPosition(0);
         mStatusBarWindowController.setPanelVisible(true);
         mNotificationView.setVisibility(View.VISIBLE);
-
         animateNotificationPanel(mOpeningVelocity, false);
 
         setPanelExpanded(true);
@@ -625,6 +634,7 @@
                     setPanelExpanded(false);
                 } else {
                     // let the status bar know that the panel is open
+                    mNotificationView.setVisibleNotificationsAsSeen();
                     setPanelExpanded(true);
                 }
             }
@@ -825,7 +835,6 @@
         }
     }
 
-
     @Override
     public void showBatteryView() {
         if (Log.isLoggable(TAG, Log.DEBUG)) {