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
This commit is contained in:
Bhavuk Jain
2023-02-06 10:39:56 +00:00
parent adfdad85e6
commit 2d500436f2
3 changed files with 3 additions and 9 deletions

View File

@@ -1,10 +1,7 @@
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();

View File

@@ -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,

View File

@@ -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);
}