Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef4cd622 authored by Kevin Chyn's avatar Kevin Chyn
Browse files

Add BiometricManager#getUiPackage TestApi

Bug: 171357779
Test: atest CtsBiometricsTestCases
Change-Id: I3847c7bf63260ebef8436704826af37e15f2da92
parent 1baf2aa6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 {
+15 −0
Original line number Diff line number Diff line
@@ -222,6 +222,21 @@ public class BiometricManager {
        return null; // TODO(169459906)
    }

    /**
     * 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,
+3 −0
Original line number Diff line number Diff line
@@ -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,
+1 −0
Original line number Diff line number Diff line
@@ -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,
+1 −0
Original line number Diff line number Diff line
@@ -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" />

Loading