blob: 528625ee4dc861f8fe017178d444f517d2a8ba54 [file] [log] [blame]
Fabian Kozynskib176f422019-02-05 09:36:59 -05001/*
2 * Copyright (C) 2019 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 */
16
17package com.android.keyguard;
18
19
20import static android.telephony.SubscriptionManager.DATA_ROAMING_DISABLE;
21import static android.telephony.SubscriptionManager.DATA_ROAMING_ENABLE;
22import static android.telephony.SubscriptionManager.NAME_SOURCE_DEFAULT_SOURCE;
23
24import static junit.framework.Assert.assertTrue;
25
26import static org.junit.Assert.assertEquals;
27import static org.mockito.ArgumentMatchers.any;
28import static org.mockito.ArgumentMatchers.anyBoolean;
29import static org.mockito.ArgumentMatchers.anyInt;
30import static org.mockito.Mockito.never;
31import static org.mockito.Mockito.reset;
32import static org.mockito.Mockito.verify;
33import static org.mockito.Mockito.when;
34
35import android.content.Context;
36import android.net.ConnectivityManager;
37import android.net.wifi.WifiManager;
38import android.os.Handler;
Fabian Kozynskic3d06f32019-07-31 14:18:41 -040039import android.provider.Settings;
Fabian Kozynskib176f422019-02-05 09:36:59 -050040import android.telephony.SubscriptionInfo;
Malcolm Chen06ec3572019-04-09 15:55:29 -070041import android.telephony.SubscriptionManager;
Fabian Kozynskib176f422019-02-05 09:36:59 -050042import android.telephony.TelephonyManager;
43import android.test.suitebuilder.annotation.SmallTest;
44import android.testing.AndroidTestingRunner;
45import android.testing.TestableLooper;
46
47import com.android.internal.telephony.IccCardConstants;
48import com.android.systemui.Dependency;
49import com.android.systemui.SysuiTestCase;
50import com.android.systemui.keyguard.WakefulnessLifecycle;
51
52import org.junit.Before;
53import org.junit.Test;
54import org.junit.runner.RunWith;
55import org.mockito.ArgumentCaptor;
56import org.mockito.Mock;
57import org.mockito.MockitoAnnotations;
58
59import java.util.ArrayList;
Bonian Chena7e9e8c2019-06-02 23:59:31 +000060import java.util.HashMap;
Fabian Kozynskib176f422019-02-05 09:36:59 -050061import java.util.List;
62
63@SmallTest
64@RunWith(AndroidTestingRunner.class)
65@TestableLooper.RunWithLooper
66public class CarrierTextControllerTest extends SysuiTestCase {
67
68 private static final CharSequence SEPARATOR = " \u2014 ";
Fabian Kozynskic3d06f32019-07-31 14:18:41 -040069 private static final CharSequence INVALID_CARD_TEXT = "Invalid card";
70 private static final CharSequence AIRPLANE_MODE_TEXT = "Airplane mode";
Fabian Kozynskib176f422019-02-05 09:36:59 -050071 private static final String TEST_CARRIER = "TEST_CARRIER";
Sooraj Sasindran0d45da72019-04-25 15:12:21 -070072 private static final String TEST_CARRIER_2 = "TEST_CARRIER_2";
73 private static final String TEST_GROUP_UUID = "59b5c870-fc4c-47a4-a99e-9db826b48b24";
74 private static final int TEST_CARRIER_ID = 1;
Fabian Kozynskib176f422019-02-05 09:36:59 -050075 private static final SubscriptionInfo TEST_SUBSCRIPTION = new SubscriptionInfo(0, "", 0,
76 TEST_CARRIER, TEST_CARRIER, NAME_SOURCE_DEFAULT_SOURCE, 0xFFFFFF, "",
Sooraj Sasindran0d45da72019-04-25 15:12:21 -070077 DATA_ROAMING_DISABLE, null, null, null, null, false, null, "", false, TEST_GROUP_UUID,
78 TEST_CARRIER_ID, 0);
79 private static final SubscriptionInfo TEST_SUBSCRIPTION_2 = new SubscriptionInfo(0, "", 0,
80 TEST_CARRIER, TEST_CARRIER_2, NAME_SOURCE_DEFAULT_SOURCE, 0xFFFFFF, "",
81 DATA_ROAMING_DISABLE, null, null, null, null, false, null, "", true, TEST_GROUP_UUID,
82 TEST_CARRIER_ID, 0);
Fabian Kozynskib176f422019-02-05 09:36:59 -050083 private static final SubscriptionInfo TEST_SUBSCRIPTION_ROAMING = new SubscriptionInfo(0, "", 0,
84 TEST_CARRIER, TEST_CARRIER, NAME_SOURCE_DEFAULT_SOURCE, 0xFFFFFF, "",
85 DATA_ROAMING_ENABLE, null, null, null, null, false, null, "");
86 @Mock
87 private WifiManager mWifiManager;
88 @Mock
89 private CarrierTextController.CarrierTextCallback mCarrierTextCallback;
90 @Mock
91 private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
92 @Mock
93 private ConnectivityManager mConnectivityManager;
94 @Mock
95 private TelephonyManager mTelephonyManager;
Malcolm Chen06ec3572019-04-09 15:55:29 -070096 @Mock
97 private SubscriptionManager mSubscriptionManager;
Fabian Kozynskib176f422019-02-05 09:36:59 -050098 private CarrierTextController.CarrierTextCallbackInfo mCarrierTextCallbackInfo;
99
100 private CarrierTextController mCarrierTextController;
101 private TestableLooper mTestableLooper;
102
103 @Before
104 public void setUp() {
105 MockitoAnnotations.initMocks(this);
106 mTestableLooper = TestableLooper.get(this);
107
108 mContext.addMockSystemService(WifiManager.class, mWifiManager);
109 mContext.addMockSystemService(ConnectivityManager.class, mConnectivityManager);
110 mContext.addMockSystemService(TelephonyManager.class, mTelephonyManager);
Malcolm Chen06ec3572019-04-09 15:55:29 -0700111 mContext.addMockSystemService(SubscriptionManager.class, mSubscriptionManager);
Fabian Kozynskic3d06f32019-07-31 14:18:41 -0400112 mContext.getOrCreateTestableResources().addOverride(
113 R.string.keyguard_sim_error_message_short, INVALID_CARD_TEXT);
114 mContext.getOrCreateTestableResources().addOverride(
115 R.string.airplane_mode, AIRPLANE_MODE_TEXT);
Fabian Kozynskib176f422019-02-05 09:36:59 -0500116 mDependency.injectMockDependency(WakefulnessLifecycle.class);
117 mDependency.injectTestDependency(Dependency.MAIN_HANDLER,
118 new Handler(mTestableLooper.getLooper()));
119
120 mCarrierTextCallbackInfo = new CarrierTextController.CarrierTextCallbackInfo("",
121 new CharSequence[]{}, false, new int[]{});
Malcolm Chen387dc0e2019-10-08 18:11:22 -0700122 when(mTelephonyManager.getSupportedModemCount()).thenReturn(3);
Fabian Kozynski00d02f12019-04-15 09:48:30 -0400123
Fabian Kozynskib176f422019-02-05 09:36:59 -0500124 mCarrierTextController = new TestCarrierTextController(mContext, SEPARATOR, true, true,
125 mKeyguardUpdateMonitor);
126 // This should not start listening on any of the real dependencies
127 mCarrierTextController.setListening(mCarrierTextCallback);
Sooraj Sasindranb7d633b2019-05-02 13:47:21 -0700128 mCarrierTextController.updateDisplayOpportunisticSubscriptionCarrierText(false);
Fabian Kozynskib176f422019-02-05 09:36:59 -0500129 }
130
131 @Test
Fabian Kozynskic3d06f32019-07-31 14:18:41 -0400132 public void testAirplaneMode() {
133 Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 1);
134 reset(mCarrierTextCallback);
135 List<SubscriptionInfo> list = new ArrayList<>();
136 list.add(TEST_SUBSCRIPTION);
137 when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(list);
138 when(mKeyguardUpdateMonitor.getSimState(0)).thenReturn(IccCardConstants.State.READY);
139 mKeyguardUpdateMonitor.mServiceStates = new HashMap<>();
140
141 mCarrierTextController.updateCarrierText();
142
143 ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor =
144 ArgumentCaptor.forClass(
145 CarrierTextController.CarrierTextCallbackInfo.class);
146
147 mTestableLooper.processAllMessages();
148 verify(mCarrierTextCallback).updateCarrierInfo(captor.capture());
149 assertEquals(AIRPLANE_MODE_TEXT, captor.getValue().carrierText);
150 }
151
152 @Test
153 public void testCardIOError() {
154 reset(mCarrierTextCallback);
155 List<SubscriptionInfo> list = new ArrayList<>();
156 list.add(TEST_SUBSCRIPTION);
157 when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(list);
158 when(mKeyguardUpdateMonitor.getSimState(0)).thenReturn(IccCardConstants.State.READY);
159 when(mKeyguardUpdateMonitor.getSimState(1)).thenReturn(
160 IccCardConstants.State.CARD_IO_ERROR);
161 mKeyguardUpdateMonitor.mServiceStates = new HashMap<>();
162
163 mCarrierTextController.mCallback.onSimStateChanged(3, 1,
164 IccCardConstants.State.CARD_IO_ERROR);
165
166 ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor =
167 ArgumentCaptor.forClass(
168 CarrierTextController.CarrierTextCallbackInfo.class);
169
170 mTestableLooper.processAllMessages();
171 verify(mCarrierTextCallback).updateCarrierInfo(captor.capture());
172 assertEquals("TEST_CARRIER" + SEPARATOR + INVALID_CARD_TEXT, captor.getValue().carrierText);
173 // There's only one subscription in the list
174 assertEquals(1, captor.getValue().listOfCarriers.length);
175 assertEquals(TEST_CARRIER, captor.getValue().listOfCarriers[0]);
176 }
177
178 @Test
Fabian Kozynskib176f422019-02-05 09:36:59 -0500179 public void testWrongSlots() {
180 reset(mCarrierTextCallback);
181 when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(
182 new ArrayList<>());
183 when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn(
184 IccCardConstants.State.CARD_IO_ERROR);
185 // This should not produce an out of bounds error, even though there are no subscriptions
186 mCarrierTextController.mCallback.onSimStateChanged(0, -3,
187 IccCardConstants.State.CARD_IO_ERROR);
188 mCarrierTextController.mCallback.onSimStateChanged(0, 3, IccCardConstants.State.READY);
189 verify(mCarrierTextCallback, never()).updateCarrierInfo(any());
190 }
191
192 @Test
193 public void testMoreSlotsThanSubs() {
194 reset(mCarrierTextCallback);
195 when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(
196 new ArrayList<>());
Fabian Kozynski00d02f12019-04-15 09:48:30 -0400197
198 // STOPSHIP(b/130246708) This line makes sure that SubscriptionManager provides the
199 // same answer as KeyguardUpdateMonitor. Remove when this is addressed
200 when(mSubscriptionManager.getActiveSubscriptionInfoList(anyBoolean())).thenReturn(
201 new ArrayList<>());
202
Fabian Kozynskib176f422019-02-05 09:36:59 -0500203 when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn(
204 IccCardConstants.State.CARD_IO_ERROR);
205 // This should not produce an out of bounds error, even though there are no subscriptions
206 mCarrierTextController.mCallback.onSimStateChanged(0, 1,
207 IccCardConstants.State.CARD_IO_ERROR);
208
209 mTestableLooper.processAllMessages();
210 verify(mCarrierTextCallback).updateCarrierInfo(
211 any(CarrierTextController.CarrierTextCallbackInfo.class));
212 }
213
214 @Test
215 public void testCallback() {
216 reset(mCarrierTextCallback);
217 mCarrierTextController.postToCallback(mCarrierTextCallbackInfo);
218 mTestableLooper.processAllMessages();
219
220 ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor =
221 ArgumentCaptor.forClass(
222 CarrierTextController.CarrierTextCallbackInfo.class);
223 verify(mCarrierTextCallback).updateCarrierInfo(captor.capture());
224 assertEquals(mCarrierTextCallbackInfo, captor.getValue());
225 }
226
227 @Test
228 public void testNullingCallback() {
229 reset(mCarrierTextCallback);
230
231 mCarrierTextController.postToCallback(mCarrierTextCallbackInfo);
232 mCarrierTextController.setListening(null);
233
234 // This shouldn't produce NPE
235 mTestableLooper.processAllMessages();
236 verify(mCarrierTextCallback).updateCarrierInfo(any());
237 }
238
239 @Test
240 public void testCreateInfo_OneValidSubscription() {
241 reset(mCarrierTextCallback);
242 List<SubscriptionInfo> list = new ArrayList<>();
243 list.add(TEST_SUBSCRIPTION);
244 when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn(IccCardConstants.State.READY);
245 when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(list);
Fabian Kozynski00d02f12019-04-15 09:48:30 -0400246
Bonian Chena7e9e8c2019-06-02 23:59:31 +0000247 mKeyguardUpdateMonitor.mServiceStates = new HashMap<>();
248
Fabian Kozynskib176f422019-02-05 09:36:59 -0500249 ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor =
250 ArgumentCaptor.forClass(
251 CarrierTextController.CarrierTextCallbackInfo.class);
252
253 mCarrierTextController.updateCarrierText();
254 mTestableLooper.processAllMessages();
255 verify(mCarrierTextCallback).updateCarrierInfo(captor.capture());
256
257 CarrierTextController.CarrierTextCallbackInfo info = captor.getValue();
258 assertEquals(1, info.listOfCarriers.length);
259 assertEquals(TEST_CARRIER, info.listOfCarriers[0]);
260 assertEquals(1, info.subscriptionIds.length);
261 }
262
263 @Test
264 public void testCreateInfo_OneValidSubscriptionWithRoaming() {
265 reset(mCarrierTextCallback);
266 List<SubscriptionInfo> list = new ArrayList<>();
267 list.add(TEST_SUBSCRIPTION_ROAMING);
268 when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn(IccCardConstants.State.READY);
269 when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(list);
Fabian Kozynski00d02f12019-04-15 09:48:30 -0400270
Bonian Chena7e9e8c2019-06-02 23:59:31 +0000271 mKeyguardUpdateMonitor.mServiceStates = new HashMap<>();
272
Fabian Kozynskib176f422019-02-05 09:36:59 -0500273 ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor =
274 ArgumentCaptor.forClass(
275 CarrierTextController.CarrierTextCallbackInfo.class);
276
277 mCarrierTextController.updateCarrierText();
278 mTestableLooper.processAllMessages();
279 verify(mCarrierTextCallback).updateCarrierInfo(captor.capture());
280
281 CarrierTextController.CarrierTextCallbackInfo info = captor.getValue();
282 assertEquals(1, info.listOfCarriers.length);
283 assertTrue(info.listOfCarriers[0].toString().contains(TEST_CARRIER));
284 assertEquals(1, info.subscriptionIds.length);
285 }
286
287 @Test
288 public void testCreateInfo_noSubscriptions() {
289 reset(mCarrierTextCallback);
290 when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(
291 new ArrayList<>());
Fabian Kozynski00d02f12019-04-15 09:48:30 -0400292
Fabian Kozynskib176f422019-02-05 09:36:59 -0500293 ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor =
294 ArgumentCaptor.forClass(
295 CarrierTextController.CarrierTextCallbackInfo.class);
296
297 mCarrierTextController.updateCarrierText();
298 mTestableLooper.processAllMessages();
299 verify(mCarrierTextCallback).updateCarrierInfo(captor.capture());
300
301 CarrierTextController.CarrierTextCallbackInfo info = captor.getValue();
302 assertEquals(0, info.listOfCarriers.length);
303 assertEquals(0, info.subscriptionIds.length);
304
305 }
306
Fabian Kozynski00d02f12019-04-15 09:48:30 -0400307 @Test
308 public void testCarrierText_twoValidSubscriptions() {
309 reset(mCarrierTextCallback);
310 List<SubscriptionInfo> list = new ArrayList<>();
311 list.add(TEST_SUBSCRIPTION);
312 list.add(TEST_SUBSCRIPTION);
313 when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn(IccCardConstants.State.READY);
314 when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(list);
315
Bonian Chena7e9e8c2019-06-02 23:59:31 +0000316 mKeyguardUpdateMonitor.mServiceStates = new HashMap<>();
317
Fabian Kozynski00d02f12019-04-15 09:48:30 -0400318 ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor =
319 ArgumentCaptor.forClass(
320 CarrierTextController.CarrierTextCallbackInfo.class);
321
322 mCarrierTextController.updateCarrierText();
323 mTestableLooper.processAllMessages();
324 verify(mCarrierTextCallback).updateCarrierInfo(captor.capture());
325
326 assertEquals(TEST_CARRIER + SEPARATOR + TEST_CARRIER,
327 captor.getValue().carrierText);
328 }
329
330 @Test
331 public void testCarrierText_oneDisabledSub() {
332 reset(mCarrierTextCallback);
333 List<SubscriptionInfo> list = new ArrayList<>();
334 list.add(TEST_SUBSCRIPTION);
335 list.add(TEST_SUBSCRIPTION);
336 when(mKeyguardUpdateMonitor.getSimState(anyInt()))
337 .thenReturn(IccCardConstants.State.READY)
338 .thenReturn(IccCardConstants.State.NOT_READY);
339 when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(list);
340
Bonian Chena7e9e8c2019-06-02 23:59:31 +0000341 mKeyguardUpdateMonitor.mServiceStates = new HashMap<>();
342
Fabian Kozynski00d02f12019-04-15 09:48:30 -0400343 ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor =
344 ArgumentCaptor.forClass(
345 CarrierTextController.CarrierTextCallbackInfo.class);
346
347 mCarrierTextController.updateCarrierText();
348 mTestableLooper.processAllMessages();
349 verify(mCarrierTextCallback).updateCarrierInfo(captor.capture());
350
351 assertEquals(TEST_CARRIER,
352 captor.getValue().carrierText);
353 }
354
355 @Test
356 public void testCarrierText_firstDisabledSub() {
357 reset(mCarrierTextCallback);
358 List<SubscriptionInfo> list = new ArrayList<>();
359 list.add(TEST_SUBSCRIPTION);
360 list.add(TEST_SUBSCRIPTION);
361 when(mKeyguardUpdateMonitor.getSimState(anyInt()))
362 .thenReturn(IccCardConstants.State.NOT_READY)
363 .thenReturn(IccCardConstants.State.READY);
364 when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(list);
365
Bonian Chena7e9e8c2019-06-02 23:59:31 +0000366 mKeyguardUpdateMonitor.mServiceStates = new HashMap<>();
367
Fabian Kozynski00d02f12019-04-15 09:48:30 -0400368 ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor =
369 ArgumentCaptor.forClass(
370 CarrierTextController.CarrierTextCallbackInfo.class);
371
372 mCarrierTextController.updateCarrierText();
373 mTestableLooper.processAllMessages();
374 verify(mCarrierTextCallback).updateCarrierInfo(captor.capture());
375
376 assertEquals(TEST_CARRIER,
377 captor.getValue().carrierText);
378 }
379
380 @Test
381 public void testCarrierText_threeSubsMiddleDisabled() {
382 reset(mCarrierTextCallback);
383 List<SubscriptionInfo> list = new ArrayList<>();
384 list.add(TEST_SUBSCRIPTION);
385 list.add(TEST_SUBSCRIPTION);
386 list.add(TEST_SUBSCRIPTION);
387 when(mKeyguardUpdateMonitor.getSimState(anyInt()))
388 .thenReturn(IccCardConstants.State.READY)
389 .thenReturn(IccCardConstants.State.NOT_READY)
390 .thenReturn(IccCardConstants.State.READY);
391 when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(list);
Bonian Chena7e9e8c2019-06-02 23:59:31 +0000392 mKeyguardUpdateMonitor.mServiceStates = new HashMap<>();
Fabian Kozynski00d02f12019-04-15 09:48:30 -0400393
Fabian Kozynski00d02f12019-04-15 09:48:30 -0400394 ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor =
395 ArgumentCaptor.forClass(
396 CarrierTextController.CarrierTextCallbackInfo.class);
397
398 mCarrierTextController.updateCarrierText();
399 mTestableLooper.processAllMessages();
400 verify(mCarrierTextCallback).updateCarrierInfo(captor.capture());
401
402 assertEquals(TEST_CARRIER + SEPARATOR + TEST_CARRIER,
403 captor.getValue().carrierText);
404 }
405
Sooraj Sasindran0d45da72019-04-25 15:12:21 -0700406 @Test
407 public void testCarrierText_GroupedSubWithOpportunisticCarrierText() {
408 reset(mCarrierTextCallback);
409 List<SubscriptionInfo> list = new ArrayList<>();
410 list.add(TEST_SUBSCRIPTION);
411 list.add(TEST_SUBSCRIPTION_2);
412 when(mKeyguardUpdateMonitor.getSimState(anyInt()))
413 .thenReturn(IccCardConstants.State.READY);
Fabian Kozynski8d735cc2019-04-29 10:44:10 -0400414
Bonian Chena7e9e8c2019-06-02 23:59:31 +0000415 mKeyguardUpdateMonitor.mServiceStates = new HashMap<>();
Sooraj Sasindranb7d633b2019-05-02 13:47:21 -0700416 mCarrierTextController.updateDisplayOpportunisticSubscriptionCarrierText(true);
Sooraj Sasindran0d45da72019-04-25 15:12:21 -0700417 when(mSubscriptionManager.getActiveSubscriptionInfoList(anyBoolean())).thenReturn(list);
418
419 ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor =
420 ArgumentCaptor.forClass(
421 CarrierTextController.CarrierTextCallbackInfo.class);
422
423 mCarrierTextController.updateCarrierText();
424 mTestableLooper.processAllMessages();
425 verify(mCarrierTextCallback).updateCarrierInfo(captor.capture());
426
427 assertEquals(TEST_CARRIER_2, captor.getValue().carrierText);
428 }
429
Fabian Kozynskib176f422019-02-05 09:36:59 -0500430 public static class TestCarrierTextController extends CarrierTextController {
431 private KeyguardUpdateMonitor mKUM;
432
433 public TestCarrierTextController(Context context, CharSequence separator,
434 boolean showAirplaneMode, boolean showMissingSim, KeyguardUpdateMonitor kum) {
435 super(context, separator, showAirplaneMode, showMissingSim);
436 mKUM = kum;
437 }
438
439 @Override
440 public void setListening(CarrierTextCallback callback) {
441 super.setListening(callback);
442 mKeyguardUpdateMonitor = mKUM;
443 }
Fabian Kozynskib176f422019-02-05 09:36:59 -0500444 }
445}