Merge "Show FACE_COVERING and DARK_GLASSES messages" into tm-d1-dev am: b71d120eb7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18759908 Change-Id: Iac2d445bdf09eafc606e2a51d11b241eb5d23b63 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -620,7 +620,8 @@
|
|||||||
<!-- Which face help messages to surface when fingerprint is also enrolled.
|
<!-- Which face help messages to surface when fingerprint is also enrolled.
|
||||||
Message ids correspond with the acquired ids in BiometricFaceConstants -->
|
Message ids correspond with the acquired ids in BiometricFaceConstants -->
|
||||||
<integer-array name="config_face_help_msgs_when_fingerprint_enrolled">
|
<integer-array name="config_face_help_msgs_when_fingerprint_enrolled">
|
||||||
<!-- for example: <item>26</item> for FACE_ACQUIRED_MOUTH_COVERING_DETECTED -->
|
<item>25</item>
|
||||||
|
<item>26</item>
|
||||||
</integer-array>
|
</integer-array>
|
||||||
|
|
||||||
<!-- Whether the communal service should be enabled -->
|
<!-- Whether the communal service should be enabled -->
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ import android.os.Message;
|
|||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.provider.Settings;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.format.Formatter;
|
import android.text.format.Formatter;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -244,19 +243,10 @@ public class KeyguardIndicationController {
|
|||||||
mScreenLifecycle.addObserver(mScreenObserver);
|
mScreenLifecycle.addObserver(mScreenObserver);
|
||||||
|
|
||||||
mCoExFaceHelpMsgIdsToShow = new HashSet<>();
|
mCoExFaceHelpMsgIdsToShow = new HashSet<>();
|
||||||
final String msgsToShowOverride = Settings.Global.getString(mContext.getContentResolver(),
|
int[] msgIds = context.getResources().getIntArray(
|
||||||
"coex_face_help_msgs"); // TODO: remove after UX testing b/231733975
|
com.android.systemui.R.array.config_face_help_msgs_when_fingerprint_enrolled);
|
||||||
if (msgsToShowOverride != null) {
|
for (int msgId : msgIds) {
|
||||||
final String[] msgIds = msgsToShowOverride.split("\\|");
|
mCoExFaceHelpMsgIdsToShow.add(msgId);
|
||||||
for (String msgId : msgIds) {
|
|
||||||
mCoExFaceHelpMsgIdsToShow.add(Integer.parseInt(msgId));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
int[] msgIds = context.getResources().getIntArray(
|
|
||||||
com.android.systemui.R.array.config_face_help_msgs_when_fingerprint_enrolled);
|
|
||||||
for (int msgId : msgIds) {
|
|
||||||
mCoExFaceHelpMsgIdsToShow.add(msgId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mHandler = new Handler(mainLooper) {
|
mHandler = new Handler(mainLooper) {
|
||||||
@@ -1032,7 +1022,8 @@ public class KeyguardIndicationController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msgId == FaceManager.FACE_ERROR_TIMEOUT) {
|
if (biometricSourceType == BiometricSourceType.FACE
|
||||||
|
&& msgId == FaceManager.FACE_ERROR_TIMEOUT) {
|
||||||
if (mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
if (mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
||||||
KeyguardUpdateMonitor.getCurrentUser())) {
|
KeyguardUpdateMonitor.getCurrentUser())) {
|
||||||
// no message if fingerprint is also enrolled
|
// no message if fingerprint is also enrolled
|
||||||
|
|||||||
@@ -598,18 +598,44 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void doNotSendFaceHelpMessages_fingerprintEnrolled() {
|
public void sendFaceHelpMessages_fingerprintEnrolled() {
|
||||||
createController();
|
createController();
|
||||||
|
|
||||||
// GIVEN fingerprint enrolled
|
// GIVEN fingerprint enrolled
|
||||||
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
||||||
0)).thenReturn(true);
|
0)).thenReturn(true);
|
||||||
|
|
||||||
// WHEN help messages received
|
// WHEN help messages received that are allowed to show
|
||||||
|
final String helpString = "helpString";
|
||||||
|
final int[] msgIds = new int[]{
|
||||||
|
BiometricFaceConstants.FACE_ACQUIRED_MOUTH_COVERING_DETECTED,
|
||||||
|
BiometricFaceConstants.FACE_ACQUIRED_DARK_GLASSES_DETECTED
|
||||||
|
};
|
||||||
|
Set<CharSequence> messages = new HashSet<>();
|
||||||
|
for (int msgId : msgIds) {
|
||||||
|
final String message = helpString + msgId;
|
||||||
|
messages.add(message);
|
||||||
|
mKeyguardUpdateMonitorCallback.onBiometricHelp(
|
||||||
|
msgId, message, BiometricSourceType.FACE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// THEN FACE_ACQUIRED_MOUTH_COVERING_DETECTED and DARK_GLASSES help messages shown
|
||||||
|
verifyIndicationMessages(INDICATION_TYPE_BIOMETRIC_MESSAGE,
|
||||||
|
messages);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void doNotSendMostFaceHelpMessages_fingerprintEnrolled() {
|
||||||
|
createController();
|
||||||
|
|
||||||
|
// GIVEN fingerprint enrolled
|
||||||
|
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
||||||
|
0)).thenReturn(true);
|
||||||
|
|
||||||
|
// WHEN help messages received that aren't supposed to show
|
||||||
final String helpString = "helpString";
|
final String helpString = "helpString";
|
||||||
final int[] msgIds = new int[]{
|
final int[] msgIds = new int[]{
|
||||||
BiometricFaceConstants.FACE_ACQUIRED_FACE_OBSCURED,
|
BiometricFaceConstants.FACE_ACQUIRED_FACE_OBSCURED,
|
||||||
BiometricFaceConstants.FACE_ACQUIRED_DARK_GLASSES_DETECTED,
|
|
||||||
BiometricFaceConstants.FACE_ACQUIRED_TOO_RIGHT,
|
BiometricFaceConstants.FACE_ACQUIRED_TOO_RIGHT,
|
||||||
BiometricFaceConstants.FACE_ACQUIRED_TOO_LEFT,
|
BiometricFaceConstants.FACE_ACQUIRED_TOO_LEFT,
|
||||||
BiometricFaceConstants.FACE_ACQUIRED_TOO_HIGH,
|
BiometricFaceConstants.FACE_ACQUIRED_TOO_HIGH,
|
||||||
|
|||||||
Reference in New Issue
Block a user