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

Commit d6c5d308 authored by Grace Cheng's avatar Grace Cheng Committed by Automerger Merge Worker
Browse files

Merge "Add plumbing to show/hide side-fps UI affordance near power button"...

Merge "Add plumbing to show/hide side-fps UI affordance near power button" into sc-dev am: 96174915

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14628982

Change-Id: I4666c6015024ca755e8588c90d17b17eca423968
parents e1b3bb49 96174915
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -85,7 +85,6 @@ import javax.crypto.Mac;
@SystemService(Context.FINGERPRINT_SERVICE)
@RequiresFeature(PackageManager.FEATURE_FINGERPRINT)
public class FingerprintManager implements BiometricAuthenticator, BiometricFingerprintConstants {

    private static final String TAG = "FingerprintManager";
    private static final boolean DEBUG = true;
    private static final int MSG_ENROLL_RESULT = 100;
@@ -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
     * @param listener new FingerprintStateListener being added
+14 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

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_ULTRASONIC;

@@ -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
    public String toString() {
        return "ID: " + sensorId + ", Strength: " + sensorStrength + ", Type: " + sensorType;
+4 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.hardware.fingerprint.IFingerprintAuthenticatorsRegisteredCallback
import android.hardware.fingerprint.IFingerprintServiceReceiver;
import android.hardware.fingerprint.IFingerprintStateListener;
import android.hardware.fingerprint.IUdfpsOverlayController;
import android.hardware.fingerprint.ISidefpsController;
import android.hardware.fingerprint.Fingerprint;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import java.util.List;
@@ -166,6 +167,9 @@ interface IFingerprintService {
    // Sets the controller for managing the UDFPS overlay.
    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.
    void registerFingerprintStateListener(IFingerprintStateListener listener);
}
+29 −0
Original line number 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();
}
+24 −0
Original line number 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