Merge "Update lock screen messages to match UX expectations." into tm-qpr-dev
This commit is contained in:
@@ -375,7 +375,7 @@ public class KeyguardIndicationRotateTextViewController extends
|
|||||||
public static final int INDICATION_TYPE_ALIGNMENT = 4;
|
public static final int INDICATION_TYPE_ALIGNMENT = 4;
|
||||||
public static final int INDICATION_TYPE_TRANSIENT = 5;
|
public static final int INDICATION_TYPE_TRANSIENT = 5;
|
||||||
public static final int INDICATION_TYPE_TRUST = 6;
|
public static final int INDICATION_TYPE_TRUST = 6;
|
||||||
public static final int INDICATION_TYPE_RESTING = 7;
|
public static final int INDICATION_TYPE_PERSISTENT_UNLOCK_MESSAGE = 7;
|
||||||
public static final int INDICATION_TYPE_USER_LOCKED = 8;
|
public static final int INDICATION_TYPE_USER_LOCKED = 8;
|
||||||
public static final int INDICATION_TYPE_REVERSE_CHARGING = 10;
|
public static final int INDICATION_TYPE_REVERSE_CHARGING = 10;
|
||||||
public static final int INDICATION_TYPE_BIOMETRIC_MESSAGE = 11;
|
public static final int INDICATION_TYPE_BIOMETRIC_MESSAGE = 11;
|
||||||
@@ -390,7 +390,7 @@ public class KeyguardIndicationRotateTextViewController extends
|
|||||||
INDICATION_TYPE_ALIGNMENT,
|
INDICATION_TYPE_ALIGNMENT,
|
||||||
INDICATION_TYPE_TRANSIENT,
|
INDICATION_TYPE_TRANSIENT,
|
||||||
INDICATION_TYPE_TRUST,
|
INDICATION_TYPE_TRUST,
|
||||||
INDICATION_TYPE_RESTING,
|
INDICATION_TYPE_PERSISTENT_UNLOCK_MESSAGE,
|
||||||
INDICATION_TYPE_USER_LOCKED,
|
INDICATION_TYPE_USER_LOCKED,
|
||||||
INDICATION_TYPE_REVERSE_CHARGING,
|
INDICATION_TYPE_REVERSE_CHARGING,
|
||||||
INDICATION_TYPE_BIOMETRIC_MESSAGE,
|
INDICATION_TYPE_BIOMETRIC_MESSAGE,
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewCont
|
|||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_DISCLOSURE;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_DISCLOSURE;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_LOGOUT;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_LOGOUT;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_OWNER_INFO;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_OWNER_INFO;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_RESTING;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_PERSISTENT_UNLOCK_MESSAGE;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRUST;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRUST;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_USER_LOCKED;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_USER_LOCKED;
|
||||||
import static com.android.systemui.keyguard.ScreenLifecycle.SCREEN_ON;
|
import static com.android.systemui.keyguard.ScreenLifecycle.SCREEN_ON;
|
||||||
@@ -161,7 +161,7 @@ public class KeyguardIndicationController {
|
|||||||
private BroadcastReceiver mBroadcastReceiver;
|
private BroadcastReceiver mBroadcastReceiver;
|
||||||
private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
|
private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
|
||||||
|
|
||||||
private String mRestingIndication;
|
private String mPersistentUnlockMessage;
|
||||||
private String mAlignmentIndication;
|
private String mAlignmentIndication;
|
||||||
private CharSequence mTrustGrantedIndication;
|
private CharSequence mTrustGrantedIndication;
|
||||||
private CharSequence mTransientIndication;
|
private CharSequence mTransientIndication;
|
||||||
@@ -379,7 +379,7 @@ public class KeyguardIndicationController {
|
|||||||
updateLockScreenTrustMsg(userId, getTrustGrantedIndication(), getTrustManagedIndication());
|
updateLockScreenTrustMsg(userId, getTrustGrantedIndication(), getTrustManagedIndication());
|
||||||
updateLockScreenAlignmentMsg();
|
updateLockScreenAlignmentMsg();
|
||||||
updateLockScreenLogoutView();
|
updateLockScreenLogoutView();
|
||||||
updateLockScreenRestingMsg();
|
updateLockScreenPersistentUnlockMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateOrganizedOwnedDevice() {
|
private void updateOrganizedOwnedDevice() {
|
||||||
@@ -485,7 +485,8 @@ public class KeyguardIndicationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateLockScreenUserLockedMsg(int userId) {
|
private void updateLockScreenUserLockedMsg(int userId) {
|
||||||
if (!mKeyguardUpdateMonitor.isUserUnlocked(userId)) {
|
if (!mKeyguardUpdateMonitor.isUserUnlocked(userId)
|
||||||
|
|| mKeyguardUpdateMonitor.isEncryptedOrLockdown(userId)) {
|
||||||
mRotateTextViewController.updateIndication(
|
mRotateTextViewController.updateIndication(
|
||||||
INDICATION_TYPE_USER_LOCKED,
|
INDICATION_TYPE_USER_LOCKED,
|
||||||
new KeyguardIndication.Builder()
|
new KeyguardIndication.Builder()
|
||||||
@@ -590,18 +591,17 @@ public class KeyguardIndicationController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateLockScreenRestingMsg() {
|
private void updateLockScreenPersistentUnlockMsg() {
|
||||||
if (!TextUtils.isEmpty(mRestingIndication)
|
if (!TextUtils.isEmpty(mPersistentUnlockMessage)) {
|
||||||
&& !mRotateTextViewController.hasIndications()) {
|
|
||||||
mRotateTextViewController.updateIndication(
|
mRotateTextViewController.updateIndication(
|
||||||
INDICATION_TYPE_RESTING,
|
INDICATION_TYPE_PERSISTENT_UNLOCK_MESSAGE,
|
||||||
new KeyguardIndication.Builder()
|
new KeyguardIndication.Builder()
|
||||||
.setMessage(mRestingIndication)
|
.setMessage(mPersistentUnlockMessage)
|
||||||
.setTextColor(mInitialTextColorState)
|
.setTextColor(mInitialTextColorState)
|
||||||
.build(),
|
.build(),
|
||||||
false);
|
true);
|
||||||
} else {
|
} else {
|
||||||
mRotateTextViewController.hideIndication(INDICATION_TYPE_RESTING);
|
mRotateTextViewController.hideIndication(INDICATION_TYPE_PERSISTENT_UNLOCK_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,11 +684,8 @@ public class KeyguardIndicationController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private void setPersistentUnlockMessage(String persistentUnlockMessage) {
|
||||||
* Sets the indication that is shown if nothing else is showing.
|
mPersistentUnlockMessage = persistentUnlockMessage;
|
||||||
*/
|
|
||||||
public void setRestingIndication(String restingIndication) {
|
|
||||||
mRestingIndication = restingIndication;
|
|
||||||
updateDeviceEntryIndication(false);
|
updateDeviceEntryIndication(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1122,6 +1119,9 @@ public class KeyguardIndicationController {
|
|||||||
public void onLockedOutStateChanged(BiometricSourceType biometricSourceType) {
|
public void onLockedOutStateChanged(BiometricSourceType biometricSourceType) {
|
||||||
if (biometricSourceType == FACE && !mKeyguardUpdateMonitor.isFaceLockedOut()) {
|
if (biometricSourceType == FACE && !mKeyguardUpdateMonitor.isFaceLockedOut()) {
|
||||||
mFaceLockedOutThisAuthSession = false;
|
mFaceLockedOutThisAuthSession = false;
|
||||||
|
} else if (biometricSourceType == FINGERPRINT) {
|
||||||
|
setPersistentUnlockMessage(mKeyguardUpdateMonitor.isFingerprintLockedOut()
|
||||||
|
? mContext.getString(R.string.keyguard_unlock) : "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,9 @@ import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewCont
|
|||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_DISCLOSURE;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_DISCLOSURE;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_LOGOUT;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_LOGOUT;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_OWNER_INFO;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_OWNER_INFO;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_RESTING;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_PERSISTENT_UNLOCK_MESSAGE;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRANSIENT;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRANSIENT;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRUST;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRUST;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_USER_LOCKED;
|
|
||||||
import static com.android.systemui.keyguard.ScreenLifecycle.SCREEN_OFF;
|
import static com.android.systemui.keyguard.ScreenLifecycle.SCREEN_OFF;
|
||||||
import static com.android.systemui.keyguard.ScreenLifecycle.SCREEN_ON;
|
import static com.android.systemui.keyguard.ScreenLifecycle.SCREEN_ON;
|
||||||
import static com.android.systemui.keyguard.ScreenLifecycle.SCREEN_TURNING_ON;
|
import static com.android.systemui.keyguard.ScreenLifecycle.SCREEN_TURNING_ON;
|
||||||
@@ -830,31 +829,6 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
mContext.getString(R.string.keyguard_suggest_fingerprint));
|
mContext.getString(R.string.keyguard_suggest_fingerprint));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void updateMonitor_listenerUpdatesIndication() {
|
|
||||||
createController();
|
|
||||||
String restingIndication = "Resting indication";
|
|
||||||
reset(mKeyguardUpdateMonitor);
|
|
||||||
|
|
||||||
mController.setVisible(true);
|
|
||||||
verifyIndicationMessage(INDICATION_TYPE_USER_LOCKED,
|
|
||||||
mContext.getString(com.android.internal.R.string.lockscreen_storage_locked));
|
|
||||||
|
|
||||||
reset(mRotateTextViewController);
|
|
||||||
when(mKeyguardUpdateMonitor.getUserHasTrust(anyInt())).thenReturn(true);
|
|
||||||
when(mKeyguardUpdateMonitor.isUserUnlocked(anyInt())).thenReturn(true);
|
|
||||||
mController.setRestingIndication(restingIndication);
|
|
||||||
verifyHideIndication(INDICATION_TYPE_USER_LOCKED);
|
|
||||||
verifyIndicationMessage(INDICATION_TYPE_RESTING, restingIndication);
|
|
||||||
|
|
||||||
reset(mRotateTextViewController);
|
|
||||||
reset(mKeyguardUpdateMonitor);
|
|
||||||
when(mKeyguardUpdateMonitor.isUserUnlocked(anyInt())).thenReturn(true);
|
|
||||||
when(mKeyguardUpdateMonitor.getUserHasTrust(anyInt())).thenReturn(false);
|
|
||||||
mKeyguardStateControllerCallback.onUnlockedChanged();
|
|
||||||
verifyIndicationMessage(INDICATION_TYPE_RESTING, restingIndication);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onRefreshBatteryInfo_computesChargingTime() throws RemoteException {
|
public void onRefreshBatteryInfo_computesChargingTime() throws RemoteException {
|
||||||
createController();
|
createController();
|
||||||
@@ -1490,6 +1464,44 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
verifyIndicationShown(INDICATION_TYPE_BIOMETRIC_MESSAGE, "second lockout");
|
verifyIndicationShown(INDICATION_TYPE_BIOMETRIC_MESSAGE, "second lockout");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void onFpLockoutStateChanged_whenFpIsLockedOut_showsPersistentMessage() {
|
||||||
|
createController();
|
||||||
|
mController.setVisible(true);
|
||||||
|
when(mKeyguardUpdateMonitor.isFingerprintLockedOut()).thenReturn(true);
|
||||||
|
|
||||||
|
mKeyguardUpdateMonitorCallback.onLockedOutStateChanged(BiometricSourceType.FINGERPRINT);
|
||||||
|
|
||||||
|
verifyIndicationShown(INDICATION_TYPE_PERSISTENT_UNLOCK_MESSAGE,
|
||||||
|
mContext.getString(R.string.keyguard_unlock));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void onFpLockoutStateChanged_whenFpIsNotLockedOut_showsPersistentMessage() {
|
||||||
|
createController();
|
||||||
|
mController.setVisible(true);
|
||||||
|
clearInvocations(mRotateTextViewController);
|
||||||
|
when(mKeyguardUpdateMonitor.isFingerprintLockedOut()).thenReturn(false);
|
||||||
|
|
||||||
|
mKeyguardUpdateMonitorCallback.onLockedOutStateChanged(BiometricSourceType.FINGERPRINT);
|
||||||
|
|
||||||
|
verifyHideIndication(INDICATION_TYPE_PERSISTENT_UNLOCK_MESSAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void onVisibilityChange_showsPersistentMessage_ifFpIsLockedOut() {
|
||||||
|
createController();
|
||||||
|
mController.setVisible(false);
|
||||||
|
when(mKeyguardUpdateMonitor.isFingerprintLockedOut()).thenReturn(true);
|
||||||
|
mKeyguardUpdateMonitorCallback.onLockedOutStateChanged(BiometricSourceType.FINGERPRINT);
|
||||||
|
clearInvocations(mRotateTextViewController);
|
||||||
|
|
||||||
|
mController.setVisible(true);
|
||||||
|
|
||||||
|
verifyIndicationShown(INDICATION_TYPE_PERSISTENT_UNLOCK_MESSAGE,
|
||||||
|
mContext.getString(R.string.keyguard_unlock));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onBiometricError_whenFaceIsLocked_onMultipleLockOutErrors_showUnavailableMessage() {
|
public void onBiometricError_whenFaceIsLocked_onMultipleLockOutErrors_showUnavailableMessage() {
|
||||||
createController();
|
createController();
|
||||||
|
|||||||
Reference in New Issue
Block a user