Loading services/core/java/com/android/server/biometrics/Utils.java +9 −3 Original line number Diff line number Diff line Loading @@ -253,9 +253,15 @@ public class Utils { // Check if any of the non-biometric and non-credential bits are set. If so, this is // invalid. final int testBits = ~(Authenticators.DEVICE_CREDENTIAL final int testBits; if (Flags.mandatoryBiometrics()) { testBits = ~(Authenticators.DEVICE_CREDENTIAL | Authenticators.BIOMETRIC_MIN_STRENGTH | Authenticators.MANDATORY_BIOMETRICS); } else { testBits = ~(Authenticators.DEVICE_CREDENTIAL | Authenticators.BIOMETRIC_MIN_STRENGTH); } if ((authenticators & testBits) != 0) { Slog.e(BiometricService.TAG, "Non-biometric, non-credential bits found." + " Authenticators: " + authenticators); Loading services/tests/servicestests/src/com/android/server/biometrics/UtilsTest.java +7 −1 Original line number Diff line number Diff line Loading @@ -217,7 +217,13 @@ public class UtilsTest { doNothing().when(mContext).enforceCallingOrSelfPermission( eq(SET_BIOMETRIC_DIALOG_ADVANCED), any()); assertTrue(Utils.isValidAuthenticatorConfig(mContext, Authenticators.MANDATORY_BIOMETRICS)); if (Flags.mandatoryBiometrics()) { assertTrue(Utils.isValidAuthenticatorConfig(mContext, Authenticators.MANDATORY_BIOMETRICS)); } else { assertFalse(Utils.isValidAuthenticatorConfig(mContext, Authenticators.MANDATORY_BIOMETRICS)); } // The rest of the bits are not allowed to integrate with the public APIs for (int i = 8; i < 32; i++) { Loading Loading
services/core/java/com/android/server/biometrics/Utils.java +9 −3 Original line number Diff line number Diff line Loading @@ -253,9 +253,15 @@ public class Utils { // Check if any of the non-biometric and non-credential bits are set. If so, this is // invalid. final int testBits = ~(Authenticators.DEVICE_CREDENTIAL final int testBits; if (Flags.mandatoryBiometrics()) { testBits = ~(Authenticators.DEVICE_CREDENTIAL | Authenticators.BIOMETRIC_MIN_STRENGTH | Authenticators.MANDATORY_BIOMETRICS); } else { testBits = ~(Authenticators.DEVICE_CREDENTIAL | Authenticators.BIOMETRIC_MIN_STRENGTH); } if ((authenticators & testBits) != 0) { Slog.e(BiometricService.TAG, "Non-biometric, non-credential bits found." + " Authenticators: " + authenticators); Loading
services/tests/servicestests/src/com/android/server/biometrics/UtilsTest.java +7 −1 Original line number Diff line number Diff line Loading @@ -217,7 +217,13 @@ public class UtilsTest { doNothing().when(mContext).enforceCallingOrSelfPermission( eq(SET_BIOMETRIC_DIALOG_ADVANCED), any()); assertTrue(Utils.isValidAuthenticatorConfig(mContext, Authenticators.MANDATORY_BIOMETRICS)); if (Flags.mandatoryBiometrics()) { assertTrue(Utils.isValidAuthenticatorConfig(mContext, Authenticators.MANDATORY_BIOMETRICS)); } else { assertFalse(Utils.isValidAuthenticatorConfig(mContext, Authenticators.MANDATORY_BIOMETRICS)); } // The rest of the bits are not allowed to integrate with the public APIs for (int i = 8; i < 32; i++) { Loading