Merge "Cancel authentication when secure camera is launched on Keyguard" into qt-r1-dev

am: 38466fd886

Change-Id: I1d09eb1d3054f2a3c560b2535974fe027fd40504
This commit is contained in:
Kevin Chyn
2019-06-11 18:37:58 -07:00
committed by android-build-merger
2 changed files with 22 additions and 1 deletions

View File

@@ -212,6 +212,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
private boolean mHasLockscreenWallpaper; private boolean mHasLockscreenWallpaper;
private boolean mAssistantVisible; private boolean mAssistantVisible;
private boolean mKeyguardOccluded; private boolean mKeyguardOccluded;
private boolean mSecureCameraLaunched;
@VisibleForTesting @VisibleForTesting
protected boolean mTelephonyCapable; protected boolean mTelephonyCapable;
@@ -522,6 +523,14 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
updateBiometricListeningState(); updateBiometricListeningState();
} }
/**
* Invoked when the secure camera is launched.
*/
public void onCameraLaunched() {
mSecureCameraLaunched = true;
updateBiometricListeningState();
}
/** /**
* @return a cached version of DreamManager.isDreaming() * @return a cached version of DreamManager.isDreaming()
*/ */
@@ -1654,7 +1663,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
return (mBouncer || mAuthInterruptActive || awakeKeyguard || shouldListenForFaceAssistant()) return (mBouncer || mAuthInterruptActive || awakeKeyguard || shouldListenForFaceAssistant())
&& !mSwitchingUser && !getUserCanSkipBouncer(user) && !isFaceDisabled(user) && !mSwitchingUser && !getUserCanSkipBouncer(user) && !isFaceDisabled(user)
&& !mKeyguardGoingAway && mFaceSettingEnabledForUser && !mLockIconPressed && !mKeyguardGoingAway && mFaceSettingEnabledForUser && !mLockIconPressed
&& mUserManager.isUserUnlocked(user) && mIsPrimaryUser; && mUserManager.isUserUnlocked(user) && mIsPrimaryUser
&& !mSecureCameraLaunched;
} }
/** /**
@@ -2102,6 +2112,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
checkIsHandlerThread(); checkIsHandlerThread();
Log.d(TAG, "onKeyguardVisibilityChanged(" + showing + ")"); Log.d(TAG, "onKeyguardVisibilityChanged(" + showing + ")");
mKeyguardIsVisible = showing; mKeyguardIsVisible = showing;
if (showing) {
mSecureCameraLaunched = false;
}
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) {

View File

@@ -3770,6 +3770,12 @@ public class StatusBar extends SystemUI implements DemoMode,
"com.android.systemui:CAMERA_GESTURE"); "com.android.systemui:CAMERA_GESTURE");
} }
vibrateForCameraGesture(); vibrateForCameraGesture();
if (source == StatusBarManager.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP) {
Log.v(TAG, "Camera launch");
mKeyguardUpdateMonitor.onCameraLaunched();
}
if (!mStatusBarKeyguardViewManager.isShowing()) { if (!mStatusBarKeyguardViewManager.isShowing()) {
startActivityDismissingKeyguard(KeyguardBottomAreaView.INSECURE_CAMERA_INTENT, startActivityDismissingKeyguard(KeyguardBottomAreaView.INSECURE_CAMERA_INTENT,
false /* onlyProvisioned */, true /* dismissShade */, false /* onlyProvisioned */, true /* dismissShade */,