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/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index cd2e77a..52d005c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -68,14 +68,12 @@
 import com.android.systemui.statusbar.NotificationShelf;
 import com.android.systemui.statusbar.StatusBarState;
 import com.android.systemui.statusbar.notification.ActivityLaunchAnimator;
-import com.android.systemui.statusbar.policy.HeadsUpManager;
 import com.android.systemui.statusbar.policy.KeyguardUserSwitcher;
 import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
 import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
 import com.android.systemui.statusbar.stack.StackStateAnimator;
 
 import java.util.List;
-import java.util.Collection;
 
 public class NotificationPanelView extends PanelView implements
         ExpandableView.OnHeightChangedListener,
@@ -1571,7 +1569,7 @@
     private void updatePanelExpanded() {
         boolean isExpanded = !isFullyCollapsed();
         if (mPanelExpanded != isExpanded) {
-            mHeadsUpManager.setIsExpanded(isExpanded);
+            mHeadsUpManager.setIsPanelExpanded(isExpanded);
             mStatusBar.setPanelExpanded(isExpanded);
             mPanelExpanded = isExpanded;
         }
@@ -2338,7 +2336,7 @@
     }
 
     @Override
-    public void setHeadsUpManager(HeadsUpManager headsUpManager) {
+    public void setHeadsUpManager(HeadsUpManagerPhone headsUpManager) {
         super.setHeadsUpManager(headsUpManager);
         mHeadsUpTouchHelper = new HeadsUpTouchHelper(headsUpManager, mNotificationStackScroller,
                 this);
@@ -2630,8 +2628,8 @@
         }
     }
 
-    public void setPulsing(Collection<HeadsUpManager.HeadsUpEntry> pulsing) {
-        mKeyguardStatusView.setPulsing(pulsing != null);
+    public void setPulsing(boolean pulsing) {
+        mKeyguardStatusView.setPulsing(pulsing);
         positionClockAndNotifications();
         mNotificationStackScroller.setPulsing(pulsing, mKeyguardStatusView.getLocationOnScreen()[1]
                 + mKeyguardStatusView.getClockBottom());