From 1e05927464a85cb07460b0b06cade0d9f64ab645 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 21 May 2019 18:15:00 -0700 Subject: [PATCH] Removed the darkShelf logic Previously we were hiding the dark shelf conditionally, but that logic isn't needed anymore and is creating other issues Fixes: 130327302 Test: atest SystemUiTests Change-Id: Iaadad0c1de6a0bcaba98799585bf35813d60a765 --- .../stack/NotificationStackScrollLayout.java | 19 +++---------------- .../phone/NotificationPanelView.java | 3 --- .../phone/NotificationPanelViewTest.java | 15 --------------- 3 files changed, 3 insertions(+), 34 deletions(-) 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 de187f1de1cc1..05ffea4aa7a39 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 @@ -409,7 +409,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private final ViewOutlineProvider mOutlineProvider = new ViewOutlineProvider() { @Override public void getOutline(View view, Outline outline) { - if (mAmbientState.isDarkAtAll() || !mShowDarkShelf) { + if (mAmbientState.isDarkAtAll()) { float xProgress = mDarkXInterpolator.getInterpolation( (1 - mLinearDarkAmount) * mBackgroundXFactor); outline.setRoundRect(mBackgroundAnimationRect, @@ -507,7 +507,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd /** * If the {@link NotificationShelf} should be visible when dark. */ - private boolean mShowDarkShelf; private boolean mAnimateBottomOnLayout; @Inject @@ -1365,8 +1364,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd mIsClipped = clipped; } - if (!mAmbientPulseManager.hasNotifications() - && mAmbientState.isFullyDark() && mShowDarkShelf) { + if (!mAmbientPulseManager.hasNotifications() && mAmbientState.isFullyDark()) { setClipBounds(null); } else if (mAmbientState.isDarkAtAll()) { clipToOutline = true; @@ -4719,9 +4717,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd if (mAmbientState.isDark() == dark) { return; } - if (!dark) { - mShowDarkShelf = false; - } mAmbientState.setDark(dark); if (animate && mAnimationsEnabled) { mDarkNeedsAnimation = true; @@ -4783,7 +4778,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd boolean nowDarkAtAll = mAmbientState.isDarkAtAll(); if (nowFullyDark != wasFullyDark) { updateContentHeight(); - if (nowFullyDark && mShowDarkShelf) { + if (nowFullyDark) { updateDarkShelfVisibility(); } } @@ -4799,14 +4794,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd requestChildrenUpdate(); } - /** - * If the shelf should be visible when the device is in ambient mode (dozing.) - */ - @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) - public void showDarkShelf() { - mShowDarkShelf = true; - } - private void updateDarkShelfVisibility() { DozeParameters dozeParameters = DozeParameters.getInstance(mContext); if (dozeParameters.shouldControlScreenOff()) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index da9f2448a1aa9..3fe7f36bc1732 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -2853,9 +2853,6 @@ public class NotificationPanelView extends PanelView implements if (dozing == mDozing) return; mDozing = dozing; mNotificationStackScroller.setDark(mDozing, animate, wakeUpTouchLocation); - if (mDozing) { - mNotificationStackScroller.showDarkShelf(); - } mKeyguardBottomArea.setDozing(mDozing, animate); if (mBarState == StatusBarState.KEYGUARD diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java index 08471d8c17816..2f9d89272a4d6 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java @@ -119,24 +119,9 @@ public class NotificationPanelViewTest extends SysuiTestCase { mNotificationPanelView.setDozing(true /* dozing */, true /* animate */, null /* touch */); InOrder inOrder = inOrder(mNotificationStackScrollLayout, mStatusBarStateController); inOrder.verify(mNotificationStackScrollLayout).setDark(eq(true), eq(true), eq(null)); - inOrder.verify(mNotificationStackScrollLayout).showDarkShelf(); inOrder.verify(mStatusBarStateController).setDozeAmount(eq(1f), eq(true)); } - @Test - public void testSetDozing_showsDarkShelfWithDefaultClock() { - when(mKeyguardStatusView.hasCustomClock()).thenReturn(false); - mNotificationPanelView.setDozing(true /* dozing */, true /* animate */, null /* touch */); - verify(mNotificationStackScrollLayout).showDarkShelf(); - } - - @Test - public void testSetDozing_showsDarkShelfWhenCustomClock() { - when(mKeyguardStatusView.hasCustomClock()).thenReturn(true); - mNotificationPanelView.setDozing(true /* dozing */, true /* animate */, null /* touch */); - verify(mNotificationStackScrollLayout).showDarkShelf(); - } - @Test public void testSetExpandedHeight() { mNotificationPanelView.setExpandedHeight(200);