Gate screen off unlock UDFPS until power optimitized
Flag: com.android.settings.flags.screen_off_unlock_power_optimization Test: atest SetupFingerprintEnrollFinishTest atest FingerprintSettingsUnlockCategoryControllerTest atest FingerprintSettingsScreenOffUnlockUdfpsPreferenceControllerTest Test: manual verify the function hide behind flag screen_off_unlock_power_optimization Bug: 368465560 Bug: 377635539 Change-Id: Icf3ff83b2a2717228b54ec03e3c27228bb1cad93
This commit is contained in:
@@ -15,3 +15,13 @@ flag {
|
|||||||
bug: "301226085"
|
bug: "301226085"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flag {
|
||||||
|
name: "screen_off_unlock_power_optimization"
|
||||||
|
namespace: "biometrics_integration"
|
||||||
|
description: "This flag controls Whether to gate fp unlock when screen turns off feature before AOC optimized"
|
||||||
|
bug: "368465560"
|
||||||
|
metadata {
|
||||||
|
purpose: PURPOSE_BUGFIX
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -27,6 +27,7 @@ import static com.android.settings.Utils.isPrivateProfile;
|
|||||||
import static com.android.settings.biometrics.BiometricEnrollBase.BIOMETRIC_AUTH_REQUEST;
|
import static com.android.settings.biometrics.BiometricEnrollBase.BIOMETRIC_AUTH_REQUEST;
|
||||||
import static com.android.settings.biometrics.BiometricEnrollBase.EXTRA_FROM_SETTINGS_SUMMARY;
|
import static com.android.settings.biometrics.BiometricEnrollBase.EXTRA_FROM_SETTINGS_SUMMARY;
|
||||||
import static com.android.settings.biometrics.BiometricEnrollBase.EXTRA_KEY_CHALLENGE;
|
import static com.android.settings.biometrics.BiometricEnrollBase.EXTRA_KEY_CHALLENGE;
|
||||||
|
import static com.android.settings.flags.Flags.screenOffUnlockPowerOptimization;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -600,6 +601,24 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isUltrasnoicUdfps() {
|
||||||
|
// b/368465560 Gate either ultrasonic or optical UDFPS if the power do not optimized
|
||||||
|
if (!screenOffUnlockPowerOptimization()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
mFingerprintManager = Utils.getFingerprintManagerOrNull(getActivity());
|
||||||
|
if (mFingerprintManager != null) {
|
||||||
|
mSensorProperties = mFingerprintManager.getSensorPropertiesInternal();
|
||||||
|
for (FingerprintSensorPropertiesInternal prop : mSensorProperties) {
|
||||||
|
if (prop.isUltrasonicUdfps()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
protected void removeFingerprintPreference(int fingerprintId) {
|
protected void removeFingerprintPreference(int fingerprintId) {
|
||||||
String name = genKey(fingerprintId);
|
String name = genKey(fingerprintId);
|
||||||
Log.e(TAG, "removeFingerprintPreference : " + fingerprintId);
|
Log.e(TAG, "removeFingerprintPreference : " + fingerprintId);
|
||||||
@@ -639,7 +658,7 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
// This needs to be after setting ids, otherwise
|
// This needs to be after setting ids, otherwise
|
||||||
// |mRequireScreenOnToAuthPreferenceController.isChecked| is always checking the primary
|
// |mRequireScreenOnToAuthPreferenceController.isChecked| is always checking the primary
|
||||||
// user instead of the user with |mUserId|.
|
// user instead of the user with |mUserId|.
|
||||||
if (isSfps() || screenOffUnlockUdfps()) {
|
if (isSfps() || (screenOffUnlockUdfps() && isUltrasnoicUdfps())) {
|
||||||
scrollToPreference(fpPrefKey);
|
scrollToPreference(fpPrefKey);
|
||||||
addFingerprintUnlockCategory();
|
addFingerprintUnlockCategory();
|
||||||
}
|
}
|
||||||
@@ -706,7 +725,7 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
restToUnlockPreference.getOnPreferenceChangeListener());
|
restToUnlockPreference.getOnPreferenceChangeListener());
|
||||||
}
|
}
|
||||||
setupFingerprintUnlockCategoryPreferencesForScreenOnToAuth();
|
setupFingerprintUnlockCategoryPreferencesForScreenOnToAuth();
|
||||||
} else if (screenOffUnlockUdfps()) {
|
} else if (screenOffUnlockUdfps() && isUltrasnoicUdfps()) {
|
||||||
setupFingerprintUnlockCategoryPreferencesForScreenOffUnlock();
|
setupFingerprintUnlockCategoryPreferencesForScreenOffUnlock();
|
||||||
}
|
}
|
||||||
updateFingerprintUnlockCategoryVisibility();
|
updateFingerprintUnlockCategoryVisibility();
|
||||||
@@ -754,7 +773,7 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
|
|
||||||
private void updatePreferencesAfterFingerprintRemoved() {
|
private void updatePreferencesAfterFingerprintRemoved() {
|
||||||
updateAddPreference();
|
updateAddPreference();
|
||||||
if (isSfps() || screenOffUnlockUdfps()) {
|
if (isSfps() || (screenOffUnlockUdfps() && isUltrasnoicUdfps())) {
|
||||||
updateFingerprintUnlockCategoryVisibility();
|
updateFingerprintUnlockCategoryVisibility();
|
||||||
}
|
}
|
||||||
updatePreferences();
|
updatePreferences();
|
||||||
@@ -998,7 +1017,7 @@ public class FingerprintSettings extends SubSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (screenOffUnlockUdfps()) {
|
} else if (screenOffUnlockUdfps() && isUltrasnoicUdfps()) {
|
||||||
for (AbstractPreferenceController controller : controllers) {
|
for (AbstractPreferenceController controller : controllers) {
|
||||||
if (controller.getPreferenceKey() == KEY_FINGERPRINT_UNLOCK_CATEGORY) {
|
if (controller.getPreferenceKey() == KEY_FINGERPRINT_UNLOCK_CATEGORY) {
|
||||||
mFingerprintUnlockCategoryPreferenceController =
|
mFingerprintUnlockCategoryPreferenceController =
|
||||||
|
Reference in New Issue
Block a user