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

Commit 7cfd6a5c 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:...

Merge "Prevent NPE on deleting fingerprint in Settings" into udc-dev am: 8b367774 am: 7771d0ea am: 8347708f

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22911556



Change-Id: I00a403958ccf831af9b1e7d39eeab9dd05096348
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents cfb5694a 8347708f
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;
        }