Loading core/api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -1035,9 +1035,11 @@ package android.hardware.biometrics { public class BiometricPrompt { method @NonNull public java.util.List<java.lang.Integer> getAllowedSensorIds(); method public boolean isAllowBackgroundAuthentication(); } public static class BiometricPrompt.Builder { method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.TEST_BIOMETRIC, "android.permission.USE_BIOMETRIC_INTERNAL"}) public android.hardware.biometrics.BiometricPrompt.Builder setAllowBackgroundAuthentication(boolean); method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.TEST_BIOMETRIC, "android.permission.USE_BIOMETRIC_INTERNAL"}) public android.hardware.biometrics.BiometricPrompt.Builder setAllowedSensorIds(@NonNull java.util.List<java.lang.Integer>); } Loading core/java/android/hardware/biometrics/BiometricPrompt.java +23 −0 Original line number Diff line number Diff line Loading @@ -367,6 +367,20 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan return this; } /** * @param allow If true, allows authentication when the calling package is not in the * foreground. This is set to false by default. * @return This builder * @hide */ @TestApi @NonNull @RequiresPermission(anyOf = {TEST_BIOMETRIC, USE_BIOMETRIC_INTERNAL}) public Builder setAllowBackgroundAuthentication(boolean allow) { mPromptInfo.setAllowBackgroundAuthentication(allow); return this; } /** * If set check the Device Policy Manager for disabled biometrics. * Loading Loading @@ -619,6 +633,15 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan return mPromptInfo.getAllowedSensorIds(); } /** * @return The value set by {@link Builder#setAllowBackgroundAuthentication(boolean)} * @hide */ @TestApi public boolean isAllowBackgroundAuthentication() { return mPromptInfo.isAllowBackgroundAuthentication(); } /** * A wrapper class for the cryptographic operations supported by BiometricPrompt. * Loading core/java/android/hardware/biometrics/IBiometricAuthenticator.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ interface IBiometricAuthenticator { // startPreparedClient(). void prepareForAuthentication(boolean requireConfirmation, IBinder token, long operationId, int userId, IBiometricSensorReceiver sensorReceiver, String opPackageName, int cookie); int cookie, boolean allowBackgroundAuthentication); // Starts authentication with the previously prepared client. void startPreparedClient(int cookie); Loading core/java/android/hardware/biometrics/PromptInfo.java +13 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ public class PromptInfo implements Parcelable { private boolean mDisallowBiometricsIfPolicyExists; private boolean mReceiveSystemEvents; @NonNull private List<Integer> mAllowedSensorIds = new ArrayList<>(); private boolean mAllowBackgroundAuthentication; public PromptInfo() { Loading @@ -64,6 +65,7 @@ public class PromptInfo implements Parcelable { mDisallowBiometricsIfPolicyExists = in.readBoolean(); mReceiveSystemEvents = in.readBoolean(); mAllowedSensorIds = in.readArrayList(Integer.class.getClassLoader()); mAllowBackgroundAuthentication = in.readBoolean(); } public static final Creator<PromptInfo> CREATOR = new Creator<PromptInfo>() { Loading Loading @@ -99,11 +101,14 @@ public class PromptInfo implements Parcelable { dest.writeBoolean(mDisallowBiometricsIfPolicyExists); dest.writeBoolean(mReceiveSystemEvents); dest.writeList(mAllowedSensorIds); dest.writeBoolean(mAllowBackgroundAuthentication); } public boolean containsTestConfigurations() { if (!mAllowedSensorIds.isEmpty()) { return true; } else if (mAllowBackgroundAuthentication) { return true; } return false; } Loading Loading @@ -183,6 +188,10 @@ public class PromptInfo implements Parcelable { mAllowedSensorIds = sensorIds; } public void setAllowBackgroundAuthentication(boolean allow) { mAllowBackgroundAuthentication = allow; } // Getters public CharSequence getTitle() { Loading Loading @@ -248,4 +257,8 @@ public class PromptInfo implements Parcelable { public List<Integer> getAllowedSensorIds() { return mAllowedSensorIds; } public boolean isAllowBackgroundAuthentication() { return mAllowBackgroundAuthentication; } } core/java/android/hardware/face/IFaceService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ interface IFaceService { // startPreparedClient(). void prepareForAuthentication(int sensorId, boolean requireConfirmation, IBinder token, long operationId, int userId, IBiometricSensorReceiver sensorReceiver, String opPackageName, int cookie); int cookie, boolean allowBackgroundAuthentication); // Starts authentication with the previously prepared client. void startPreparedClient(int sensorId, int cookie); Loading Loading
core/api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -1035,9 +1035,11 @@ package android.hardware.biometrics { public class BiometricPrompt { method @NonNull public java.util.List<java.lang.Integer> getAllowedSensorIds(); method public boolean isAllowBackgroundAuthentication(); } public static class BiometricPrompt.Builder { method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.TEST_BIOMETRIC, "android.permission.USE_BIOMETRIC_INTERNAL"}) public android.hardware.biometrics.BiometricPrompt.Builder setAllowBackgroundAuthentication(boolean); method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.TEST_BIOMETRIC, "android.permission.USE_BIOMETRIC_INTERNAL"}) public android.hardware.biometrics.BiometricPrompt.Builder setAllowedSensorIds(@NonNull java.util.List<java.lang.Integer>); } Loading
core/java/android/hardware/biometrics/BiometricPrompt.java +23 −0 Original line number Diff line number Diff line Loading @@ -367,6 +367,20 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan return this; } /** * @param allow If true, allows authentication when the calling package is not in the * foreground. This is set to false by default. * @return This builder * @hide */ @TestApi @NonNull @RequiresPermission(anyOf = {TEST_BIOMETRIC, USE_BIOMETRIC_INTERNAL}) public Builder setAllowBackgroundAuthentication(boolean allow) { mPromptInfo.setAllowBackgroundAuthentication(allow); return this; } /** * If set check the Device Policy Manager for disabled biometrics. * Loading Loading @@ -619,6 +633,15 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan return mPromptInfo.getAllowedSensorIds(); } /** * @return The value set by {@link Builder#setAllowBackgroundAuthentication(boolean)} * @hide */ @TestApi public boolean isAllowBackgroundAuthentication() { return mPromptInfo.isAllowBackgroundAuthentication(); } /** * A wrapper class for the cryptographic operations supported by BiometricPrompt. * Loading
core/java/android/hardware/biometrics/IBiometricAuthenticator.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ interface IBiometricAuthenticator { // startPreparedClient(). void prepareForAuthentication(boolean requireConfirmation, IBinder token, long operationId, int userId, IBiometricSensorReceiver sensorReceiver, String opPackageName, int cookie); int cookie, boolean allowBackgroundAuthentication); // Starts authentication with the previously prepared client. void startPreparedClient(int cookie); Loading
core/java/android/hardware/biometrics/PromptInfo.java +13 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ public class PromptInfo implements Parcelable { private boolean mDisallowBiometricsIfPolicyExists; private boolean mReceiveSystemEvents; @NonNull private List<Integer> mAllowedSensorIds = new ArrayList<>(); private boolean mAllowBackgroundAuthentication; public PromptInfo() { Loading @@ -64,6 +65,7 @@ public class PromptInfo implements Parcelable { mDisallowBiometricsIfPolicyExists = in.readBoolean(); mReceiveSystemEvents = in.readBoolean(); mAllowedSensorIds = in.readArrayList(Integer.class.getClassLoader()); mAllowBackgroundAuthentication = in.readBoolean(); } public static final Creator<PromptInfo> CREATOR = new Creator<PromptInfo>() { Loading Loading @@ -99,11 +101,14 @@ public class PromptInfo implements Parcelable { dest.writeBoolean(mDisallowBiometricsIfPolicyExists); dest.writeBoolean(mReceiveSystemEvents); dest.writeList(mAllowedSensorIds); dest.writeBoolean(mAllowBackgroundAuthentication); } public boolean containsTestConfigurations() { if (!mAllowedSensorIds.isEmpty()) { return true; } else if (mAllowBackgroundAuthentication) { return true; } return false; } Loading Loading @@ -183,6 +188,10 @@ public class PromptInfo implements Parcelable { mAllowedSensorIds = sensorIds; } public void setAllowBackgroundAuthentication(boolean allow) { mAllowBackgroundAuthentication = allow; } // Getters public CharSequence getTitle() { Loading Loading @@ -248,4 +257,8 @@ public class PromptInfo implements Parcelable { public List<Integer> getAllowedSensorIds() { return mAllowedSensorIds; } public boolean isAllowBackgroundAuthentication() { return mAllowBackgroundAuthentication; } }
core/java/android/hardware/face/IFaceService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ interface IFaceService { // startPreparedClient(). void prepareForAuthentication(int sensorId, boolean requireConfirmation, IBinder token, long operationId, int userId, IBiometricSensorReceiver sensorReceiver, String opPackageName, int cookie); int cookie, boolean allowBackgroundAuthentication); // Starts authentication with the previously prepared client. void startPreparedClient(int sensorId, int cookie); Loading