Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fdc38fe authored by Grace Cheng's avatar Grace Cheng Committed by Automerger Merge Worker
Browse files

Merge "Prevent NPE on deleting fingerprint in Settings" into udc-dev am: 8b367774 am: 9ae24317

parents 02206d21 9ae24317
Loading
Loading
Loading
Loading
+22 −14
Original line number Diff line number Diff line
@@ -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;
        }