Dynamic Injection into PreferenceCategory
- Avoid NPE when groupkey is null Bug: 335592049 Change-Id: I810220d18e55351a280cff08b74b37130607168c Test: robotest & manual
This commit is contained in:
@@ -545,9 +545,13 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
|
|||||||
getActivity(), this, forceRoundedIcons, pref, tile, key,
|
getActivity(), this, forceRoundedIcons, pref, tile, key,
|
||||||
mPlaceholderPreferenceController.getOrder());
|
mPlaceholderPreferenceController.getOrder());
|
||||||
if (Flags.dynamicInjectionCategory()) {
|
if (Flags.dynamicInjectionCategory()) {
|
||||||
Preference group = screen.findPreference(tile.getGroupKey());
|
if (tile.hasGroupKey()) {
|
||||||
if (tile.hasGroupKey() && group instanceof PreferenceCategory) {
|
Preference group = screen.findPreference(tile.getGroupKey());
|
||||||
((PreferenceCategory) group).addPreference(pref);
|
if (group instanceof PreferenceCategory) {
|
||||||
|
((PreferenceCategory) group).addPreference(pref);
|
||||||
|
} else {
|
||||||
|
screen.addPreference(pref);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
screen.addPreference(pref);
|
screen.addPreference(pref);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user