Jason Monk | da68f59 | 2015-01-07 10:55:58 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 16 | package com.android.systemui.statusbar.policy; |
| 17 | |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 18 | import android.content.Intent; |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 19 | import android.net.ConnectivityManager; |
Jason Monk | 33f8ae7 | 2015-05-08 10:45:15 -0400 | [diff] [blame] | 20 | import android.net.NetworkCapabilities; |
Jason Monk | 07b75fe | 2015-05-14 16:47:03 -0400 | [diff] [blame] | 21 | import android.os.Looper; |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 22 | import android.support.test.runner.AndroidJUnit4; |
Jason Monk | b0808aa | 2015-07-22 16:34:36 -0400 | [diff] [blame] | 23 | import android.telephony.ServiceState; |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 24 | import android.telephony.SignalStrength; |
Jason Monk | c014dec | 2014-12-12 11:49:55 -0500 | [diff] [blame] | 25 | import android.telephony.SubscriptionInfo; |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 26 | import android.telephony.TelephonyManager; |
Jason Monk | e427cb8 | 2015-07-28 09:18:08 -0400 | [diff] [blame] | 27 | import android.test.suitebuilder.annotation.SmallTest; |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 28 | |
Jason Monk | 18985e0 | 2015-01-07 12:07:06 -0500 | [diff] [blame] | 29 | import com.android.internal.telephony.PhoneConstants; |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 30 | import com.android.internal.telephony.TelephonyIntents; |
Jason Monk | f668d7c | 2016-01-14 10:38:41 -0500 | [diff] [blame] | 31 | import com.android.settingslib.net.DataUsageController; |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 32 | import com.android.systemui.R; |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 33 | import com.android.systemui.statusbar.phone.SignalDrawable; |
Jason Monk | da68f59 | 2015-01-07 10:55:58 -0500 | [diff] [blame] | 34 | |
Jason Monk | ca8d3d7 | 2017-07-06 12:36:32 -0400 | [diff] [blame] | 35 | import org.junit.Ignore; |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 36 | import org.junit.Test; |
| 37 | import org.junit.runner.RunWith; |
Jason Monk | c6cc626 | 2015-06-11 11:10:15 -0400 | [diff] [blame] | 38 | import org.mockito.ArgumentCaptor; |
Jason Monk | da68f59 | 2015-01-07 10:55:58 -0500 | [diff] [blame] | 39 | import org.mockito.Mockito; |
| 40 | |
| 41 | import java.util.ArrayList; |
| 42 | import java.util.List; |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 43 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 44 | import static junit.framework.Assert.assertEquals; |
| 45 | import static junit.framework.Assert.assertTrue; |
| 46 | import static junit.framework.Assert.assertFalse; |
| 47 | import static org.mockito.Mockito.mock; |
| 48 | |
Jason Monk | e427cb8 | 2015-07-28 09:18:08 -0400 | [diff] [blame] | 49 | @SmallTest |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 50 | @RunWith(AndroidJUnit4.class) |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 51 | public class NetworkControllerSignalTest extends NetworkControllerBaseTest { |
| 52 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 53 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 54 | @Ignore("Flaky") |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 55 | public void testNoIconWithoutMobile() { |
| 56 | // Turn off mobile network support. |
| 57 | Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false); |
| 58 | // Create a new NetworkController as this is currently handled in constructor. |
Sundeep Ghuman | 9d10a3c | 2017-06-16 00:05:16 +0000 | [diff] [blame] | 59 | mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm, mMockSm, |
Jason Monk | 07b75fe | 2015-05-14 16:47:03 -0400 | [diff] [blame] | 60 | mConfig, Looper.getMainLooper(), mCallbackHandler, |
Jason Monk | f668d7c | 2016-01-14 10:38:41 -0500 | [diff] [blame] | 61 | mock(AccessPointControllerImpl.class), mock(DataUsageController.class), |
Jason Monk | 9c7844c | 2017-01-18 15:21:53 -0500 | [diff] [blame] | 62 | mMockSubDefaults, mock(DeviceProvisionedController.class)); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 63 | setupNetworkController(); |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 64 | |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 65 | verifyLastMobileDataIndicators(false, -1, 0); |
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 |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 69 | @Ignore("Flaky") |
Jason Monk | 21d05a0 | 2014-12-02 12:46:58 -0500 | [diff] [blame] | 70 | public void testNoSimsIconPresent() { |
| 71 | // No Subscriptions. |
| 72 | mNetworkController.mMobileSignalControllers.clear(); |
| 73 | mNetworkController.updateNoSims(); |
| 74 | |
| 75 | verifyHasNoSims(true); |
| 76 | } |
| 77 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 78 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 79 | @Ignore("Flaky") |
Jason Monk | c6cc626 | 2015-06-11 11:10:15 -0400 | [diff] [blame] | 80 | public void testEmergencyOnly() { |
| 81 | setupDefaultSignal(); |
| 82 | mNetworkController.recalculateEmergency(); |
| 83 | verifyEmergencyOnly(false); |
| 84 | |
| 85 | mMobileSignalController.getState().isEmergency = true; |
| 86 | mNetworkController.recalculateEmergency(); |
| 87 | verifyEmergencyOnly(true); |
| 88 | } |
| 89 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 90 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 91 | @Ignore("Flaky") |
Jason Monk | c6cc626 | 2015-06-11 11:10:15 -0400 | [diff] [blame] | 92 | public void testEmergencyOnlyNoSubscriptions() { |
| 93 | setupDefaultSignal(); |
Jason Monk | b0808aa | 2015-07-22 16:34:36 -0400 | [diff] [blame] | 94 | setSubscriptions(); |
| 95 | mNetworkController.mLastServiceState = new ServiceState(); |
| 96 | mNetworkController.mLastServiceState.setEmergencyOnly(true); |
| 97 | mNetworkController.recalculateEmergency(); |
| 98 | verifyEmergencyOnly(true); |
| 99 | } |
| 100 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 101 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 102 | @Ignore("Flaky") |
Jason Monk | 8996b94 | 2017-03-02 13:58:19 -0500 | [diff] [blame] | 103 | public void testNoEmergencyOnlyWrongSubscription() { |
| 104 | setupDefaultSignal(); |
| 105 | setDefaultSubId(42); |
| 106 | mNetworkController.recalculateEmergency(); |
| 107 | verifyEmergencyOnly(false); |
| 108 | } |
| 109 | |
| 110 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 111 | @Ignore("Flaky") |
Jason Monk | b0808aa | 2015-07-22 16:34:36 -0400 | [diff] [blame] | 112 | public void testNoEmengencyNoSubscriptions() { |
| 113 | setupDefaultSignal(); |
| 114 | setSubscriptions(); |
| 115 | mNetworkController.mLastServiceState = new ServiceState(); |
| 116 | mNetworkController.mLastServiceState.setEmergencyOnly(false); |
Jason Monk | c6cc626 | 2015-06-11 11:10:15 -0400 | [diff] [blame] | 117 | mNetworkController.recalculateEmergency(); |
| 118 | verifyEmergencyOnly(false); |
Jason Monk | c6cc626 | 2015-06-11 11:10:15 -0400 | [diff] [blame] | 119 | } |
| 120 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 121 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 122 | @Ignore("Flaky") |
Jason Monk | 21d05a0 | 2014-12-02 12:46:58 -0500 | [diff] [blame] | 123 | public void testNoSimlessIconWithoutMobile() { |
| 124 | // Turn off mobile network support. |
| 125 | Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false); |
| 126 | // Create a new NetworkController as this is currently handled in constructor. |
Sundeep Ghuman | 9d10a3c | 2017-06-16 00:05:16 +0000 | [diff] [blame] | 127 | mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm, mMockSm, |
Jason Monk | 07b75fe | 2015-05-14 16:47:03 -0400 | [diff] [blame] | 128 | mConfig, Looper.getMainLooper(), mCallbackHandler, |
Jason Monk | f668d7c | 2016-01-14 10:38:41 -0500 | [diff] [blame] | 129 | mock(AccessPointControllerImpl.class), mock(DataUsageController.class), |
Jason Monk | 9c7844c | 2017-01-18 15:21:53 -0500 | [diff] [blame] | 130 | mMockSubDefaults, mock(DeviceProvisionedController.class)); |
Jason Monk | 21d05a0 | 2014-12-02 12:46:58 -0500 | [diff] [blame] | 131 | setupNetworkController(); |
| 132 | |
| 133 | // No Subscriptions. |
| 134 | mNetworkController.mMobileSignalControllers.clear(); |
| 135 | mNetworkController.updateNoSims(); |
| 136 | |
| 137 | verifyHasNoSims(false); |
| 138 | } |
| 139 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 140 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 141 | @Ignore("Flaky") |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 142 | public void testSignalStrength() { |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 143 | for (int testStrength = 0; |
| 144 | testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 145 | setupDefaultSignal(); |
| 146 | setLevel(testStrength); |
| 147 | |
| 148 | verifyLastMobileDataIndicators(true, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 149 | testStrength, DEFAULT_ICON); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 150 | |
| 151 | // Verify low inet number indexing. |
Jason Monk | 33f8ae7 | 2015-05-08 10:45:15 -0400 | [diff] [blame] | 152 | setConnectivity(NetworkCapabilities.TRANSPORT_CELLULAR, false, true); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 153 | verifyLastMobileDataIndicators(true, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 154 | testStrength, DEFAULT_ICON, false, false); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 155 | } |
| 156 | } |
| 157 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 158 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 159 | @Ignore("Flaky") |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 160 | public void testCdmaSignalStrength() { |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 161 | for (int testStrength = 0; |
| 162 | testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 163 | setupDefaultSignal(); |
| 164 | setCdma(); |
| 165 | setLevel(testStrength); |
| 166 | |
| 167 | verifyLastMobileDataIndicators(true, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 168 | testStrength, |
| 169 | TelephonyIcons.ICON_1X); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 170 | } |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 171 | } |
| 172 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 173 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 174 | @Ignore("Flaky") |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 175 | public void testSignalRoaming() { |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 176 | for (int testStrength = 0; |
| 177 | testStrength < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; testStrength++) { |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 178 | setupDefaultSignal(); |
| 179 | setGsmRoaming(true); |
| 180 | setLevel(testStrength); |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 181 | |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 182 | verifyLastMobileDataIndicators(true, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 183 | testStrength, |
Jason Monk | 0f0de13 | 2016-12-19 15:36:13 -0500 | [diff] [blame] | 184 | DEFAULT_ICON, true); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 185 | } |
| 186 | } |
| 187 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 188 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 189 | @Ignore("Flaky") |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 190 | public void testCdmaSignalRoaming() { |
| 191 | for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; |
| 192 | testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { |
| 193 | setupDefaultSignal(); |
| 194 | setCdma(); |
| 195 | setCdmaRoaming(true); |
| 196 | setLevel(testStrength); |
| 197 | |
| 198 | verifyLastMobileDataIndicators(true, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 199 | testStrength, |
| 200 | TelephonyIcons.ICON_1X, true); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 201 | } |
| 202 | } |
| 203 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 204 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 205 | @Ignore("Flaky") |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 206 | public void testQsSignalStrength() { |
| 207 | for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; |
| 208 | testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { |
| 209 | setupDefaultSignal(); |
| 210 | setLevel(testStrength); |
| 211 | |
| 212 | verifyLastQsMobileDataIndicators(true, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 213 | testStrength, |
Jason Monk | b574627 | 2014-11-12 16:50:31 -0500 | [diff] [blame] | 214 | DEFAULT_QS_ICON, false, false); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 215 | } |
| 216 | } |
| 217 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 218 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 219 | @Ignore("Flaky") |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 220 | public void testCdmaQsSignalStrength() { |
| 221 | for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; |
| 222 | testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) { |
| 223 | setupDefaultSignal(); |
| 224 | setCdma(); |
| 225 | setLevel(testStrength); |
| 226 | |
| 227 | verifyLastQsMobileDataIndicators(true, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 228 | testStrength, |
Jason Monk | 01df36f | 2017-06-07 13:02:47 -0400 | [diff] [blame] | 229 | TelephonyIcons.QS_DATA_1X, false, false); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 230 | } |
| 231 | } |
| 232 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 233 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 234 | @Ignore("Flaky") |
Jason Monk | 33f8ae7 | 2015-05-08 10:45:15 -0400 | [diff] [blame] | 235 | public void testNoBangWithWifi() { |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 236 | setupDefaultSignal(); |
Jason Monk | 33f8ae7 | 2015-05-08 10:45:15 -0400 | [diff] [blame] | 237 | setConnectivity(mMobileSignalController.mTransportType, false, false); |
| 238 | setConnectivity(NetworkCapabilities.TRANSPORT_WIFI, true, true); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 239 | |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 240 | verifyLastMobileDataIndicators(true, DEFAULT_LEVEL, 0); |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 241 | } |
| 242 | |
Jason Monk | c014dec | 2014-12-12 11:49:55 -0500 | [diff] [blame] | 243 | // Some tests of actual NetworkController code, just internals not display stuff |
| 244 | // TODO: Put this somewhere else, maybe in its own file. |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 245 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 246 | @Ignore("Flaky") |
Jason Monk | c014dec | 2014-12-12 11:49:55 -0500 | [diff] [blame] | 247 | public void testHasCorrectMobileControllers() { |
| 248 | int[] testSubscriptions = new int[] { 1, 5, 3 }; |
| 249 | int notTestSubscription = 0; |
| 250 | MobileSignalController mobileSignalController = Mockito.mock(MobileSignalController.class); |
| 251 | |
| 252 | mNetworkController.mMobileSignalControllers.clear(); |
| 253 | List<SubscriptionInfo> subscriptions = new ArrayList<>(); |
| 254 | for (int i = 0; i < testSubscriptions.length; i++) { |
| 255 | // Force the test controllers into NetworkController. |
| 256 | mNetworkController.mMobileSignalControllers.put(testSubscriptions[i], |
| 257 | mobileSignalController); |
| 258 | |
| 259 | // Generate a list of subscriptions we will tell the NetworkController to use. |
| 260 | SubscriptionInfo mockSubInfo = Mockito.mock(SubscriptionInfo.class); |
| 261 | Mockito.when(mockSubInfo.getSubscriptionId()).thenReturn(testSubscriptions[i]); |
| 262 | subscriptions.add(mockSubInfo); |
| 263 | } |
| 264 | assertTrue(mNetworkController.hasCorrectMobileControllers(subscriptions)); |
| 265 | |
| 266 | // Add a subscription that the NetworkController doesn't know about. |
| 267 | SubscriptionInfo mockSubInfo = Mockito.mock(SubscriptionInfo.class); |
| 268 | Mockito.when(mockSubInfo.getSubscriptionId()).thenReturn(notTestSubscription); |
| 269 | subscriptions.add(mockSubInfo); |
| 270 | assertFalse(mNetworkController.hasCorrectMobileControllers(subscriptions)); |
| 271 | } |
| 272 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 273 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 274 | @Ignore("Flaky") |
Jason Monk | c014dec | 2014-12-12 11:49:55 -0500 | [diff] [blame] | 275 | public void testSetCurrentSubscriptions() { |
| 276 | // We will not add one controller to make sure it gets created. |
| 277 | int indexToSkipController = 0; |
| 278 | // We will not add one subscription to make sure it's controller gets removed. |
| 279 | int indexToSkipSubscription = 1; |
| 280 | |
| 281 | int[] testSubscriptions = new int[] { 1, 5, 3 }; |
| 282 | MobileSignalController[] mobileSignalControllers = new MobileSignalController[] { |
| 283 | Mockito.mock(MobileSignalController.class), |
| 284 | Mockito.mock(MobileSignalController.class), |
| 285 | Mockito.mock(MobileSignalController.class), |
| 286 | }; |
| 287 | mNetworkController.mMobileSignalControllers.clear(); |
| 288 | List<SubscriptionInfo> subscriptions = new ArrayList<>(); |
| 289 | for (int i = 0; i < testSubscriptions.length; i++) { |
| 290 | if (i != indexToSkipController) { |
| 291 | // Force the test controllers into NetworkController. |
| 292 | mNetworkController.mMobileSignalControllers.put(testSubscriptions[i], |
| 293 | mobileSignalControllers[i]); |
| 294 | } |
| 295 | |
| 296 | if (i != indexToSkipSubscription) { |
| 297 | // Generate a list of subscriptions we will tell the NetworkController to use. |
| 298 | SubscriptionInfo mockSubInfo = Mockito.mock(SubscriptionInfo.class); |
| 299 | Mockito.when(mockSubInfo.getSubscriptionId()).thenReturn(testSubscriptions[i]); |
| 300 | Mockito.when(mockSubInfo.getSimSlotIndex()).thenReturn(testSubscriptions[i]); |
| 301 | subscriptions.add(mockSubInfo); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | // We can only test whether unregister gets called if it thinks its in a listening |
| 306 | // state. |
| 307 | mNetworkController.mListening = true; |
| 308 | mNetworkController.setCurrentSubscriptions(subscriptions); |
| 309 | |
| 310 | for (int i = 0; i < testSubscriptions.length; i++) { |
| 311 | if (i == indexToSkipController) { |
| 312 | // Make sure a controller was created despite us not adding one. |
Jason Monk | 8996b94 | 2017-03-02 13:58:19 -0500 | [diff] [blame] | 313 | assertTrue(mNetworkController.mMobileSignalControllers.indexOfKey( |
| 314 | testSubscriptions[i]) >= 0); |
Jason Monk | c014dec | 2014-12-12 11:49:55 -0500 | [diff] [blame] | 315 | } else if (i == indexToSkipSubscription) { |
| 316 | // Make sure the controller that did exist was removed |
Jason Monk | 8996b94 | 2017-03-02 13:58:19 -0500 | [diff] [blame] | 317 | assertFalse(mNetworkController.mMobileSignalControllers.indexOfKey( |
| 318 | testSubscriptions[i]) >= 0); |
Jason Monk | c014dec | 2014-12-12 11:49:55 -0500 | [diff] [blame] | 319 | } else { |
| 320 | // If a MobileSignalController is around it needs to not be unregistered. |
| 321 | Mockito.verify(mobileSignalControllers[i], Mockito.never()) |
| 322 | .unregisterListener(); |
| 323 | } |
| 324 | } |
| 325 | } |
| 326 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 327 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 328 | @Ignore("Flaky") |
Jason Monk | 7f9623f | 2015-02-11 09:03:02 -0500 | [diff] [blame] | 329 | public void testHistorySize() { |
| 330 | // Verify valid history size, otherwise it gits printed out the wrong order and whatnot. |
| 331 | assertEquals(0, SignalController.HISTORY_SIZE & (SignalController.HISTORY_SIZE - 1)); |
| 332 | } |
| 333 | |
Jason Monk | f13b4b3 | 2014-11-07 16:39:34 -0500 | [diff] [blame] | 334 | private void setCdma() { |
| 335 | setIsGsm(false); |
| 336 | updateDataConnectionState(TelephonyManager.DATA_CONNECTED, |
| 337 | TelephonyManager.NETWORK_TYPE_CDMA); |
| 338 | setCdmaRoaming(false); |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 339 | } |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 340 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 341 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 342 | @Ignore("Flaky") |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 343 | public void testOnReceive_stringsUpdatedAction_spn() { |
| 344 | String expectedMNetworkName = "Test"; |
| 345 | Intent intent = createStringsUpdatedIntent(true /* showSpn */, |
| 346 | expectedMNetworkName /* spn */, |
| 347 | false /* showPlmn */, |
| 348 | "NotTest" /* plmn */); |
| 349 | |
| 350 | mNetworkController.onReceive(mContext, intent); |
| 351 | |
| 352 | assertNetworkNameEquals(expectedMNetworkName); |
| 353 | } |
| 354 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 355 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 356 | @Ignore("Flaky") |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 357 | public void testOnReceive_stringsUpdatedAction_plmn() { |
| 358 | String expectedMNetworkName = "Test"; |
| 359 | |
| 360 | Intent intent = createStringsUpdatedIntent(false /* showSpn */, |
| 361 | "NotTest" /* spn */, |
| 362 | true /* showPlmn */, |
| 363 | expectedMNetworkName /* plmn */); |
| 364 | |
| 365 | mNetworkController.onReceive(mContext, intent); |
| 366 | |
| 367 | assertNetworkNameEquals(expectedMNetworkName); |
| 368 | } |
| 369 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 370 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 371 | @Ignore("Flaky") |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 372 | public void testOnReceive_stringsUpdatedAction_bothFalse() { |
| 373 | Intent intent = createStringsUpdatedIntent(false /* showSpn */, |
| 374 | "Irrelevant" /* spn */, |
| 375 | false /* showPlmn */, |
| 376 | "Irrelevant" /* plmn */); |
| 377 | |
| 378 | mNetworkController.onReceive(mContext, intent); |
| 379 | |
| 380 | String defaultNetworkName = mMobileSignalController |
| 381 | .getStringIfExists( |
| 382 | com.android.internal.R.string.lockscreen_carrier_default); |
| 383 | assertNetworkNameEquals(defaultNetworkName); |
| 384 | } |
| 385 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 386 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 387 | @Ignore("Flaky") |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 388 | public void testOnReceive_stringsUpdatedAction_bothTrueAndNull() { |
| 389 | Intent intent = createStringsUpdatedIntent(true /* showSpn */, |
| 390 | null /* spn */, |
| 391 | true /* showPlmn */, |
| 392 | null /* plmn */); |
| 393 | |
| 394 | mNetworkController.onReceive(mContext, intent); |
| 395 | |
| 396 | String defaultNetworkName = mMobileSignalController.getStringIfExists( |
| 397 | com.android.internal.R.string.lockscreen_carrier_default); |
| 398 | assertNetworkNameEquals(defaultNetworkName); |
| 399 | } |
| 400 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 401 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 402 | @Ignore("Flaky") |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 403 | public void testOnReceive_stringsUpdatedAction_bothTrueAndNonNull() { |
| 404 | String spn = "Test1"; |
| 405 | String plmn = "Test2"; |
| 406 | |
| 407 | Intent intent = createStringsUpdatedIntent(true /* showSpn */, |
| 408 | spn /* spn */, |
| 409 | true /* showPlmn */, |
| 410 | plmn /* plmn */); |
| 411 | |
| 412 | mNetworkController.onReceive(mContext, intent); |
| 413 | |
| 414 | assertNetworkNameEquals(plmn |
| 415 | + mMobileSignalController.getStringIfExists( |
| 416 | R.string.status_bar_network_name_separator) |
| 417 | + spn); |
| 418 | } |
| 419 | |
| 420 | private Intent createStringsUpdatedIntent(boolean showSpn, String spn, |
| 421 | boolean showPlmn, String plmn) { |
| 422 | |
| 423 | Intent intent = new Intent(); |
| 424 | intent.setAction(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION); |
| 425 | |
| 426 | intent.putExtra(TelephonyIntents.EXTRA_SHOW_SPN, showSpn); |
| 427 | intent.putExtra(TelephonyIntents.EXTRA_SPN, spn); |
| 428 | |
| 429 | intent.putExtra(TelephonyIntents.EXTRA_SHOW_PLMN, showPlmn); |
| 430 | intent.putExtra(TelephonyIntents.EXTRA_PLMN, plmn); |
Jason Monk | 18985e0 | 2015-01-07 12:07:06 -0500 | [diff] [blame] | 431 | intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, mSubId); |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 432 | |
| 433 | return intent; |
| 434 | } |
| 435 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 436 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 437 | @Ignore("Flaky") |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 438 | public void testOnUpdateDataActivity_dataIn() { |
| 439 | setupDefaultSignal(); |
| 440 | |
| 441 | updateDataActivity(TelephonyManager.DATA_ACTIVITY_IN); |
| 442 | |
| 443 | verifyLastQsMobileDataIndicators(true /* visible */, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 444 | DEFAULT_LEVEL /* icon */, |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 445 | DEFAULT_QS_ICON /* typeIcon */, |
| 446 | true /* dataIn */, |
| 447 | false /* dataOut */); |
| 448 | |
| 449 | } |
| 450 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 451 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 452 | @Ignore("Flaky") |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 453 | public void testOnUpdateDataActivity_dataOut() { |
| 454 | setupDefaultSignal(); |
| 455 | |
| 456 | updateDataActivity(TelephonyManager.DATA_ACTIVITY_OUT); |
| 457 | |
| 458 | verifyLastQsMobileDataIndicators(true /* visible */, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 459 | DEFAULT_LEVEL /* icon */, |
Jason Monk | 7e6c83c | 2017-04-26 14:35:24 -0400 | [diff] [blame] | 460 | DEFAULT_QS_ICON /* typeIcon */, |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 461 | false /* dataIn */, |
| 462 | true /* dataOut */); |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 463 | } |
| 464 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 465 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 466 | @Ignore("Flaky") |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 467 | public void testOnUpdateDataActivity_dataInOut() { |
| 468 | setupDefaultSignal(); |
| 469 | |
| 470 | updateDataActivity(TelephonyManager.DATA_ACTIVITY_INOUT); |
| 471 | |
| 472 | verifyLastQsMobileDataIndicators(true /* visible */, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 473 | DEFAULT_LEVEL /* icon */, |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 474 | DEFAULT_QS_ICON /* typeIcon */, |
| 475 | true /* dataIn */, |
| 476 | true /* dataOut */); |
| 477 | |
| 478 | } |
| 479 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 480 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 481 | @Ignore("Flaky") |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 482 | public void testOnUpdateDataActivity_dataActivityNone() { |
| 483 | setupDefaultSignal(); |
| 484 | |
| 485 | updateDataActivity(TelephonyManager.DATA_ACTIVITY_NONE); |
| 486 | |
| 487 | verifyLastQsMobileDataIndicators(true /* visible */, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 488 | DEFAULT_LEVEL /* icon */, |
Leigh Anne | d0a6279 | 2014-11-13 14:27:10 -0800 | [diff] [blame] | 489 | DEFAULT_QS_ICON /* typeIcon */, |
| 490 | false /* dataIn */, |
| 491 | false /* dataOut */); |
| 492 | |
| 493 | } |
Andrew Flynn | 5e75147 | 2015-05-01 11:50:07 -0400 | [diff] [blame] | 494 | |
Geoffrey Pitsch | 2c403db | 2016-08-26 09:09:39 -0400 | [diff] [blame] | 495 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 496 | @Ignore("Flaky") |
Andrew Flynn | 55fc800 | 2015-05-29 08:33:46 -0400 | [diff] [blame] | 497 | public void testCarrierNetworkChange_carrierNetworkChange() { |
Andrew Flynn | 5e75147 | 2015-05-01 11:50:07 -0400 | [diff] [blame] | 498 | int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; |
| 499 | |
| 500 | setupDefaultSignal(); |
| 501 | setLevel(strength); |
| 502 | |
| 503 | // Verify baseline |
| 504 | verifyLastMobileDataIndicators(true /* visible */, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 505 | strength /* strengthIcon */, |
Andrew Flynn | 5e75147 | 2015-05-01 11:50:07 -0400 | [diff] [blame] | 506 | DEFAULT_ICON /* typeIcon */); |
| 507 | |
Andrew Flynn | 55fc800 | 2015-05-29 08:33:46 -0400 | [diff] [blame] | 508 | // API call is made |
Andrew Flynn | 5e75147 | 2015-05-01 11:50:07 -0400 | [diff] [blame] | 509 | setCarrierNetworkChange(true /* enabled */); |
Andrew Flynn | 5e75147 | 2015-05-01 11:50:07 -0400 | [diff] [blame] | 510 | |
Andrew Flynn | 55fc800 | 2015-05-29 08:33:46 -0400 | [diff] [blame] | 511 | // Carrier network change is true, show special indicator |
Andrew Flynn | 5e75147 | 2015-05-01 11:50:07 -0400 | [diff] [blame] | 512 | verifyLastMobileDataIndicators(true /* visible */, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 513 | SignalDrawable.getCarrierChangeState(SignalStrength.NUM_SIGNAL_STRENGTH_BINS), |
Andrew Flynn | 5e75147 | 2015-05-01 11:50:07 -0400 | [diff] [blame] | 514 | 0 /* typeIcon */); |
| 515 | |
| 516 | // Revert back |
| 517 | setCarrierNetworkChange(false /* enabled */); |
Andrew Flynn | 5e75147 | 2015-05-01 11:50:07 -0400 | [diff] [blame] | 518 | |
| 519 | // Verify back in previous state |
| 520 | verifyLastMobileDataIndicators(true /* visible */, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 521 | strength /* strengthIcon */, |
Andrew Flynn | 5e75147 | 2015-05-01 11:50:07 -0400 | [diff] [blame] | 522 | DEFAULT_ICON /* typeIcon */); |
| 523 | } |
Jason Monk | c6cc626 | 2015-06-11 11:10:15 -0400 | [diff] [blame] | 524 | |
Shishir Agrawal | 7ef5b88 | 2017-06-26 12:06:03 -0700 | [diff] [blame] | 525 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 526 | @Ignore("Flaky") |
Shishir Agrawal | 7ef5b88 | 2017-06-26 12:06:03 -0700 | [diff] [blame] | 527 | public void testCarrierNetworkChange_roamingBeforeNetworkChange() { |
| 528 | int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; |
| 529 | |
| 530 | setupDefaultSignal(); |
| 531 | setLevel(strength); |
| 532 | setGsmRoaming(true); |
| 533 | |
| 534 | // Verify baseline |
| 535 | verifyLastMobileDataIndicators(true /* visible */, |
| 536 | strength /* strengthIcon */, |
| 537 | DEFAULT_ICON /* typeIcon */, |
| 538 | true /* roaming */); |
| 539 | |
| 540 | // API call is made |
| 541 | setCarrierNetworkChange(true /* enabled */); |
| 542 | |
| 543 | // Carrier network change is true, show special indicator, no roaming. |
| 544 | verifyLastMobileDataIndicators(true /* visible */, |
| 545 | SignalDrawable.getCarrierChangeState(SignalStrength.NUM_SIGNAL_STRENGTH_BINS), |
| 546 | 0 /* typeIcon */, |
| 547 | false /* roaming */); |
| 548 | |
| 549 | // Revert back |
| 550 | setCarrierNetworkChange(false /* enabled */); |
| 551 | |
| 552 | // Verify back in previous state |
| 553 | verifyLastMobileDataIndicators(true /* visible */, |
| 554 | strength /* strengthIcon */, |
| 555 | DEFAULT_ICON /* typeIcon */, |
| 556 | true /* roaming */); |
| 557 | } |
| 558 | |
| 559 | @Test |
Geoffrey Pitsch | ba918db | 2017-07-12 11:40:32 -0400 | [diff] [blame] | 560 | @Ignore("Flaky") |
Shishir Agrawal | 7ef5b88 | 2017-06-26 12:06:03 -0700 | [diff] [blame] | 561 | public void testCarrierNetworkChange_roamingAfterNetworkChange() { |
| 562 | int strength = SignalStrength.SIGNAL_STRENGTH_GREAT; |
| 563 | |
| 564 | setupDefaultSignal(); |
| 565 | setLevel(strength); |
| 566 | |
| 567 | // Verify baseline |
| 568 | verifyLastMobileDataIndicators(true /* visible */, |
| 569 | strength /* strengthIcon */, |
| 570 | DEFAULT_ICON /* typeIcon */, |
| 571 | false /* roaming */); |
| 572 | |
| 573 | // API call is made |
| 574 | setCarrierNetworkChange(true /* enabled */); |
| 575 | |
| 576 | // Carrier network change is true, show special indicator, no roaming. |
| 577 | verifyLastMobileDataIndicators(true /* visible */, |
| 578 | SignalDrawable.getCarrierChangeState(SignalStrength.NUM_SIGNAL_STRENGTH_BINS), |
| 579 | 0 /* typeIcon */, |
| 580 | false /* roaming */); |
| 581 | |
| 582 | setGsmRoaming(true); |
| 583 | |
| 584 | // Roaming should not show. |
| 585 | verifyLastMobileDataIndicators(true /* visible */, |
| 586 | SignalDrawable.getCarrierChangeState(SignalStrength.NUM_SIGNAL_STRENGTH_BINS), |
| 587 | 0 /* typeIcon */, |
| 588 | false /* roaming */); |
| 589 | |
| 590 | // Revert back |
| 591 | setCarrierNetworkChange(false /* enabled */); |
| 592 | |
| 593 | // Verify back in previous state |
| 594 | verifyLastMobileDataIndicators(true /* visible */, |
| 595 | strength /* strengthIcon */, |
| 596 | DEFAULT_ICON /* typeIcon */, |
| 597 | true /* roaming */); |
| 598 | } |
| 599 | |
Jason Monk | c6cc626 | 2015-06-11 11:10:15 -0400 | [diff] [blame] | 600 | private void verifyEmergencyOnly(boolean isEmergencyOnly) { |
| 601 | ArgumentCaptor<Boolean> emergencyOnly = ArgumentCaptor.forClass(Boolean.class); |
| 602 | Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setEmergencyCallsOnly( |
| 603 | emergencyOnly.capture()); |
| 604 | assertEquals(isEmergencyOnly, (boolean) emergencyOnly.getValue()); |
| 605 | } |
Jason Monk | e0cdb60 | 2014-11-05 12:39:45 -0500 | [diff] [blame] | 606 | } |