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

Commit a12c57da authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add FP auth feature when screen off(1/2)" into main

parents 0c1a4a41 c90c65d8
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -39,3 +39,11 @@ flag {
  description: "This flag controls whether LSKF fallback is removed from biometric prompt when the phone is outside trusted locations"
  bug: "322081563"
}

flag {
  name: "screen_off_unlock_udfps"
  is_exported: true
  namespace: "biometrics_integration"
  description: "This flag controls Whether to enable fp unlock when screen turns off on udfps devices"
  bug: "373792870"
}
+7 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.hardware.display;

import android.annotation.TestApi;
import android.content.Context;
import android.hardware.biometrics.Flags;
import android.os.Build;
import android.os.SystemProperties;
import android.provider.Settings;
@@ -41,6 +42,7 @@ public class AmbientDisplayConfiguration {
    private final Context mContext;
    private final boolean mAlwaysOnByDefault;
    private final boolean mPickupGestureEnabledByDefault;
    private final boolean mScreenOffUdfpsEnabledByDefault;

    /** Copied from android.provider.Settings.Secure since these keys are hidden. */
    private static final String[] DOZE_SETTINGS = {
@@ -68,6 +70,8 @@ public class AmbientDisplayConfiguration {
        mAlwaysOnByDefault = mContext.getResources().getBoolean(R.bool.config_dozeAlwaysOnEnabled);
        mPickupGestureEnabledByDefault =
                mContext.getResources().getBoolean(R.bool.config_dozePickupGestureEnabled);
        mScreenOffUdfpsEnabledByDefault =
                mContext.getResources().getBoolean(R.bool.config_screen_off_udfps_enabled);
    }

    /** @hide */
@@ -146,7 +150,9 @@ public class AmbientDisplayConfiguration {
    /** @hide */
    public boolean screenOffUdfpsEnabled(int user) {
        return !TextUtils.isEmpty(udfpsLongPressSensorType())
            && boolSettingDefaultOff("screen_off_udfps_enabled", user);
                && ((mScreenOffUdfpsEnabledByDefault && Flags.screenOffUnlockUdfps())
                ? boolSettingDefaultOn("screen_off_udfps_enabled", user)
                : boolSettingDefaultOff("screen_off_udfps_enabled", user));
    }

    /** @hide */
+3 −0
Original line number Diff line number Diff line
@@ -7178,4 +7178,7 @@

    <!-- The name of the service for forensic backup transport. -->
    <string name="config_forensicBackupTransport" translatable="false"></string>

    <!-- Whether to enable fp unlock when screen turns off on udfps devices -->
    <bool name="config_screen_off_udfps_enabled">false</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -5639,4 +5639,7 @@

  <!-- Forensic backup transport -->
  <java-symbol type="string" name="config_forensicBackupTransport" />

  <!-- Fingerprint screen off unlock config -->
  <java-symbol type="bool" name="config_screen_off_udfps_enabled" />
</resources>
+3 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.doze;

import static android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT;
import static android.hardware.biometrics.Flags.screenOffUnlockUdfps;

import static com.android.systemui.doze.DozeLog.REASON_SENSOR_QUICK_PICKUP;
import static com.android.systemui.doze.DozeLog.REASON_SENSOR_UDFPS_LONG_PRESS;
@@ -248,8 +249,8 @@ public class DozeSensors {
                        true /* touchscreen */,
                        false /* ignoresSetting */,
                        dozeParameters.longPressUsesProx(),
                        false /* immediatelyReRegister */,
                        true /* requiresAod */
                        screenOffUnlockUdfps() /* immediatelyReRegister */,
                        !screenOffUnlockUdfps() /* requiresAod */
                ),
                new PluginSensor(
                        new SensorManagerPlugin.Sensor(TYPE_WAKE_DISPLAY),
Loading