summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Selim Cinek <cinek@google.com> 2021-05-25 18:42:11 +0200
committer Selim Cinek <cinek@google.com> 2021-05-26 16:44:14 +0200
commite4dbcf927d6a225e5d6ff23d8659f5ffd825560b (patch)
treeaac75103174b4faf5977bed1996f7a746d006416
parent48f518618e3c75ac793703da678e3c4ba9b05b64 (diff)
Fixed an issue where media could flicker during bypass
When turning off the phone, media could sometimes flicker in during bypass, because the qs expansion would become larger than 0.0f. We now keep the expansion at 0 during screen off Bug: 189318793 Test: enable bypass, turn off screen. Change-Id: Ib2b30fb1c96e4b078978b1958747473aa5fc9cfc
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
index 9d8a9bfafe49..2bfcf2b60fdf 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
@@ -572,6 +572,7 @@ public class NotificationPanelViewController extends PanelViewController {
private int mScrimCornerRadius;
private int mScreenCornerRadius;
private int mNotificationScrimPadding;
+ private boolean mQSAnimatingHiddenFromCollapsed;
private final QuickAccessWalletClient mQuickAccessWalletClient;
private final Executor mUiExecutor;
@@ -1419,7 +1420,7 @@ public class NotificationPanelViewController extends PanelViewController {
}
mStatusBar.getGutsManager().closeAndSaveGuts(true /* leavebehind */, true /* force */,
true /* controls */, -1 /* x */, -1 /* y */, true /* resetMenu */);
- if (animate) {
+ if (animate && !isFullyCollapsed()) {
animateCloseQs(true /* animateAway */);
} else {
closeQs();
@@ -1703,6 +1704,11 @@ public class NotificationPanelViewController extends PanelViewController {
}
private float computeQsExpansionFraction() {
+ if (mQSAnimatingHiddenFromCollapsed) {
+ // When hiding QS from collapsed state, the expansion can sometimes temporarily
+ // be larger than 0 because of the timing, leading to flickers.
+ return 0.0f;
+ }
return Math.min(
1f, (mQsExpansionHeight - mQsMinExpansionHeight) / (mQsMaxExpansionHeight
- mQsMinExpansionHeight));
@@ -2505,6 +2511,7 @@ public class NotificationPanelViewController extends PanelViewController {
@Override
public void onAnimationEnd(Animator animation) {
+ mQSAnimatingHiddenFromCollapsed = false;
mAnimatingQS = false;
notifyExpandingFinished();
mNotificationStackScrollLayoutController.resetCheckSnoozeLeavebehind();
@@ -2521,6 +2528,7 @@ public class NotificationPanelViewController extends PanelViewController {
animator.start();
mQsExpansionAnimator = animator;
mQsAnimatorExpand = expanding;
+ mQSAnimatingHiddenFromCollapsed = computeQsExpansionFraction() == 0.0f && target == 0;
}
/**