Merge changes Ie8264c4d,Ic83ac0f1 into mnc-dr-dev
* changes: Fix jank in wake-and-unlock while pulsing Don't call authenticate immediately after getting valid fingerprint
This commit is contained in:
@@ -147,6 +147,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
|
|||||||
private int mRingMode;
|
private int mRingMode;
|
||||||
private int mPhoneState;
|
private int mPhoneState;
|
||||||
private boolean mKeyguardIsVisible;
|
private boolean mKeyguardIsVisible;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true, fingerprint was already authenticated and we don't need to start listening again
|
||||||
|
* until the Keyguard has been dismissed.
|
||||||
|
*/
|
||||||
|
private boolean mFingerprintAlreadyAuthenticated;
|
||||||
private boolean mBouncer;
|
private boolean mBouncer;
|
||||||
private boolean mBootCompleted;
|
private boolean mBootCompleted;
|
||||||
private boolean mUserHasAuthenticatedSinceBoot;
|
private boolean mUserHasAuthenticatedSinceBoot;
|
||||||
@@ -373,6 +379,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
|
|||||||
|
|
||||||
private void onFingerprintAuthenticated(int userId) {
|
private void onFingerprintAuthenticated(int userId) {
|
||||||
mUserFingerprintAuthenticated.put(userId, true);
|
mUserFingerprintAuthenticated.put(userId, true);
|
||||||
|
|
||||||
|
// If fingerprint unlocking is allowed, this event will lead to a Keyguard dismiss or to a
|
||||||
|
// wake-up (if Keyguard is not showing), so we don't need to listen until Keyguard is
|
||||||
|
// fully gone.
|
||||||
|
mFingerprintAlreadyAuthenticated = isUnlockingWithFingerprintAllowed();
|
||||||
for (int i = 0; i < mCallbacks.size(); i++) {
|
for (int i = 0; i < mCallbacks.size(); i++) {
|
||||||
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
|
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
|
||||||
if (cb != null) {
|
if (cb != null) {
|
||||||
@@ -818,6 +829,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
|
|||||||
cb.onFinishedGoingToSleep(arg1);
|
cb.onFinishedGoingToSleep(arg1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mFingerprintAlreadyAuthenticated = false;
|
||||||
updateFingerprintListeningState();
|
updateFingerprintListeningState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -951,13 +963,14 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldListenForFingerprint() {
|
private boolean shouldListenForFingerprint() {
|
||||||
return (mKeyguardIsVisible || !mDeviceInteractive) && !mSwitchingUser;
|
return (mKeyguardIsVisible || !mDeviceInteractive) && !mSwitchingUser
|
||||||
|
&& !mFingerprintAlreadyAuthenticated;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startListeningForFingerprint() {
|
private void startListeningForFingerprint() {
|
||||||
if (DEBUG) Log.v(TAG, "startListeningForFingerprint()");
|
if (DEBUG) Log.v(TAG, "startListeningForFingerprint()");
|
||||||
int userId = ActivityManager.getCurrentUser();
|
int userId = ActivityManager.getCurrentUser();
|
||||||
if (!mFingerprintDetectionRunning && isUnlockWithFingerprintPossible(userId)) {
|
if (isUnlockWithFingerprintPossible(userId)) {
|
||||||
mUserHasAuthenticatedSinceBoot = mTrustManager.hasUserAuthenticatedSinceBoot(
|
mUserHasAuthenticatedSinceBoot = mTrustManager.hasUserAuthenticatedSinceBoot(
|
||||||
ActivityManager.getCurrentUser());
|
ActivityManager.getCurrentUser());
|
||||||
if (mFingerprintCancelSignal != null) {
|
if (mFingerprintCancelSignal != null) {
|
||||||
@@ -1249,6 +1262,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
|
|||||||
cb.onKeyguardVisibilityChangedRaw(isShowing);
|
cb.onKeyguardVisibilityChangedRaw(isShowing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!isShowing) {
|
||||||
|
mFingerprintAlreadyAuthenticated = false;
|
||||||
|
}
|
||||||
updateFingerprintListeningState();
|
updateFingerprintListeningState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2388,4 +2388,9 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
protected boolean isPanelVisibleBecauseOfHeadsUp() {
|
protected boolean isPanelVisibleBecauseOfHeadsUp() {
|
||||||
return mHeadsUpManager.hasPinnedHeadsUp() || mHeadsUpAnimatingAway;
|
return mHeadsUpManager.hasPinnedHeadsUp() || mHeadsUpAnimatingAway;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasOverlappingRendering() {
|
||||||
|
return !mDozing;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
|
|
||||||
public static final int FADE_KEYGUARD_START_DELAY = 100;
|
public static final int FADE_KEYGUARD_START_DELAY = 100;
|
||||||
public static final int FADE_KEYGUARD_DURATION = 300;
|
public static final int FADE_KEYGUARD_DURATION = 300;
|
||||||
public static final int FADE_KEYGUARD_DURATION_PULSING = 120;
|
public static final int FADE_KEYGUARD_DURATION_PULSING = 96;
|
||||||
|
|
||||||
/** Allow some time inbetween the long press for back and recents. */
|
/** Allow some time inbetween the long press for back and recents. */
|
||||||
private static final int LOCK_TO_APP_GESTURE_TOLERENCE = 200;
|
private static final int LOCK_TO_APP_GESTURE_TOLERENCE = 200;
|
||||||
@@ -3441,16 +3441,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
.alpha(0f)
|
.alpha(0f)
|
||||||
.setStartDelay(0)
|
.setStartDelay(0)
|
||||||
.setDuration(FADE_KEYGUARD_DURATION_PULSING)
|
.setDuration(FADE_KEYGUARD_DURATION_PULSING)
|
||||||
.setInterpolator(ScrimController.KEYGUARD_FADE_OUT_INTERPOLATOR)
|
.setInterpolator(ScrimController.KEYGUARD_FADE_OUT_INTERPOLATOR);
|
||||||
.withLayer()
|
|
||||||
.withEndAction(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mNotificationPanel.setAlpha(1f);
|
|
||||||
hideKeyguard();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3516,6 +3507,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
mQSPanel.refreshAllTiles();
|
mQSPanel.refreshAllTiles();
|
||||||
}
|
}
|
||||||
mHandler.removeMessages(MSG_LAUNCH_TRANSITION_TIMEOUT);
|
mHandler.removeMessages(MSG_LAUNCH_TRANSITION_TIMEOUT);
|
||||||
|
mNotificationPanel.setAlpha(1f);
|
||||||
return staying;
|
return staying;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -279,10 +279,15 @@ public class StatusBarKeyguardViewManager {
|
|||||||
if (mFingerprintUnlockController.getMode()
|
if (mFingerprintUnlockController.getMode()
|
||||||
== FingerprintUnlockController.MODE_WAKE_AND_UNLOCK_PULSING) {
|
== FingerprintUnlockController.MODE_WAKE_AND_UNLOCK_PULSING) {
|
||||||
mFingerprintUnlockController.startKeyguardFadingAway();
|
mFingerprintUnlockController.startKeyguardFadingAway();
|
||||||
mPhoneStatusBar.setKeyguardFadingAway(startTime, 0, 250);
|
mPhoneStatusBar.setKeyguardFadingAway(startTime, 0, 240);
|
||||||
mStatusBarWindowManager.setKeyguardFadingAway(true);
|
mStatusBarWindowManager.setKeyguardFadingAway(true);
|
||||||
mPhoneStatusBar.fadeKeyguardWhilePulsing();
|
mPhoneStatusBar.fadeKeyguardWhilePulsing();
|
||||||
animateScrimControllerKeyguardFadingOut(0, 250);
|
animateScrimControllerKeyguardFadingOut(0, 240, new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
mPhoneStatusBar.hideKeyguard();
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
mFingerprintUnlockController.startKeyguardFadingAway();
|
mFingerprintUnlockController.startKeyguardFadingAway();
|
||||||
mPhoneStatusBar.setKeyguardFadingAway(startTime, delay, fadeoutDuration);
|
mPhoneStatusBar.setKeyguardFadingAway(startTime, delay, fadeoutDuration);
|
||||||
@@ -316,10 +321,18 @@ public class StatusBarKeyguardViewManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void animateScrimControllerKeyguardFadingOut(long delay, long duration) {
|
private void animateScrimControllerKeyguardFadingOut(long delay, long duration) {
|
||||||
|
animateScrimControllerKeyguardFadingOut(delay, duration, null /* endRunnable */);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void animateScrimControllerKeyguardFadingOut(long delay, long duration,
|
||||||
|
final Runnable endRunnable) {
|
||||||
Trace.asyncTraceBegin(Trace.TRACE_TAG_VIEW, "Fading out", 0);
|
Trace.asyncTraceBegin(Trace.TRACE_TAG_VIEW, "Fading out", 0);
|
||||||
mScrimController.animateKeyguardFadingOut(delay, duration, new Runnable() {
|
mScrimController.animateKeyguardFadingOut(delay, duration, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (endRunnable != null) {
|
||||||
|
endRunnable.run();
|
||||||
|
}
|
||||||
mStatusBarWindowManager.setKeyguardFadingAway(false);
|
mStatusBarWindowManager.setKeyguardFadingAway(false);
|
||||||
mPhoneStatusBar.finishKeyguardFadingAway();
|
mPhoneStatusBar.finishKeyguardFadingAway();
|
||||||
mFingerprintUnlockController.finishKeyguardFadingAway();
|
mFingerprintUnlockController.finishKeyguardFadingAway();
|
||||||
|
|||||||
Reference in New Issue
Block a user