Merge "fix merge conflicts - SysUI co-ex updates" into sc-v2-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
ab666a6ac8
@@ -1463,32 +1463,42 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
||||
final FaceManager.AuthenticationCallback mFaceAuthenticationCallback
|
||||
= new FaceManager.AuthenticationCallback() {
|
||||
|
||||
@Override
|
||||
public void onAuthenticationFailed() {
|
||||
handleFaceAuthFailed();
|
||||
}
|
||||
@Override
|
||||
public void onAuthenticationFailed() {
|
||||
handleFaceAuthFailed();
|
||||
if (mKeyguardBypassController != null) {
|
||||
mKeyguardBypassController.setUserHasDeviceEntryIntent(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationSucceeded(FaceManager.AuthenticationResult result) {
|
||||
Trace.beginSection("KeyguardUpdateMonitor#onAuthenticationSucceeded");
|
||||
handleFaceAuthenticated(result.getUserId(), result.isStrongBiometric());
|
||||
Trace.endSection();
|
||||
}
|
||||
@Override
|
||||
public void onAuthenticationSucceeded(FaceManager.AuthenticationResult result) {
|
||||
Trace.beginSection("KeyguardUpdateMonitor#onAuthenticationSucceeded");
|
||||
handleFaceAuthenticated(result.getUserId(), result.isStrongBiometric());
|
||||
Trace.endSection();
|
||||
|
||||
@Override
|
||||
public void onAuthenticationHelp(int helpMsgId, CharSequence helpString) {
|
||||
handleFaceHelp(helpMsgId, helpString.toString());
|
||||
}
|
||||
if (mKeyguardBypassController != null) {
|
||||
mKeyguardBypassController.setUserHasDeviceEntryIntent(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationError(int errMsgId, CharSequence errString) {
|
||||
handleFaceError(errMsgId, errString.toString());
|
||||
}
|
||||
@Override
|
||||
public void onAuthenticationHelp(int helpMsgId, CharSequence helpString) {
|
||||
handleFaceHelp(helpMsgId, helpString.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationAcquired(int acquireInfo) {
|
||||
handleFaceAcquired(acquireInfo);
|
||||
}
|
||||
@Override
|
||||
public void onAuthenticationError(int errMsgId, CharSequence errString) {
|
||||
handleFaceError(errMsgId, errString.toString());
|
||||
if (mKeyguardBypassController != null) {
|
||||
mKeyguardBypassController.setUserHasDeviceEntryIntent(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationAcquired(int acquireInfo) {
|
||||
handleFaceAcquired(acquireInfo);
|
||||
}
|
||||
};
|
||||
|
||||
private CancellationSignal mFingerprintCancelSignal;
|
||||
|
||||
@@ -69,6 +69,7 @@ import com.android.systemui.keyguard.ScreenLifecycle;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.LockscreenShadeTransitionController;
|
||||
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||
import com.android.systemui.statusbar.phone.StatusBar;
|
||||
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||
import com.android.systemui.statusbar.policy.KeyguardStateController;
|
||||
@@ -121,6 +122,7 @@ public class UdfpsController implements DozeReceiver {
|
||||
@NonNull private final AccessibilityManager mAccessibilityManager;
|
||||
@NonNull private final LockscreenShadeTransitionController mLockscreenShadeTransitionController;
|
||||
@Nullable private final UdfpsHbmProvider mHbmProvider;
|
||||
@NonNull private final KeyguardBypassController mKeyguardBypassController;
|
||||
@VisibleForTesting @NonNull final BiometricOrientationEventListener mOrientationListener;
|
||||
// Currently the UdfpsController supports a single UDFPS sensor. If devices have multiple
|
||||
// sensors, this, in addition to a lot of the code here, will be updated.
|
||||
@@ -398,7 +400,10 @@ public class UdfpsController implements DozeReceiver {
|
||||
handled = true;
|
||||
}
|
||||
if ((withinSensorArea || fromUdfpsView) && shouldTryToDismissKeyguard()) {
|
||||
Log.v(TAG, "onTouch | dismiss keyguard from ACTION_DOWN");
|
||||
Log.v(TAG, "onTouch | dismiss keyguard ACTION_DOWN");
|
||||
if (!mOnFingerDown) {
|
||||
playStartHaptic();
|
||||
}
|
||||
mKeyguardViewManager.notifyKeyguardAuthenticated(false /* strongAuth */);
|
||||
mAttemptedToDismissKeyguard = true;
|
||||
}
|
||||
@@ -415,6 +420,16 @@ public class UdfpsController implements DozeReceiver {
|
||||
boolean actionMoveWithinSensorArea =
|
||||
isWithinSensorArea(udfpsView, event.getX(idx), event.getY(idx),
|
||||
fromUdfpsView);
|
||||
if ((fromUdfpsView || actionMoveWithinSensorArea)
|
||||
&& shouldTryToDismissKeyguard()) {
|
||||
Log.v(TAG, "onTouch | dismiss keyguard ACTION_MOVE");
|
||||
if (!mOnFingerDown) {
|
||||
playStartHaptic();
|
||||
}
|
||||
mKeyguardViewManager.notifyKeyguardAuthenticated(false /* strongAuth */);
|
||||
mAttemptedToDismissKeyguard = true;
|
||||
break;
|
||||
}
|
||||
if (actionMoveWithinSensorArea) {
|
||||
if (mVelocityTracker == null) {
|
||||
// touches could be injected, so the velocity tracker may not have
|
||||
@@ -450,12 +465,6 @@ public class UdfpsController implements DozeReceiver {
|
||||
Log.v(TAG, "onTouch | finger outside");
|
||||
onFingerUp();
|
||||
}
|
||||
if ((fromUdfpsView || actionMoveWithinSensorArea)
|
||||
&& shouldTryToDismissKeyguard()) {
|
||||
Log.v(TAG, "onTouch | dismiss keyguard from ACTION_MOVE");
|
||||
mKeyguardViewManager.notifyKeyguardAuthenticated(false /* strongAuth */);
|
||||
mAttemptedToDismissKeyguard = true;
|
||||
}
|
||||
}
|
||||
Trace.endSection();
|
||||
break;
|
||||
@@ -511,6 +520,7 @@ public class UdfpsController implements DozeReceiver {
|
||||
@NonNull UdfpsHapticsSimulator udfpsHapticsSimulator,
|
||||
@NonNull Optional<UdfpsHbmProvider> hbmProvider,
|
||||
@NonNull KeyguardStateController keyguardStateController,
|
||||
@NonNull KeyguardBypassController keyguardBypassController,
|
||||
@NonNull DisplayManager displayManager,
|
||||
@Main Handler mainHandler) {
|
||||
mContext = context;
|
||||
@@ -546,6 +556,7 @@ public class UdfpsController implements DozeReceiver {
|
||||
},
|
||||
displayManager,
|
||||
mainHandler);
|
||||
mKeyguardBypassController = keyguardBypassController;
|
||||
|
||||
mSensorProps = findFirstUdfps();
|
||||
// At least one UDFPS sensor exists
|
||||
@@ -872,12 +883,17 @@ public class UdfpsController implements DozeReceiver {
|
||||
|
||||
private void onFingerDown(int x, int y, float minor, float major) {
|
||||
mExecution.assertIsMainThread();
|
||||
mKeyguardBypassController.setUserHasDeviceEntryIntent(true);
|
||||
if (mView == null) {
|
||||
Log.w(TAG, "Null view in onFingerDown");
|
||||
return;
|
||||
}
|
||||
if (!mOnFingerDown) {
|
||||
playStartHaptic();
|
||||
|
||||
if (!mKeyguardUpdateMonitor.isFaceDetectionRunning()) {
|
||||
mKeyguardUpdateMonitor.requestFaceAuth(/* userInitiatedRequest */ false);
|
||||
}
|
||||
}
|
||||
mOnFingerDown = true;
|
||||
mFingerprintManager.onPointerDown(mSensorProps.sensorId, x, y, minor, major);
|
||||
|
||||
@@ -564,8 +564,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback imp
|
||||
boolean unlockingAllowed =
|
||||
mUpdateMonitor.isUnlockingWithBiometricAllowed(isStrongBiometric);
|
||||
boolean deviceDreaming = mUpdateMonitor.isDreaming();
|
||||
boolean bypass = mKeyguardBypassController.getBypassEnabled();
|
||||
|
||||
boolean bypass = mKeyguardBypassController.getBypassEnabled()
|
||||
|| mKeyguardBypassController.getUserHasDeviceEntryIntent();
|
||||
if (!mUpdateMonitor.isDeviceInteractive()) {
|
||||
if (!mKeyguardViewController.isShowing()) {
|
||||
return bypass ? MODE_WAKE_AND_UNLOCK : MODE_ONLY_WAKE;
|
||||
|
||||
@@ -48,6 +48,7 @@ open class KeyguardBypassController : Dumpable, StackScrollAlgorithm.BypassContr
|
||||
private val faceAuthEnabledChangedCallback = object : KeyguardStateController.Callback {
|
||||
override fun onFaceAuthEnabledChanged() = notifyListeners()
|
||||
}
|
||||
var userHasDeviceEntryIntent: Boolean = false // ie: attempted udfps auth
|
||||
|
||||
@IntDef(
|
||||
FACE_UNLOCK_BYPASS_NO_OVERRIDE,
|
||||
|
||||
@@ -59,6 +59,7 @@ import com.android.systemui.keyguard.ScreenLifecycle;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.LockscreenShadeTransitionController;
|
||||
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||
import com.android.systemui.statusbar.phone.StatusBar;
|
||||
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||
import com.android.systemui.statusbar.policy.KeyguardStateController;
|
||||
@@ -140,6 +141,8 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
||||
private DisplayManager mDisplayManager;
|
||||
@Mock
|
||||
private Handler mHandler;
|
||||
@Mock
|
||||
private KeyguardBypassController mKeyguardBypassController;
|
||||
|
||||
private FakeExecutor mFgExecutor;
|
||||
|
||||
@@ -209,6 +212,7 @@ public class UdfpsControllerTest extends SysuiTestCase {
|
||||
mUdfpsHapticsSimulator,
|
||||
Optional.of(mHbmProvider),
|
||||
mKeyguardStateController,
|
||||
mKeyguardBypassController,
|
||||
mDisplayManager,
|
||||
mHandler);
|
||||
verify(mFingerprintManager).setUdfpsOverlayController(mOverlayCaptor.capture());
|
||||
|
||||
Reference in New Issue
Block a user