Loading core/java/android/hardware/fingerprint/FingerprintManager.java +18 −1 Original line number Original line Diff line number Diff line Loading @@ -85,7 +85,6 @@ import javax.crypto.Mac; @SystemService(Context.FINGERPRINT_SERVICE) @SystemService(Context.FINGERPRINT_SERVICE) @RequiresFeature(PackageManager.FEATURE_FINGERPRINT) @RequiresFeature(PackageManager.FEATURE_FINGERPRINT) public class FingerprintManager implements BiometricAuthenticator, BiometricFingerprintConstants { public class FingerprintManager implements BiometricAuthenticator, BiometricFingerprintConstants { private static final String TAG = "FingerprintManager"; private static final String TAG = "FingerprintManager"; private static final boolean DEBUG = true; private static final boolean DEBUG = true; private static final int MSG_ENROLL_RESULT = 100; private static final int MSG_ENROLL_RESULT = 100; Loading Loading @@ -881,6 +880,24 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing } } } } /** * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public void setSidefpsController(@NonNull ISidefpsController controller) { if (mService == null) { Slog.w(TAG, "setSidefpsController: no fingerprint service"); return; } try { mService.setSidefpsController(controller); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** /** * Forwards FingerprintStateListener to FingerprintService * Forwards FingerprintStateListener to FingerprintService * @param listener new FingerprintStateListener being added * @param listener new FingerprintStateListener being added Loading core/java/android/hardware/fingerprint/FingerprintSensorPropertiesInternal.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.hardware.fingerprint; package android.hardware.fingerprint; import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_POWER_BUTTON; import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_OPTICAL; import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_OPTICAL; import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_ULTRASONIC; import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_ULTRASONIC; Loading Loading @@ -136,6 +137,19 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna } } } } /** * Returns if sensor type is side-FPS * @return true if sensor is side-fps, false otherwise */ public boolean isAnySidefpsType() { switch (sensorType) { case TYPE_POWER_BUTTON: return true; default: return false; } } @Override @Override public String toString() { public String toString() { return "ID: " + sensorId + ", Strength: " + sensorStrength + ", Type: " + sensorType; return "ID: " + sensorId + ", Strength: " + sensorStrength + ", Type: " + sensorType; Loading core/java/android/hardware/fingerprint/IFingerprintService.aidl +4 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.hardware.fingerprint.IFingerprintAuthenticatorsRegisteredCallback import android.hardware.fingerprint.IFingerprintServiceReceiver; import android.hardware.fingerprint.IFingerprintServiceReceiver; import android.hardware.fingerprint.IFingerprintStateListener; import android.hardware.fingerprint.IFingerprintStateListener; import android.hardware.fingerprint.IUdfpsOverlayController; import android.hardware.fingerprint.IUdfpsOverlayController; import android.hardware.fingerprint.ISidefpsController; import android.hardware.fingerprint.Fingerprint; import android.hardware.fingerprint.Fingerprint; import android.hardware.fingerprint.FingerprintSensorPropertiesInternal; import android.hardware.fingerprint.FingerprintSensorPropertiesInternal; import java.util.List; import java.util.List; Loading Loading @@ -166,6 +167,9 @@ interface IFingerprintService { // Sets the controller for managing the UDFPS overlay. // Sets the controller for managing the UDFPS overlay. void setUdfpsOverlayController(in IUdfpsOverlayController controller); void setUdfpsOverlayController(in IUdfpsOverlayController controller); // Sets the controller for managing the SideFPS overlay. void setSidefpsController(in ISidefpsController controller); // Registers FingerprintStateListener in list stored by FingerprintService. // Registers FingerprintStateListener in list stored by FingerprintService. void registerFingerprintStateListener(IFingerprintStateListener listener); void registerFingerprintStateListener(IFingerprintStateListener listener); } } core/java/android/hardware/fingerprint/ISidefpsController.aidl 0 → 100644 +29 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2021 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.fingerprint; /** * Interface for interacting with the side fingerprint sensor (side-fps) overlay. * @hide */ oneway interface ISidefpsController { // Shows the overlay. void show(); // Hides the overlay. void hide(); } packages/SystemUI/res/layout/sidefps_view.xml 0 → 100644 +24 −0 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 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.SidefpsView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res-auto" android:id="@+id/sidefps_view" android:layout_width="match_parent" android:layout_height="match_parent" android:contentDescription="@string/accessibility_fingerprint_label"> </com.android.systemui.biometrics.SidefpsView> Loading
core/java/android/hardware/fingerprint/FingerprintManager.java +18 −1 Original line number Original line Diff line number Diff line Loading @@ -85,7 +85,6 @@ import javax.crypto.Mac; @SystemService(Context.FINGERPRINT_SERVICE) @SystemService(Context.FINGERPRINT_SERVICE) @RequiresFeature(PackageManager.FEATURE_FINGERPRINT) @RequiresFeature(PackageManager.FEATURE_FINGERPRINT) public class FingerprintManager implements BiometricAuthenticator, BiometricFingerprintConstants { public class FingerprintManager implements BiometricAuthenticator, BiometricFingerprintConstants { private static final String TAG = "FingerprintManager"; private static final String TAG = "FingerprintManager"; private static final boolean DEBUG = true; private static final boolean DEBUG = true; private static final int MSG_ENROLL_RESULT = 100; private static final int MSG_ENROLL_RESULT = 100; Loading Loading @@ -881,6 +880,24 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing } } } } /** * @hide */ @RequiresPermission(USE_BIOMETRIC_INTERNAL) public void setSidefpsController(@NonNull ISidefpsController controller) { if (mService == null) { Slog.w(TAG, "setSidefpsController: no fingerprint service"); return; } try { mService.setSidefpsController(controller); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** /** * Forwards FingerprintStateListener to FingerprintService * Forwards FingerprintStateListener to FingerprintService * @param listener new FingerprintStateListener being added * @param listener new FingerprintStateListener being added Loading
core/java/android/hardware/fingerprint/FingerprintSensorPropertiesInternal.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.hardware.fingerprint; package android.hardware.fingerprint; import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_POWER_BUTTON; import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_OPTICAL; import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_OPTICAL; import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_ULTRASONIC; import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_ULTRASONIC; Loading Loading @@ -136,6 +137,19 @@ public class FingerprintSensorPropertiesInternal extends SensorPropertiesInterna } } } } /** * Returns if sensor type is side-FPS * @return true if sensor is side-fps, false otherwise */ public boolean isAnySidefpsType() { switch (sensorType) { case TYPE_POWER_BUTTON: return true; default: return false; } } @Override @Override public String toString() { public String toString() { return "ID: " + sensorId + ", Strength: " + sensorStrength + ", Type: " + sensorType; return "ID: " + sensorId + ", Strength: " + sensorStrength + ", Type: " + sensorType; Loading
core/java/android/hardware/fingerprint/IFingerprintService.aidl +4 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.hardware.fingerprint.IFingerprintAuthenticatorsRegisteredCallback import android.hardware.fingerprint.IFingerprintServiceReceiver; import android.hardware.fingerprint.IFingerprintServiceReceiver; import android.hardware.fingerprint.IFingerprintStateListener; import android.hardware.fingerprint.IFingerprintStateListener; import android.hardware.fingerprint.IUdfpsOverlayController; import android.hardware.fingerprint.IUdfpsOverlayController; import android.hardware.fingerprint.ISidefpsController; import android.hardware.fingerprint.Fingerprint; import android.hardware.fingerprint.Fingerprint; import android.hardware.fingerprint.FingerprintSensorPropertiesInternal; import android.hardware.fingerprint.FingerprintSensorPropertiesInternal; import java.util.List; import java.util.List; Loading Loading @@ -166,6 +167,9 @@ interface IFingerprintService { // Sets the controller for managing the UDFPS overlay. // Sets the controller for managing the UDFPS overlay. void setUdfpsOverlayController(in IUdfpsOverlayController controller); void setUdfpsOverlayController(in IUdfpsOverlayController controller); // Sets the controller for managing the SideFPS overlay. void setSidefpsController(in ISidefpsController controller); // Registers FingerprintStateListener in list stored by FingerprintService. // Registers FingerprintStateListener in list stored by FingerprintService. void registerFingerprintStateListener(IFingerprintStateListener listener); void registerFingerprintStateListener(IFingerprintStateListener listener); } }
core/java/android/hardware/fingerprint/ISidefpsController.aidl 0 → 100644 +29 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2021 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.fingerprint; /** * Interface for interacting with the side fingerprint sensor (side-fps) overlay. * @hide */ oneway interface ISidefpsController { // Shows the overlay. void show(); // Hides the overlay. void hide(); }
packages/SystemUI/res/layout/sidefps_view.xml 0 → 100644 +24 −0 Original line number Original line Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 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.SidefpsView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res-auto" android:id="@+id/sidefps_view" android:layout_width="match_parent" android:layout_height="match_parent" android:contentDescription="@string/accessibility_fingerprint_label"> </com.android.systemui.biometrics.SidefpsView>