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

Commit a23d86f4 authored by Sungmin Choi's avatar Sungmin Choi Committed by Vineeta Srivastava
Browse files

telephony: Fix roaming icon setting

Currently, if data roaming is true and gsm roaming is true,
roaming icon is always true.
But, in this case, roamin icon shoould depends on other condition,
i.e., same named operators or operator considered non-roaming.

Bug: 10642211
Change-Id: Ia98ffeec5dc013cf045b15c9a7c53c4a24f2eeb5
parent 2d973cc9
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -722,19 +722,24 @@ final class GsmServiceStateTracker extends ServiceStateTracker {

        if (mPollingContext[0] == 0) {
            /**
             *  Since the roaming states of gsm service (from +CREG) and
             * Since the roaming state of gsm service (from +CREG) and
             * data service (from +CGREG) could be different, the new SS
             *  is set roaming while either one is roaming.
             * is set to roaming when either is true.
             *
             *  There is an exception for the above rule. The new SS is not set
             *  as roaming while gsm service reports roaming but indeed it is
             *  not roaming between operators.
             * There are exceptions for the above rule.
             * The new SS is not set as roaming while gsm service reports
             * roaming but indeed it is same operator.
             * And the operator is considered non roaming.
             *
             *  And specific operators do not report roaming in national roaming
             * The test for the operators is to handle special roaming
             * agreements and MVNO's.
             */
            mNewSS.setRoaming(mDataRoaming
                    || (mGsmRoaming && !(isSameNamedOperators(mNewSS)
                            || isOperatorConsideredNonRoaming(mNewSS))));
            boolean roaming = (mGsmRoaming || mDataRoaming);
            if ((mGsmRoaming && isSameNamedOperators(mNewSS))
                    || isOperatorConsideredNonRoaming(mNewSS)) {
                roaming = false;
            }
            mNewSS.setRoaming(roaming);
            mNewSS.setEmergencyOnly(mEmergencyOnly);
            pollStateDone();
        }