Fix heads up/ambient content inflation w/ groups.

This CL fixes lazy content inflation for alerting notifications in
groups by inflating them on the fly if we would transfer to a
notification that does not have its content inflated. We introduce a
helper class here to explicitly deal with the transfer logic,
refactoring a lot of the GroupManager code out.

This removes the previous workaround to always inflate heads up +
ambient views.

Bug: 111809944
Fixes: 111809944
Fixes: 117933032
Fixes: 117894786
Test: runtest systemui
Test: manual, posted groups that trigger a transfer and a transfer back.
Group alerts behaved as expected.
Change-Id: I9b5ec4c8bdeea20707874d90213dcd1d22d8b503
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/AlertingNotificationManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/AlertingNotificationManagerTest.java
index 8b41516..f49c5b4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/AlertingNotificationManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/AlertingNotificationManagerTest.java
@@ -17,6 +17,8 @@
 
 package com.android.systemui.statusbar;
 
+import static com.android.systemui.statusbar.notification.row.NotificationInflater.FLAG_CONTENT_VIEW_CONTRACTED;
+
 import static junit.framework.Assert.assertFalse;
 import static junit.framework.Assert.assertTrue;
 
@@ -84,6 +86,11 @@
 
         @Override
         protected void onAlertEntryRemoved(AlertEntry alertEntry) {}
+
+        @Override
+        public int getContentFlag() {
+            return FLAG_CONTENT_VIEW_CONTRACTED;
+        }
     }
 
     protected AlertingNotificationManager createAlertingNotificationManager() {