FingerprintSettings: Add proximity check awareness if supported
Fingerprint authentication when screen is off doesn't nativelly support checking the proximity sensor status to prevent accidental unlocks. However, some devices implement this feature, so account for that. The only thing really needed is just to adapt the descriptions shown to the users. Change-Id: I635f7b1a2970c0364b6cd22dfe20e69d009a3f91
This commit is contained in:
parent
26c986650e
commit
072a487b00
2 changed files with 11 additions and 0 deletions
|
|
@ -105,6 +105,10 @@
|
|||
<string name="fingerprint_enroll_touch_dialog_message_side" product="device">Touch the sensor on the side of your device.</string>
|
||||
<string name="fingerprint_enroll_touch_dialog_message_side" product="default">Touch the sensor on the side of your phone.</string>
|
||||
|
||||
<!-- Description for require screen on to auth toggle shown in fingerprint enrollment dialog once enrollment is completed.
|
||||
Only for devices that support checking proximity prior to allowing fingerprint unlock. -->
|
||||
<string name="security_settings_require_screen_on_to_auth_with_proximity_description">Touch the sensor to unlock, even when the screen is off. Proximity sensor prevents accidental unlocking.</string>
|
||||
|
||||
<!-- Navigation bar hint -->
|
||||
<string name="show_navbar_hint_title">Navigation hint</string>
|
||||
<string name="show_navbar_hint_summary">Show navigation hint bar at the bottom of the screen</string>
|
||||
|
|
|
|||
|
|
@ -298,6 +298,7 @@ public class FingerprintSettings extends SubSettings {
|
|||
private PreferenceCategory mFingerprintUnlockCategory;
|
||||
private PreferenceCategory mFingerprintUnlockFooter;
|
||||
private boolean mFingerprintWakeAndUnlock;
|
||||
private boolean mProximityCheckOnFingerprintUnlock;
|
||||
|
||||
private FingerprintManager mFingerprintManager;
|
||||
private FingerprintUpdater mFingerprintUpdater;
|
||||
|
|
@ -477,6 +478,8 @@ public class FingerprintSettings extends SubSettings {
|
|||
mSensorProperties = mFingerprintManager.getSensorPropertiesInternal();
|
||||
mFingerprintWakeAndUnlock = getContext().getResources().getBoolean(
|
||||
org.lineageos.platform.internal.R.bool.config_fingerprintWakeAndUnlock);
|
||||
mProximityCheckOnFingerprintUnlock = getContext().getResources().getBoolean(
|
||||
org.lineageos.platform.internal.R.bool.config_proximityCheckOnFpsUnlock);
|
||||
|
||||
mToken = getIntent().getByteArrayExtra(
|
||||
ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
|
||||
|
|
@ -789,6 +792,10 @@ public class FingerprintSettings extends SubSettings {
|
|||
mRequireScreenOnToAuthPreferenceController.setChecked(!isChecked);
|
||||
return true;
|
||||
});
|
||||
if (mProximityCheckOnFingerprintUnlock) {
|
||||
mRequireScreenOnToAuthPreference.setSummary(R.string.
|
||||
security_settings_require_screen_on_to_auth_with_proximity_description);
|
||||
}
|
||||
}
|
||||
|
||||
private void setupFingerprintUnlockCategoryPreferencesForScreenOffUnlock() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue