DISALLOW_CONFIG_MOBILE_NETWORKS for Mobile Network
- Avoid intent start MobileNetworkSettings page - Avoid Mobile network preference show on screen Flag: EXEMPT bug fix Fix: 289232540 Test: Manual test. see b/289232540#28 Test: atest passed Change-Id: I25b75673fbc0758dc06ca15f890e5dee0ea1367f
This commit is contained in:
@@ -241,6 +241,8 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
|
|||||||
if (mSubsGearPref == null) {
|
if (mSubsGearPref == null) {
|
||||||
mPreferenceGroup.removeAll();
|
mPreferenceGroup.removeAll();
|
||||||
mSubsGearPref = new MutableGearPreference(mContext, null);
|
mSubsGearPref = new MutableGearPreference(mContext, null);
|
||||||
|
mSubsGearPref
|
||||||
|
.checkRestrictionAndSetDisabled(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS);
|
||||||
mSubsGearPref.setOnPreferenceClickListener(preference -> {
|
mSubsGearPref.setOnPreferenceClickListener(preference -> {
|
||||||
connectCarrierNetwork();
|
connectCarrierNetwork();
|
||||||
return true;
|
return true;
|
||||||
|
@@ -202,6 +202,11 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
|
|||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
|
if (isUiRestricted()) {
|
||||||
|
Log.d(LOG_TAG, "Mobile network page is disallowed.");
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
if (mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||||
Log.d(LOG_TAG, "Invalid subId, get the default subscription to show.");
|
Log.d(LOG_TAG, "Invalid subId, get the default subscription to show.");
|
||||||
|
@@ -41,11 +41,13 @@ public class MutableGearPreference extends GearPreference {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGearEnabled(boolean enabled) {
|
public void setGearEnabled(boolean enabled) {
|
||||||
|
boolean state = false;
|
||||||
if (mGear != null) {
|
if (mGear != null) {
|
||||||
mGear.setEnabled(enabled);
|
state = enabled && !(isDisabledByAdmin() || isDisabledByEcm());
|
||||||
mGear.setImageAlpha(enabled ? VALUE_ENABLED_ALPHA : mDisabledAlphaValue);
|
mGear.setEnabled(state);
|
||||||
|
mGear.setImageAlpha(state ? VALUE_ENABLED_ALPHA : mDisabledAlphaValue);
|
||||||
}
|
}
|
||||||
mGearState = enabled;
|
mGearState = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user