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

Commit 352adfec authored by Kevin Chyn's avatar Kevin Chyn
Browse files

2/n: Rename BiometricPromptService to BiometricService

This is in preparation for BiometricManager. Each Manager should have its
own Service.

Bug: 112570477

Test: BiometricPromptDemo works
Change-Id: Ibbbd499a0fd5a2050b329ee038776c6c9f49cdb2
parent 355c6bfb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -151,8 +151,8 @@ java_defaults {
        ":libcamera_client_framework_aidl",
        "core/java/android/hardware/IConsumerIrService.aidl",
        "core/java/android/hardware/ISerialManager.aidl",
        "core/java/android/hardware/biometrics/IBiometricPromptService.aidl",
        "core/java/android/hardware/biometrics/IBiometricPromptServiceReceiver.aidl",
        "core/java/android/hardware/biometrics/IBiometricService.aidl",
        "core/java/android/hardware/biometrics/IBiometricServiceReceiver.aidl",
        "core/java/android/hardware/biometrics/IBiometricPromptReceiver.aidl",
        "core/java/android/hardware/biometrics/IBiometricServiceLockoutResetCallback.aidl",
        "core/java/android/hardware/display/IDisplayManager.aidl",
+1 −2
Original line number Diff line number Diff line
@@ -3685,9 +3685,8 @@ public abstract class Context {
     *
     * @hide
     * @see #getSystemService(String)
     * @see com.android.server.biometrics.BiometricPromptService
     */
    public static final String BIOMETRIC_PROMPT_SERVICE = "biometric_prompt";
    public static final String BIOMETRIC_SERVICE = "biometric";

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
+6 −6
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan

    private final IBinder mToken = new Binder();
    private final Context mContext;
    private final IBiometricPromptService mService;
    private final IBiometricService mService;
    private final Bundle mBundle;
    private final ButtonInfo mPositiveButtonInfo;
    private final ButtonInfo mNegativeButtonInfo;
@@ -250,8 +250,8 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
        }
    };

    IBiometricPromptServiceReceiver mBiometricPromptServiceReceiver =
            new IBiometricPromptServiceReceiver.Stub() {
    IBiometricServiceReceiver mBiometricServiceReceiver =
            new IBiometricServiceReceiver.Stub() {

        @Override
        public void onAuthenticationSucceeded(long deviceId) throws RemoteException {
@@ -290,8 +290,8 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
        mBundle = bundle;
        mPositiveButtonInfo = positiveButtonInfo;
        mNegativeButtonInfo = negativeButtonInfo;
        mService = IBiometricPromptService.Stub.asInterface(
                ServiceManager.getService(Context.BIOMETRIC_PROMPT_SERVICE));
        mService = IBiometricService.Stub.asInterface(
                ServiceManager.getService(Context.BIOMETRIC_SERVICE));
    }

    /**
@@ -516,7 +516,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
            mAuthenticationCallback = callback;
            final long sessionId = crypto != null ? crypto.getOpId() : 0;
            mService.authenticate(mToken, sessionId, mContext.getUserId(),
                    mBiometricPromptServiceReceiver, 0 /* flags */, mContext.getOpPackageName(),
                    mBiometricServiceReceiver, 0 /* flags */, mContext.getOpPackageName(),
                    mBundle, mDialogReceiver);
        } catch (RemoteException e) {
            Log.e(TAG, "Remote exception while authenticating", e);
+7 −6
Original line number Diff line number Diff line
@@ -18,19 +18,20 @@ package android.hardware.biometrics;

import android.os.Bundle;
import android.hardware.biometrics.IBiometricPromptReceiver;
import android.hardware.biometrics.IBiometricPromptServiceReceiver;
import android.hardware.biometrics.IBiometricServiceReceiver;

/**
 * Communication channel from BiometricPrompt to BiometricPromptService. The interface does not
 * expose specific biometric modalities. The system will use the default biometric for apps. On
 * devices with more than one, the choice is dictated by user preference in Settings.
 * Communication channel from BiometricPrompt and BiometricManager to BiometricService. The
 * interface does not expose specific biometric modalities. The system will use the default
 * biometric for apps. On devices with more than one, the choice is dictated by user preference in
 * Settings.
 * @hide
 */
interface IBiometricPromptService {
interface IBiometricService {
    // Requests authentication. The service choose the appropriate biometric to use, and show
    // the corresponding BiometricDialog.
    void authenticate(IBinder token, long sessionId, int userId,
            IBiometricPromptServiceReceiver receiver, int flags, String opPackageName,
            IBiometricServiceReceiver receiver, int flags, String opPackageName,
            in Bundle bundle, IBiometricPromptReceiver dialogReceiver);

    // Cancel authentication for the given sessionId
+2 −2
Original line number Diff line number Diff line
@@ -20,10 +20,10 @@ import android.os.Bundle;
import android.os.UserHandle;

/**
 * Communication channel from the BiometricPromptService back to BiometricPrompt.
 * Communication channel from the BiometricService back to BiometricPrompt.
 * @hide
 */
oneway interface IBiometricPromptServiceReceiver {
oneway interface IBiometricServiceReceiver {
    void onAuthenticationSucceeded(long deviceId);
    void onAuthenticationFailed(long deviceId);
    void onError(long deviceId, int error, String message);
Loading