From 9bfba9c157e4a5b1325a60d2122be2bf034a5a2a Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Mon, 8 Aug 2016 15:20:06 -0700 Subject: [PATCH] Made background updater more robust to state changes With raceconditions, the background of notifications could become colored when dozing. Change-Id: Ib39f873e6dce40e97a8df06dec281733a8ae2fd9 Fixes: 29331596 --- .../stack/NotificationStackScrollLayout.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index f72e50beec108..e60a809cd38f1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -1963,9 +1963,9 @@ public class NotificationStackScrollLayout extends ViewGroup } private void applyCurrentBackgroundBounds() { - if (!mFadingOut) { - mScrimController.setExcludedBackgroundArea(mCurrentBounds); - } + mScrimController.setExcludedBackgroundArea( + mFadingOut || mParentFadingOut || mAmbientState.isDark() ? null + : mCurrentBounds); invalidate(); } @@ -3843,11 +3843,7 @@ public class NotificationStackScrollLayout extends ViewGroup } private void updateFadingState() { - if (mFadingOut || mParentFadingOut || mAmbientState.isDark()) { - mScrimController.setExcludedBackgroundArea(null); - } else { - applyCurrentBackgroundBounds(); - } + applyCurrentBackgroundBounds(); updateSrcDrawing(); }