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

Commit 1c9a0627 authored by Joe Bolinger's avatar Joe Bolinger
Browse files

Remove face to fingerprint multi-sensor behavior.

Refactor existing tests to remove unnecessary mocks and boilerplate code to
cover more of the real behavior. This is prep for adding new tests in another
change to add the new face and fingerprint behavior.

Bug: 217393533
Test: atest AuthBiometricViewTest AuthContainerViewTest
Test: manual (authenticate using test app)

Change-Id: If984d1c07fee98d2d7a20cb0025ad434ad9977f4
parent b7e24331
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -104,16 +104,16 @@ public class BiometricManager {
    public static final int BIOMETRIC_MULTI_SENSOR_DEFAULT = 0;

    /**
     * Prefer the face sensor and fall back to fingerprint when needed.
     * Use face and fingerprint sensors together.
     * @hide
     */
    public static final int BIOMETRIC_MULTI_SENSOR_FACE_THEN_FINGERPRINT = 1;
    public static final int BIOMETRIC_MULTI_SENSOR_FINGERPRINT_AND_FACE = 1;

    /**
     * @hide
     */
    @IntDef({BIOMETRIC_MULTI_SENSOR_DEFAULT,
            BIOMETRIC_MULTI_SENSOR_FACE_THEN_FINGERPRINT})
            BIOMETRIC_MULTI_SENSOR_FINGERPRINT_AND_FACE})
    @Retention(RetentionPolicy.SOURCE)
    public @interface BiometricMultiSensorMode {}

+0 −2
Original line number Diff line number Diff line
@@ -30,6 +30,4 @@ oneway interface IBiometricSysuiReceiver {
    void onSystemEvent(int event);
    // Notifies that the dialog has finished animating.
    void onDialogAnimatedIn();
    // For multi-sensor devices, notifies that the fingerprint should start now.
    void onStartFingerprintNow();
}
+0 −14
Original line number Diff line number Diff line
@@ -91,23 +91,9 @@ message BiometricServiceStateProto {
        STATE_CLIENT_DIED_CANCELLING = 10;
    }

    enum MultiSensorState {
        // Initializing or not yet started.
        MULTI_SENSOR_STATE_UNKNOWN = 0;
        // Sensors are in the process of being transitioned and there is no active sensor.
        MULTI_SENSOR_STATE_SWITCHING = 1;
        // Face sensor is being used as the primary input.
        MULTI_SENSOR_STATE_FACE_SCANNING = 2;
        // Fingerprint sensor is being used as the primary input.
        MULTI_SENSOR_STATE_FP_SCANNING = 3;
    }

    repeated SensorServiceStateProto sensor_service_states = 1;

    optional AuthSessionState auth_session_state = 2;

    // Additional session state information, when the device has multiple sensors.
    optional MultiSensorState auth_session_multi_sensor_state = 3;
}

// Overall state for an instance of a <Biometric>Service, for example FingerprintService or
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
  ~ limitations under the License.
  -->

<com.android.systemui.biometrics.AuthBiometricFaceToFingerprintView
<com.android.systemui.biometrics.AuthBiometricFingerprintAndFaceView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
@@ -22,4 +22,4 @@

    <include layout="@layout/auth_biometric_contents"/>

</com.android.systemui.biometrics.AuthBiometricFaceToFingerprintView>
 No newline at end of file
</com.android.systemui.biometrics.AuthBiometricFingerprintAndFaceView>
 No newline at end of file
+26 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2022 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.
  -->

<com.android.systemui.biometrics.AuthBiometricView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/contents"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <include layout="@layout/auth_biometric_contents"/>

</com.android.systemui.biometrics.AuthBiometricView>
 No newline at end of file
Loading