Settings: Show single-touch wakeup setting on rear & front fps devices
Not sure why Google assumed that showing this setting is only useful for devices with FP sensor built into a side-mounted power button. Change logic to preserve check for side mounted (really, power-button mounted) FP sensors, but allow any device which has a a rear or front mounted sensor to show the relevant setting; so users can toggle it. Bug: Enchilada (Oneplus 6, capacitive FP sensor on the back) no longer wakes & unlocks from screen-off with FP sensor touch after QPR3 merge. Test: Apply commit. "Touch to unlock anytime" setting is now visible; enabling once again allows one-touch wakeup-and-unlock-on-successful- FP-auth, does nothing with failed FP auth, while disabling toggle requires pressing power button to wake screen first before FP auth will unlock. Change-Id: I4d8204b5fed7d43baa93d6793e7280260ae404d6
This commit is contained in:
parent
d5606f0897
commit
727918bcc3
3 changed files with 24 additions and 13 deletions
|
|
@ -198,7 +198,16 @@ public class FingerprintSettings extends SubSettings {
|
|||
if (manager == null || !manager.isHardwareDetected()) {
|
||||
return null;
|
||||
}
|
||||
if (manager.isPowerbuttonFps() && context.getResources().getBoolean(
|
||||
List<FingerprintSensorPropertiesInternal> sensorProperties =
|
||||
manager.getSensorPropertiesInternal();
|
||||
boolean isUdfps = false;
|
||||
for (FingerprintSensorPropertiesInternal prop : sensorProperties) {
|
||||
if (prop.isAnyUdfpsType()) {
|
||||
isUdfps = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isUdfps && context.getResources().getBoolean(
|
||||
org.lineageos.platform.internal.R.bool.config_fingerprintWakeAndUnlock)) {
|
||||
controllers.add(
|
||||
new FingerprintUnlockCategoryController(
|
||||
|
|
@ -565,7 +574,7 @@ public class FingerprintSettings extends SubSettings {
|
|||
column2.mTitle = getText(
|
||||
R.string.security_fingerprint_disclaimer_lockscreen_disabled_2
|
||||
);
|
||||
if (isSfps() && mFingerprintWakeAndUnlock) {
|
||||
if (!isUdfps() && mFingerprintWakeAndUnlock) {
|
||||
column2.mLearnMoreOverrideText = getText(
|
||||
R.string.security_settings_fingerprint_settings_footer_learn_more);
|
||||
}
|
||||
|
|
@ -585,11 +594,15 @@ public class FingerprintSettings extends SubSettings {
|
|||
}
|
||||
|
||||
private boolean isUdfps() {
|
||||
mFingerprintManager = Utils.getFingerprintManagerOrNull(getActivity());
|
||||
if (mFingerprintManager != null) {
|
||||
mSensorProperties = mFingerprintManager.getSensorPropertiesInternal();
|
||||
for (FingerprintSensorPropertiesInternal prop : mSensorProperties) {
|
||||
if (prop.isAnyUdfpsType()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -663,7 +676,7 @@ public class FingerprintSettings extends SubSettings {
|
|||
// This needs to be after setting ids, otherwise
|
||||
// |mRequireScreenOnToAuthPreferenceController.isChecked| is always checking the primary
|
||||
// user instead of the user with |mUserId|.
|
||||
if ((isSfps() && mFingerprintWakeAndUnlock) ||
|
||||
if ((!isUdfps() && mFingerprintWakeAndUnlock) ||
|
||||
(screenOffUnlockUdfps() && isUltrasnoicUdfps())) {
|
||||
scrollToPreference(fpPrefKey);
|
||||
addFingerprintUnlockCategory();
|
||||
|
|
@ -714,7 +727,7 @@ public class FingerprintSettings extends SubSettings {
|
|||
|
||||
private void addFingerprintUnlockCategory() {
|
||||
mFingerprintUnlockCategory = findPreference(KEY_FINGERPRINT_UNLOCK_CATEGORY);
|
||||
if (isSfps() && mFingerprintWakeAndUnlock) {
|
||||
if (!isUdfps() && mFingerprintWakeAndUnlock) {
|
||||
// For both SFPS "screen on to auth" and "rest to unlock"
|
||||
final Preference restToUnlockPreference = FeatureFactory.getFeatureFactory()
|
||||
.getFingerprintFeatureProvider()
|
||||
|
|
@ -781,7 +794,7 @@ public class FingerprintSettings extends SubSettings {
|
|||
|
||||
private void updatePreferencesAfterFingerprintRemoved() {
|
||||
updateAddPreference();
|
||||
if ((isSfps() && mFingerprintWakeAndUnlock) ||
|
||||
if ((!isUdfps() && mFingerprintWakeAndUnlock) ||
|
||||
(screenOffUnlockUdfps() && isUltrasnoicUdfps())) {
|
||||
updateFingerprintUnlockCategoryVisibility();
|
||||
}
|
||||
|
|
@ -1014,7 +1027,7 @@ public class FingerprintSettings extends SubSettings {
|
|||
private List<AbstractPreferenceController> buildPreferenceControllers(Context context) {
|
||||
final List<AbstractPreferenceController> controllers =
|
||||
createThePreferenceControllers(context);
|
||||
if (isSfps() && context.getResources().getBoolean(
|
||||
if (!isUdfps() && context.getResources().getBoolean(
|
||||
org.lineageos.platform.internal.R.bool.config_fingerprintWakeAndUnlock)) {
|
||||
for (AbstractPreferenceController controller : controllers) {
|
||||
if (controller.getPreferenceKey() == KEY_FINGERPRINT_UNLOCK_CATEGORY) {
|
||||
|
|
|
|||
|
|
@ -96,8 +96,7 @@ public class FingerprintSettingsRequireScreenOnToAuthPreferenceController
|
|||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
if (mFingerprintManager != null
|
||||
&& mFingerprintManager.isHardwareDetected()
|
||||
&& mFingerprintManager.isPowerbuttonFps()) {
|
||||
&& mFingerprintManager.isHardwareDetected()) {
|
||||
return mFingerprintManager.hasEnrolledTemplates(getUserId())
|
||||
? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -43,8 +43,7 @@ public class FingerprintUnlockCategoryController extends BasePreferenceControlle
|
|||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
if (mFingerprintManager != null
|
||||
&& mFingerprintManager.isHardwareDetected()
|
||||
&& (mFingerprintManager.isPowerbuttonFps() || screenOffUnlockUdfps())) {
|
||||
&& mFingerprintManager.isHardwareDetected()) {
|
||||
return mFingerprintManager.hasEnrolledTemplates(getUserId())
|
||||
? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue