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

Commit 303ca319 authored by kaiyiz's avatar kaiyiz Committed by Xiaojing Zhang
Browse files

Settings: Hide SUPL apn for requirement

Some carriers require not to show SUPL type apn, so hide it in UI.

Change-Id: I4f640c824b3337aae4a8ad7d973238050d4fb9b3
parent f1f4499a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1368,4 +1368,8 @@
        <item>1</item>
        <item>2</item>
    </string-array>

    <string-array name="hidesupl_plmn_list">
        <item>46001</item>
    </string-array>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@
    <!-- Display additional System Update menu if true -->
    <bool name="config_additional_system_update_setting_enable">false</bool>

    <!-- Whether to hide SUPL apn for China Union -->
    <bool name="config_hidesupl_enable">false</bool>

    <!-- Whether the bluetooth activation confirmation dialogs should be auto dismissed.
         Can be overridden for specific product builds. -->
    <bool name="auto_confirm_bluetooth_activation_dialog">false</bool>
+15 −0
Original line number Diff line number Diff line
@@ -264,6 +264,21 @@ public class ApnSettings extends SettingsPreferenceFragment implements
        //remove the filtered items, no need to show in UI
        where += " and type <>\"" + APN_TYPE_FOTA + "\"";

        if (getResources().getBoolean(R.bool.config_hidesupl_enable)) {
            boolean needHideSupl = false;
            for (String plmn : getResources().getStringArray(R.array.hidesupl_plmn_list)) {
                if (plmn.equals(TelephonyManager.getDefault()
                           .getSimOperator(mSubId))) {
                    needHideSupl = true;
                    break;
                }
            }

            if (needHideSupl) {
                where += " and type <>\"" + PhoneConstants.APN_TYPE_SUPL + "\"";
            }
        }

        //Hide mms if config is true
        if(getResources().getBoolean(R.bool.config_mms_enable)) {
            where += " and type <>\"" + APN_TYPE_MMS + "\"" ;