Loading src/java/com/android/internal/telephony/SubscriptionController.java +3 −3 Original line number Diff line number Diff line Loading @@ -541,7 +541,7 @@ public class SubscriptionController extends ISub.Stub { SubscriptionManager.DISPLAY_NAME))) .setCarrierName(cursor.getString(cursor.getColumnIndexOrThrow( SubscriptionManager.CARRIER_NAME))) .setNameSource(cursor.getInt(cursor.getColumnIndexOrThrow( .setDisplayNameSource(cursor.getInt(cursor.getColumnIndexOrThrow( SubscriptionManager.NAME_SOURCE))) .setIconTint(cursor.getInt(cursor.getColumnIndexOrThrow( SubscriptionManager.HUE))) Loading Loading @@ -1908,7 +1908,7 @@ public class SubscriptionController extends ISub.Stub { String spn; switch (subInfo.getNameSource()) { switch (subInfo.getDisplayNameSource()) { case SubscriptionManager.NAME_SOURCE_SIM_PNN: String pnn = phone.getPlmn(); return !TextUtils.isEmpty(pnn); Loading Loading @@ -1976,7 +1976,7 @@ public class SubscriptionController extends ISub.Stub { // if there is no sub in the db, return 0 since subId does not exist in db if (allSubInfo == null || allSubInfo.isEmpty()) return 0; for (SubscriptionInfo subInfo : allSubInfo) { int subInfoNameSource = subInfo.getNameSource(); int subInfoNameSource = subInfo.getDisplayNameSource(); boolean isHigherPriority = (getNameSourcePriority(subInfoNameSource) > getNameSourcePriority(nameSource)); boolean isEqualPriorityAndName = (getNameSourcePriority(subInfoNameSource) Loading src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -1018,7 +1018,7 @@ public class SubscriptionInfoUpdater extends Handler { mSubscriptionController.insertEmptySubInfoRecord( embeddedProfile.getIccid(), SubscriptionManager.SIM_NOT_INSERTED); } else { nameSource = existingSubscriptions.get(index).getNameSource(); nameSource = existingSubscriptions.get(index).getDisplayNameSource(); prevCarrierId = existingSubscriptions.get(index).getCarrierId(); existingSubscriptions.remove(index); } Loading tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -1664,7 +1664,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { .setSimSlotIndex(1) .setDisplayName("Android Test") .setDisplayName("Android Test") .setNameSource(SubscriptionManager.NAME_SOURCE_CARRIER) .setDisplayNameSource(SubscriptionManager.NAME_SOURCE_CARRIER) .setNumber("8675309") .setMcc("001") .setMnc("01") Loading tests/telephonytests/src/com/android/internal/telephony/MultiSimSettingControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ public class MultiSimSettingControllerTest extends TelephonyTest { .setSimSlotIndex(0) .setDisplayName("T-mobile") .setCarrierName("T-mobile") .setNameSource(SubscriptionManager.NAME_SOURCE_CARRIER) .setDisplayNameSource(SubscriptionManager.NAME_SOURCE_CARRIER) .setIconTint(255) .setNumber("12345") .setMcc("310") Loading tests/telephonytests/src/com/android/internal/telephony/SubscriptionControllerTest.java +13 −13 Original line number Diff line number Diff line Loading @@ -302,7 +302,7 @@ public class SubscriptionControllerTest extends TelephonyTest { .getActiveSubscriptionInfo(subID, mCallingPackage, mCallingFeature); assertNotNull(subInfo); assertEquals(disName, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } private void setSimEmbedded(boolean isEmbedded) throws Exception { Loading Loading @@ -336,7 +336,7 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest Loading @@ -363,7 +363,7 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest Loading @@ -390,7 +390,7 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest Loading Loading @@ -421,7 +421,7 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest Loading @@ -447,7 +447,7 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest Loading @@ -472,13 +472,13 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest public void testIsExistingNameSourceStillValid_pnnIsNotNull_returnTrue() { when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_SIM_PNN); when(mPhone.getPlmn()).thenReturn("testing_pnn"); Loading @@ -488,7 +488,7 @@ public class SubscriptionControllerTest extends TelephonyTest { @Test @SmallTest public void testIsExistingNameSourceStillValid_spnIsNotNull_returnTrue() { when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_SIM_SPN); when(mUiccController.getUiccProfileForPhone(anyInt())).thenReturn(mUiccProfile); when(mUiccProfile.getServiceProviderName()).thenReturn("testing_spn"); Loading @@ -500,7 +500,7 @@ public class SubscriptionControllerTest extends TelephonyTest { public void testIsExistingNameSourceStillValid_simIsEmbedded_returnTrue() { when(mMockSubscriptionInfo.isEmbedded()).thenReturn(true); when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_CARRIER); assertTrue(mSubscriptionControllerUT.isExistingNameSourceStillValid(mMockSubscriptionInfo)); Loading @@ -510,7 +510,7 @@ public class SubscriptionControllerTest extends TelephonyTest { public void testIsExistingNameSourceStillValid_carrierConfigIsNull_returnTrue() { when(mMockSubscriptionInfo.isEmbedded()).thenReturn(false); when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_CARRIER); when(mCarrierConfigManager.getConfigForSubId(FAKE_SUBID)).thenReturn(null); Loading @@ -521,7 +521,7 @@ public class SubscriptionControllerTest extends TelephonyTest { public void testIsExistingNameSourceStillValid_carrierNameOverrideIsTrue_returnTrue() { when(mMockSubscriptionInfo.isEmbedded()).thenReturn(false); when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_CARRIER); mCarrierConfigs.putBoolean(CarrierConfigManager.KEY_CARRIER_NAME_OVERRIDE_BOOL, true); Loading @@ -532,7 +532,7 @@ public class SubscriptionControllerTest extends TelephonyTest { public void testIsExistingNameSourceStillValid_spnIsNullAndCarrierNameIsNotNull_returnTrue() { when(mMockSubscriptionInfo.isEmbedded()).thenReturn(false); when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_CARRIER); when(mUiccController.getUiccProfileForPhone(anyInt())).thenReturn(mUiccProfile); when(mUiccProfile.getServiceProviderName()).thenReturn(null); Loading Loading
src/java/com/android/internal/telephony/SubscriptionController.java +3 −3 Original line number Diff line number Diff line Loading @@ -541,7 +541,7 @@ public class SubscriptionController extends ISub.Stub { SubscriptionManager.DISPLAY_NAME))) .setCarrierName(cursor.getString(cursor.getColumnIndexOrThrow( SubscriptionManager.CARRIER_NAME))) .setNameSource(cursor.getInt(cursor.getColumnIndexOrThrow( .setDisplayNameSource(cursor.getInt(cursor.getColumnIndexOrThrow( SubscriptionManager.NAME_SOURCE))) .setIconTint(cursor.getInt(cursor.getColumnIndexOrThrow( SubscriptionManager.HUE))) Loading Loading @@ -1908,7 +1908,7 @@ public class SubscriptionController extends ISub.Stub { String spn; switch (subInfo.getNameSource()) { switch (subInfo.getDisplayNameSource()) { case SubscriptionManager.NAME_SOURCE_SIM_PNN: String pnn = phone.getPlmn(); return !TextUtils.isEmpty(pnn); Loading Loading @@ -1976,7 +1976,7 @@ public class SubscriptionController extends ISub.Stub { // if there is no sub in the db, return 0 since subId does not exist in db if (allSubInfo == null || allSubInfo.isEmpty()) return 0; for (SubscriptionInfo subInfo : allSubInfo) { int subInfoNameSource = subInfo.getNameSource(); int subInfoNameSource = subInfo.getDisplayNameSource(); boolean isHigherPriority = (getNameSourcePriority(subInfoNameSource) > getNameSourcePriority(nameSource)); boolean isEqualPriorityAndName = (getNameSourcePriority(subInfoNameSource) Loading
src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -1018,7 +1018,7 @@ public class SubscriptionInfoUpdater extends Handler { mSubscriptionController.insertEmptySubInfoRecord( embeddedProfile.getIccid(), SubscriptionManager.SIM_NOT_INSERTED); } else { nameSource = existingSubscriptions.get(index).getNameSource(); nameSource = existingSubscriptions.get(index).getDisplayNameSource(); prevCarrierId = existingSubscriptions.get(index).getCarrierId(); existingSubscriptions.remove(index); } Loading
tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -1664,7 +1664,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { .setSimSlotIndex(1) .setDisplayName("Android Test") .setDisplayName("Android Test") .setNameSource(SubscriptionManager.NAME_SOURCE_CARRIER) .setDisplayNameSource(SubscriptionManager.NAME_SOURCE_CARRIER) .setNumber("8675309") .setMcc("001") .setMnc("01") Loading
tests/telephonytests/src/com/android/internal/telephony/MultiSimSettingControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ public class MultiSimSettingControllerTest extends TelephonyTest { .setSimSlotIndex(0) .setDisplayName("T-mobile") .setCarrierName("T-mobile") .setNameSource(SubscriptionManager.NAME_SOURCE_CARRIER) .setDisplayNameSource(SubscriptionManager.NAME_SOURCE_CARRIER) .setIconTint(255) .setNumber("12345") .setMcc("310") Loading
tests/telephonytests/src/com/android/internal/telephony/SubscriptionControllerTest.java +13 −13 Original line number Diff line number Diff line Loading @@ -302,7 +302,7 @@ public class SubscriptionControllerTest extends TelephonyTest { .getActiveSubscriptionInfo(subID, mCallingPackage, mCallingFeature); assertNotNull(subInfo); assertEquals(disName, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } private void setSimEmbedded(boolean isEmbedded) throws Exception { Loading Loading @@ -336,7 +336,7 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest Loading @@ -363,7 +363,7 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest Loading @@ -390,7 +390,7 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest Loading Loading @@ -421,7 +421,7 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest Loading @@ -447,7 +447,7 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest Loading @@ -472,13 +472,13 @@ public class SubscriptionControllerTest extends TelephonyTest { assertNotNull(subInfo); assertEquals(DISPLAY_NAME, subInfo.getDisplayName()); assertEquals(nameSource, subInfo.getNameSource()); assertEquals(nameSource, subInfo.getDisplayNameSource()); } @Test @SmallTest public void testIsExistingNameSourceStillValid_pnnIsNotNull_returnTrue() { when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_SIM_PNN); when(mPhone.getPlmn()).thenReturn("testing_pnn"); Loading @@ -488,7 +488,7 @@ public class SubscriptionControllerTest extends TelephonyTest { @Test @SmallTest public void testIsExistingNameSourceStillValid_spnIsNotNull_returnTrue() { when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_SIM_SPN); when(mUiccController.getUiccProfileForPhone(anyInt())).thenReturn(mUiccProfile); when(mUiccProfile.getServiceProviderName()).thenReturn("testing_spn"); Loading @@ -500,7 +500,7 @@ public class SubscriptionControllerTest extends TelephonyTest { public void testIsExistingNameSourceStillValid_simIsEmbedded_returnTrue() { when(mMockSubscriptionInfo.isEmbedded()).thenReturn(true); when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_CARRIER); assertTrue(mSubscriptionControllerUT.isExistingNameSourceStillValid(mMockSubscriptionInfo)); Loading @@ -510,7 +510,7 @@ public class SubscriptionControllerTest extends TelephonyTest { public void testIsExistingNameSourceStillValid_carrierConfigIsNull_returnTrue() { when(mMockSubscriptionInfo.isEmbedded()).thenReturn(false); when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_CARRIER); when(mCarrierConfigManager.getConfigForSubId(FAKE_SUBID)).thenReturn(null); Loading @@ -521,7 +521,7 @@ public class SubscriptionControllerTest extends TelephonyTest { public void testIsExistingNameSourceStillValid_carrierNameOverrideIsTrue_returnTrue() { when(mMockSubscriptionInfo.isEmbedded()).thenReturn(false); when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_CARRIER); mCarrierConfigs.putBoolean(CarrierConfigManager.KEY_CARRIER_NAME_OVERRIDE_BOOL, true); Loading @@ -532,7 +532,7 @@ public class SubscriptionControllerTest extends TelephonyTest { public void testIsExistingNameSourceStillValid_spnIsNullAndCarrierNameIsNotNull_returnTrue() { when(mMockSubscriptionInfo.isEmbedded()).thenReturn(false); when((mMockSubscriptionInfo).getSubscriptionId()).thenReturn(FAKE_SUBID); when(mMockSubscriptionInfo.getNameSource()) when(mMockSubscriptionInfo.getDisplayNameSource()) .thenReturn(SubscriptionManager.NAME_SOURCE_CARRIER); when(mUiccController.getUiccProfileForPhone(anyInt())).thenReturn(mUiccProfile); when(mUiccProfile.getServiceProviderName()).thenReturn(null); Loading