Merge "Require permission for hidden APIs in BiometricPrompt" into udc-qpr-dev
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(anyOf = {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(anyOf = {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(anyOf = {TEST_BIOMETRIC, 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(anyOf = {TEST_BIOMETRIC, 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}.
|
||||
|
||||
@@ -113,6 +113,7 @@ public class PromptInfo implements Parcelable {
|
||||
dest.writeBoolean(mIsForLegacyFingerprintManager);
|
||||
}
|
||||
|
||||
// LINT.IfChange
|
||||
public boolean containsTestConfigurations() {
|
||||
if (mIsForLegacyFingerprintManager
|
||||
&& mAllowedSensorIds.size() == 1
|
||||
@@ -122,6 +123,10 @@ public class PromptInfo implements Parcelable {
|
||||
return true;
|
||||
} else if (mAllowBackgroundAuthentication) {
|
||||
return true;
|
||||
} else if (mIsForLegacyFingerprintManager) {
|
||||
return true;
|
||||
} else if (mIgnoreEnrollmentState) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -144,6 +149,7 @@ public class PromptInfo implements Parcelable {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// LINT.ThenChange(frameworks/base/core/java/android/hardware/biometrics/BiometricPrompt.java)
|
||||
|
||||
// Setters
|
||||
|
||||
|
||||
Reference in New Issue
Block a user