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

Commit 9d14b037 authored by Aleksander Morgado's avatar Aleksander Morgado
Browse files

Use isMobileDataCapable/isVoiceCapable helpers in network/telephony settings/utils

Instead of relying exclusively on the config_show_sim_info config
option to disable telephony support, use both isMobileDataCapable()
and isVoiceCapable() helper methods to check for the telephony support
on runtime, based on the TelephonyManager capabilities.

Bug: 395714454
Test: mm && atest tests/spa_unit/src/com/android/settings/network/telephony/
Flag: EXEMPT bugfix
Change-Id: I1dc5c8fa93dea18f7f456212613200db3802253e
parent 55343192
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme

    @Override
    protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
        if (!SubscriptionUtil.isSimHardwareVisible(context)) {
        if (!Utils.isMobileDataCapable(context) && !Utils.isVoiceCapable(context)) {
            finish();
            return Arrays.asList();
        }
+1 −1
Original line number Diff line number Diff line
@@ -732,7 +732,7 @@ public class MobileNetworkUtils {
    }

    public static void launchMobileNetworkSettings(Context context, SubscriptionInfo info) {
        if (!SubscriptionUtil.isSimHardwareVisible(context)) {
        if (!Utils.isMobileDataCapable(context) && !Utils.isVoiceCapable(context)) {
            Log.e(TAG, "launchMobileNetworkSettings fail, device without such UI.");
            return;
        }