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

Commit 355c6bfb authored by Kevin Chyn's avatar Kevin Chyn
Browse files

1/n: Rename BiometricService to BiometricServiceBase

This is in preparation for BiometricManager. This file is actually the
base class of <Biometric>Service, and isn't itself a system service,
since BiometricManager should follow the Manager/Service pattern.

Bug: 112570477

Test: Builds
Change-Id: I1287681a470de1634893188f5e8727604f2398ee
parent 609ae206
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -139,8 +139,8 @@ public abstract class AuthenticationClient extends ClientMonitor {
    public abstract void onAuthenticationConfirmed();

    public AuthenticationClient(Context context, Metrics metrics,
            BiometricService.DaemonWrapper daemon, long halDeviceId, IBinder token,
            BiometricService.ServiceListener listener, int targetUserId, int groupId, long opId,
            BiometricServiceBase.DaemonWrapper daemon, long halDeviceId, IBinder token,
            BiometricServiceBase.ServiceListener listener, int targetUserId, int groupId, long opId,
            boolean restricted, String owner, Bundle bundle,
            IBiometricPromptReceiver dialogReceiver, IStatusBarService statusBarService,
            boolean requireConfirmation) {
@@ -207,7 +207,7 @@ public abstract class AuthenticationClient extends ClientMonitor {

    private void notifyClientAuthenticationSucceeded(BiometricAuthenticator.Identifier identifier)
            throws RemoteException {
        final BiometricService.ServiceListener listener = getListener();
        final BiometricServiceBase.ServiceListener listener = getListener();
        // Explicitly have if/else here to make it super obvious in case the code is
        // touched in the future.
        if (!getIsRestricted()) {
@@ -256,7 +256,7 @@ public abstract class AuthenticationClient extends ClientMonitor {
            }
        }

        final BiometricService.ServiceListener listener = getListener();
        final BiometricServiceBase.ServiceListener listener = getListener();
        if (listener != null) {
            try {
                mMetricsLogger.action(mMetrics.actionBiometricAuth(), authenticated);
+5 −3
Original line number Diff line number Diff line
@@ -72,7 +72,8 @@ import java.util.Map;
 *
 * @hide
 */
public abstract class BiometricService extends SystemService implements IHwBinder.DeathRecipient {
public abstract class BiometricServiceBase extends SystemService
        implements IHwBinder.DeathRecipient {

    protected static final boolean DEBUG = true;

@@ -529,7 +530,7 @@ public abstract class BiometricService extends SystemService implements IHwBinde
     *
     * @param context The system server context.
     */
    public BiometricService(Context context) {
    public BiometricServiceBase(Context context) {
        super(context);
        mContext = context;
        mStatusBarService = IStatusBarService.Stub.asInterface(
@@ -630,7 +631,8 @@ public abstract class BiometricService extends SystemService implements IHwBinde
        if (error == BiometricConstants.BIOMETRIC_ERROR_CANCELED) {
            mHandler.removeCallbacks(mResetClientState);
            if (mPendingClient != null) {
                if (DEBUG) Slog.v(getTag(), "start pending client " + mPendingClient.getOwnerString());
                if (DEBUG) Slog.v(getTag(), "start pending client " +
                        mPendingClient.getOwnerString());
                startClient(mPendingClient, false);
                mPendingClient = null;
            }
+9 −8
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ import java.util.NoSuchElementException;
 */
public abstract class ClientMonitor implements IBinder.DeathRecipient {
    protected static final int ERROR_ESRCH = 3; // Likely HAL is dead. See errno.h.
    protected static final boolean DEBUG = BiometricService.DEBUG;
    protected static final boolean DEBUG = BiometricServiceBase.DEBUG;
    private static final AudioAttributes FINGERPRINT_SONFICATION_ATTRIBUTES =
            new AudioAttributes.Builder()
                    .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
@@ -54,10 +54,10 @@ public abstract class ClientMonitor implements IBinder.DeathRecipient {
    private final String mOwner;
    private final VibrationEffect mSuccessVibrationEffect;
    private final VibrationEffect mErrorVibrationEffect;
    private final BiometricService.DaemonWrapper mDaemon;
    private final BiometricServiceBase.DaemonWrapper mDaemon;

    private IBinder mToken;
    private BiometricService.ServiceListener mListener;
    private BiometricServiceBase.ServiceListener mListener;

    protected final MetricsLogger mMetricsLogger;
    protected final Metrics mMetrics;
@@ -76,9 +76,10 @@ public abstract class ClientMonitor implements IBinder.DeathRecipient {
     * permission
     * @param owner name of the client that owns this
     */
    public ClientMonitor(Context context, Metrics metrics, BiometricService.DaemonWrapper daemon,
            long halDeviceId, IBinder token, BiometricService.ServiceListener listener, int userId,
            int groupId, boolean restricted, String owner) {
    public ClientMonitor(Context context, Metrics metrics,
            BiometricServiceBase.DaemonWrapper daemon, long halDeviceId, IBinder token,
            BiometricServiceBase.ServiceListener listener, int userId, int groupId,
            boolean restricted, String owner) {
        mContext = context;
        mMetrics = metrics;
        mDaemon = daemon;
@@ -221,11 +222,11 @@ public abstract class ClientMonitor implements IBinder.DeathRecipient {
        return mOwner;
    }

    public final BiometricService.ServiceListener getListener() {
    public final BiometricServiceBase.ServiceListener getListener() {
        return mListener;
    }

    public final BiometricService.DaemonWrapper getDaemonWrapper() {
    public final BiometricServiceBase.DaemonWrapper getDaemonWrapper() {
        return mDaemon;
    }

+4 −4
Original line number Diff line number Diff line
@@ -35,10 +35,10 @@ public abstract class EnrollClient extends ClientMonitor {
    private final byte[] mCryptoToken;
    private final BiometricUtils mBiometricUtils;

    public EnrollClient(Context context, Metrics metrics, BiometricService.DaemonWrapper daemon,
            long halDeviceId, IBinder token, BiometricService.ServiceListener listener, int userId,
            int groupId, byte[] cryptoToken, boolean restricted, String owner,
            BiometricUtils utils) {
    public EnrollClient(Context context, Metrics metrics,
            BiometricServiceBase.DaemonWrapper daemon, long halDeviceId, IBinder token,
            BiometricServiceBase.ServiceListener listener, int userId, int groupId,
            byte[] cryptoToken, boolean restricted, String owner, BiometricUtils utils) {
        super(context, metrics, daemon, halDeviceId, token, listener, userId, groupId, restricted,
                owner);
        mBiometricUtils = utils;
+4 −3
Original line number Diff line number Diff line
@@ -29,9 +29,10 @@ import java.util.ArrayList;
 * A class to keep track of the enumeration state for a given client.
 */
public abstract class EnumerateClient extends ClientMonitor {
    public EnumerateClient(Context context, Metrics metrics, BiometricService.DaemonWrapper daemon,
            long halDeviceId, IBinder token, BiometricService.ServiceListener listener, int groupId,
            int userId, boolean restricted, String owner) {
    public EnumerateClient(Context context, Metrics metrics,
            BiometricServiceBase.DaemonWrapper daemon, long halDeviceId, IBinder token,
            BiometricServiceBase.ServiceListener listener, int groupId, int userId,
            boolean restricted, String owner) {
        super(context, metrics, daemon, halDeviceId, token, listener, userId, groupId, restricted,
                owner);
    }
Loading