Merge "Added changes for utilising a common feature flag"

This commit is contained in:
Bhavuk Jain
2023-02-06 14:05:07 +00:00
committed by Android (Google) Code Review
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);
}