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

Commit 2d500436 authored by Bhavuk Jain's avatar Bhavuk Jain
Browse files

Added changes for utilising a common feature flag

This CL aims at updating feature flag used for platform storage of PIN
length to make it the same as the one we use in Settings. This is to
make sure we use a single feature flag for Auto PIN Confirmation
feature.

Test: Tested by building and flashing on local. And modifying the
feature flag value using mobdog and checking if the PIN length is
getting stored or not.
Bug: b/262935308

Change-Id: I61304bb9e9518222267f7810d9b2509fcc02bc67
parent adfdad85
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
package com.android.internal.widget;

import static android.provider.DeviceConfig.NAMESPACE_AUTO_PIN_CONFIRMATION;

import android.annotation.NonNull;
import android.os.AsyncTask;
import android.provider.DeviceConfig;

import com.android.internal.widget.LockPatternUtils.RequestThrottledException;

@@ -120,8 +117,7 @@ public final class LockPatternChecker {
            @Override
            protected void onPostExecute(Boolean result) {
                callback.onChecked(result, mThrottleTimeout);
                if (DeviceConfig.getBoolean(NAMESPACE_AUTO_PIN_CONFIRMATION,
                        "enable_auto_pin_confirmation", false)) {
                if (LockPatternUtils.isAutoPinConfirmFeatureAvailable()) {
                    utils.setPinLength(userId, credentialCopy.size());
                }
                credentialCopy.zeroize();
+1 −1
Original line number Diff line number Diff line
@@ -681,7 +681,7 @@ public class LockPatternUtils {
     * @return true, if deviceConfig flag is set to true or the flag is not propagated and
     * defaultValue is true.
     */
    public boolean isAutoPinConfirmFeatureAvailable() {
    public static boolean isAutoPinConfirmFeatureAvailable() {
        return DeviceConfig.getBoolean(
                DeviceConfig.NAMESPACE_AUTO_PIN_CONFIRMATION,
                FLAG_ENABLE_AUTO_PIN_CONFIRMATION,
+1 −3
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import static android.content.Context.KEYGUARD_SERVICE;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.UserHandle.USER_ALL;
import static android.os.UserHandle.USER_SYSTEM;
import static android.provider.DeviceConfig.NAMESPACE_AUTO_PIN_CONFIRMATION;

import static com.android.internal.widget.LockPatternUtils.CREDENTIAL_TYPE_NONE;
import static com.android.internal.widget.LockPatternUtils.CREDENTIAL_TYPE_PASSWORD;
@@ -1729,8 +1728,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        if (newCredential.isPattern()) {
            setBoolean(LockPatternUtils.PATTERN_EVER_CHOSEN_KEY, true, userHandle);
        }
        if (DeviceConfig.getBoolean(NAMESPACE_AUTO_PIN_CONFIRMATION,
                "enable_auto_pin_confirmation", /* defaultValue= */ false)) {
        if (LockPatternUtils.isAutoPinConfirmFeatureAvailable()) {
            if (newCredential.isPin()) {
                setLong(LockPatternUtils.PIN_LENGTH, newCredential.size(), userHandle);
            }