Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 1 | package com.android.systemui.statusbar.policy; |
| 2 | |
Hall Liu | 5a95a70 | 2020-01-06 19:04:10 -0800 | [diff] [blame] | 3 | import static android.telephony.AccessNetworkConstants.TRANSPORT_TYPE_WWAN; |
| 4 | import static android.telephony.NetworkRegistrationInfo.DOMAIN_PS; |
| 5 | |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 6 | import static org.junit.Assert.assertFalse; |
| 7 | import static org.junit.Assert.assertTrue; |
Jason Monk | 0288de0 | 2017-02-23 14:48:05 -0500 | [diff] [blame] | 8 | import static org.mockito.Matchers.anyInt; |
Pengquan Meng | a62d32b | 2018-12-06 17:38:38 -0800 | [diff] [blame] | 9 | import static org.mockito.Mockito.doReturn; |
Jason Monk | 9c7844c | 2017-01-18 15:21:53 -0500 | [diff] [blame] | 10 | import static org.mockito.Mockito.mock; |
Jason Monk | 0288de0 | 2017-02-23 14:48:05 -0500 | [diff] [blame] | 11 | import static org.mockito.Mockito.when; |
Jason Monk | 9c7844c | 2017-01-18 15:21:53 -0500 | [diff] [blame] | 12 | |
Jason Monk | fd57ea7 | 2016-04-29 13:37:58 -0400 | [diff] [blame] | 13 | import android.net.NetworkCapabilities; |
Jason Monk | 07b75fe | 2015-05-14 16:47:03 -0400 | [diff] [blame] | 14 | import android.os.Looper; |
Jack Yu | e27d3fd | 2019-03-15 14:49:53 -0700 | [diff] [blame] | 15 | import android.telephony.NetworkRegistrationInfo; |
Pengquan Meng | a62d32b | 2018-12-06 17:38:38 -0800 | [diff] [blame] | 16 | import android.telephony.ServiceState; |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 17 | import android.telephony.TelephonyManager; |
Jason Monk | e427cb8 | 2015-07-28 09:18:08 -0400 | [diff] [blame] | 18 | import android.test.suitebuilder.annotation.SmallTest; |
Jason Monk | 2515f47 | 2017-09-19 09:52:43 -0400 | [diff] [blame] | 19 | import android.testing.AndroidTestingRunner; |
| 20 | import android.testing.TestableLooper; |
| 21 | import android.testing.TestableLooper.RunWithLooper; |
Jason Monk | 0288de0 | 2017-02-23 14:48:05 -0500 | [diff] [blame] | 22 | |
Jason Monk | f668d7c | 2016-01-14 10:38:41 -0500 | [diff] [blame] | 23 | import com.android.settingslib.net.DataUsageController; |
Jason Monk | 0288de0 | 2017-02-23 14:48:05 -0500 | [diff] [blame] | 24 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 25 | import org.junit.Test; |
| 26 | import org.junit.runner.RunWith; |
Pengquan Meng | a62d32b | 2018-12-06 17:38:38 -0800 | [diff] [blame] | 27 | import org.mockito.Mockito; |
Jason Monk | 33f8ae7 | 2015-05-08 10:45:15 -0400 | [diff] [blame] | 28 | |
Jason Monk | e427cb8 | 2015-07-28 09:18:08 -0400 | [diff] [blame] | 29 | @SmallTest |
Jason Monk | 2515f47 | 2017-09-19 09:52:43 -0400 | [diff] [blame] | 30 | @RunWith(AndroidTestingRunner.class) |
| 31 | @RunWithLooper |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 32 | public class NetworkControllerDataTest extends NetworkControllerBaseTest { |
| 33 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 34 | @Test |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 35 | public void test3gDataIcon() { |
| 36 | setupDefaultSignal(); |
| 37 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 38 | verifyDataIndicators(TelephonyIcons.ICON_3G); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 39 | } |
| 40 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 41 | @Test |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 42 | public void test2gDataIcon() { |
| 43 | setupDefaultSignal(); |
| 44 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 45 | TelephonyManager.NETWORK_TYPE_GSM); |
| 46 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 47 | verifyDataIndicators(TelephonyIcons.ICON_G); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 48 | } |
| 49 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 50 | @Test |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 51 | public void testCdmaDataIcon() { |
| 52 | setupDefaultSignal(); |
| 53 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 54 | TelephonyManager.NETWORK_TYPE_CDMA); |
| 55 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 56 | verifyDataIndicators(TelephonyIcons.ICON_1X); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 57 | } |
| 58 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 59 | @Test |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 60 | public void testEdgeDataIcon() { |
| 61 | setupDefaultSignal(); |
| 62 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 63 | TelephonyManager.NETWORK_TYPE_EDGE); |
| 64 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 65 | verifyDataIndicators(TelephonyIcons.ICON_E); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 66 | } |
| 67 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 68 | @Test |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 69 | public void testLteDataIcon() { |
| 70 | setupDefaultSignal(); |
| 71 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 72 | TelephonyManager.NETWORK_TYPE_LTE); |
| 73 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 74 | verifyDataIndicators(TelephonyIcons.ICON_LTE); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 75 | } |
| 76 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 77 | @Test |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 78 | public void testHspaDataIcon() { |
| 79 | setupDefaultSignal(); |
| 80 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 81 | TelephonyManager.NETWORK_TYPE_HSPA); |
| 82 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 83 | verifyDataIndicators(TelephonyIcons.ICON_H); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 84 | } |
| 85 | |
Amin Shaikh | f5830ca | 2018-03-09 14:06:50 -0500 | [diff] [blame] | 86 | |
| 87 | @Test |
| 88 | public void testHspaPlusDataIcon() { |
| 89 | setupDefaultSignal(); |
| 90 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 91 | TelephonyManager.NETWORK_TYPE_HSPAP); |
| 92 | |
| 93 | verifyDataIndicators(TelephonyIcons.ICON_H_PLUS); |
| 94 | } |
| 95 | |
| 96 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 97 | @Test |
Jason Monk | 7150d7f | 2015-07-09 10:14:12 -0400 | [diff] [blame] | 98 | public void testWfcNoDataIcon() { |
| 99 | setupDefaultSignal(); |
| 100 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 101 | TelephonyManager.NETWORK_TYPE_IWLAN); |
| 102 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 103 | verifyDataIndicators(0); |
Jason Monk | 7150d7f | 2015-07-09 10:14:12 -0400 | [diff] [blame] | 104 | } |
| 105 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 106 | @Test |
Jason Monk | 3aaabd7 | 2014-12-12 11:11:44 -0500 | [diff] [blame] | 107 | public void test4gDataIcon() { |
| 108 | // Switch to showing 4g icon and re-initialize the NetworkController. |
| 109 | mConfig.show4gForLte = true; |
Sundeep Ghuman | 9d10a3c | 2017-06-16 00:05:16 +0000 | [diff] [blame] | 110 | mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm, mMockSm, |
Jason Monk | 07b75fe | 2015-05-14 16:47:03 -0400 | [diff] [blame] | 111 | mConfig, Looper.getMainLooper(), mCallbackHandler, |
Jason Monk | 9c7844c | 2017-01-18 15:21:53 -0500 | [diff] [blame] | 112 | mock(AccessPointControllerImpl.class), |
| 113 | mock(DataUsageController.class), mMockSubDefaults, |
Fabian Kozynski | 5ca7a51 | 2019-10-16 19:56:11 +0000 | [diff] [blame] | 114 | mock(DeviceProvisionedController.class), mMockBd); |
Jason Monk | 3aaabd7 | 2014-12-12 11:11:44 -0500 | [diff] [blame] | 115 | setupNetworkController(); |
| 116 | |
| 117 | setupDefaultSignal(); |
| 118 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 119 | TelephonyManager.NETWORK_TYPE_LTE); |
| 120 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 121 | verifyDataIndicators(TelephonyIcons.ICON_4G); |
Jason Monk | 3aaabd7 | 2014-12-12 11:11:44 -0500 | [diff] [blame] | 122 | } |
| 123 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 124 | @Test |
Fabian Kozynski | c7bc84b | 2019-03-11 13:57:31 -0400 | [diff] [blame] | 125 | public void testNoInternetIcon_withDefaultSub() { |
Amin Shaikh | af4c193 | 2018-03-08 10:29:56 -0500 | [diff] [blame] | 126 | setupNetworkController(); |
Shuo Qian | 2914158 | 2020-01-02 15:18:01 -0800 | [diff] [blame] | 127 | when(mMockTm.isDataConnectionEnabled()).thenReturn(false); |
Amin Shaikh | af4c193 | 2018-03-08 10:29:56 -0500 | [diff] [blame] | 128 | setupDefaultSignal(); |
| 129 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, 0); |
Anarghya Mitra | 678722f | 2018-05-11 14:29:54 -0700 | [diff] [blame] | 130 | setConnectivityViaBroadcast(NetworkCapabilities.TRANSPORT_CELLULAR, false, false); |
Amin Shaikh | af4c193 | 2018-03-08 10:29:56 -0500 | [diff] [blame] | 131 | |
| 132 | // Verify that a SignalDrawable with a cut out is used to display data disabled. |
| 133 | verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, 0, |
| 134 | true, DEFAULT_QS_SIGNAL_STRENGTH, 0, false, |
Fabian Kozynski | c7bc84b | 2019-03-11 13:57:31 -0400 | [diff] [blame] | 135 | false, true, NO_DATA_STRING); |
Amin Shaikh | af4c193 | 2018-03-08 10:29:56 -0500 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | @Test |
Fabian Kozynski | c7bc84b | 2019-03-11 13:57:31 -0400 | [diff] [blame] | 139 | public void testDataDisabledIcon_withDefaultSub() { |
Jason Monk | fd57ea7 | 2016-04-29 13:37:58 -0400 | [diff] [blame] | 140 | setupNetworkController(); |
Shuo Qian | 2914158 | 2020-01-02 15:18:01 -0800 | [diff] [blame] | 141 | when(mMockTm.isDataConnectionEnabled()).thenReturn(false); |
Jason Monk | fd57ea7 | 2016-04-29 13:37:58 -0400 | [diff] [blame] | 142 | setupDefaultSignal(); |
| 143 | updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, 0); |
Anarghya Mitra | 678722f | 2018-05-11 14:29:54 -0700 | [diff] [blame] | 144 | setConnectivityViaBroadcast(NetworkCapabilities.TRANSPORT_CELLULAR, false, false); |
Jason Monk | fd57ea7 | 2016-04-29 13:37:58 -0400 | [diff] [blame] | 145 | |
Amin Shaikh | af4c193 | 2018-03-08 10:29:56 -0500 | [diff] [blame] | 146 | // Verify that a SignalDrawable with a cut out is used to display data disabled. |
| 147 | verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, 0, |
| 148 | true, DEFAULT_QS_SIGNAL_STRENGTH, 0, false, |
Fabian Kozynski | c7bc84b | 2019-03-11 13:57:31 -0400 | [diff] [blame] | 149 | false, true, NO_DATA_STRING); |
| 150 | } |
| 151 | |
| 152 | @Test |
Evan Laird | 2ea99c1 | 2019-09-19 16:52:58 -0400 | [diff] [blame] | 153 | public void testNonDefaultSIM_showsFullSignal_connected() { |
Fabian Kozynski | c7bc84b | 2019-03-11 13:57:31 -0400 | [diff] [blame] | 154 | setupNetworkController(); |
Shuo Qian | 2914158 | 2020-01-02 15:18:01 -0800 | [diff] [blame] | 155 | when(mMockTm.isDataConnectionEnabled()).thenReturn(false); |
Fabian Kozynski | c7bc84b | 2019-03-11 13:57:31 -0400 | [diff] [blame] | 156 | setupDefaultSignal(); |
| 157 | setDefaultSubId(mSubId + 1); |
| 158 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, 0); |
| 159 | setConnectivityViaBroadcast(NetworkCapabilities.TRANSPORT_CELLULAR, false, false); |
| 160 | |
| 161 | // Verify that a SignalDrawable with a cut out is used to display data disabled. |
| 162 | verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, 0, |
| 163 | true, DEFAULT_QS_SIGNAL_STRENGTH, 0, false, |
Evan Laird | 2ea99c1 | 2019-09-19 16:52:58 -0400 | [diff] [blame] | 164 | false, false, NOT_DEFAULT_DATA_STRING); |
Fabian Kozynski | c7bc84b | 2019-03-11 13:57:31 -0400 | [diff] [blame] | 165 | } |
| 166 | |
| 167 | @Test |
Evan Laird | 2ea99c1 | 2019-09-19 16:52:58 -0400 | [diff] [blame] | 168 | public void testNonDefaultSIM_showsFullSignal_disconnected() { |
Fabian Kozynski | c7bc84b | 2019-03-11 13:57:31 -0400 | [diff] [blame] | 169 | setupNetworkController(); |
Shuo Qian | 2914158 | 2020-01-02 15:18:01 -0800 | [diff] [blame] | 170 | when(mMockTm.isDataConnectionEnabled()).thenReturn(false); |
Fabian Kozynski | c7bc84b | 2019-03-11 13:57:31 -0400 | [diff] [blame] | 171 | setupDefaultSignal(); |
| 172 | setDefaultSubId(mSubId + 1); |
| 173 | updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, 0); |
| 174 | setConnectivityViaBroadcast(NetworkCapabilities.TRANSPORT_CELLULAR, false, false); |
| 175 | |
| 176 | // Verify that a SignalDrawable with a cut out is used to display data disabled. |
| 177 | verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, 0, |
| 178 | true, DEFAULT_QS_SIGNAL_STRENGTH, 0, false, |
Evan Laird | 2ea99c1 | 2019-09-19 16:52:58 -0400 | [diff] [blame] | 179 | false, false, NOT_DEFAULT_DATA_STRING); |
Jason Monk | fd57ea7 | 2016-04-29 13:37:58 -0400 | [diff] [blame] | 180 | } |
| 181 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 182 | @Test |
SongFerngWang | 52dada7 | 2019-08-14 16:59:29 +0800 | [diff] [blame] | 183 | public void testNr5GIcon_NrNotRestrictedRrcCon_show5GIcon() { |
| 184 | setupNr5GIconConfigurationForNotRestrictedRrcCon(); |
| 185 | setupDefaultSignal(); |
| 186 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 187 | TelephonyManager.NETWORK_TYPE_LTE); |
| 188 | updateDataActivity(TelephonyManager.DATA_ACTIVITY_INOUT); |
| 189 | ServiceState ss = Mockito.mock(ServiceState.class); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 190 | setNrState(ss, NetworkRegistrationInfo.NR_STATE_NOT_RESTRICTED); |
SongFerngWang | 52dada7 | 2019-08-14 16:59:29 +0800 | [diff] [blame] | 191 | mPhoneStateListener.onServiceStateChanged(ss); |
| 192 | |
| 193 | verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, TelephonyIcons.ICON_5G, |
| 194 | true, DEFAULT_QS_SIGNAL_STRENGTH, TelephonyIcons.ICON_5G, true, true); |
| 195 | } |
| 196 | |
| 197 | @Test |
| 198 | public void testNr5GIcon_NrNotRestrictedRrcIdle_show5GIcon() { |
| 199 | setupNr5GIconConfigurationForNotRestrictedRrcIdle(); |
| 200 | setupDefaultSignal(); |
| 201 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 202 | TelephonyManager.NETWORK_TYPE_LTE); |
| 203 | updateDataActivity(TelephonyManager.DATA_ACTIVITY_DORMANT); |
| 204 | ServiceState ss = Mockito.mock(ServiceState.class); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 205 | setNrState(ss, NetworkRegistrationInfo.NR_STATE_NOT_RESTRICTED); |
SongFerngWang | 52dada7 | 2019-08-14 16:59:29 +0800 | [diff] [blame] | 206 | mPhoneStateListener.onServiceStateChanged(ss); |
| 207 | |
| 208 | verifyDataIndicators(TelephonyIcons.ICON_5G); |
| 209 | } |
| 210 | |
| 211 | @Test |
Pengquan Meng | a62d32b | 2018-12-06 17:38:38 -0800 | [diff] [blame] | 212 | public void testNr5GIcon_NrConnectedWithoutMMWave_show5GIcon() { |
| 213 | setupDefaultNr5GIconConfiguration(); |
| 214 | setupDefaultSignal(); |
| 215 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 216 | TelephonyManager.NETWORK_TYPE_LTE); |
| 217 | ServiceState ss = Mockito.mock(ServiceState.class); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 218 | setNrState(ss, NetworkRegistrationInfo.NR_STATE_CONNECTED); |
Pengquan Meng | a62d32b | 2018-12-06 17:38:38 -0800 | [diff] [blame] | 219 | doReturn(ServiceState.FREQUENCY_RANGE_HIGH).when(ss).getNrFrequencyRange(); |
| 220 | mPhoneStateListener.onServiceStateChanged(ss); |
| 221 | |
| 222 | verifyDataIndicators(TelephonyIcons.ICON_5G); |
| 223 | } |
| 224 | |
| 225 | @Test |
| 226 | public void testNr5GIcon_NrConnectedWithMMWave_show5GPlusIcon() { |
| 227 | setupDefaultNr5GIconConfiguration(); |
| 228 | setupDefaultSignal(); |
| 229 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 230 | TelephonyManager.NETWORK_TYPE_LTE); |
| 231 | ServiceState ss = Mockito.mock(ServiceState.class); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 232 | setNrState(ss, NetworkRegistrationInfo.NR_STATE_CONNECTED); |
Pengquan Meng | a62d32b | 2018-12-06 17:38:38 -0800 | [diff] [blame] | 233 | doReturn(ServiceState.FREQUENCY_RANGE_MMWAVE).when(ss).getNrFrequencyRange(); |
| 234 | mPhoneStateListener.onServiceStateChanged(ss); |
| 235 | |
| 236 | verifyDataIndicators(TelephonyIcons.ICON_5G_PLUS); |
| 237 | } |
| 238 | |
| 239 | @Test |
| 240 | public void testNr5GIcon_NrRestricted_showLteIcon() { |
| 241 | setupDefaultNr5GIconConfiguration(); |
| 242 | setupDefaultSignal(); |
| 243 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 244 | TelephonyManager.NETWORK_TYPE_LTE); |
| 245 | ServiceState ss = Mockito.mock(ServiceState.class); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 246 | setNrState(ss, NetworkRegistrationInfo.NR_STATE_RESTRICTED); |
Pengquan Meng | a62d32b | 2018-12-06 17:38:38 -0800 | [diff] [blame] | 247 | mPhoneStateListener.onServiceStateChanged(mServiceState); |
| 248 | |
| 249 | verifyDataIndicators(TelephonyIcons.ICON_LTE); |
| 250 | } |
| 251 | |
| 252 | @Test |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 253 | public void testNr5GIcon_displayGracePeriodTime_enabled() { |
| 254 | setupDefaultNr5GIconConfiguration(); |
| 255 | setupDefaultNr5GIconDisplayGracePeriodTime_enableThirtySeconds(); |
| 256 | setupDefaultSignal(); |
| 257 | mNetworkController.handleConfigurationChanged(); |
| 258 | mPhoneStateListener.onServiceStateChanged(mServiceState); |
| 259 | |
| 260 | ServiceState ss = Mockito.mock(ServiceState.class); |
| 261 | // While nrIconDisplayGracePeriodMs > 0 & is Nr5G, mIsShowingIconGracefully should be true |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 262 | setNrState(ss, NetworkRegistrationInfo.NR_STATE_CONNECTED); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 263 | doReturn(ServiceState.FREQUENCY_RANGE_HIGH).when(ss).getNrFrequencyRange(); |
| 264 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 265 | TelephonyManager.NETWORK_TYPE_LTE); |
| 266 | mPhoneStateListener.onServiceStateChanged(ss); |
| 267 | |
| 268 | assertTrue(mConfig.nrIconDisplayGracePeriodMs > 0); |
| 269 | assertTrue(mMobileSignalController.mIsShowingIconGracefully); |
| 270 | } |
| 271 | |
| 272 | @Test |
| 273 | public void testNr5GIcon_displayGracePeriodTime_disabled() { |
| 274 | setupDefaultNr5GIconConfiguration(); |
| 275 | setupDefaultNr5GIconDisplayGracePeriodTime_disabled(); |
| 276 | setupDefaultSignal(); |
| 277 | |
| 278 | assertTrue(mConfig.nrIconDisplayGracePeriodMs == 0); |
| 279 | |
| 280 | // While nrIconDisplayGracePeriodMs <= 0, mIsShowingIconGracefully should be false |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 281 | setNrState(mServiceState, NetworkRegistrationInfo.NR_STATE_CONNECTED); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 282 | doReturn(ServiceState.FREQUENCY_RANGE_HIGH).when(mServiceState).getNrFrequencyRange(); |
| 283 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 284 | TelephonyManager.NETWORK_TYPE_LTE); |
| 285 | |
| 286 | assertFalse(mMobileSignalController.mIsShowingIconGracefully); |
| 287 | } |
| 288 | |
| 289 | @Test |
| 290 | public void testNr5GIcon_enableDisplayGracePeriodTime_showIconGracefully() { |
| 291 | setupDefaultNr5GIconConfiguration(); |
| 292 | setupDefaultNr5GIconDisplayGracePeriodTime_enableThirtySeconds(); |
| 293 | setupDefaultSignal(); |
| 294 | mNetworkController.handleConfigurationChanged(); |
| 295 | mPhoneStateListener.onServiceStateChanged(mServiceState); |
| 296 | |
| 297 | ServiceState ss = Mockito.mock(ServiceState.class); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 298 | setNrState(ss, NetworkRegistrationInfo.NR_STATE_CONNECTED); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 299 | doReturn(ServiceState.FREQUENCY_RANGE_HIGH).when(ss).getNrFrequencyRange(); |
| 300 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 301 | TelephonyManager.NETWORK_TYPE_LTE); |
| 302 | mPhoneStateListener.onServiceStateChanged(ss); |
| 303 | |
| 304 | verifyDataIndicators(TelephonyIcons.ICON_5G); |
| 305 | |
| 306 | // Enabled timer Nr5G switch to None Nr5G, showing 5G icon gracefully |
| 307 | ServiceState ssLte = Mockito.mock(ServiceState.class); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 308 | setNrState(ssLte, NetworkRegistrationInfo.NR_STATE_NONE); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 309 | doReturn(ServiceState.FREQUENCY_RANGE_UNKNOWN).when(ssLte).getNrFrequencyRange(); |
| 310 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 311 | TelephonyManager.NETWORK_TYPE_LTE); |
| 312 | mPhoneStateListener.onServiceStateChanged(ssLte); |
| 313 | |
| 314 | verifyDataIndicators(TelephonyIcons.ICON_5G); |
| 315 | } |
| 316 | |
| 317 | @Test |
| 318 | public void testNr5GIcon_disableDisplayGracePeriodTime_showLatestIconImmediately() { |
| 319 | setupDefaultNr5GIconConfiguration(); |
| 320 | setupDefaultNr5GIconDisplayGracePeriodTime_disabled(); |
| 321 | setupDefaultSignal(); |
| 322 | mNetworkController.handleConfigurationChanged(); |
| 323 | |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 324 | setNrState(mServiceState, NetworkRegistrationInfo.NR_STATE_CONNECTED); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 325 | doReturn(ServiceState.FREQUENCY_RANGE_HIGH).when(mServiceState).getNrFrequencyRange(); |
| 326 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 327 | TelephonyManager.NETWORK_TYPE_LTE); |
| 328 | |
| 329 | verifyDataIndicators(TelephonyIcons.ICON_5G); |
| 330 | |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 331 | setNrState(mServiceState, NetworkRegistrationInfo.NR_STATE_NONE); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 332 | doReturn(ServiceState.FREQUENCY_RANGE_UNKNOWN).when(mServiceState).getNrFrequencyRange(); |
| 333 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 334 | TelephonyManager.NETWORK_TYPE_LTE); |
| 335 | |
| 336 | verifyDataIndicators(TelephonyIcons.ICON_LTE); |
| 337 | } |
| 338 | |
| 339 | @Test |
| 340 | public void testNr5GIcon_resetDisplayGracePeriodTime_whenDataDisconnected() { |
| 341 | setupDefaultNr5GIconConfiguration(); |
| 342 | setupDefaultNr5GIconDisplayGracePeriodTime_enableThirtySeconds(); |
| 343 | setupDefaultSignal(); |
| 344 | mNetworkController.handleConfigurationChanged(); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 345 | setNrState(mServiceState, NetworkRegistrationInfo.NR_STATE_CONNECTED); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 346 | doReturn(ServiceState.FREQUENCY_RANGE_HIGH).when(mServiceState).getNrFrequencyRange(); |
| 347 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 348 | TelephonyManager.NETWORK_TYPE_LTE); |
| 349 | |
| 350 | verifyDataIndicators(TelephonyIcons.ICON_5G); |
| 351 | |
| 352 | // Disabled timer, when out of service, reset timer to display latest state |
| 353 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 354 | TelephonyManager.NETWORK_TYPE_LTE); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 355 | setNrState(mServiceState, NetworkRegistrationInfo.NR_STATE_NONE); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 356 | doReturn(ServiceState.FREQUENCY_RANGE_UNKNOWN).when(mServiceState).getNrFrequencyRange(); |
| 357 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_DISCONNECTED, |
| 358 | TelephonyManager.NETWORK_TYPE_UMTS); |
| 359 | |
| 360 | verifyDataIndicators(0); |
| 361 | } |
| 362 | |
| 363 | @Test |
| 364 | public void testNr5GIcon_enableDisplayGracePeriodTime_show5G_switching_5GPlus() { |
| 365 | setupDefaultNr5GIconConfiguration(); |
| 366 | setupDefaultNr5GIconDisplayGracePeriodTime_enableThirtySeconds(); |
| 367 | setupDefaultSignal(); |
| 368 | mNetworkController.handleConfigurationChanged(); |
| 369 | mPhoneStateListener.onServiceStateChanged(mServiceState); |
| 370 | |
| 371 | ServiceState ss5G = Mockito.mock(ServiceState.class); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 372 | setNrState(ss5G, NetworkRegistrationInfo.NR_STATE_CONNECTED); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 373 | doReturn(ServiceState.FREQUENCY_RANGE_HIGH).when(ss5G).getNrFrequencyRange(); |
| 374 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 375 | TelephonyManager.NETWORK_TYPE_LTE); |
| 376 | mPhoneStateListener.onServiceStateChanged(ss5G); |
| 377 | |
| 378 | verifyDataIndicators(TelephonyIcons.ICON_5G); |
| 379 | |
| 380 | // When timeout enabled, 5G/5G+ switching should be updated immediately |
| 381 | ServiceState ss5GPlus = Mockito.mock(ServiceState.class); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 382 | setNrState(ss5GPlus, NetworkRegistrationInfo.NR_STATE_CONNECTED); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 383 | doReturn(ServiceState.FREQUENCY_RANGE_MMWAVE).when(ss5GPlus).getNrFrequencyRange(); |
| 384 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 385 | TelephonyManager.NETWORK_TYPE_LTE); |
| 386 | mPhoneStateListener.onServiceStateChanged(ss5GPlus); |
| 387 | |
| 388 | verifyDataIndicators(TelephonyIcons.ICON_5G_PLUS); |
| 389 | } |
| 390 | |
| 391 | @Test |
| 392 | public void testNr5GIcon_carrierDisabledDisplayGracePeriodTime_shouldUpdateIconImmediately() { |
| 393 | setupDefaultNr5GIconConfiguration(); |
| 394 | setupDefaultNr5GIconDisplayGracePeriodTime_enableThirtySeconds(); |
| 395 | setupDefaultSignal(); |
| 396 | mNetworkController.handleConfigurationChanged(); |
| 397 | mPhoneStateListener.onServiceStateChanged(mServiceState); |
| 398 | |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 399 | ServiceState ss = Mockito.mock(ServiceState.class); |
| 400 | setNrState(ss, NetworkRegistrationInfo.NR_STATE_CONNECTED); |
| 401 | doReturn(ServiceState.FREQUENCY_RANGE_HIGH).when(ss).getNrFrequencyRange(); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 402 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 403 | TelephonyManager.NETWORK_TYPE_LTE); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 404 | mPhoneStateListener.onServiceStateChanged(ss); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 405 | |
| 406 | verifyDataIndicators(TelephonyIcons.ICON_5G); |
| 407 | |
| 408 | // State from NR_5G to NONE NR_5G with timeout, should show previous 5G icon |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 409 | setNrState(ss, NetworkRegistrationInfo.NR_STATE_NONE); |
| 410 | doReturn(ServiceState.FREQUENCY_RANGE_UNKNOWN).when(ss).getNrFrequencyRange(); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 411 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 412 | TelephonyManager.NETWORK_TYPE_LTE); |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 413 | mPhoneStateListener.onServiceStateChanged(ss); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 414 | |
| 415 | verifyDataIndicators(TelephonyIcons.ICON_5G); |
| 416 | |
| 417 | // Update nrIconDisplayGracePeriodMs to 0 |
| 418 | setupDefaultNr5GIconDisplayGracePeriodTime_disabled(); |
| 419 | mNetworkController.handleConfigurationChanged(); |
| 420 | |
| 421 | // State from NR_5G to NONE NR_STATE_RESTRICTED, showing corresponding icon |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 422 | setNrState(ss, NetworkRegistrationInfo.NR_STATE_RESTRICTED); |
Bill Lin | 767c0db | 2019-08-15 20:42:06 +0800 | [diff] [blame] | 423 | mPhoneStateListener.onDataConnectionStateChanged(TelephonyManager.DATA_CONNECTED, |
| 424 | TelephonyManager.NETWORK_TYPE_LTE); |
| 425 | |
| 426 | assertTrue(mConfig.nrIconDisplayGracePeriodMs == 0); |
| 427 | verifyDataIndicators(TelephonyIcons.ICON_LTE); |
| 428 | } |
| 429 | |
| 430 | @Test |
Jason Monk | fd57ea7 | 2016-04-29 13:37:58 -0400 | [diff] [blame] | 431 | public void testDataDisabledIcon_UserNotSetup() { |
| 432 | setupNetworkController(); |
Shuo Qian | 2914158 | 2020-01-02 15:18:01 -0800 | [diff] [blame] | 433 | when(mMockTm.isDataConnectionEnabled()).thenReturn(false); |
Jason Monk | fd57ea7 | 2016-04-29 13:37:58 -0400 | [diff] [blame] | 434 | setupDefaultSignal(); |
| 435 | updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, 0); |
Anarghya Mitra | 678722f | 2018-05-11 14:29:54 -0700 | [diff] [blame] | 436 | setConnectivityViaBroadcast(NetworkCapabilities.TRANSPORT_CELLULAR, false, false); |
Jason Monk | 0288de0 | 2017-02-23 14:48:05 -0500 | [diff] [blame] | 437 | when(mMockProvisionController.isUserSetup(anyInt())).thenReturn(false); |
| 438 | mUserCallback.onUserSetupChanged(); |
Jason Monk | 2515f47 | 2017-09-19 09:52:43 -0400 | [diff] [blame] | 439 | TestableLooper.get(this).processAllMessages(); |
Jason Monk | fd57ea7 | 2016-04-29 13:37:58 -0400 | [diff] [blame] | 440 | |
| 441 | // Don't show the X until the device is setup. |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 442 | verifyDataIndicators(0); |
Jason Monk | fd57ea7 | 2016-04-29 13:37:58 -0400 | [diff] [blame] | 443 | } |
| 444 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 445 | @Test |
Wenting Xiong | 63364fe | 2017-02-07 19:12:27 +0800 | [diff] [blame] | 446 | public void testAlwaysShowDataRatIcon() { |
| 447 | setupDefaultSignal(); |
Shuo Qian | 2914158 | 2020-01-02 15:18:01 -0800 | [diff] [blame] | 448 | when(mMockTm.isDataConnectionEnabled()).thenReturn(false); |
Wenting Xiong | 63364fe | 2017-02-07 19:12:27 +0800 | [diff] [blame] | 449 | updateDataConnectionState(TelephonyManager.DATA_DISCONNECTED, |
| 450 | TelephonyManager.NETWORK_TYPE_GSM); |
| 451 | |
| 452 | // Switch to showing data RAT icon when data is disconnected |
| 453 | // and re-initialize the NetworkController. |
| 454 | mConfig.alwaysShowDataRatIcon = true; |
| 455 | mNetworkController.handleConfigurationChanged(); |
| 456 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 457 | verifyDataIndicators(TelephonyIcons.ICON_G); |
Wenting Xiong | 63364fe | 2017-02-07 19:12:27 +0800 | [diff] [blame] | 458 | } |
| 459 | |
| 460 | @Test |
Jason Monk | 3aaabd7 | 2014-12-12 11:11:44 -0500 | [diff] [blame] | 461 | public void test4gDataIconConfigChange() { |
| 462 | setupDefaultSignal(); |
| 463 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 464 | TelephonyManager.NETWORK_TYPE_LTE); |
| 465 | |
| 466 | // Switch to showing 4g icon and re-initialize the NetworkController. |
| 467 | mConfig.show4gForLte = true; |
| 468 | // Can't send the broadcast as that would actually read the config from |
| 469 | // the context. Instead we'll just poke at a function that does all of |
| 470 | // the after work. |
| 471 | mNetworkController.handleConfigurationChanged(); |
| 472 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 473 | verifyDataIndicators(TelephonyIcons.ICON_4G); |
Jason Monk | 3aaabd7 | 2014-12-12 11:11:44 -0500 | [diff] [blame] | 474 | } |
| 475 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 476 | @Test |
Jason Monk | 67b2c16 | 2016-01-12 10:24:09 -0500 | [diff] [blame] | 477 | public void testDataChangeWithoutConnectionState() { |
| 478 | setupDefaultSignal(); |
| 479 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 480 | TelephonyManager.NETWORK_TYPE_LTE); |
| 481 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 482 | verifyDataIndicators(TelephonyIcons.ICON_LTE); |
Jason Monk | 67b2c16 | 2016-01-12 10:24:09 -0500 | [diff] [blame] | 483 | |
Hall Liu | 5a95a70 | 2020-01-06 19:04:10 -0800 | [diff] [blame] | 484 | NetworkRegistrationInfo fakeRegInfo = new NetworkRegistrationInfo.Builder() |
| 485 | .setTransportType(TRANSPORT_TYPE_WWAN) |
| 486 | .setDomain(DOMAIN_PS) |
| 487 | .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_HSPA) |
| 488 | .build(); |
| 489 | when(mServiceState.getNetworkRegistrationInfo(DOMAIN_PS, TRANSPORT_TYPE_WWAN)) |
| 490 | .thenReturn(fakeRegInfo); |
Jason Monk | 67b2c16 | 2016-01-12 10:24:09 -0500 | [diff] [blame] | 491 | updateServiceState(); |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 492 | verifyDataIndicators(TelephonyIcons.ICON_H); |
Jason Monk | 67b2c16 | 2016-01-12 10:24:09 -0500 | [diff] [blame] | 493 | } |
| 494 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 495 | @Test |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 496 | public void testDataActivity() { |
| 497 | setupDefaultSignal(); |
| 498 | |
| 499 | testDataActivity(TelephonyManager.DATA_ACTIVITY_NONE, false, false); |
| 500 | testDataActivity(TelephonyManager.DATA_ACTIVITY_IN, true, false); |
| 501 | testDataActivity(TelephonyManager.DATA_ACTIVITY_OUT, false, true); |
| 502 | testDataActivity(TelephonyManager.DATA_ACTIVITY_INOUT, true, true); |
| 503 | } |
| 504 | |
Fabian Kozynski | a909199 | 2019-03-25 11:08:32 -0400 | [diff] [blame] | 505 | @Test |
| 506 | public void testUpdateDataNetworkName() { |
| 507 | setupDefaultSignal(); |
| 508 | String newDataName = "TestDataName"; |
SongFerngWang | 2b1ea8d | 2019-11-20 02:11:09 +0800 | [diff] [blame] | 509 | when(mServiceState.getOperatorAlphaShort()).thenReturn(newDataName); |
Fabian Kozynski | a909199 | 2019-03-25 11:08:32 -0400 | [diff] [blame] | 510 | updateServiceState(); |
| 511 | assertDataNetworkNameEquals(newDataName); |
| 512 | } |
| 513 | |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 514 | private void testDataActivity(int direction, boolean in, boolean out) { |
| 515 | updateDataActivity(direction); |
| 516 | |
Jason Monk | 26ad85a | 2016-12-08 14:45:42 -0500 | [diff] [blame] | 517 | verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, DEFAULT_ICON, true, |
Jason Monk | 7e6c83c | 2017-04-26 14:35:24 -0400 | [diff] [blame] | 518 | DEFAULT_QS_SIGNAL_STRENGTH, DEFAULT_QS_ICON, in, out); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 519 | } |
| 520 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 521 | private void verifyDataIndicators(int dataIcon) { |
Jason Monk | 26ad85a | 2016-12-08 14:45:42 -0500 | [diff] [blame] | 522 | verifyLastMobileDataIndicators(true, DEFAULT_SIGNAL_STRENGTH, dataIcon, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 523 | true, DEFAULT_QS_SIGNAL_STRENGTH, dataIcon, false, |
Jason Monk | b574627 | 2014-11-12 16:50:31 -0500 | [diff] [blame] | 524 | false); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 525 | } |
Jayachandran C | 09fceba | 2020-01-29 14:13:09 -0800 | [diff] [blame] | 526 | |
| 527 | private void setNrState(ServiceState ss, int nrState) { |
| 528 | mFakeRegInfo.setNrState(nrState); |
| 529 | doReturn(mFakeRegInfo).when(ss) |
| 530 | .getNetworkRegistrationInfo(DOMAIN_PS, TRANSPORT_TYPE_WWAN); |
| 531 | } |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 532 | } |