summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author AndrĂ¡s Kurucz <kurucz@google.com> 2023-05-15 19:06:55 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-05-15 19:06:55 +0000
commit9f200877a15f00a5d6056be3ec75ec669fa6d1cb (patch)
tree7211d843599955b21903f605cc4d663162edeca1
parentf817f842077796ef8cf085fa5d250835e9280204 (diff)
parent3ca0c57064999e7c48548a72355531aafc6f126e (diff)
Merge "Fix LightReveal Scrim animation flickering" into udc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java5
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java37
2 files changed, 39 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
index 752c982ddfdd..0fdd7ca1564f 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -2917,6 +2917,10 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
&& mBarState == StatusBarState.SHADE;
}
+ private boolean isPanelVisibleBecauseScrimIsAnimatingOff() {
+ return mUnlockedScreenOffAnimationController.isAnimationPlaying();
+ }
+
@Override
public boolean shouldHideStatusBarIconsWhenExpanded() {
if (mIsLaunchAnimationRunning) {
@@ -3976,6 +3980,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
|| isPanelVisibleBecauseOfHeadsUp()
|| mTracking
|| mHeightAnimator != null
+ || isPanelVisibleBecauseScrimIsAnimatingOff()
&& !mIsSpringBackAnimation;
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java
index c5495e1fd024..a5a9de54c558 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java
@@ -1106,7 +1106,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
}
@Test
- public void shadeExpanded_inShadeState() {
+ public void shadeFullyExpanded_inShadeState() {
mStatusBarStateController.setState(SHADE);
mNotificationPanelViewController.setExpandedHeight(0);
@@ -1118,7 +1118,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
}
@Test
- public void shadeExpanded_onKeyguard() {
+ public void shadeFullyExpanded_onKeyguard() {
mStatusBarStateController.setState(KEYGUARD);
int transitionDistance = mNotificationPanelViewController.getMaxPanelTransitionDistance();
@@ -1127,8 +1127,39 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
}
@Test
- public void shadeExpanded_onShadeLocked() {
+ public void shadeFullyExpanded_onShadeLocked() {
mStatusBarStateController.setState(SHADE_LOCKED);
assertThat(mNotificationPanelViewController.isShadeFullyExpanded()).isTrue();
}
+
+ @Test
+ public void shadeExpanded_whenHasHeight() {
+ int transitionDistance = mNotificationPanelViewController.getMaxPanelTransitionDistance();
+ mNotificationPanelViewController.setExpandedHeight(transitionDistance);
+ assertThat(mNotificationPanelViewController.isExpanded()).isTrue();
+ }
+
+ @Test
+ public void shadeExpanded_whenInstantExpanding() {
+ mNotificationPanelViewController.expand(true);
+ assertThat(mNotificationPanelViewController.isExpanded()).isTrue();
+ }
+
+ @Test
+ public void shadeExpanded_whenHunIsPresent() {
+ when(mHeadsUpManager.hasPinnedHeadsUp()).thenReturn(true);
+ assertThat(mNotificationPanelViewController.isExpanded()).isTrue();
+ }
+
+ @Test
+ public void shadeExpanded_whenWaitingForExpandGesture() {
+ mNotificationPanelViewController.startWaitingForExpandGesture();
+ assertThat(mNotificationPanelViewController.isExpanded()).isTrue();
+ }
+
+ @Test
+ public void shadeExpanded_whenUnlockedOffscreenAnimationRunning() {
+ when(mUnlockedScreenOffAnimationController.isAnimationPlaying()).thenReturn(true);
+ assertThat(mNotificationPanelViewController.isExpanded()).isTrue();
+ }
}