summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/api/test-current.txt1
-rw-r--r--core/java/android/hardware/biometrics/BiometricManager.java15
-rw-r--r--core/java/android/hardware/biometrics/IAuthService.aidl3
-rw-r--r--core/res/res/values/config.xml1
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--services/core/java/com/android/server/biometrics/AuthService.java9
6 files changed, 30 insertions, 0 deletions
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index 1c72d02204c6..f19b704c8c2b 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -698,6 +698,7 @@ package android.hardware.biometrics {
public class BiometricManager {
method @NonNull @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public android.hardware.biometrics.BiometricTestSession createTestSession(int);
method @NonNull @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public java.util.List<android.hardware.biometrics.SensorProperties> getSensorProperties();
+ method @NonNull @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public String getUiPackage();
}
public class BiometricTestSession implements java.lang.AutoCloseable {
diff --git a/core/java/android/hardware/biometrics/BiometricManager.java b/core/java/android/hardware/biometrics/BiometricManager.java
index 25c749b9c14b..3b56dde69704 100644
--- a/core/java/android/hardware/biometrics/BiometricManager.java
+++ b/core/java/android/hardware/biometrics/BiometricManager.java
@@ -223,6 +223,21 @@ public class BiometricManager {
}
/**
+ * Retrieves the package where BiometricPrompt's UI is implemented.
+ * @hide
+ */
+ @TestApi
+ @NonNull
+ @RequiresPermission(TEST_BIOMETRIC)
+ public String getUiPackage() {
+ try {
+ return mService.getUiPackage();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Determine if biometrics can be used. In other words, determine if
* {@link BiometricPrompt} can be expected to be shown (hardware available, templates enrolled,
* user-enabled). This is the equivalent of {@link #canAuthenticate(int)} with
diff --git a/core/java/android/hardware/biometrics/IAuthService.aidl b/core/java/android/hardware/biometrics/IAuthService.aidl
index dd6aa736a1a3..b44327678ad4 100644
--- a/core/java/android/hardware/biometrics/IAuthService.aidl
+++ b/core/java/android/hardware/biometrics/IAuthService.aidl
@@ -28,6 +28,9 @@ import android.hardware.biometrics.PromptInfo;
* @hide
*/
interface IAuthService {
+ // Retrieve the package where BIometricOrompt's UI is implemented
+ String getUiPackage();
+
// Requests authentication. The service choose the appropriate biometric to use, and show
// the corresponding BiometricDialog.
void authenticate(IBinder token, long sessionId, int userId,
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 3295df1122d0..ab0ae51d60fd 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4264,6 +4264,7 @@
<!-- Which binder services to include in incident reports containing restricted images. -->
<string-array name="config_restrictedImagesServices" translatable="false"/>
+ <string name="config_biometric_prompt_ui_package">com.android.systemui</string>
<!-- List of biometric sensors on the device, in decreasing strength. Consumed by AuthService
when registering authenticators with BiometricService. Format must be ID:Modality:Strength,
where: IDs are unique per device, Modality as defined in BiometricAuthenticator.java,
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index fba431c66f53..f80f4ba4b6bd 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2516,6 +2516,7 @@
<java-symbol type="string" name="face_authenticated_confirmation_required" />
<java-symbol type="string" name="face_error_security_update_required" />
+ <java-symbol type="string" name="config_biometric_prompt_ui_package" />
<java-symbol type="array" name="config_biometric_sensors" />
<java-symbol type="bool" name="allow_test_udfps" />
diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
index eeec1bbf8d75..27b39c69758f 100644
--- a/services/core/java/com/android/server/biometrics/AuthService.java
+++ b/services/core/java/com/android/server/biometrics/AuthService.java
@@ -20,6 +20,7 @@ package com.android.server.biometrics;
// TODO(b/141025588): Create separate internal and external permissions for AuthService.
// TODO(b/141025588): Get rid of the USE_FINGERPRINT permission.
+import static android.Manifest.permission.TEST_BIOMETRIC;
import static android.Manifest.permission.USE_BIOMETRIC;
import static android.Manifest.permission.USE_BIOMETRIC_INTERNAL;
import static android.Manifest.permission.USE_FINGERPRINT;
@@ -137,6 +138,14 @@ public class AuthService extends SystemService {
private final class AuthServiceImpl extends IAuthService.Stub {
@Override
+ public String getUiPackage() {
+ Utils.checkPermission(getContext(), TEST_BIOMETRIC);
+
+ return getContext().getResources()
+ .getString(R.string.config_biometric_prompt_ui_package);
+ }
+
+ @Override
public void authenticate(IBinder token, long sessionId, int userId,
IBiometricServiceReceiver receiver, String opPackageName, PromptInfo promptInfo)
throws RemoteException {