diff options
| author | 2020-03-23 17:14:39 -0700 | |
|---|---|---|
| committer | 2020-03-24 17:47:46 -0700 | |
| commit | 4943b86bd3d7cf96d129fbdbe15654a3751801ac (patch) | |
| tree | 38f16f9fcc653b7767af357f953cd01478255515 | |
| parent | 027c823801986d95732b6c52c5f8017deca79e9a (diff) | |
Hook up new pipeline so notifs are visible
Various small bugs made it so that turning on the new pipeline wouldn't
actually show anything. This CL takes out some of these bugs so
that turning on the pipeline shows you notifications.
Everything is still pretty broken (although not TOO crashy), but you can
at least confirm some things are working (things are inflating!)
Bug: 112656837
Test: adb shell device_config put systemui
notification.newpipeline.rendering true
Test: smoke test while rendering flag is off
Change-Id: Ie2f407963240d8bf98ae194397b4a4fd00b55c9a
3 files changed, 8 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java index c6d84ff79bde..d2f781d2e19c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java @@ -651,7 +651,7 @@ public class NotificationEntryManager implements */ public void updateNotifications(String reason) { reapplyFilterAndSort(reason); - if (mPresenter != null) { + if (mPresenter != null && !mFeatureFlags.isNewNotifPipelineRenderingEnabled()) { mPresenter.updateNotificationViews(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifViewManager.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifViewManager.kt index 0437877d8330..cf670bd5a424 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifViewManager.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifViewManager.kt @@ -142,9 +142,11 @@ class NotifViewManager @Inject constructor( // To attach rows we can use _this one weird trick_: if the intended view to add does not // have a parent, then simply add it (and its children). entries.forEach { entry -> - val listItem = rowRegistry.requireView(entry) + // TODO: We should eventually map GroupEntry's themselves to views so that we don't + // depend on representativeEntry here which may actually be null in the future + val listItem = rowRegistry.requireView(entry.representativeEntry!!) - if (listItem.view.parent != null) { + if (listItem.view.parent == null) { listContainer.addListItem(listItem) stabilityManager.notifyViewAddition(listItem.view) } @@ -153,7 +155,8 @@ class NotifViewManager @Inject constructor( for ((idx, childEntry) in entry.children.withIndex()) { val childListItem = rowRegistry.requireView(childEntry) // Child hasn't been added yet. add it! - if (!listItem.notificationChildren.contains(childListItem)) { + if (listItem.notificationChildren == null || + !listItem.notificationChildren.contains(childListItem)) { // TODO: old code here just Log.wtf()'d here. This might wreak havoc if (childListItem.view.parent != null) { throw IllegalStateException("trying to add a notification child that " + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 4d4a2ded08ca..07104ff67027 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -6466,7 +6466,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private boolean hasActiveNotifications() { if (mFeatureFlags.isNewNotifPipelineRenderingEnabled()) { - return mNotifPipeline.getShadeList().isEmpty(); + return !mNotifPipeline.getShadeList().isEmpty(); } else { return mEntryManager.hasActiveNotifications(); } |