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

Commit a3967d8a authored by Joshua McCloskey's avatar Joshua McCloskey Committed by Joshua Mccloskey
Browse files

Enabled multibiometric lockout for aidl hals

Test: atest com.android.server.biometrics
Test: atest com.android.server.locksettings
Test: tested on hidl fingerprint device
Test: tested on hidl face device
Test: tested on aidl fingerprint/face device with various different combinations of strengths.

The device tested consisted of:

* Locking out device in keyguard, resetting, ensuring it works as expected
* Locking out device in biometric prompt, resetting, ensuring it works as expected
for work profile & default profile.

Bug: 244355277
Change-Id: I849dfc13da17a49ec9b20fa58390707e1f8109ab
parent c04a6736
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -639,5 +639,24 @@ public class BiometricManager {
            }
        }
    }

    /**
     * Notifies AuthService that keyguard has been dismissed for the given userId.
     *
     * @param userId
     * @param hardwareAuthToken
     * @hide
     */
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    public void resetLockout(int userId, byte[] hardwareAuthToken) {
        if (mService != null) {
            try {
                mService.resetLockout(userId, hardwareAuthToken);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        }

    }
}
+1 −0
Original line number Diff line number Diff line
@@ -73,4 +73,5 @@ public abstract class BiometricStateListener extends IBiometricStateListener.Stu
     */
    public void onEnrollmentsChanged(int userId, int sensorId, boolean hasEnrollments) {
    }

}
+3 −0
Original line number Diff line number Diff line
@@ -79,6 +79,9 @@ interface IAuthService {
    void resetLockoutTimeBound(IBinder token, String opPackageName, int fromSensorId, int userId,
            in byte[] hardwareAuthToken);

    // See documentation in BiometricManager.
    void resetLockout(int userId, in byte[] hardwareAuthToken);

    // Provides a localized string that may be used as the label for a button that invokes
    // BiometricPrompt.
    CharSequence getButtonLabel(int userId, String opPackageName, int authenticators);
+4 −0
Original line number Diff line number Diff line
@@ -91,6 +91,10 @@ interface IBiometricService {
    void resetLockoutTimeBound(IBinder token, String opPackageName, int fromSensorId, int userId,
            in byte[] hardwareAuthToken);

    // See documentation in BiometricManager.
    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    void resetLockout(int userId, in byte[] hardwareAuthToken);

    @EnforcePermission("USE_BIOMETRIC_INTERNAL")
    int getCurrentStrength(int sensorId);

+11 −0
Original line number Diff line number Diff line
@@ -409,6 +409,17 @@ public class AuthService extends SystemService {
            }
        }

        @Override
        public void resetLockout(int userId, byte[] hardwareAuthToken) throws RemoteException {
            checkInternalPermission();
            final long identity = Binder.clearCallingIdentity();
            try {
                mBiometricService.resetLockout(userId, hardwareAuthToken);
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        }

        @Override
        public CharSequence getButtonLabel(
                int userId,
Loading