Merge "Fix status bar flickering" into qt-qpr1-dev
am: 89ebc7c1ad
Change-Id: I0fb3b62248e139ca30f3981588278c04b3471dd5
This commit is contained in:
@@ -96,6 +96,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;
|
||||
@@ -169,12 +170,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);
|
||||
}
|
||||
@@ -183,6 +194,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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -404,7 +426,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;
|
||||
|
||||
@Inject
|
||||
public NotificationPanelView(@Named(VIEW_CONTEXT) Context context, AttributeSet attrs,
|
||||
@@ -436,6 +468,7 @@ public class NotificationPanelView extends PanelView implements
|
||||
mKeyguardBypassController = bypassController;
|
||||
mUpdateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
|
||||
mFirstBypassAttempt = mKeyguardBypassController.getBypassEnabled();
|
||||
mKeyguardMonitor.addCallback(mKeyguardMonitorCallback);
|
||||
dynamicPrivacyController.addListener(this);
|
||||
|
||||
mBottomAreaShadeAlphaAnimator = ValueAnimator.ofFloat(1f, 0);
|
||||
@@ -2263,7 +2296,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user