Added performant auth feature

Test: Manually verified in settings that the performant auth
feature(fingerprint) is disabled by default
Bug: 261216422
Bug: 265031172

Change-Id: I6422b12f801d038fa514758eca34efcbfdeef27a
This commit is contained in:
Joshua McCloskey
2023-01-10 22:36:30 +00:00
committed by Joshua Mccloskey
parent 988e1712a3
commit b8695b8e76
3 changed files with 17 additions and 12 deletions

View File

@@ -51,21 +51,26 @@ public class FingerprintSettingsRequireScreenOnToAuthPreferenceController
} else if (getRestrictingAdmin() != null) {
return false;
}
int defaultValue = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_requireScreenOnToAuthEnabled) ? 1 : 0;
return Settings.Secure.getIntForUser(
int toReturn = Settings.Secure.getIntForUser(
mContext.getContentResolver(),
Settings.Secure.SFPS_REQUIRE_SCREEN_ON_TO_AUTH_ENABLED,
defaultValue,
getUserHandle()) != 0;
Settings.Secure.SFPS_PERFORMANT_AUTH_ENABLED,
-1,
getUserHandle());
if (toReturn == -1) {
toReturn = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_requireScreenOnToAuthEnabled) ? 1 : 0;
Settings.Secure.putIntForUser(mContext.getContentResolver(),
Settings.Secure.SFPS_PERFORMANT_AUTH_ENABLED, toReturn, getUserHandle());
}
return toReturn == 1;
}
@Override
public boolean setChecked(boolean isChecked) {
Settings.Secure.putIntForUser(
mContext.getContentResolver(),
Settings.Secure.SFPS_REQUIRE_SCREEN_ON_TO_AUTH_ENABLED,
Settings.Secure.SFPS_PERFORMANT_AUTH_ENABLED,
isChecked ? 1 : 0,
getUserHandle());
return true;