Merge "On devices with udfps, hint to press to open" into sc-dev
This commit is contained in:
@@ -2067,6 +2067,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
return mIsUdfpsEnrolled;
|
return mIsUdfpsEnrolled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return if udfps is available on this device. will return true even if the user hasn't
|
||||||
|
* enrolled udfps.
|
||||||
|
*/
|
||||||
|
public boolean isUdfpsAvailable() {
|
||||||
|
return mAuthController.getUdfpsProps() != null
|
||||||
|
&& !mAuthController.getUdfpsProps().isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if there's at least one face enrolled
|
* @return true if there's at least one face enrolled
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ import com.android.systemui.keyguard.KeyguardIndication;
|
|||||||
import com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController;
|
import com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController;
|
||||||
import com.android.systemui.plugins.FalsingManager;
|
import com.android.systemui.plugins.FalsingManager;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
|
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||||
import com.android.systemui.statusbar.phone.KeyguardIndicationTextView;
|
import com.android.systemui.statusbar.phone.KeyguardIndicationTextView;
|
||||||
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||||
import com.android.systemui.statusbar.policy.KeyguardStateController;
|
import com.android.systemui.statusbar.policy.KeyguardStateController;
|
||||||
@@ -100,7 +101,7 @@ public class KeyguardIndicationController {
|
|||||||
private static final boolean DEBUG_CHARGING_SPEED = false;
|
private static final boolean DEBUG_CHARGING_SPEED = false;
|
||||||
|
|
||||||
private static final int MSG_HIDE_TRANSIENT = 1;
|
private static final int MSG_HIDE_TRANSIENT = 1;
|
||||||
private static final int MSG_SWIPE_UP_TO_UNLOCK = 2;
|
private static final int MSG_SHOW_ACTION_TO_UNLOCK = 2;
|
||||||
private static final long TRANSIENT_BIOMETRIC_ERROR_TIMEOUT = 1300;
|
private static final long TRANSIENT_BIOMETRIC_ERROR_TIMEOUT = 1300;
|
||||||
private static final float BOUNCE_ANIMATION_FINAL_Y = 0f;
|
private static final float BOUNCE_ANIMATION_FINAL_Y = 0f;
|
||||||
|
|
||||||
@@ -121,6 +122,7 @@ public class KeyguardIndicationController {
|
|||||||
private final LockPatternUtils mLockPatternUtils;
|
private final LockPatternUtils mLockPatternUtils;
|
||||||
private final IActivityManager mIActivityManager;
|
private final IActivityManager mIActivityManager;
|
||||||
private final FalsingManager mFalsingManager;
|
private final FalsingManager mFalsingManager;
|
||||||
|
private final KeyguardBypassController mKeyguardBypassController;
|
||||||
|
|
||||||
protected KeyguardIndicationRotateTextViewController mRotateTextViewController;
|
protected KeyguardIndicationRotateTextViewController mRotateTextViewController;
|
||||||
private BroadcastReceiver mBroadcastReceiver;
|
private BroadcastReceiver mBroadcastReceiver;
|
||||||
@@ -175,7 +177,8 @@ public class KeyguardIndicationController {
|
|||||||
@Main DelayableExecutor executor,
|
@Main DelayableExecutor executor,
|
||||||
FalsingManager falsingManager,
|
FalsingManager falsingManager,
|
||||||
LockPatternUtils lockPatternUtils,
|
LockPatternUtils lockPatternUtils,
|
||||||
IActivityManager iActivityManager) {
|
IActivityManager iActivityManager,
|
||||||
|
KeyguardBypassController keyguardBypassController) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mBroadcastDispatcher = broadcastDispatcher;
|
mBroadcastDispatcher = broadcastDispatcher;
|
||||||
mDevicePolicyManager = devicePolicyManager;
|
mDevicePolicyManager = devicePolicyManager;
|
||||||
@@ -191,6 +194,7 @@ public class KeyguardIndicationController {
|
|||||||
mLockPatternUtils = lockPatternUtils;
|
mLockPatternUtils = lockPatternUtils;
|
||||||
mIActivityManager = iActivityManager;
|
mIActivityManager = iActivityManager;
|
||||||
mFalsingManager = falsingManager;
|
mFalsingManager = falsingManager;
|
||||||
|
mKeyguardBypassController = keyguardBypassController;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -593,7 +597,7 @@ public class KeyguardIndicationController {
|
|||||||
mTransientIndication = transientIndication;
|
mTransientIndication = transientIndication;
|
||||||
mHideTransientMessageOnScreenOff = hideOnScreenOff && transientIndication != null;
|
mHideTransientMessageOnScreenOff = hideOnScreenOff && transientIndication != null;
|
||||||
mHandler.removeMessages(MSG_HIDE_TRANSIENT);
|
mHandler.removeMessages(MSG_HIDE_TRANSIENT);
|
||||||
mHandler.removeMessages(MSG_SWIPE_UP_TO_UNLOCK);
|
mHandler.removeMessages(MSG_SHOW_ACTION_TO_UNLOCK);
|
||||||
if (mDozing && !TextUtils.isEmpty(mTransientIndication)) {
|
if (mDozing && !TextUtils.isEmpty(mTransientIndication)) {
|
||||||
// Make sure this doesn't get stuck and burns in. Acquire wakelock until its cleared.
|
// Make sure this doesn't get stuck and burns in. Acquire wakelock until its cleared.
|
||||||
mWakeLock.setAcquired(true);
|
mWakeLock.setAcquired(true);
|
||||||
@@ -785,27 +789,35 @@ public class KeyguardIndicationController {
|
|||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
if (msg.what == MSG_HIDE_TRANSIENT) {
|
if (msg.what == MSG_HIDE_TRANSIENT) {
|
||||||
hideTransientIndication();
|
hideTransientIndication();
|
||||||
} else if (msg.what == MSG_SWIPE_UP_TO_UNLOCK) {
|
} else if (msg.what == MSG_SHOW_ACTION_TO_UNLOCK) {
|
||||||
showSwipeUpToUnlock();
|
showActionToUnlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private void showSwipeUpToUnlock() {
|
/**
|
||||||
|
* Show message on the keyguard for how the user can unlock/enter their device.
|
||||||
|
*/
|
||||||
|
public void showActionToUnlock() {
|
||||||
if (mDozing) {
|
if (mDozing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
||||||
if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
|
if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
|
||||||
return; // udfps affordance is highlighted, no need to surface face auth error
|
return; // udfps affordance is highlighted, no need to show action to unlock
|
||||||
} else {
|
} else if (mKeyguardUpdateMonitor.isFaceEnrolled()) {
|
||||||
String message = mContext.getString(R.string.keyguard_retry);
|
String message = mContext.getString(R.string.keyguard_retry);
|
||||||
mStatusBarKeyguardViewManager.showBouncerMessage(message, mInitialTextColorState);
|
mStatusBarKeyguardViewManager.showBouncerMessage(message, mInitialTextColorState);
|
||||||
}
|
}
|
||||||
} else if (mKeyguardUpdateMonitor.isScreenOn()) {
|
} else if (mKeyguardUpdateMonitor.isScreenOn()) {
|
||||||
showTransientIndication(mContext.getString(R.string.keyguard_unlock),
|
if (mKeyguardUpdateMonitor.isUdfpsAvailable()) {
|
||||||
false /* isError */, true /* hideOnScreenOff */);
|
showTransientIndication(mContext.getString(R.string.keyguard_unlock_press),
|
||||||
|
false /* isError */, true /* hideOnScreenOff */);
|
||||||
|
} else {
|
||||||
|
showTransientIndication(mContext.getString(R.string.keyguard_unlock),
|
||||||
|
false /* isError */, true /* hideOnScreenOff */);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -894,7 +906,7 @@ public class KeyguardIndicationController {
|
|||||||
showTransientIndication(helpString, false /* isError */, showSwipeToUnlock);
|
showTransientIndication(helpString, false /* isError */, showSwipeToUnlock);
|
||||||
}
|
}
|
||||||
if (showSwipeToUnlock) {
|
if (showSwipeToUnlock) {
|
||||||
mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_SWIPE_UP_TO_UNLOCK),
|
mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_SHOW_ACTION_TO_UNLOCK),
|
||||||
TRANSIENT_BIOMETRIC_ERROR_TIMEOUT);
|
TRANSIENT_BIOMETRIC_ERROR_TIMEOUT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -928,7 +940,7 @@ public class KeyguardIndicationController {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// suggest swiping up to unlock (try face auth again or swipe up to bouncer)
|
// suggest swiping up to unlock (try face auth again or swipe up to bouncer)
|
||||||
showSwipeUpToUnlock();
|
showActionToUnlock();
|
||||||
}
|
}
|
||||||
} else if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
} else if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
||||||
mStatusBarKeyguardViewManager.showBouncerMessage(errString, mInitialTextColorState);
|
mStatusBarKeyguardViewManager.showBouncerMessage(errString, mInitialTextColorState);
|
||||||
@@ -1010,6 +1022,11 @@ public class KeyguardIndicationController {
|
|||||||
boolean isStrongBiometric) {
|
boolean isStrongBiometric) {
|
||||||
super.onBiometricAuthenticated(userId, biometricSourceType, isStrongBiometric);
|
super.onBiometricAuthenticated(userId, biometricSourceType, isStrongBiometric);
|
||||||
mHandler.sendEmptyMessage(MSG_HIDE_TRANSIENT);
|
mHandler.sendEmptyMessage(MSG_HIDE_TRANSIENT);
|
||||||
|
|
||||||
|
if (biometricSourceType == BiometricSourceType.FACE
|
||||||
|
&& !mKeyguardBypassController.canBypass()) {
|
||||||
|
mHandler.sendEmptyMessage(MSG_SHOW_ACTION_TO_UNLOCK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3979,7 +3979,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
|
|
||||||
public void onUnlockHintStarted() {
|
public void onUnlockHintStarted() {
|
||||||
mFalsingCollector.onUnlockHintStarted();
|
mFalsingCollector.onUnlockHintStarted();
|
||||||
mKeyguardIndicationController.showTransientIndication(R.string.keyguard_unlock);
|
mKeyguardIndicationController.showActionToUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onHintFinished() {
|
public void onHintFinished() {
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ import com.android.systemui.keyguard.KeyguardIndication;
|
|||||||
import com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController;
|
import com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController;
|
||||||
import com.android.systemui.plugins.FalsingManager;
|
import com.android.systemui.plugins.FalsingManager;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
|
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||||
import com.android.systemui.statusbar.phone.KeyguardIndicationTextView;
|
import com.android.systemui.statusbar.phone.KeyguardIndicationTextView;
|
||||||
import com.android.systemui.statusbar.phone.LockIcon;
|
import com.android.systemui.statusbar.phone.LockIcon;
|
||||||
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||||
@@ -146,6 +147,8 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
private LockPatternUtils mLockPatternUtils;
|
private LockPatternUtils mLockPatternUtils;
|
||||||
@Mock
|
@Mock
|
||||||
private IActivityManager mIActivityManager;
|
private IActivityManager mIActivityManager;
|
||||||
|
@Mock
|
||||||
|
private KeyguardBypassController mKeyguardBypassController;
|
||||||
@Captor
|
@Captor
|
||||||
private ArgumentCaptor<DockManager.AlignmentStateListener> mAlignmentListener;
|
private ArgumentCaptor<DockManager.AlignmentStateListener> mAlignmentListener;
|
||||||
@Captor
|
@Captor
|
||||||
@@ -216,7 +219,8 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
mController = new KeyguardIndicationController(mContext, mWakeLockBuilder,
|
mController = new KeyguardIndicationController(mContext, mWakeLockBuilder,
|
||||||
mKeyguardStateController, mStatusBarStateController, mKeyguardUpdateMonitor,
|
mKeyguardStateController, mStatusBarStateController, mKeyguardUpdateMonitor,
|
||||||
mDockManager, mBroadcastDispatcher, mDevicePolicyManager, mIBatteryStats,
|
mDockManager, mBroadcastDispatcher, mDevicePolicyManager, mIBatteryStats,
|
||||||
mUserManager, mExecutor, mFalsingManager, mLockPatternUtils, mIActivityManager);
|
mUserManager, mExecutor, mFalsingManager, mLockPatternUtils, mIActivityManager,
|
||||||
|
mKeyguardBypassController);
|
||||||
mController.init();
|
mController.init();
|
||||||
mController.setIndicationArea(mIndicationArea);
|
mController.setIndicationArea(mIndicationArea);
|
||||||
verify(mStatusBarStateController).addCallback(mStatusBarStateListenerCaptor.capture());
|
verify(mStatusBarStateController).addCallback(mStatusBarStateListenerCaptor.capture());
|
||||||
@@ -507,6 +511,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
createController();
|
createController();
|
||||||
String message = mContext.getString(R.string.keyguard_retry);
|
String message = mContext.getString(R.string.keyguard_retry);
|
||||||
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true);
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true);
|
||||||
|
when(mKeyguardUpdateMonitor.isFaceEnrolled()).thenReturn(true);
|
||||||
|
|
||||||
mController.setVisible(true);
|
mController.setVisible(true);
|
||||||
mController.getKeyguardCallback().onBiometricError(FaceManager.FACE_ERROR_TIMEOUT,
|
mController.getKeyguardCallback().onBiometricError(FaceManager.FACE_ERROR_TIMEOUT,
|
||||||
|
|||||||
Reference in New Issue
Block a user