Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46163804 authored by Jack Yu's avatar Jack Yu Committed by Android (Google) Code Review
Browse files

Merge "Renamed name source to display name source"

parents d8fafb5e 7d4dd3c2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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)))
@@ -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);
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -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);
            }
+1 −1
Original line number Diff line number Diff line
@@ -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")
+1 −1
Original line number Diff line number Diff line
@@ -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")
+13 −13
Original line number Diff line number Diff line
@@ -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 {
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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");

@@ -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");
@@ -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));
@@ -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);

@@ -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);

@@ -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