Merge changes Ia3307593,I43126ce1 into qt-r1-dev

* changes:
  Reset mSecureCameraLaunched when bouncer is shown
  Do task stack work on handler to ensure in-order execution
This commit is contained in:
Kevin Chyn
2019-07-12 05:14:04 +00:00
committed by Android (Google) Code Review
2 changed files with 21 additions and 4 deletions

View File

@@ -2203,6 +2203,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
if (DEBUG) Log.d(TAG, "handleKeyguardBouncerChanged(" + bouncer + ")");
boolean isBouncer = (bouncer == 1);
mBouncer = isBouncer;
if (isBouncer) {
// If the bouncer is shown, always clear this flag. This can happen in the following
// situations: 1) Default camera with SHOW_WHEN_LOCKED is not chosen yet. 2) Secure
// camera requests dismiss keyguard (tapping on photos for example). When these happen,
// face auth should resume.
mSecureCameraLaunched = false;
}
for (int i = 0; i < mCallbacks.size(); i++) {
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
if (cb != null) {
@@ -2649,6 +2658,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
pw.println(" strongAuthFlags=" + Integer.toHexString(strongAuthFlags));
pw.println(" trustManaged=" + getUserTrustIsManaged(userId));
pw.println(" enabledByUser=" + mFaceSettingEnabledForUser);
pw.println(" mSecureCameraLaunched=" + mSecureCameraLaunched);
}
}
}

View File

@@ -497,9 +497,9 @@ public abstract class BiometricServiceBase extends SystemService
}
}
private final class BiometricTaskStackListener extends TaskStackListener {
private final Runnable mOnTaskStackChangedRunnable = new Runnable() {
@Override
public void onTaskStackChanged() {
public void run() {
try {
if (!(mCurrentClient instanceof AuthenticationClient)) {
return;
@@ -514,8 +514,8 @@ public abstract class BiometricServiceBase extends SystemService
final String topPackage = runningTasks.get(0).topActivity.getPackageName();
if (!topPackage.contentEquals(currentClient)
&& !mCurrentClient.isAlreadyDone()) {
Slog.e(getTag(), "Stopping background authentication, top: " + topPackage
+ " currentClient: " + currentClient);
Slog.e(getTag(), "Stopping background authentication, top: "
+ topPackage + " currentClient: " + currentClient);
mCurrentClient.stop(false /* initiatedByClient */);
}
}
@@ -523,6 +523,13 @@ public abstract class BiometricServiceBase extends SystemService
Slog.e(getTag(), "Unable to get running tasks", e);
}
}
};
private final class BiometricTaskStackListener extends TaskStackListener {
@Override
public void onTaskStackChanged() {
mHandler.post(mOnTaskStackChangedRunnable);
}
}
private final class ResetClientStateRunnable implements Runnable {