Merge "Prevent NPE on deleting fingerprint in Settings" into udc-dev am: 8b36777419
am: 7771d0eab0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22911556 Change-Id: I70f7354d948a6e9cda23a301117b31ac39b0ed1d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -283,7 +283,9 @@ public class FingerprintSettings extends SubSettings {
|
||||
case MSG_REFRESH_FINGERPRINT_TEMPLATES:
|
||||
removeFingerprintPreference(msg.arg1);
|
||||
updateAddPreference();
|
||||
if (isSfps()) {
|
||||
updateFingerprintUnlockCategoryVisibility();
|
||||
}
|
||||
updatePreferences();
|
||||
break;
|
||||
case MSG_FINGER_AUTH_SUCCESS:
|
||||
@@ -494,11 +496,15 @@ public class FingerprintSettings extends SubSettings {
|
||||
}
|
||||
|
||||
private boolean isSfps() {
|
||||
mFingerprintManager = Utils.getFingerprintManagerOrNull(getActivity());
|
||||
if (mFingerprintManager != null) {
|
||||
mSensorProperties = mFingerprintManager.getSensorPropertiesInternal();
|
||||
for (FingerprintSensorPropertiesInternal prop : mSensorProperties) {
|
||||
if (prop.isAnySidefpsType()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -838,6 +844,7 @@ public class FingerprintSettings extends SubSettings {
|
||||
|
||||
private List<AbstractPreferenceController> buildPreferenceControllers(Context context) {
|
||||
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||
if (isSfps()) {
|
||||
mFingerprintUnlockCategoryPreferenceController =
|
||||
new FingerprintUnlockCategoryController(
|
||||
context,
|
||||
@@ -850,6 +857,7 @@ public class FingerprintSettings extends SubSettings {
|
||||
);
|
||||
controllers.add(mFingerprintUnlockCategoryPreferenceController);
|
||||
controllers.add(mRequireScreenOnToAuthPreferenceController);
|
||||
}
|
||||
return controllers;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user