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

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

6/n: Have FaceService extend BiometricService

In the Service layer, this change is pretty much the same as ag/4340638.
FingerprintService already extends BiometricService which contains all
of the common code. FaceService now does the same after this change.

Updated the Manager layer to use the infrastructure added in P, namely
  - Private APIs for BiometricPrompt
  - Removed FaceManager#CryptoObject, use biometrics/CryptoObject directly
  - Few other BiometricAuthenticator things

Bug: 110387294

Test: enrolling FP still works
Test: removing FP still works
Test: changing FP name persists across reboots
Test: enumerating still works (extra framework fp, extra hw fp)
Test: keyguard still receives lockout reset callbacks

Change-Id: I2195b08e28d024a120df56fe87b0dd4f9b96505a
parent 778ff3c7
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -148,15 +148,14 @@ java_library {
        "core/java/android/hardware/IConsumerIrService.aidl",
        "core/java/android/hardware/ISerialManager.aidl",
        "core/java/android/hardware/biometrics/IBiometricPromptReceiver.aidl",
        "core/java/android/hardware/biometrics/IBiometricServiceLockoutResetCallback.aidl",
        "core/java/android/hardware/display/IDisplayManager.aidl",
        "core/java/android/hardware/display/IDisplayManagerCallback.aidl",
        "core/java/android/hardware/display/IVirtualDisplayCallback.aidl",
        "core/java/android/hardware/fingerprint/IFingerprintClientActiveCallback.aidl",
        "core/java/android/hardware/face/IFaceService.aidl",
        "core/java/android/hardware/face/IFaceServiceLockoutResetCallback.aidl",
        "core/java/android/hardware/face/IFaceServiceReceiver.aidl",
        "core/java/android/hardware/fingerprint/IFingerprintService.aidl",
        "core/java/android/hardware/fingerprint/IFingerprintServiceLockoutResetCallback.aidl",
        "core/java/android/hardware/fingerprint/IFingerprintServiceReceiver.aidl",
        "core/java/android/hardware/hdmi/IHdmiControlCallback.aidl",
        "core/java/android/hardware/hdmi/IHdmiControlService.aidl",
+0 −2
Original line number Diff line number Diff line
@@ -2493,8 +2493,6 @@ Landroid/hardware/display/WifiDisplayStatus;->getScanState()I
Landroid/hardware/display/WifiDisplayStatus;->mActiveDisplay:Landroid/hardware/display/WifiDisplay;
Landroid/hardware/display/WifiDisplayStatus;->mDisplays:[Landroid/hardware/display/WifiDisplay;
Landroid/hardware/display/WifiDisplayStatus;->SCAN_STATE_NOT_SCANNING:I
Landroid/hardware/fingerprint/Fingerprint;->getFingerId()I
Landroid/hardware/fingerprint/Fingerprint;->getName()Ljava/lang/CharSequence;
Landroid/hardware/fingerprint/FingerprintManager$AuthenticationResult;->getFingerprint()Landroid/hardware/fingerprint/Fingerprint;
Landroid/hardware/fingerprint/FingerprintManager;->getAuthenticatorId()J
Landroid/hardware/fingerprint/FingerprintManager;->getEnrolledFingerprints()Ljava/util/List;
+0 −2
Original line number Diff line number Diff line
@@ -1626,8 +1626,6 @@ Landroid/hardware/display/DisplayManagerGlobal;->sInstance:Landroid/hardware/dis
Landroid/hardware/display/IDisplayManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/display/IDisplayManager;
Landroid/hardware/display/WifiDisplayStatus;->mActiveDisplay:Landroid/hardware/display/WifiDisplay;
Landroid/hardware/display/WifiDisplayStatus;->mDisplays:[Landroid/hardware/display/WifiDisplay;
Landroid/hardware/fingerprint/Fingerprint;->getFingerId()I
Landroid/hardware/fingerprint/Fingerprint;->getName()Ljava/lang/CharSequence;
Landroid/hardware/fingerprint/IFingerprintService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/hardware/input/IInputManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/hardware/input/IInputManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/input/IInputManager;
+1 −3
Original line number Diff line number Diff line
@@ -599,9 +599,7 @@ public class AppOpsManager {
    public static final String OPSTR_BLUETOOTH_SCAN = "android:bluetooth_scan";

    /** @hide Use the face authentication API. */
    public static final String OPSTR_USE_FACE = "android:use_FACE";


    public static final String OPSTR_USE_FACE = "android:use_face";

    // Warning: If an permission is added here it also has to be added to
    // com.android.packageinstaller.permission.utils.EventLogger
+47 −4
Original line number Diff line number Diff line
@@ -33,7 +33,50 @@ public interface BiometricAuthenticator {
     * Container for biometric data
     * @hide
     */
    abstract class BiometricIdentifier implements Parcelable {}
    abstract class Identifier implements Parcelable {
        private CharSequence mName;
        private int mBiometricId;
        private long mDeviceId; // physical device this is associated with

        public Identifier() {}

        public Identifier(CharSequence name, int biometricId, long deviceId) {
            mName = name;
            mBiometricId = biometricId;
            mDeviceId = deviceId;
        }

        /**
         * Gets the human-readable name for the given biometric.
         * @return name given to the biometric
         */
        public CharSequence getName() {
            return mName;
        }

        /**
         * Gets the device-specific biometric id.  Used by Settings to map a name to a specific
         * biometric template.
         */
        public int getBiometricId() {
            return mBiometricId;
        }

        /**
         * Device this biometric belongs to.
         */
        public long getDeviceId() {
            return mDeviceId;
        }

        public void setName(CharSequence name) {
            mName = name;
        }

        public void setDeviceId(long deviceId) {
            mDeviceId = deviceId;
        }
    }

    /**
     * Container for callback data from {@link BiometricAuthenticator#authenticate(
@@ -42,7 +85,7 @@ public interface BiometricAuthenticator {
     * AuthenticationCallback)}
     */
    class AuthenticationResult {
        private BiometricIdentifier mIdentifier;
        private Identifier mIdentifier;
        private CryptoObject mCryptoObject;
        private int mUserId;

@@ -58,7 +101,7 @@ public interface BiometricAuthenticator {
         * @param userId
         * @hide
         */
        public AuthenticationResult(CryptoObject crypto, BiometricIdentifier identifier,
        public AuthenticationResult(CryptoObject crypto, Identifier identifier,
                int userId) {
            mCryptoObject = crypto;
            mIdentifier = identifier;
@@ -80,7 +123,7 @@ public interface BiometricAuthenticator {
         * operations.
         * @hide
         */
        public BiometricIdentifier getId() {
        public Identifier getId() {
            return mIdentifier;
        }

Loading