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

Commit d57975a6 authored by Grace Cheng's avatar Grace Cheng
Browse files

Remove SideFpsController

Removes SideFpsController and ISidefpsController from SystemUI and
system_server under sidefps_controller_refactor flag. This refactor
creates a new AuthenticationStateListener AIDL interface to communicate
authentication state updates from system_server to SystemUI - the
details of this refactor can be found at
go/sfps-controller-diagram-refactor

Flag: ACONFIG com.android.systemui.shared.sidefps_controller_refactor DEVELOPMENT
Bug: 288175061
Test: atest BiometricStatusRepositoryTest
Test: atest BiometricStatusInteractorImplTest
Test: atest DeviceEntrySideFpsOverlayInteractorTest
Test: atest AuthServiceTest
Test: atest KeyguardSecurityContainerControllerTest
Test: atest FingerprintAuthenticationClientTest
Test: atest FingerprintEnrollClientTest
Test: atest SideFpsControllerTest
Test: atest KeyguardBouncerViewModelTest
Test: atest PrimaryBouncerInteractorTest
Test: atest SideFpsOverlayViewModelTest
Test: atest SideFpsOverlayViewBinderTest
Change-Id: Ie375705df9ad4fc54074dde565b9628e4b8c31df
parent 44a32ba6
Loading
Loading
Loading
Loading
+36 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.hardware.biometrics;

/**
 * Low-level callback interface between <Biometric>Manager and <Auth>Service. Allows core system
 * services (e.g. SystemUI) to register a listener for updates about the current state of biometric
 * authentication.
 * @hide
 */
oneway interface AuthenticationStateListener {
    /**
     * Defines behavior in response to authentication starting
     * @param requestReason reason from [BiometricRequestConstants.RequestReason] for requesting
     * authentication starting
     */
    void onAuthenticationStarted(int requestReason);

    /**
     * Defines behavior in response to authentication stopping
     */
    void onAuthenticationStopped();
}
+38 −0
Original line number Original line Diff line number Diff line
@@ -551,6 +551,44 @@ public class BiometricManager {
        }
        }
    }
    }


    /**
     * Registers listener for changes to biometric authentication state.
     * Only sends callbacks for events that occur after the callback has been registered.
     * @param listener Listener for changes to biometric authentication state
     * @hide
     */
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    public void registerAuthenticationStateListener(AuthenticationStateListener listener) {
        if (mService != null) {
            try {
                mService.registerAuthenticationStateListener(listener);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        } else {
            Slog.w(TAG, "registerAuthenticationStateListener(): Service not connected");
        }
    }

    /**
     * Unregisters listener for changes to biometric authentication state.
     * @param listener Listener for changes to biometric authentication state
     * @hide
     */
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    public void unregisterAuthenticationStateListener(AuthenticationStateListener listener) {
        if (mService != null) {
            try {
                mService.unregisterAuthenticationStateListener(listener);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        } else {
            Slog.w(TAG, "unregisterAuthenticationStateListener(): Service not connected");
        }
    }


    /**
    /**
     * Requests all {@link Authenticators.Types#BIOMETRIC_STRONG} sensors to have their
     * Requests all {@link Authenticators.Types#BIOMETRIC_STRONG} sensors to have their
     * authenticatorId invalidated for the specified user. This happens when enrollments have been
     * authenticatorId invalidated for the specified user. This happens when enrollments have been
+14 −11
Original line number Original line Diff line number Diff line
@@ -22,24 +22,27 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.RetentionPolicy;


/**
/**
 * Common constants for biometric overlays.
 * Common constants for biometric requests.
 * @hide
 * @hide
 */
 */
public interface BiometricOverlayConstants {
public class BiometricRequestConstants {

    private BiometricRequestConstants() {}

    /** Unknown usage. */
    /** Unknown usage. */
    int REASON_UNKNOWN = 0;
    public static final int REASON_UNKNOWN = 0;
    /** User is about to enroll. */
    /** User is about to enroll. */
    int REASON_ENROLL_FIND_SENSOR = 1;
    public static final int REASON_ENROLL_FIND_SENSOR = 1;
    /** User is enrolling. */
    /** User is enrolling. */
    int REASON_ENROLL_ENROLLING = 2;
    public static final int REASON_ENROLL_ENROLLING = 2;
    /** Usage from BiometricPrompt. */
    /** Usage from BiometricPrompt. */
    int REASON_AUTH_BP = 3;
    public static final int REASON_AUTH_BP = 3;
    /** Usage from Keyguard. */
    /** Usage from Device Entry. */
    int REASON_AUTH_KEYGUARD = 4;
    public static final int REASON_AUTH_KEYGUARD = 4;
    /** Non-specific usage (from FingerprintManager). */
    /** Non-specific usage (from FingerprintManager). */
    int REASON_AUTH_OTHER = 5;
    public static final int REASON_AUTH_OTHER = 5;
    /** Usage from Settings. */
    /** Usage from Settings. */
    int REASON_AUTH_SETTINGS = 6;
    public static final int REASON_AUTH_SETTINGS = 6;


    @IntDef({REASON_UNKNOWN,
    @IntDef({REASON_UNKNOWN,
            REASON_ENROLL_FIND_SENSOR,
            REASON_ENROLL_FIND_SENSOR,
@@ -49,5 +52,5 @@ public interface BiometricOverlayConstants {
            REASON_AUTH_OTHER,
            REASON_AUTH_OTHER,
            REASON_AUTH_SETTINGS})
            REASON_AUTH_SETTINGS})
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    @interface ShowReason {}
    public @interface RequestReason {}
}
}
+7 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.hardware.biometrics;
package android.hardware.biometrics;


import android.hardware.biometrics.AuthenticationStateListener;
import android.hardware.biometrics.IBiometricEnabledOnKeyguardCallback;
import android.hardware.biometrics.IBiometricEnabledOnKeyguardCallback;
import android.hardware.biometrics.IBiometricServiceReceiver;
import android.hardware.biometrics.IBiometricServiceReceiver;
import android.hardware.biometrics.IInvalidationCallback;
import android.hardware.biometrics.IInvalidationCallback;
@@ -66,6 +67,12 @@ interface IAuthService {
    // Register callback for when keyguard biometric eligibility changes.
    // Register callback for when keyguard biometric eligibility changes.
    void registerEnabledOnKeyguardCallback(IBiometricEnabledOnKeyguardCallback callback);
    void registerEnabledOnKeyguardCallback(IBiometricEnabledOnKeyguardCallback callback);


    // Register listener for changes to authentication state.
    void registerAuthenticationStateListener(AuthenticationStateListener listener);

    // Unregister listener for changes to authentication state.
    void unregisterAuthenticationStateListener(AuthenticationStateListener listener);

    // Requests all BIOMETRIC_STRONG sensors to have their authenticatorId invalidated for the
    // Requests all BIOMETRIC_STRONG sensors to have their authenticatorId invalidated for the
    // specified user. This happens when enrollments have been added on devices with multiple
    // specified user. This happens when enrollments have been added on devices with multiple
    // biometric sensors.
    // biometric sensors.
+1 −0
Original line number Original line Diff line number Diff line
@@ -983,6 +983,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
        }
        }
    }
    }


    // TODO(b/288175061): remove with Flags.FLAG_SIDEFPS_CONTROLLER_REFACTOR
    /**
    /**
     * @hide
     * @hide
     */
     */
Loading