Loading packages/SystemUI/src/com/android/keyguard/CarrierTextManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -293,7 +293,7 @@ public class CarrierTextManager { } protected List<SubscriptionInfo> getSubscriptionInfo() { return mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(false); return mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(); } protected void updateCarrierText() { Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +1 −1 Original line number Diff line number Diff line Loading @@ -605,7 +605,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab * of them based on carrier config. e.g. In this case we should only show one carrier name * on the status bar and quick settings. */ public List<SubscriptionInfo> getFilteredSubscriptionInfo(boolean forceReload) { public List<SubscriptionInfo> getFilteredSubscriptionInfo() { List<SubscriptionInfo> subscriptions = getSubscriptionInfo(false); if (subscriptions.size() == 2) { SubscriptionInfo info1 = subscriptions.get(0); Loading packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java +1 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ public class InternetDialogController implements AccessPointController.AccessPoi }; protected List<SubscriptionInfo> getSubscriptionInfo() { return mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(false); return mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(); } @Inject Loading packages/SystemUI/tests/src/com/android/keyguard/CarrierTextManagerTest.java +13 −14 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; Loading Loading @@ -171,7 +170,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { reset(mCarrierTextCallback); List<SubscriptionInfo> list = new ArrayList<>(); list.add(TEST_SUBSCRIPTION); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); when(mKeyguardUpdateMonitor.getSimState(0)).thenReturn(TelephonyManager.SIM_STATE_READY); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -191,7 +190,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { reset(mCarrierTextCallback); List<SubscriptionInfo> list = new ArrayList<>(); list.add(TEST_SUBSCRIPTION); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); when(mKeyguardUpdateMonitor.getSimState(0)).thenReturn(TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getSimState(1)).thenReturn( TelephonyManager.SIM_STATE_CARD_IO_ERROR); Loading Loading @@ -224,7 +223,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { @Test public void testWrongSlots() { reset(mCarrierTextCallback); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn( when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn( new ArrayList<>()); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_CARD_IO_ERROR); Loading @@ -238,7 +237,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { @Test public void testMoreSlotsThanSubs() { reset(mCarrierTextCallback); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn( when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn( new ArrayList<>()); // STOPSHIP(b/130246708) This line makes sure that SubscriptionManager provides the Loading Loading @@ -289,7 +288,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { list.add(TEST_SUBSCRIPTION); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -314,7 +313,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { list.add(TEST_SUBSCRIPTION_ROAMING); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -339,7 +338,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { list.add(TEST_SUBSCRIPTION_NULL); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -364,7 +363,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { list.add(TEST_SUBSCRIPTION_NULL); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mockWifi(); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading Loading @@ -396,7 +395,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { @Test public void testCreateInfo_noSubscriptions() { reset(mCarrierTextCallback); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn( when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn( new ArrayList<>()); ArgumentCaptor<CarrierTextManager.CarrierTextCallbackInfo> captor = Loading @@ -421,7 +420,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { list.add(TEST_SUBSCRIPTION); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -446,7 +445,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { when(mKeyguardUpdateMonitor.getSimState(anyInt())) .thenReturn(TelephonyManager.SIM_STATE_READY) .thenReturn(TelephonyManager.SIM_STATE_NOT_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -471,7 +470,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { when(mKeyguardUpdateMonitor.getSimState(anyInt())) .thenReturn(TelephonyManager.SIM_STATE_NOT_READY) .thenReturn(TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -498,7 +497,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { .thenReturn(TelephonyManager.SIM_STATE_READY) .thenReturn(TelephonyManager.SIM_STATE_NOT_READY) .thenReturn(TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); ArgumentCaptor<CarrierTextManager.CarrierTextCallbackInfo> captor = Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -906,7 +906,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { mTestableLooper.processAllMessages(); List<SubscriptionInfo> listToVerify = mKeyguardUpdateMonitor .getFilteredSubscriptionInfo(false); .getFilteredSubscriptionInfo(); assertThat(listToVerify.size()).isEqualTo(1); assertThat(listToVerify.get(0)).isEqualTo(TEST_SUBSCRIPTION_2); } Loading Loading
packages/SystemUI/src/com/android/keyguard/CarrierTextManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -293,7 +293,7 @@ public class CarrierTextManager { } protected List<SubscriptionInfo> getSubscriptionInfo() { return mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(false); return mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(); } protected void updateCarrierText() { Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +1 −1 Original line number Diff line number Diff line Loading @@ -605,7 +605,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab * of them based on carrier config. e.g. In this case we should only show one carrier name * on the status bar and quick settings. */ public List<SubscriptionInfo> getFilteredSubscriptionInfo(boolean forceReload) { public List<SubscriptionInfo> getFilteredSubscriptionInfo() { List<SubscriptionInfo> subscriptions = getSubscriptionInfo(false); if (subscriptions.size() == 2) { SubscriptionInfo info1 = subscriptions.get(0); Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java +1 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ public class InternetDialogController implements AccessPointController.AccessPoi }; protected List<SubscriptionInfo> getSubscriptionInfo() { return mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(false); return mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(); } @Inject Loading
packages/SystemUI/tests/src/com/android/keyguard/CarrierTextManagerTest.java +13 −14 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; Loading Loading @@ -171,7 +170,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { reset(mCarrierTextCallback); List<SubscriptionInfo> list = new ArrayList<>(); list.add(TEST_SUBSCRIPTION); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); when(mKeyguardUpdateMonitor.getSimState(0)).thenReturn(TelephonyManager.SIM_STATE_READY); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -191,7 +190,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { reset(mCarrierTextCallback); List<SubscriptionInfo> list = new ArrayList<>(); list.add(TEST_SUBSCRIPTION); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); when(mKeyguardUpdateMonitor.getSimState(0)).thenReturn(TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getSimState(1)).thenReturn( TelephonyManager.SIM_STATE_CARD_IO_ERROR); Loading Loading @@ -224,7 +223,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { @Test public void testWrongSlots() { reset(mCarrierTextCallback); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn( when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn( new ArrayList<>()); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_CARD_IO_ERROR); Loading @@ -238,7 +237,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { @Test public void testMoreSlotsThanSubs() { reset(mCarrierTextCallback); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn( when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn( new ArrayList<>()); // STOPSHIP(b/130246708) This line makes sure that SubscriptionManager provides the Loading Loading @@ -289,7 +288,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { list.add(TEST_SUBSCRIPTION); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -314,7 +313,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { list.add(TEST_SUBSCRIPTION_ROAMING); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -339,7 +338,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { list.add(TEST_SUBSCRIPTION_NULL); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -364,7 +363,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { list.add(TEST_SUBSCRIPTION_NULL); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mockWifi(); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading Loading @@ -396,7 +395,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { @Test public void testCreateInfo_noSubscriptions() { reset(mCarrierTextCallback); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn( when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn( new ArrayList<>()); ArgumentCaptor<CarrierTextManager.CarrierTextCallbackInfo> captor = Loading @@ -421,7 +420,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { list.add(TEST_SUBSCRIPTION); when(mKeyguardUpdateMonitor.getSimState(anyInt())).thenReturn( TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -446,7 +445,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { when(mKeyguardUpdateMonitor.getSimState(anyInt())) .thenReturn(TelephonyManager.SIM_STATE_READY) .thenReturn(TelephonyManager.SIM_STATE_NOT_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -471,7 +470,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { when(mKeyguardUpdateMonitor.getSimState(anyInt())) .thenReturn(TelephonyManager.SIM_STATE_NOT_READY) .thenReturn(TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); Loading @@ -498,7 +497,7 @@ public class CarrierTextManagerTest extends SysuiTestCase { .thenReturn(TelephonyManager.SIM_STATE_READY) .thenReturn(TelephonyManager.SIM_STATE_NOT_READY) .thenReturn(TelephonyManager.SIM_STATE_READY); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo(anyBoolean())).thenReturn(list); when(mKeyguardUpdateMonitor.getFilteredSubscriptionInfo()).thenReturn(list); mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); ArgumentCaptor<CarrierTextManager.CarrierTextCallbackInfo> captor = Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -906,7 +906,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { mTestableLooper.processAllMessages(); List<SubscriptionInfo> listToVerify = mKeyguardUpdateMonitor .getFilteredSubscriptionInfo(false); .getFilteredSubscriptionInfo(); assertThat(listToVerify.size()).isEqualTo(1); assertThat(listToVerify.get(0)).isEqualTo(TEST_SUBSCRIPTION_2); } Loading