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

Commit fb36cdca authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Vineeta Srivastava
Browse files

Fix isSameNamedOperatorConsideredRoaming [DO NOT MERGE]

Does a loop checking data based on your current network,
but exits out based on the result of the first check rather
than doing the rest of the checks.

Bug: 11408729
Bug: 12121959
Change-Id: I37f98682702ec19467f374d64a23e15fb87e9697
parent 7af882af
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -1361,13 +1361,15 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
        String[] numericArray = mPhone.getContext().getResources().getStringArray(
                    com.android.internal.R.array.config_operatorConsideredNonRoaming);

        if (numericArray.length == 0 || operatorNumeric == null)
        if (numericArray.length == 0 || operatorNumeric == null) {
            return false;
        }

        for (String numeric : numericArray) {
            if (operatorNumeric.startsWith(numeric))
            if (operatorNumeric.startsWith(numeric)) {
                return true;
            }
        }
        return false;
    }

@@ -1376,14 +1378,14 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
        String[] numericArray = mPhone.getContext().getResources().getStringArray(
                    com.android.internal.R.array.config_sameNamedOperatorConsideredRoaming);

        if (numericArray.length == 0 || operatorNumeric == null)
        if (numericArray.length == 0 || operatorNumeric == null) {
            return false;
        }

        for (String numeric : numericArray) {
            if (operatorNumeric.startsWith(numeric))
            if (operatorNumeric.startsWith(numeric)) {
                return true;
            else
                return false;
            }
        }
        return false;
    }