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

Commit ed26614b authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "ServiceState merges voice and data into a single value" am: 333ab184 am: 954842d5

Change-Id: If3c36bd971456bb9c6f113c703c3d00d9745374a
parents f95eaf5c 954842d5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -5226,7 +5226,7 @@ public class ServiceStateTracker extends Handler {
            if (currentServiceState.getVoiceRoaming()) {
                if (mPhone.isPhoneTypeGsm()) {
                    // check roaming type by MCC
                    if (inSameCountry(currentServiceState.getVoiceOperatorNumeric())) {
                    if (inSameCountry(currentServiceState.getOperatorNumeric())) {
                        currentServiceState.setVoiceRoamingType(
                                ServiceState.ROAMING_TYPE_DOMESTIC);
                    } else {
@@ -5250,7 +5250,7 @@ public class ServiceStateTracker extends Handler {
                        }
                    } else {
                        // check roaming type by MCC
                        if (inSameCountry(currentServiceState.getVoiceOperatorNumeric())) {
                        if (inSameCountry(currentServiceState.getOperatorNumeric())) {
                            currentServiceState.setVoiceRoamingType(
                                    ServiceState.ROAMING_TYPE_DOMESTIC);
                        } else {
@@ -5297,7 +5297,7 @@ public class ServiceStateTracker extends Handler {
                        }
                    } else {
                        // take it as 3GPP roaming
                        if (inSameCountry(currentServiceState.getDataOperatorNumeric())) {
                        if (inSameCountry(currentServiceState.getOperatorNumeric())) {
                            currentServiceState.setDataRoamingType(ServiceState.ROAMING_TYPE_DOMESTIC);
                        } else {
                            currentServiceState.setDataRoamingType(
+9 −20
Original line number Diff line number Diff line
@@ -903,31 +903,20 @@ public class TelephonyMetrics {
        ssProto.dataRoamingType = serviceState.getDataRoamingType();

        ssProto.voiceOperator = new TelephonyServiceState.TelephonyOperator();

        if (serviceState.getVoiceOperatorAlphaLong() != null) {
            ssProto.voiceOperator.alphaLong = serviceState.getVoiceOperatorAlphaLong();
        }

        if (serviceState.getVoiceOperatorAlphaShort() != null) {
            ssProto.voiceOperator.alphaShort = serviceState.getVoiceOperatorAlphaShort();
        }

        if (serviceState.getVoiceOperatorNumeric() != null) {
            ssProto.voiceOperator.numeric = serviceState.getVoiceOperatorNumeric();
        }

        ssProto.dataOperator = new TelephonyServiceState.TelephonyOperator();

        if (serviceState.getDataOperatorAlphaLong() != null) {
            ssProto.dataOperator.alphaLong = serviceState.getDataOperatorAlphaLong();
        if (serviceState.getOperatorAlphaLong() != null) {
            ssProto.voiceOperator.alphaLong = serviceState.getOperatorAlphaLong();
            ssProto.dataOperator.alphaLong = serviceState.getOperatorAlphaLong();
        }

        if (serviceState.getDataOperatorAlphaShort() != null) {
            ssProto.dataOperator.alphaShort = serviceState.getDataOperatorAlphaShort();
        if (serviceState.getOperatorAlphaShort() != null) {
            ssProto.voiceOperator.alphaShort = serviceState.getOperatorAlphaShort();
            ssProto.dataOperator.alphaShort = serviceState.getOperatorAlphaShort();
        }

        if (serviceState.getDataOperatorNumeric() != null) {
            ssProto.dataOperator.numeric = serviceState.getDataOperatorNumeric();
        if (serviceState.getOperatorNumeric() != null) {
            ssProto.voiceOperator.numeric = serviceState.getOperatorNumeric();
            ssProto.dataOperator.numeric = serviceState.getOperatorNumeric();
        }

        ssProto.voiceRat = serviceState.getRilVoiceRadioTechnology();
+5 −11
Original line number Diff line number Diff line
@@ -200,19 +200,13 @@ public class ServiceStateTest extends TestCase {
    public void testOperatorName() {
        ServiceState ss = new ServiceState();

        ss.setDataOperatorAlphaLong("abc");
        assertEquals("abc", ss.getDataOperatorAlphaLong());

        ss.setDataOperatorName("def", "xyz", "123456");
        assertEquals("xyz", ss.getDataOperatorAlphaShort());
        ss.setOperatorAlphaLong("abc");
        assertEquals("abc", ss.getOperatorAlphaLong());

        ss.setOperatorName("long", "short", "numeric");
        assertEquals("long", ss.getVoiceOperatorAlphaLong());
        assertEquals("short", ss.getVoiceOperatorAlphaShort());
        assertEquals("numeric", ss.getVoiceOperatorNumeric());
        assertEquals("long", ss.getDataOperatorAlphaLong());
        assertEquals("short", ss.getDataOperatorAlphaShort());
        assertEquals("numeric", ss.getDataOperatorNumeric());
        assertEquals("long", ss.getOperatorAlphaLong());
        assertEquals("short", ss.getOperatorAlphaShort());
        assertEquals("numeric", ss.getOperatorNumeric());
        assertEquals("long", ss.getOperatorAlpha());

        ss.setOperatorName("", "short", "");
+11 −14
Original line number Diff line number Diff line
@@ -113,12 +113,9 @@ public class TelephonyMetricsTest extends TelephonyTest {

        doReturn(ROAMING_TYPE_DOMESTIC).when(mServiceState).getVoiceRoamingType();
        doReturn(ROAMING_TYPE_DOMESTIC).when(mServiceState).getDataRoamingType();
        doReturn("voiceshort").when(mServiceState).getVoiceOperatorAlphaShort();
        doReturn("voicelong").when(mServiceState).getVoiceOperatorAlphaLong();
        doReturn("datashort").when(mServiceState).getDataOperatorAlphaShort();
        doReturn("datalong").when(mServiceState).getDataOperatorAlphaLong();
        doReturn("123456").when(mServiceState).getVoiceOperatorNumeric();
        doReturn("123456").when(mServiceState).getDataOperatorNumeric();
        doReturn("short").when(mServiceState).getOperatorAlphaShort();
        doReturn("long").when(mServiceState).getOperatorAlphaLong();
        doReturn("123456").when(mServiceState).getOperatorNumeric();
        doReturn(RIL_RADIO_TECHNOLOGY_LTE).when(mServiceState).getRilVoiceRadioTechnology();
        doReturn(RIL_RADIO_TECHNOLOGY_LTE).when(mServiceState).getRilDataRadioTechnology();
        doReturn(FREQUENCY_RANGE_UNKNOWN).when(mServiceState).getNrFrequencyRange();
@@ -708,15 +705,15 @@ public class TelephonyMetricsTest extends TelephonyTest {

        assertEquals(RoamingType.ROAMING_TYPE_DOMESTIC, state.dataRoamingType);

        assertEquals("voicelong", state.voiceOperator.alphaLong);
        assertEquals("long", state.voiceOperator.alphaLong);

        assertEquals("voiceshort", state.voiceOperator.alphaShort);
        assertEquals("short", state.voiceOperator.alphaShort);

        assertEquals("123456", state.voiceOperator.numeric);

        assertEquals("datalong", state.dataOperator.alphaLong);
        assertEquals("long", state.dataOperator.alphaLong);

        assertEquals("datashort", state.dataOperator.alphaShort);
        assertEquals("short", state.dataOperator.alphaShort);

        assertEquals("123456", state.dataOperator.numeric);

@@ -756,15 +753,15 @@ public class TelephonyMetricsTest extends TelephonyTest {

        assertEquals(RoamingType.ROAMING_TYPE_DOMESTIC, state.dataRoamingType);

        assertEquals("voicelong", state.voiceOperator.alphaLong);
        assertEquals("long", state.voiceOperator.alphaLong);

        assertEquals("voiceshort", state.voiceOperator.alphaShort);
        assertEquals("short", state.voiceOperator.alphaShort);

        assertEquals("123456", state.voiceOperator.numeric);

        assertEquals("datalong", state.dataOperator.alphaLong);
        assertEquals("long", state.dataOperator.alphaLong);

        assertEquals("datashort", state.dataOperator.alphaShort);
        assertEquals("short", state.dataOperator.alphaShort);

        assertEquals("123456", state.dataOperator.numeric);
    }