Merge changes I40acd41d,I3bc15180 into tm-qpr-dev am: f16bc97e18
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20265599 Change-Id: Ib135411b5fcb91c852c25ff92ffe89603af0e74d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -342,12 +342,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
|
|||||||
*/
|
*/
|
||||||
private int mDelayedProfileShowingSequence;
|
private int mDelayedProfileShowingSequence;
|
||||||
|
|
||||||
/**
|
|
||||||
* If the user has disabled the keyguard, then requests to exit, this is
|
|
||||||
* how we'll ultimately let them know whether it was successful. We use this
|
|
||||||
* var being non-null as an indicator that there is an in progress request.
|
|
||||||
*/
|
|
||||||
private IKeyguardExitCallback mExitSecureCallback;
|
|
||||||
private final DismissCallbackRegistry mDismissCallbackRegistry;
|
private final DismissCallbackRegistry mDismissCallbackRegistry;
|
||||||
|
|
||||||
// the properties of the keyguard
|
// the properties of the keyguard
|
||||||
@@ -1341,18 +1335,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
|
|||||||
|| !mLockPatternUtils.isSecure(currentUser);
|
|| !mLockPatternUtils.isSecure(currentUser);
|
||||||
long timeout = getLockTimeout(KeyguardUpdateMonitor.getCurrentUser());
|
long timeout = getLockTimeout(KeyguardUpdateMonitor.getCurrentUser());
|
||||||
mLockLater = false;
|
mLockLater = false;
|
||||||
if (mExitSecureCallback != null) {
|
if (mShowing && !mKeyguardStateController.isKeyguardGoingAway()) {
|
||||||
if (DEBUG) Log.d(TAG, "pending exit secure callback cancelled");
|
|
||||||
try {
|
|
||||||
mExitSecureCallback.onKeyguardExitResult(false);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Slog.w(TAG, "Failed to call onKeyguardExitResult(false)", e);
|
|
||||||
}
|
|
||||||
mExitSecureCallback = null;
|
|
||||||
if (!mExternallyEnabled) {
|
|
||||||
hideLocked();
|
|
||||||
}
|
|
||||||
} else if (mShowing && !mKeyguardStateController.isKeyguardGoingAway()) {
|
|
||||||
// If we are going to sleep but the keyguard is showing (and will continue to be
|
// If we are going to sleep but the keyguard is showing (and will continue to be
|
||||||
// showing, not in the process of going away) then reset its state. Otherwise, let
|
// showing, not in the process of going away) then reset its state. Otherwise, let
|
||||||
// this fall through and explicitly re-lock the keyguard.
|
// this fall through and explicitly re-lock the keyguard.
|
||||||
@@ -1671,13 +1654,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
|
|||||||
mExternallyEnabled = enabled;
|
mExternallyEnabled = enabled;
|
||||||
|
|
||||||
if (!enabled && mShowing) {
|
if (!enabled && mShowing) {
|
||||||
if (mExitSecureCallback != null) {
|
|
||||||
if (DEBUG) Log.d(TAG, "in process of verifyUnlock request, ignoring");
|
|
||||||
// we're in the process of handling a request to verify the user
|
|
||||||
// can get past the keyguard. ignore extraneous requests to disable / re-enable
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// hiding keyguard that is showing, remember to reshow later
|
// hiding keyguard that is showing, remember to reshow later
|
||||||
if (DEBUG) Log.d(TAG, "remembering to reshow, hiding keyguard, "
|
if (DEBUG) Log.d(TAG, "remembering to reshow, hiding keyguard, "
|
||||||
+ "disabling status bar expansion");
|
+ "disabling status bar expansion");
|
||||||
@@ -1691,33 +1667,23 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
|
|||||||
mNeedToReshowWhenReenabled = false;
|
mNeedToReshowWhenReenabled = false;
|
||||||
updateInputRestrictedLocked();
|
updateInputRestrictedLocked();
|
||||||
|
|
||||||
if (mExitSecureCallback != null) {
|
showLocked(null);
|
||||||
if (DEBUG) Log.d(TAG, "onKeyguardExitResult(false), resetting");
|
|
||||||
try {
|
|
||||||
mExitSecureCallback.onKeyguardExitResult(false);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Slog.w(TAG, "Failed to call onKeyguardExitResult(false)", e);
|
|
||||||
}
|
|
||||||
mExitSecureCallback = null;
|
|
||||||
resetStateLocked();
|
|
||||||
} else {
|
|
||||||
showLocked(null);
|
|
||||||
|
|
||||||
// block until we know the keyguard is done drawing (and post a message
|
// block until we know the keyguard is done drawing (and post a message
|
||||||
// to unblock us after a timeout, so we don't risk blocking too long
|
// to unblock us after a timeout, so we don't risk blocking too long
|
||||||
// and causing an ANR).
|
// and causing an ANR).
|
||||||
mWaitingUntilKeyguardVisible = true;
|
mWaitingUntilKeyguardVisible = true;
|
||||||
mHandler.sendEmptyMessageDelayed(KEYGUARD_DONE_DRAWING, KEYGUARD_DONE_DRAWING_TIMEOUT_MS);
|
mHandler.sendEmptyMessageDelayed(KEYGUARD_DONE_DRAWING,
|
||||||
if (DEBUG) Log.d(TAG, "waiting until mWaitingUntilKeyguardVisible is false");
|
KEYGUARD_DONE_DRAWING_TIMEOUT_MS);
|
||||||
while (mWaitingUntilKeyguardVisible) {
|
if (DEBUG) Log.d(TAG, "waiting until mWaitingUntilKeyguardVisible is false");
|
||||||
try {
|
while (mWaitingUntilKeyguardVisible) {
|
||||||
wait();
|
try {
|
||||||
} catch (InterruptedException e) {
|
wait();
|
||||||
Thread.currentThread().interrupt();
|
} catch (InterruptedException e) {
|
||||||
}
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
if (DEBUG) Log.d(TAG, "done waiting for mWaitingUntilKeyguardVisible");
|
|
||||||
}
|
}
|
||||||
|
if (DEBUG) Log.d(TAG, "done waiting for mWaitingUntilKeyguardVisible");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1747,13 +1713,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
|
|||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.w(TAG, "Failed to call onKeyguardExitResult(false)", e);
|
Slog.w(TAG, "Failed to call onKeyguardExitResult(false)", e);
|
||||||
}
|
}
|
||||||
} else if (mExitSecureCallback != null) {
|
|
||||||
// already in progress with someone else
|
|
||||||
try {
|
|
||||||
callback.onKeyguardExitResult(false);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Slog.w(TAG, "Failed to call onKeyguardExitResult(false)", e);
|
|
||||||
}
|
|
||||||
} else if (!isSecure()) {
|
} else if (!isSecure()) {
|
||||||
|
|
||||||
// Keyguard is not secure, no need to do anything, and we don't need to reshow
|
// Keyguard is not secure, no need to do anything, and we don't need to reshow
|
||||||
@@ -2294,21 +2253,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setPendingLock(false); // user may have authenticated during the screen off animation
|
setPendingLock(false); // user may have authenticated during the screen off animation
|
||||||
if (mExitSecureCallback != null) {
|
|
||||||
try {
|
|
||||||
mExitSecureCallback.onKeyguardExitResult(true /* authenciated */);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Slog.w(TAG, "Failed to call onKeyguardExitResult()", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
mExitSecureCallback = null;
|
|
||||||
|
|
||||||
// after successfully exiting securely, no need to reshow
|
|
||||||
// the keyguard when they've released the lock
|
|
||||||
mExternallyEnabled = true;
|
|
||||||
mNeedToReshowWhenReenabled = false;
|
|
||||||
updateInputRestricted();
|
|
||||||
}
|
|
||||||
|
|
||||||
handleHide();
|
handleHide();
|
||||||
mUpdateMonitor.clearBiometricRecognizedWhenKeyguardDone(currentUser);
|
mUpdateMonitor.clearBiometricRecognizedWhenKeyguardDone(currentUser);
|
||||||
@@ -3117,7 +3061,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
|
|||||||
pw.print(" mInputRestricted: "); pw.println(mInputRestricted);
|
pw.print(" mInputRestricted: "); pw.println(mInputRestricted);
|
||||||
pw.print(" mOccluded: "); pw.println(mOccluded);
|
pw.print(" mOccluded: "); pw.println(mOccluded);
|
||||||
pw.print(" mDelayedShowingSequence: "); pw.println(mDelayedShowingSequence);
|
pw.print(" mDelayedShowingSequence: "); pw.println(mDelayedShowingSequence);
|
||||||
pw.print(" mExitSecureCallback: "); pw.println(mExitSecureCallback);
|
|
||||||
pw.print(" mDeviceInteractive: "); pw.println(mDeviceInteractive);
|
pw.print(" mDeviceInteractive: "); pw.println(mDeviceInteractive);
|
||||||
pw.print(" mGoingToSleep: "); pw.println(mGoingToSleep);
|
pw.print(" mGoingToSleep: "); pw.println(mGoingToSleep);
|
||||||
pw.print(" mHiding: "); pw.println(mHiding);
|
pw.print(" mHiding: "); pw.println(mHiding);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import android.animation.AnimatorListenerAdapter
|
|||||||
import android.animation.ValueAnimator
|
import android.animation.ValueAnimator
|
||||||
import android.animation.ValueAnimator.AnimatorUpdateListener
|
import android.animation.ValueAnimator.AnimatorUpdateListener
|
||||||
import android.annotation.FloatRange
|
import android.annotation.FloatRange
|
||||||
|
import android.os.Trace
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.android.systemui.dagger.SysUISingleton
|
import com.android.systemui.dagger.SysUISingleton
|
||||||
import com.android.systemui.keyguard.shared.model.KeyguardState
|
import com.android.systemui.keyguard.shared.model.KeyguardState
|
||||||
@@ -157,12 +158,36 @@ class KeyguardTransitionRepository @Inject constructor() {
|
|||||||
value: Float,
|
value: Float,
|
||||||
transitionState: TransitionState
|
transitionState: TransitionState
|
||||||
) {
|
) {
|
||||||
|
trace(info, transitionState)
|
||||||
|
|
||||||
if (transitionState == TransitionState.FINISHED) {
|
if (transitionState == TransitionState.FINISHED) {
|
||||||
currentTransitionInfo = null
|
currentTransitionInfo = null
|
||||||
}
|
}
|
||||||
_transitions.value = TransitionStep(info.from, info.to, value, transitionState)
|
_transitions.value = TransitionStep(info.from, info.to, value, transitionState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun trace(info: TransitionInfo, transitionState: TransitionState) {
|
||||||
|
if (
|
||||||
|
transitionState != TransitionState.STARTED &&
|
||||||
|
transitionState != TransitionState.FINISHED
|
||||||
|
) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val traceName =
|
||||||
|
"Transition: ${info.from} -> ${info.to} " +
|
||||||
|
if (info.animator == null) {
|
||||||
|
"(manual)"
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
}
|
||||||
|
val traceCookie = traceName.hashCode()
|
||||||
|
if (transitionState == TransitionState.STARTED) {
|
||||||
|
Trace.beginAsyncSection(traceName, traceCookie)
|
||||||
|
} else if (transitionState == TransitionState.FINISHED) {
|
||||||
|
Trace.endAsyncSection(traceName, traceCookie)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "KeyguardTransitionRepository"
|
private const val TAG = "KeyguardTransitionRepository"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user