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

Commit 8907ec03 authored by Manuel Auer's avatar Manuel Auer Committed by Alexander Hofbauer
Browse files

Add option for MVNO roaming fix.

Making commit bc097e94 switchable.
Fix MVNO roaming setting, move to Secure.
For national roaming only consider MCC, previous version didn't work on Motorola Milestone

Change-Id: I721426c586093b8fde2cbc3a5a5e7a5562e98f9d
parent 5980e5d8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4092,6 +4092,12 @@ public final class Settings {
         */
        public static final String LOCKSCREEN_GESTURES_DISABLE_UNLOCK = "lockscreen_gestures_disable_unlock";

        /**
         * Virtual network roaming
         * @hide
         */
        public static final String MVNO_ROAMING = "button_mvno_roaming_key";

        /**
         * @hide
         */
+9 −2
Original line number Diff line number Diff line
@@ -1298,7 +1298,14 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
     * @return true for roaming state set
     */
    private boolean isRoamingBetweenOperators(boolean gsmRoaming, ServiceState s) {
        String spn = SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_ALPHA, "empty");

        boolean mvnoRoaming = Settings.System.getInt(
                phone.getContext().getContentResolver(),
                Settings.Secure.MVNO_ROAMING, 0) == 1;

        String spn;

        spn = SystemProperties.get(TelephonyProperties.PROPERTY_ICC_OPERATOR_ALPHA, "empty");

        String onsl = s.getOperatorAlphaLong();
        String onss = s.getOperatorAlphaShort();
@@ -1317,7 +1324,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
        } catch (Exception e){
        }

        return gsmRoaming && !(equalsMcc && (equalsOnsl || equalsOnss));
        return gsmRoaming && !(equalsMcc && (equalsOnsl || equalsOnss || mvnoRoaming));
    }

    private static int twoDigitsAt(String s, int offset) {