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

Commit 152e2640 authored by Ilya Matyukhin's avatar Ilya Matyukhin Committed by Android (Google) Code Review
Browse files

Merge "Remove a binder call from BiometricSensor#toString" into tm-dev

parents 24c45b96 a29a4ed6
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -22,10 +22,8 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.BiometricConstants;
import android.hardware.biometrics.BiometricManager;
import android.hardware.biometrics.IBiometricAuthenticator;
import android.hardware.biometrics.IBiometricSensorReceiver;
import android.hardware.biometrics.SensorPropertiesInternal;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
@@ -149,7 +147,7 @@ public abstract class BiometricSensor {
     * Returns the actual strength, taking any updated strengths into effect. Since more bits
     * means lower strength, the resulting strength is never stronger than the OEM's configured
     * strength.
     * @return a bitfield, see {@link BiometricManager.Authenticators}
     * @return a bitfield, see {@link android.hardware.biometrics.BiometricManager.Authenticators}
     */
    @Authenticators.Types int getCurrentStrength() {
        return oemStrength | mUpdatedStrength;
@@ -169,27 +167,19 @@ public abstract class BiometricSensor {
     * @param newStrength
     */
    void updateStrength(@Authenticators.Types int newStrength) {
        String log = "updateStrength: Before(" + toString() + ")";
        String log = "updateStrength: Before(" + this + ")";
        mUpdatedStrength = newStrength;
        log += " After(" + toString() + ")";
        log += " After(" + this + ")";
        Slog.d(TAG, log);
    }

    @Override
    public String toString() {
        SensorPropertiesInternal properties = null;
        try {
            properties = impl.getSensorProperties(mContext.getOpPackageName());
        } catch (RemoteException e) {
            Slog.e(TAG, "Remote exception", e);
        }

        return "ID(" + id + ")"
                + ", oemStrength: " + oemStrength
                + ", updatedStrength: " + mUpdatedStrength
                + ", modality " + modality
                + ", state: " + mSensorState
                + ", cookie: " + mCookie
                + ", props: " + properties;
                + ", cookie: " + mCookie;
    }
}