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

Commit 70983795 authored by Grace Jia's avatar Grace Jia
Browse files

Disable 'Mobile data' selection after removing SIM

Bug: 153895858
Test: Manually remove SIM and test
Change-Id: I5934b01c047172ae2269e77e2fe0945aacba4ca1
Exempt-From-Owner-Approval: Telephony settings
parent a7bf6a30
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -10893,6 +10893,9 @@
    <string name="mobile_data_settings_summary_auto_switch">
        Phone will automatically switch to this carrier when in range
    </string>
    <!-- Mobile network setting screen, summary of Mobile data switch preference when the network
         is unavailable, the preference selection will be disabled. [CHAR LIMIT=NONE] -->
    <string name="mobile_data_settings_summary_unavailable">No SIM card available</string>
    <!-- Mobile network settings screen, title of item showing the name of the default subscription
     that will be used for calls. This only appears in multi-SIM mode. [CHAR LIMIT=NONE] -->
+7 −0
Original line number Diff line number Diff line
@@ -128,6 +128,13 @@ public class MobileDataPreferenceController extends TelephonyTogglePreferenceCon
            preference.setEnabled(true);
            preference.setSummary(R.string.mobile_data_settings_summary);
        }

        if (mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
            preference.setSelectable(false);
            preference.setSummary(R.string.mobile_data_settings_summary_unavailable);
        } else {
            preference.setSelectable(true);
        }
    }

    private boolean isOpportunistic() {