Merge "Fix sketchy usage of new PreferenceScreen" into oc-dev

This commit is contained in:
TreeHugger Robot
2017-04-11 23:43:26 +00:00
committed by Android (Google) Code Review
3 changed files with 20 additions and 3 deletions

View File

@@ -184,8 +184,7 @@ public class ApnSettings extends RestrictedSettingsFragment implements
mUnavailable = isUiRestricted();
setHasOptionsMenu(!mUnavailable);
if (mUnavailable) {
setPreferenceScreen(new PreferenceScreen(getPrefContext(), null));
getPreferenceScreen().removeAll();
addPreferencesFromResource(R.xml.empty_settings);
return;
}

View File

@@ -396,7 +396,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
// Block access to developer options if the user is not the owner, if user policy
// restricts it, or if the device has not been provisioned
mUnavailable = true;
setPreferenceScreen(new PreferenceScreen(getPrefContext(), null));
addPreferencesFromResource(R.xml.empty_settings);
return;
}