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

Commit 62e2c705 authored by Daniel Chapin's avatar Daniel Chapin
Browse files

Revert "Update RemovalClient to support new biometric AIDL"

Revert submission 13593269

Reason for revert: Bug: 180689674
Reverted Changes:
I59f6e607f:Update RemovalClient to support new biometric AIDL...
I3fdb3fe0b:Try to ensure tests run sequentially

Change-Id: I939172f2961f3f2c9f8eddd59261f75552eeb31f
parent c0dd229f
Loading
Loading
Loading
Loading
+6 −17
Original line number Diff line number Diff line
@@ -562,23 +562,12 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
                mService.remove(mToken, face.getBiometricId(), userId, mServiceReceiver,
                        mContext.getOpPackageName());
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        }
                Slog.w(TAG, "Remote exception in remove: ", e);
                if (callback != null) {
                    callback.onRemovalError(face, FACE_ERROR_HW_UNAVAILABLE,
                            getErrorString(mContext, FACE_ERROR_HW_UNAVAILABLE,
                                0 /* vendorCode */));
                }

    /**
     * Removes all face templates for the given user.
     * @hide
     */
    @RequiresPermission(MANAGE_BIOMETRIC)
    public void removeAll(int userId, @NonNull RemovalCallback callback) {
        if (mService != null) {
            try {
                mRemovalCallback = callback;
                mService.removeAll(mToken, userId, mServiceReceiver, mContext.getOpPackageName());
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        }
    }
+1 −4
Original line number Diff line number Diff line
@@ -83,13 +83,10 @@ interface IFaceService {
    // Cancel enrollment in progress
    void cancelEnrollment(IBinder token);

    // Removes the specified face enrollment for the specified userId.
    // Any errors resulting from this call will be returned to the listener
    void remove(IBinder token, int faceId, int userId, IFaceServiceReceiver receiver,
            String opPackageName);

    // Removes all face enrollments for the specified userId.
    void removeAll(IBinder token, int userId, IFaceServiceReceiver receiver, String opPackageName);

    // Get the enrolled face for user.
    List<Face> getEnrolledFaces(int sensorId, int userId, String opPackageName);

+5 −16
Original line number Diff line number Diff line
@@ -739,22 +739,11 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
            mService.remove(mToken, fp.getBiometricId(), userId, mServiceReceiver,
                    mContext.getOpPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Removes all face templates for the given user.
     * @hide
     */
    @RequiresPermission(MANAGE_FINGERPRINT)
    public void removeAll(int userId, @NonNull RemovalCallback callback) {
        if (mService != null) {
            try {
                mRemovalCallback = callback;
                mService.removeAll(mToken, userId, mServiceReceiver, mContext.getOpPackageName());
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            Slog.w(TAG, "Remote exception in remove: ", e);
            if (callback != null) {
                callback.onRemovalError(fp, FINGERPRINT_ERROR_HW_UNAVAILABLE,
                        getErrorString(mContext, FINGERPRINT_ERROR_HW_UNAVAILABLE,
                            0 /* vendorCode */));
            }
        }
    }
+0 −3
Original line number Diff line number Diff line
@@ -87,9 +87,6 @@ interface IFingerprintService {
    void remove(IBinder token, int fingerId, int userId, IFingerprintServiceReceiver receiver,
            String opPackageName);

    // Removes all face enrollments for the specified userId.
    void removeAll(IBinder token, int userId, IFingerprintServiceReceiver receiver, String opPackageName);

    // Rename the fingerprint specified by fingerId and userId to the given name
    void rename(int fingerId, int userId, String name);

+4 −3
Original line number Diff line number Diff line
@@ -37,16 +37,18 @@ public abstract class RemovalClient<S extends BiometricAuthenticator.Identifier,

    private static final String TAG = "Biometrics/RemovalClient";

    protected final int mBiometricId;
    private final BiometricUtils<S> mBiometricUtils;
    private final Map<Integer, Long> mAuthenticatorIds;

    public RemovalClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
            @NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener,
            int userId, @NonNull String owner, @NonNull BiometricUtils<S> utils, int sensorId,
            @NonNull Map<Integer, Long> authenticatorIds, int statsModality) {
            int biometricId, int userId, @NonNull String owner, @NonNull BiometricUtils<S> utils,
            int sensorId, @NonNull Map<Integer, Long> authenticatorIds, int statsModality) {
        super(context, lazyDaemon, token, listener, userId, owner, 0 /* cookie */, sensorId,
                statsModality, BiometricsProtoEnums.ACTION_REMOVE,
                BiometricsProtoEnums.CLIENT_UNKNOWN);
        mBiometricId = biometricId;
        mBiometricUtils = utils;
        mAuthenticatorIds = authenticatorIds;
    }
@@ -66,7 +68,6 @@ public abstract class RemovalClient<S extends BiometricAuthenticator.Identifier,

    @Override
    public void onRemoved(@Nullable BiometricAuthenticator.Identifier identifier, int remaining) {
        Slog.d(TAG, "onRemoved: " + identifier.getBiometricId() + " remaining: " + remaining);
        if (identifier != null) {
            mBiometricUtils.removeBiometricForUser(getContext(), getTargetUserId(),
                    identifier.getBiometricId());
Loading