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

Commit b08920ab authored by lbill's avatar lbill
Browse files

[Screen off unlock UDFPS] Settings integration 1/2

1. Add a settings key SCREEN_OFF_UNLOCK_UDFPS_ENABLED
2. Integrate the key to AmbientDisplayConfiguration.java

Bug: 373792870
Bug: 369939804
Bug: 369938501
Flag: android.hardware.biometrics.screen_off_unlock_udfps
Test: atest DozeSensorsTest
Test: adb shell settings put secure
      screen_off_unlock_udfps <1|0>
Change-Id: If3655a0492469d5048c87c0e032d678c2e764393
parent eeff0ad5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.hardware.display;

import static android.provider.Settings.Secure.SCREEN_OFF_UNLOCK_UDFPS_ENABLED;

import android.annotation.TestApi;
import android.content.Context;
import android.hardware.biometrics.Flags;
@@ -151,8 +153,8 @@ public class AmbientDisplayConfiguration {
    public boolean screenOffUdfpsEnabled(int user) {
        return !TextUtils.isEmpty(udfpsLongPressSensorType())
                && ((mScreenOffUdfpsEnabledByDefault && Flags.screenOffUnlockUdfps())
                ? boolSettingDefaultOn("screen_off_udfps_enabled", user)
                : boolSettingDefaultOff("screen_off_udfps_enabled", user));
                ? boolSettingDefaultOn(SCREEN_OFF_UNLOCK_UDFPS_ENABLED, user)
                : boolSettingDefaultOff(SCREEN_OFF_UNLOCK_UDFPS_ENABLED, user));
    }

    /** @hide */
+6 −0
Original line number Diff line number Diff line
@@ -11084,6 +11084,12 @@ public final class Settings {
         */
        public static final String SFPS_PERFORMANT_AUTH_ENABLED = "sfps_performant_auth_enabled_v2";
        /**
         * Whether or not the UDFPS device is enabling the screen off unlock settings.
         * @hide
         */
        public static final String SCREEN_OFF_UNLOCK_UDFPS_ENABLED = "screen_off_udfps_enabled";
        /**
         * Whether or not debugging is enabled.
         * @hide
+1 −0
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ public class SecureSettings {
        Settings.Secure.FINGERPRINT_SIDE_FPS_ENROLL_TAP_WINDOW,
        Settings.Secure.FINGERPRINT_SIDE_FPS_AUTH_DOWNTIME,
        Settings.Secure.SFPS_PERFORMANT_AUTH_ENABLED,
        Settings.Secure.SCREEN_OFF_UNLOCK_UDFPS_ENABLED,
        Settings.Secure.ACTIVE_UNLOCK_ON_WAKE,
        Settings.Secure.ACTIVE_UNLOCK_ON_UNLOCK_INTENT,
        Settings.Secure.ACTIVE_UNLOCK_ON_UNLOCK_INTENT_LEGACY,
+1 −0
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@ public class SecureSettingsValidators {
                NON_NEGATIVE_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.FINGERPRINT_SIDE_FPS_AUTH_DOWNTIME, NON_NEGATIVE_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.SFPS_PERFORMANT_AUTH_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.SCREEN_OFF_UNLOCK_UDFPS_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.SHOW_MEDIA_WHEN_BYPASSING, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.FACE_UNLOCK_APP_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION, BOOLEAN_VALIDATOR);