diff options
| author | 2019-09-17 16:06:45 -0700 | |
|---|---|---|
| committer | 2019-09-17 16:06:45 -0700 | |
| commit | 1b54c6cacc60a01f64544456c39cbcca55339997 (patch) | |
| tree | 5afded3e340732db1a378efdcbefd2a8f0465cfd | |
| parent | ef43c4c912070ea1bce66f46ee7407653680328e (diff) | |
| parent | 7654f1f9564ef383115990b74b6fb142442d88b7 (diff) | |
Merge "Fix status bar flickering" into qt-qpr1-dev am: 89ebc7c1ad
am: 7654f1f956
Change-Id: I79487826b2043df089a2fb723172a7d64eec0e68
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java | 38 |
1 files changed, 36 insertions, 2 deletions
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 a79ecd905403..ea113dffa658 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -102,6 +102,7 @@ import com.android.systemui.statusbar.notification.stack.AnimationProperties; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.notification.stack.StackStateAnimator; import com.android.systemui.statusbar.policy.ConfigurationController; +import com.android.systemui.statusbar.policy.KeyguardMonitor; import com.android.systemui.statusbar.policy.KeyguardUserSwitcher; import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener; import com.android.systemui.statusbar.policy.ZenModeController; @@ -177,12 +178,22 @@ public class NotificationPanelView extends PanelView implements @VisibleForTesting final KeyguardUpdateMonitorCallback mKeyguardUpdateCallback = new KeyguardUpdateMonitorCallback() { + + @Override + public void onBiometricAuthenticated(int userId, + BiometricSourceType biometricSourceType) { + if (mFirstBypassAttempt && mUpdateMonitor.isUnlockingWithBiometricAllowed()) { + mDelayShowingKeyguardStatusBar = true; + } + } + @Override public void onBiometricRunningStateChanged(boolean running, BiometricSourceType biometricSourceType) { boolean keyguardOrShadeLocked = mBarState == StatusBarState.KEYGUARD || mBarState == StatusBarState.SHADE_LOCKED; - if (!running && mFirstBypassAttempt && keyguardOrShadeLocked && !mDozing) { + if (!running && mFirstBypassAttempt && keyguardOrShadeLocked && !mDozing + && !mDelayShowingKeyguardStatusBar) { mFirstBypassAttempt = false; animateKeyguardStatusBarIn(StackStateAnimator.ANIMATION_DURATION_STANDARD); } @@ -191,6 +202,17 @@ public class NotificationPanelView extends PanelView implements @Override public void onFinishedGoingToSleep(int why) { mFirstBypassAttempt = mKeyguardBypassController.getBypassEnabled(); + mDelayShowingKeyguardStatusBar = false; + } + }; + private final KeyguardMonitor.Callback mKeyguardMonitorCallback = + new KeyguardMonitor.Callback() { + @Override + public void onKeyguardFadingAwayChanged() { + if (!mKeyguardMonitor.isKeyguardFadingAway()) { + mFirstBypassAttempt = false; + mDelayShowingKeyguardStatusBar = false; + } } }; @@ -413,7 +435,17 @@ public class NotificationPanelView extends PanelView implements private boolean mShowingKeyguardHeadsUp; private boolean mAllowExpandForSmallExpansion; private Runnable mExpandAfterLayoutRunnable; + + /** + * If face auth with bypass is running for the first time after you turn on the screen. + * (From aod or screen off) + */ private boolean mFirstBypassAttempt; + /** + * If auth happens successfully during {@code mFirstBypassAttempt}, and we should wait until + * the keyguard is dismissed to show the status bar. + */ + private boolean mDelayShowingKeyguardStatusBar; private PluginManager mPluginManager; private FrameLayout mPluginFrame; @@ -450,6 +482,7 @@ public class NotificationPanelView extends PanelView implements mKeyguardBypassController = bypassController; mUpdateMonitor = Dependency.get(KeyguardUpdateMonitor.class); mFirstBypassAttempt = mKeyguardBypassController.getBypassEnabled(); + mKeyguardMonitor.addCallback(mKeyguardMonitorCallback); dynamicPrivacyController.addListener(this); mBottomAreaShadeAlphaAnimator = ValueAnimator.ofFloat(1f, 0); @@ -2391,7 +2424,8 @@ public class NotificationPanelView extends PanelView implements * mKeyguardStatusBarAnimateAlpha; newAlpha *= 1.0f - mKeyguardHeadsUpShowingAmount; mKeyguardStatusBar.setAlpha(newAlpha); - boolean hideForBypass = mFirstBypassAttempt && mUpdateMonitor.shouldListenForFace(); + boolean hideForBypass = mFirstBypassAttempt && mUpdateMonitor.shouldListenForFace() + || mDelayShowingKeyguardStatusBar; mKeyguardStatusBar.setVisibility(newAlpha != 0f && !mDozing && !hideForBypass ? VISIBLE : INVISIBLE); } |