Split HeadsUpManager implementation to HeadsUpManagerPhone (2nd try)

This CL splits HeadsUpManager with the basic functionality and the
phone (and car) related implementation. The former code leaves in
HeadsUpManager class, and the later code is moved to separated
HeadsUpManagerPhone class.

This contains the following minor changes:
- Move the utility static methods to HeadsUpUtil class.
- Chanege the return types of HeadsUpManager#getAllEntries() and
  HeadsUpManager#getTopEntry() from Collection<HeadsUpEntry> to
  Stream<NotificationData.Entry>.
- Add a private method: HeadsUpManagerPhone#getTopHeadsUpEntry()
- Make the mPluse propertes boolean instead of Collection in
  AmbientState and NotificationStackScrollLayout classes.
- Unify removeAllHeadsUpEntries() and releaseAllImmediately(), since
  they do same thing.
- Move getTopHeadsUpPinnedHeight method from HeadsUpManager to
  NotificationStackScrollLayout class, since only this class uses it.
- Add simple tests.

Bug: 63874929
Bug: 62602530
Test: Compile and ran "runtest systemui"
Change-Id: I96381bee75894150dae413883c168a67cd4c8267
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java
index 424858a..d7a810e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java
@@ -64,7 +64,7 @@
     private boolean mPanelTracking;
     private boolean mExpansionChanging;
     private boolean mPanelFullWidth;
-    private Collection<HeadsUpManager.HeadsUpEntry> mPulsing;
+    private boolean mPulsing;
     private boolean mUnlockHintRunning;
     private boolean mQsCustomizerShowing;
     private int mIntrinsicPadding;
@@ -315,23 +315,18 @@
     }
 
     public boolean hasPulsingNotifications() {
-        return mPulsing != null;
+        return mPulsing;
     }
 
-    public void setPulsing(Collection<HeadsUpManager.HeadsUpEntry> hasPulsing) {
+    public void setPulsing(boolean hasPulsing) {
         mPulsing = hasPulsing;
     }
 
     public boolean isPulsing(NotificationData.Entry entry) {
-        if (mPulsing == null) {
+        if (!mPulsing || mHeadsUpManager == null) {
             return false;
         }
-        for (HeadsUpManager.HeadsUpEntry e : mPulsing) {
-            if (e.entry == entry) {
-                return true;
-            }
-        }
-        return false;
+        return mHeadsUpManager.getAllEntries().anyMatch(e -> (e == entry));
     }
 
     public boolean isPanelTracking() {