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
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user