Merge "Fix NPE for ConfigureNotificationSettings" into sc-dev
This commit is contained in:
@@ -127,20 +127,23 @@ public class ConfigureNotificationSettings extends DashboardFragment implements
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle icicle) {
|
public void onCreate(Bundle icicle) {
|
||||||
super.onCreate(icicle);
|
super.onCreate(icicle);
|
||||||
final PreferenceScreen screen = getPreferenceScreen();
|
// TODO(b/182237530): This method should be removed when this flag is deprecated.
|
||||||
final Bundle arguments = getArguments();
|
if (!FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.SILKY_HOME)) {
|
||||||
|
final PreferenceScreen screen = getPreferenceScreen();
|
||||||
|
final Bundle arguments = getArguments();
|
||||||
|
|
||||||
if (screen == null) {
|
if (screen == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (arguments != null) {
|
if (arguments != null) {
|
||||||
final String highlightKey = arguments.getString(EXTRA_FRAGMENT_ARG_KEY);
|
final String highlightKey = arguments.getString(EXTRA_FRAGMENT_ARG_KEY);
|
||||||
if (!TextUtils.isEmpty(highlightKey)) {
|
if (!TextUtils.isEmpty(highlightKey)) {
|
||||||
final PreferenceCategory advancedCategory =
|
final PreferenceCategory advancedCategory =
|
||||||
screen.findPreference(KEY_ADVANCED_CATEGORY);
|
screen.findPreference(KEY_ADVANCED_CATEGORY);
|
||||||
// Has highlight row - expand everything
|
// Has highlight row - expand everything
|
||||||
advancedCategory.setInitialExpandedChildrenCount(Integer.MAX_VALUE);
|
advancedCategory.setInitialExpandedChildrenCount(Integer.MAX_VALUE);
|
||||||
scrollToPreference(advancedCategory);
|
scrollToPreference(advancedCategory);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user