Merge "Disallow MobileNetworkSettings on secondary user"
am: c4a4058d3d
Change-Id: I436790a24841d70329ead05f0edc8f21cf9a3a5f
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 7a851de..5909f03 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -627,12 +627,6 @@
bindNetworkQueryService();
- if (mUm.hasUserRestriction(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS)) {
- mUnavailable = true;
- activity.setContentView(R.layout.telephony_disallowed_preference_screen);
- return;
- }
-
addPreferencesFromResource(R.xml.network_setting_fragment);
mButton4glte = (SwitchPreference)findPreference(BUTTON_4G_LTE_KEY);
@@ -693,7 +687,13 @@
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- initializeSubscriptions();
+ if (mUm.hasUserRestriction(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS)
+ || !mUm.isSystemUser()) {
+ mUnavailable = true;
+ getActivity().setContentView(R.layout.telephony_disallowed_preference_screen);
+ } else {
+ initializeSubscriptions();
+ }
}
private class PhoneChangeReceiver extends BroadcastReceiver {