Require permission for hidden APIs in BiometricPrompt
Test: N/A Bug: 288874281 Change-Id: I1df8dd1199769c098a250a3950769870f716ef16
This commit is contained in:
@@ -144,6 +144,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
|
||||
private Context mContext;
|
||||
private IAuthService mService;
|
||||
|
||||
// LINT.IfChange
|
||||
/**
|
||||
* Creates a builder for a {@link BiometricPrompt} dialog.
|
||||
* @param context The {@link Context} that will be used to build the prompt.
|
||||
@@ -417,6 +418,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
|
||||
* @hide
|
||||
*/
|
||||
@NonNull
|
||||
@RequiresPermission(USE_BIOMETRIC_INTERNAL)
|
||||
public Builder setDisallowBiometricsIfPolicyExists(boolean checkDevicePolicyManager) {
|
||||
mPromptInfo.setDisallowBiometricsIfPolicyExists(checkDevicePolicyManager);
|
||||
return this;
|
||||
@@ -429,6 +431,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
|
||||
* @hide
|
||||
*/
|
||||
@NonNull
|
||||
@RequiresPermission(USE_BIOMETRIC_INTERNAL)
|
||||
public Builder setReceiveSystemEvents(boolean set) {
|
||||
mPromptInfo.setReceiveSystemEvents(set);
|
||||
return this;
|
||||
@@ -442,6 +445,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
|
||||
* @hide
|
||||
*/
|
||||
@NonNull
|
||||
@RequiresPermission(USE_BIOMETRIC_INTERNAL)
|
||||
public Builder setIgnoreEnrollmentState(boolean ignoreEnrollmentState) {
|
||||
mPromptInfo.setIgnoreEnrollmentState(ignoreEnrollmentState);
|
||||
return this;
|
||||
@@ -454,10 +458,12 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
|
||||
* @hide
|
||||
*/
|
||||
@NonNull
|
||||
@RequiresPermission(USE_BIOMETRIC_INTERNAL)
|
||||
public Builder setIsForLegacyFingerprintManager(int sensorId) {
|
||||
mPromptInfo.setIsForLegacyFingerprintManager(sensorId);
|
||||
return this;
|
||||
}
|
||||
// LINT.ThenChange(frameworks/base/core/java/android/hardware/biometrics/PromptInfo.java)
|
||||
|
||||
/**
|
||||
* Creates a {@link BiometricPrompt}.
|
||||
|
||||
@@ -126,6 +126,7 @@ public class PromptInfo implements Parcelable {
|
||||
return false;
|
||||
}
|
||||
|
||||
// LINT.IfChange
|
||||
public boolean containsPrivateApiConfigurations() {
|
||||
if (mDisallowBiometricsIfPolicyExists) {
|
||||
return true;
|
||||
@@ -141,9 +142,14 @@ public class PromptInfo implements Parcelable {
|
||||
return true;
|
||||
} else if (mReceiveSystemEvents) {
|
||||
return true;
|
||||
} else if (mIgnoreEnrollmentState) {
|
||||
return true;
|
||||
} else if (mIsForLegacyFingerprintManager) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// LINT.ThenChange(frameworks/base/core/java/android/hardware/biometrics/BiometricPrompt.java)
|
||||
|
||||
// Setters
|
||||
|
||||
|
||||
Reference in New Issue
Block a user