New pulsing notification layout

Test: wake up with power
Test: look at shelf on lock screen
Test: lock device w/ notifications from home screen
Test: receive notification on AOD
Test: atest KeyguardClockPositionAlgorithmTest
Test: atest NotificationRoundnessManagerTest
Test: atest ScrimControllerTest
Test: atest NotificationContentViewTest
Bug: 111405682
Change-Id: I9b4f2febd56a62256124567bffebc9f5f8255847
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
index 669e6ff..bac7844 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
@@ -90,7 +90,7 @@
      */
     private Runnable mContentChangeListener;
     private Slice mSlice;
-    private boolean mPulsing;
+    private boolean mHasHeader;
 
     public KeyguardSliceView(Context context) {
         this(context, null, 0);
@@ -150,10 +150,18 @@
         Dependency.get(ConfigurationController.class).removeCallback(this);
     }
 
+    /**
+     * Returns whether the current visible slice has a title/header.
+     */
+    public boolean hasHeader() {
+        return mHasHeader;
+    }
+
     private void showSlice() {
         Trace.beginSection("KeyguardSliceView#showSlice");
-        if (mPulsing || mSlice == null) {
+        if (mSlice == null) {
             mRow.setVisibility(GONE);
+            mHasHeader = false;
             if (mContentChangeListener != null) {
                 mContentChangeListener.run();
             }
@@ -162,7 +170,7 @@
 
         ListContent lc = new ListContent(getContext(), mSlice);
         SliceContent headerContent = lc.getHeader();
-        boolean hasHeader = headerContent != null
+        mHasHeader = headerContent != null
                 && !headerContent.getSliceItem().hasHint(HINT_LIST_ITEM);
         List<SliceContent> subItems = new ArrayList<>();
         for (int i = 0; i < lc.getRowItems().size(); i++) {
@@ -177,7 +185,7 @@
         mClickActions.clear();
         final int subItemsCount = subItems.size();
         final int blendedColor = getTextColor();
-        final int startIndex = hasHeader ? 1 : 0; // First item is header; skip it
+        final int startIndex = mHasHeader ? 1 : 0; // First item is header; skip it
         mRow.setVisibility(subItemsCount > 0 ? VISIBLE : GONE);
         for (int i = startIndex; i < subItemsCount; i++) {
             RowContent rc = (RowContent) subItems.get(i);
@@ -189,7 +197,7 @@
                 button = new KeyguardSliceButton(mContext);
                 button.setTextColor(blendedColor);
                 button.setTag(itemTag);
-                final int viewIndex = i - (hasHeader ? 1 : 0);
+                final int viewIndex = i - (mHasHeader ? 1 : 0);
                 mRow.addView(button, viewIndex);
             }
 
@@ -234,18 +242,6 @@
         Trace.endSection();
     }
 
-    public void setPulsing(boolean pulsing, boolean animate) {
-        mPulsing = pulsing;
-        LayoutTransition transition = getLayoutTransition();
-        if (!animate) {
-            setLayoutTransition(null);
-        }
-        showSlice();
-        if (!animate) {
-            setLayoutTransition(transition);
-        }
-    }
-
     public void setDarkAmount(float darkAmount) {
         mDarkAmount = darkAmount;
         mRow.setDarkAmount(darkAmount);