Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6678ad6 authored by Tom Hsu's avatar Tom Hsu Committed by Android (Google) Code Review
Browse files

Merge "DISALLOW_CONFIG_MOBILE_NETWORKS for Mobile Network" into main

parents c64611f3 e7cc2791
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -241,6 +241,8 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
        if (mSubsGearPref == null) {
            mPreferenceGroup.removeAll();
            mSubsGearPref = new MutableGearPreference(mContext, null);
            mSubsGearPref
                    .checkRestrictionAndSetDisabled(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS);
            mSubsGearPref.setOnPreferenceClickListener(preference -> {
                connectCarrierNetwork();
                return true;
+5 −0
Original line number Diff line number Diff line
@@ -202,6 +202,11 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (isUiRestricted()) {
            Log.d(LOG_TAG, "Mobile network page is disallowed.");
            finish();
            return;
        }

        if (mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
            Log.d(LOG_TAG, "Invalid subId, get the default subscription to show.");
+5 −3
Original line number Diff line number Diff line
@@ -41,11 +41,13 @@ public class MutableGearPreference extends GearPreference {

    @Override
    public void setGearEnabled(boolean enabled) {
        boolean state = false;
        if (mGear != null) {
            mGear.setEnabled(enabled);
            mGear.setImageAlpha(enabled ? VALUE_ENABLED_ALPHA : mDisabledAlphaValue);
            state = enabled && !(isDisabledByAdmin() || isDisabledByEcm());
            mGear.setEnabled(state);
            mGear.setImageAlpha(state ? VALUE_ENABLED_ALPHA : mDisabledAlphaValue);
        }
        mGearState = enabled;
        mGearState = state;
    }

    @Override