Loading src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +4 −8 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ import android.os.PersistableBundle; import android.os.UserHandle; import android.preference.PreferenceManager; import android.service.carrier.CarrierIdentifier; import android.service.carrier.CarrierService; import android.service.euicc.EuiccProfileInfo; import android.service.euicc.EuiccService; import android.service.euicc.GetEuiccProfileInfoListResult; Loading Loading @@ -65,10 +64,8 @@ import com.android.telephony.Rlog; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.CopyOnWriteArraySet; import java.util.stream.Collectors; /** *@hide Loading Loading @@ -1083,11 +1080,10 @@ public class SubscriptionInfoUpdater extends Handler { private boolean isCarrierServicePackage(int phoneId, String pkgName) { if (pkgName.equals(getDefaultCarrierServicePackageName())) return false; List<String> carrierPackageNames = TelephonyManager.from(sContext) .getCarrierPackageNamesForIntentAndPhone( new Intent(CarrierService.CARRIER_SERVICE_INTERFACE), phoneId); if (DBG) logd("Carrier Packages For Subscription = " + carrierPackageNames); return carrierPackageNames != null && carrierPackageNames.contains(pkgName); String carrierPackageName = TelephonyManager.from(sContext) .getCarrierServicePackageNameForLogicalSlot(phoneId); if (DBG) logd("Carrier service package for subscription = " + carrierPackageName); return pkgName.equals(carrierPackageName); } /** Loading tests/telephonytests/src/com/android/internal/telephony/SubscriptionInfoUpdaterTest.java +10 −11 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ import org.mockito.stubbing.Answer; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; Loading Loading @@ -746,8 +745,8 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest { doReturn(FAKE_SUB_ID_1).when(mSubscriptionController).getSubIdUsingPhoneId(phoneId); doReturn(mSubInfo).when(mSubscriptionController).getSubscriptionInfo(eq(FAKE_SUB_ID_1)); doReturn(Collections.singletonList(carrierPackageName)).when(mTelephonyManager) .getCarrierPackageNamesForIntentAndPhone(any(), eq(phoneId)); doReturn(carrierPackageName).when(mTelephonyManager) .getCarrierServicePackageNameForLogicalSlot(eq(phoneId)); ((MockContentResolver) mContext.getContentResolver()).addProvider( SubscriptionManager.CONTENT_URI.getAuthority(), new FakeSubscriptionContentProvider()); Loading @@ -772,8 +771,8 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest { doReturn(FAKE_SUB_ID_1).when(mSubscriptionController).getSubIdUsingPhoneId(phoneId); doReturn(mSubInfo).when(mSubscriptionController).getSubscriptionInfo(eq(FAKE_SUB_ID_1)); doReturn(false).when(mSubInfo).isOpportunistic(); doReturn(Collections.singletonList(carrierPackageName)).when(mTelephonyManager) .getCarrierPackageNamesForIntentAndPhone(any(), eq(phoneId)); doReturn(carrierPackageName).when(mTelephonyManager) .getCarrierServicePackageNameForLogicalSlot(eq(phoneId)); ((MockContentResolver) mContext.getContentResolver()).addProvider( SubscriptionManager.CONTENT_URI.getAuthority(), new FakeSubscriptionContentProvider()); Loading Loading @@ -805,8 +804,8 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest { ParcelUuid.fromString("11111111-2222-3333-4444-555555555555"), carrierPackageName); doReturn(FAKE_SUB_ID_1).when(mSubscriptionController).getSubIdUsingPhoneId(phoneId); doReturn(mSubInfo).when(mSubscriptionController).getSubscriptionInfo(eq(FAKE_SUB_ID_1)); doReturn(Collections.singletonList(carrierPackageName)).when(mTelephonyManager) .getCarrierPackageNamesForIntentAndPhone(any(), eq(phoneId)); doReturn(carrierPackageName).when(mTelephonyManager) .getCarrierServicePackageNameForLogicalSlot(eq(phoneId)); ((MockContentResolver) mContext.getContentResolver()).addProvider( SubscriptionManager.CONTENT_URI.getAuthority(), new FakeSubscriptionContentProvider()); Loading Loading @@ -842,8 +841,8 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest { doReturn(mSubInfo).when(mSubscriptionController).getSubscriptionInfo(eq(FAKE_SUB_ID_1)); doReturn(ParcelUuid.fromString("11111111-2222-3333-4444-555555555555")) .when(mSubInfo).getGroupUuid(); doReturn(Collections.singletonList(carrierPackageName)).when(mTelephonyManager) .getCarrierPackageNamesForIntentAndPhone(any(), eq(phoneId)); doReturn(carrierPackageName).when(mTelephonyManager) .getCarrierServicePackageNameForLogicalSlot(eq(phoneId)); ((MockContentResolver) mContext.getContentResolver()).addProvider( SubscriptionManager.CONTENT_URI.getAuthority(), new FakeSubscriptionContentProvider()); Loading Loading @@ -885,8 +884,8 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest { doReturn(FAKE_SUB_ID_1).when(mSubscriptionController).getSubIdUsingPhoneId(phoneId); doReturn(mSubInfo).when(mSubscriptionController).getSubscriptionInfo(eq(FAKE_SUB_ID_1)); doReturn(false).when(mSubInfo).isOpportunistic(); doReturn(Collections.singletonList(carrierPackageName)).when(mTelephonyManager) .getCarrierPackageNamesForIntentAndPhone(any(), eq(phoneId)); doReturn(carrierPackageName).when(mTelephonyManager) .getCarrierServicePackageNameForLogicalSlot(eq(phoneId)); ((MockContentResolver) mContext.getContentResolver()).addProvider( SubscriptionManager.CONTENT_URI.getAuthority(), new FakeSubscriptionContentProvider()); Loading Loading
src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +4 −8 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ import android.os.PersistableBundle; import android.os.UserHandle; import android.preference.PreferenceManager; import android.service.carrier.CarrierIdentifier; import android.service.carrier.CarrierService; import android.service.euicc.EuiccProfileInfo; import android.service.euicc.EuiccService; import android.service.euicc.GetEuiccProfileInfoListResult; Loading Loading @@ -65,10 +64,8 @@ import com.android.telephony.Rlog; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.CopyOnWriteArraySet; import java.util.stream.Collectors; /** *@hide Loading Loading @@ -1083,11 +1080,10 @@ public class SubscriptionInfoUpdater extends Handler { private boolean isCarrierServicePackage(int phoneId, String pkgName) { if (pkgName.equals(getDefaultCarrierServicePackageName())) return false; List<String> carrierPackageNames = TelephonyManager.from(sContext) .getCarrierPackageNamesForIntentAndPhone( new Intent(CarrierService.CARRIER_SERVICE_INTERFACE), phoneId); if (DBG) logd("Carrier Packages For Subscription = " + carrierPackageNames); return carrierPackageNames != null && carrierPackageNames.contains(pkgName); String carrierPackageName = TelephonyManager.from(sContext) .getCarrierServicePackageNameForLogicalSlot(phoneId); if (DBG) logd("Carrier service package for subscription = " + carrierPackageName); return pkgName.equals(carrierPackageName); } /** Loading
tests/telephonytests/src/com/android/internal/telephony/SubscriptionInfoUpdaterTest.java +10 −11 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ import org.mockito.stubbing.Answer; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; Loading Loading @@ -746,8 +745,8 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest { doReturn(FAKE_SUB_ID_1).when(mSubscriptionController).getSubIdUsingPhoneId(phoneId); doReturn(mSubInfo).when(mSubscriptionController).getSubscriptionInfo(eq(FAKE_SUB_ID_1)); doReturn(Collections.singletonList(carrierPackageName)).when(mTelephonyManager) .getCarrierPackageNamesForIntentAndPhone(any(), eq(phoneId)); doReturn(carrierPackageName).when(mTelephonyManager) .getCarrierServicePackageNameForLogicalSlot(eq(phoneId)); ((MockContentResolver) mContext.getContentResolver()).addProvider( SubscriptionManager.CONTENT_URI.getAuthority(), new FakeSubscriptionContentProvider()); Loading @@ -772,8 +771,8 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest { doReturn(FAKE_SUB_ID_1).when(mSubscriptionController).getSubIdUsingPhoneId(phoneId); doReturn(mSubInfo).when(mSubscriptionController).getSubscriptionInfo(eq(FAKE_SUB_ID_1)); doReturn(false).when(mSubInfo).isOpportunistic(); doReturn(Collections.singletonList(carrierPackageName)).when(mTelephonyManager) .getCarrierPackageNamesForIntentAndPhone(any(), eq(phoneId)); doReturn(carrierPackageName).when(mTelephonyManager) .getCarrierServicePackageNameForLogicalSlot(eq(phoneId)); ((MockContentResolver) mContext.getContentResolver()).addProvider( SubscriptionManager.CONTENT_URI.getAuthority(), new FakeSubscriptionContentProvider()); Loading Loading @@ -805,8 +804,8 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest { ParcelUuid.fromString("11111111-2222-3333-4444-555555555555"), carrierPackageName); doReturn(FAKE_SUB_ID_1).when(mSubscriptionController).getSubIdUsingPhoneId(phoneId); doReturn(mSubInfo).when(mSubscriptionController).getSubscriptionInfo(eq(FAKE_SUB_ID_1)); doReturn(Collections.singletonList(carrierPackageName)).when(mTelephonyManager) .getCarrierPackageNamesForIntentAndPhone(any(), eq(phoneId)); doReturn(carrierPackageName).when(mTelephonyManager) .getCarrierServicePackageNameForLogicalSlot(eq(phoneId)); ((MockContentResolver) mContext.getContentResolver()).addProvider( SubscriptionManager.CONTENT_URI.getAuthority(), new FakeSubscriptionContentProvider()); Loading Loading @@ -842,8 +841,8 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest { doReturn(mSubInfo).when(mSubscriptionController).getSubscriptionInfo(eq(FAKE_SUB_ID_1)); doReturn(ParcelUuid.fromString("11111111-2222-3333-4444-555555555555")) .when(mSubInfo).getGroupUuid(); doReturn(Collections.singletonList(carrierPackageName)).when(mTelephonyManager) .getCarrierPackageNamesForIntentAndPhone(any(), eq(phoneId)); doReturn(carrierPackageName).when(mTelephonyManager) .getCarrierServicePackageNameForLogicalSlot(eq(phoneId)); ((MockContentResolver) mContext.getContentResolver()).addProvider( SubscriptionManager.CONTENT_URI.getAuthority(), new FakeSubscriptionContentProvider()); Loading Loading @@ -885,8 +884,8 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest { doReturn(FAKE_SUB_ID_1).when(mSubscriptionController).getSubIdUsingPhoneId(phoneId); doReturn(mSubInfo).when(mSubscriptionController).getSubscriptionInfo(eq(FAKE_SUB_ID_1)); doReturn(false).when(mSubInfo).isOpportunistic(); doReturn(Collections.singletonList(carrierPackageName)).when(mTelephonyManager) .getCarrierPackageNamesForIntentAndPhone(any(), eq(phoneId)); doReturn(carrierPackageName).when(mTelephonyManager) .getCarrierServicePackageNameForLogicalSlot(eq(phoneId)); ((MockContentResolver) mContext.getContentResolver()).addProvider( SubscriptionManager.CONTENT_URI.getAuthority(), new FakeSubscriptionContentProvider()); Loading