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

Commit a42a93bb authored by Jason Chiu's avatar Jason Chiu
Browse files

Fix some pages crash after importing AndroidX from build 5175906

- Settings crash while entering Storage, Privacy, and Accounts page,
  because PreferenceGroup changed the API use from String#equals to
  String#contentEquals which doesn't support null keys.
- add a null check before calling findPreference

Test: robotest
Change-Id: I121cd9e4249fbdafbc67be65a09d770603e01044
Fixes: 121116425
parent 45e9c560
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -295,7 +295,13 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
                if (!controller.isAvailable()) {
                    continue;
                }

                final String key = controller.getPreferenceKey();
                if (TextUtils.isEmpty(key)) {
                    Log.d(TAG, String.format("Preference key is %s in Controller %s",
                            key, controller.getClass().getSimpleName()));
                    continue;
                }

                final Preference preference = screen.findPreference(key);
                if (preference == null) {