Loading packages/SettingsLib/src/com/android/settingslib/Utils.java +6 −2 Original line number Diff line number Diff line package com.android.settingslib; import static android.telephony.ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN; import android.annotation.ColorInt; import android.content.Context; import android.content.Intent; Loading Loading @@ -429,12 +431,14 @@ public class Utils { // and do not support voice service, and on these SIM cards, we // want to show signal bars for data service as well as the "no // service" or "emergency calls only" text that indicates that voice // is not available. // is not available. Note that we ignore the IWLAN service state // because that state indicates the use of VoWIFI and not cell service int state = serviceState.getState(); int dataState = serviceState.getDataRegState(); if (state == ServiceState.STATE_OUT_OF_SERVICE || state == ServiceState.STATE_EMERGENCY_ONLY) { if (dataState == ServiceState.STATE_IN_SERVICE) { if (dataState == ServiceState.STATE_IN_SERVICE && serviceState.getDataNetworkType() != RIL_RADIO_TECHNOLOGY_IWLAN) { return ServiceState.STATE_IN_SERVICE; } } Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/UtilsTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,15 @@ public class UtilsTest { assertThat(Utils.isInService(mServiceState)).isTrue(); } @Test public void isInService_voiceOutOfServiceDataInServiceOnIwLan_returnFalse() { when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE); when(mServiceState.getDataNetworkType()) .thenReturn(ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN); when(mServiceState.getDataRegState()).thenReturn(ServiceState.STATE_IN_SERVICE); assertThat(Utils.isInService(mServiceState)).isFalse(); } @Test public void isInService_voiceOutOfServiceDataOutOfService_returnFalse() { when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE); Loading Loading
packages/SettingsLib/src/com/android/settingslib/Utils.java +6 −2 Original line number Diff line number Diff line package com.android.settingslib; import static android.telephony.ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN; import android.annotation.ColorInt; import android.content.Context; import android.content.Intent; Loading Loading @@ -429,12 +431,14 @@ public class Utils { // and do not support voice service, and on these SIM cards, we // want to show signal bars for data service as well as the "no // service" or "emergency calls only" text that indicates that voice // is not available. // is not available. Note that we ignore the IWLAN service state // because that state indicates the use of VoWIFI and not cell service int state = serviceState.getState(); int dataState = serviceState.getDataRegState(); if (state == ServiceState.STATE_OUT_OF_SERVICE || state == ServiceState.STATE_EMERGENCY_ONLY) { if (dataState == ServiceState.STATE_IN_SERVICE) { if (dataState == ServiceState.STATE_IN_SERVICE && serviceState.getDataNetworkType() != RIL_RADIO_TECHNOLOGY_IWLAN) { return ServiceState.STATE_IN_SERVICE; } } Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/UtilsTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,15 @@ public class UtilsTest { assertThat(Utils.isInService(mServiceState)).isTrue(); } @Test public void isInService_voiceOutOfServiceDataInServiceOnIwLan_returnFalse() { when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE); when(mServiceState.getDataNetworkType()) .thenReturn(ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN); when(mServiceState.getDataRegState()).thenReturn(ServiceState.STATE_IN_SERVICE); assertThat(Utils.isInService(mServiceState)).isFalse(); } @Test public void isInService_voiceOutOfServiceDataOutOfService_returnFalse() { when(mServiceState.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE); Loading