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

Commit c52bd153 authored by Jayachandran C's avatar Jayachandran C
Browse files

Set CDMA data roaming based on TSB58 roaming indicator if voice is not in service

Existing implementation:
1. CDMA voiceRoaming is set based on regState and roaming indicator.
2. CDMA dataRoaming is set based on regState only.
3. CDMA dataRoaming is overwritten with voiceRoaming if voice is
   in service.

Issue:
If voice is not in service then the CDMA dataRoaming set based on
regState alone could be incorrect because it didn't use roaming
indicator from modem.

Fix:
This change sets CDMA dataRoaming based on TSB58 roaming indicator
(similar to setting voiceRoaming) if voice is not service.

Note: As per VoiceRegStateResult from radio types.hal the TSB58
roaming indicator shall be sent if device is registered on a
CDMA or EVDO system.

Test: Forced device to Evdo only and verified roaming state
Bug: 37917767
Change-Id: I3cc7fff61cea296afe17215a33b1b4c80972db13
parent 87056c26
Loading
Loading
Loading
Loading
+21 −6
Original line number Diff line number Diff line
@@ -1637,12 +1637,27 @@ public class ServiceStateTracker extends Handler {
                if (mIsSubscriptionFromRuim) {
                    mNewSS.setVoiceRoaming(isRoamingBetweenOperators(mNewSS.getVoiceRoaming(), mNewSS));
                }
                // For CDMA, voice and data should have the same roaming status
                /**
                 * For CDMA, voice and data should have the same roaming status.
                 * If voice is not in service, use TSB58 roaming indicator to set
                 * data roaming status. If TSB58 roaming indicator is not in the
                 * carrier-specified list of ERIs for home system then set roaming.
                 */
                final int dataRat = mNewSS.getRilDataRadioTechnology();
                if (ServiceState.isCdma(dataRat)) {
                    final boolean isVoiceInService =
                            (mNewSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE);
                final int dataRegType = mNewSS.getRilDataRadioTechnology();
                if (isVoiceInService && ServiceState.isCdma(dataRegType)) {
                    if (isVoiceInService) {
                        mNewSS.setDataRoaming(mNewSS.getVoiceRoaming());
                    } else {
                        /**
                         * As per VoiceRegStateResult from radio types.hal the TSB58
                         * Roaming Indicator shall be sent if device is registered
                         * on a CDMA or EVDO system.
                         */
                        mNewSS.setDataRoaming(
                                !isRoamIndForHomeSystem(Integer.toString(mRoamingIndicator)));
                    }
                }

                // Setting SS CdmaRoamingIndicator and CdmaDefaultRoamingIndicator