From c5926c36022119581f00afebd3af984303a7edeb Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 15 May 2018 11:17:07 -0700 Subject: [PATCH] Made sure that the ambient single line view remains invisible The single line views are visible by default when they are inflated and not all calls to it actually ensure that the visibility is updated. We therefore make sure that the view is appropriately hidden. Change-Id: Ied7641347d910fff5c8f1f0b38d349e7f3b56b76 Fixes: 77290485 Test: add second notification to group, observe no overlapping text --- .../systemui/statusbar/NotificationContentView.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java index 5477468505a48..dbeca60de60ac 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java @@ -1196,8 +1196,13 @@ public class NotificationContentView extends FrameLayout { } private void updateSingleLineView() { if (mIsChildInGroup) { + boolean isNewView = mSingleLineView == null; mSingleLineView = mHybridGroupManager.bindFromNotification( mSingleLineView, mStatusBarNotification.getNotification()); + if (isNewView) { + updateViewVisibility(mVisibleType, VISIBLE_TYPE_SINGLELINE, + mSingleLineView, mSingleLineView); + } } else if (mSingleLineView != null) { removeView(mSingleLineView); mSingleLineView = null; @@ -1206,8 +1211,13 @@ public class NotificationContentView extends FrameLayout { private void updateAmbientSingleLineView() { if (mIsChildInGroup) { + boolean isNewView = mAmbientSingleLineChild == null; mAmbientSingleLineChild = mHybridGroupManager.bindAmbientFromNotification( mAmbientSingleLineChild, mStatusBarNotification.getNotification()); + if (isNewView) { + updateViewVisibility(mVisibleType, VISIBLE_TYPE_AMBIENT_SINGLELINE, + mAmbientSingleLineChild, mAmbientSingleLineChild); + } } else if (mAmbientSingleLineChild != null) { removeView(mAmbientSingleLineChild); mAmbientSingleLineChild = null;