Permalink
Browse files

fingerprint: Speed up wake-and-unlock scenario

* Directly dismiss keyguard instead of using a fade-out animation
* Skip virtual navigation button animation on wake

This patch is for Nougat.

Change-Id: I7d479ce76526e0051b838053fdeba99dd5c86dd2
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
  • Loading branch information...
sultanxda authored and xlxfoxxlx committed Apr 16, 2017
1 parent 031b8a6 commit 8843afa68a7ded9f40005312554351887e87949f
@@ -1793,9 +1793,14 @@ private void handleStartKeyguardExitAnimation(long startTime, long fadeoutDurati
}
}
boolean wakeAndUnlocking = mWakeAndUnlocking;
mWakeAndUnlocking = false;
setShowingLocked(false);
mStatusBarKeyguardViewManager.hide(startTime, fadeoutDuration);
if (wakeAndUnlocking) {
mStatusBarKeyguardViewManager.hideNoAnimation();
} else {
mStatusBarKeyguardViewManager.hide(startTime, fadeoutDuration);
}
resetKeyguardDonePendingLocked();
mHideAnimationRun = false;
updateActivityLockScreenState();
@@ -213,7 +213,6 @@ public void onFingerprintAuthenticated(int userId) {
mStatusBarWindowManager.setStatusBarFocusable(false);
mDozeScrimController.abortPulsing();
mKeyguardViewMediator.onWakeAndUnlocking();
mScrimController.setWakeAndUnlocking();
if (mPhoneStatusBar.getNavigationBarView() != null) {
mPhoneStatusBar.getNavigationBarView().setWakeAndUnlocking(true);
}
@@ -223,9 +222,7 @@ public void onFingerprintAuthenticated(int userId) {
case MODE_NONE:
break;
}
if (mMode != MODE_WAKE_AND_UNLOCK_PULSING) {
mStatusBarWindowManager.setForceDozeBrightness(false);
}
mStatusBarWindowManager.setForceDozeBrightness(false);
mPhoneStatusBar.notifyFpAuthModeChanged();
Trace.endSection();
}
@@ -437,7 +437,7 @@ public void setLayoutTransitionsEnabled(boolean enabled) {
}
public void setWakeAndUnlocking(boolean wakeAndUnlocking) {
setUseFadingAnimations(wakeAndUnlocking);
setUseFadingAnimations(!wakeAndUnlocking);
mWakeAndUnlocking = wakeAndUnlocking;
updateLayoutTransitionsEnabled();
}
@@ -2708,9 +2708,10 @@ public void updateMediaMetaData(boolean metaDataChanged, boolean allowEnterAnima
if (DEBUG_MEDIA) {
Log.v(TAG, "DEBUG_MEDIA: Fading out album artwork");
}
if (mFingerprintUnlockController.getMode()
== FingerprintUnlockController.MODE_WAKE_AND_UNLOCK_PULSING
|| hideBecauseOccluded) {
int fpMode = mFingerprintUnlockController.getMode();
if (fpMode == FingerprintUnlockController.MODE_WAKE_AND_UNLOCK_PULSING ||
fpMode == FingerprintUnlockController.MODE_WAKE_AND_UNLOCK ||
hideBecauseOccluded) {
// We are unlocking directly - no animation!
mBackdrop.setVisibility(View.GONE);
@@ -370,6 +370,20 @@ public void onDensityOrFontScaleChanged() {
mBouncer.hide(true /* destroyView */);
}
public void hideNoAnimation() {
mShowing = false;
mPhoneStatusBar.setKeyguardFadingAway(SystemClock.uptimeMillis(), 0, 0);
mPhoneStatusBar.hideKeyguard();
mPhoneStatusBar.finishKeyguardFadingAway();
mStatusBarWindowManager.setKeyguardShowing(false);
mBouncer.hide(true /* destroyView */);
mViewMediatorCallback.keyguardGone();
mFingerprintUnlockController.finishKeyguardFadingAway();
updateStates();
WindowManagerGlobal.getInstance().trimMemory(
ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);
}
private void animateScrimControllerKeyguardFadingOut(long delay, long duration,
boolean skipFirstFrame) {
animateScrimControllerKeyguardFadingOut(delay, duration, null /* endRunnable */,

0 comments on commit 8843afa

Please sign in to comment.