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

Commit 0fee01f6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Create UiccController before SubscriptionController init"

parents 008c5443 273124f2
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -166,13 +166,14 @@ public class PhoneFactory {
                    sCommandsInterfaces[i] = new RIL(context, networkModes[i],
                            cdmaSubscription, i);
                }
                Rlog.i(LOG_TAG, "Creating SubscriptionController");
                SubscriptionController.init(context, sCommandsInterfaces);

                // Instantiate UiccController so that all other classes can just
                // call getInstance()
                sUiccController = UiccController.make(context, sCommandsInterfaces);

                Rlog.i(LOG_TAG, "Creating SubscriptionController");
                SubscriptionController.init(context, sCommandsInterfaces);

                if (context.getPackageManager().hasSystemFeature(
                        PackageManager.FEATURE_TELEPHONY_EUICC)) {
                    sEuiccController = EuiccController.init(context);
+11 −3
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ public class SubscriptionController extends ISub.Stub {
    @UnsupportedAppUsage
    protected Context mContext;
    protected TelephonyManager mTelephonyManager;
    protected UiccController mUiccController;

    private AppOpsManager mAppOps;

@@ -222,6 +223,13 @@ public class SubscriptionController extends ISub.Stub {
        mContext = c;
        mTelephonyManager = TelephonyManager.from(mContext);

        try {
            mUiccController = UiccController.getInstance();
        } catch(RuntimeException ex) {
            throw new RuntimeException(
                    "UiccController has to be initialised before SubscriptionController init");
        }

        mAppOps = (AppOpsManager)mContext.getSystemService(Context.APP_OPS_SERVICE);

        if(ServiceManager.getService("isub") == null) {
@@ -351,7 +359,7 @@ public class SubscriptionController extends ISub.Stub {
        String countryIso = cursor.getString(cursor.getColumnIndexOrThrow(
                SubscriptionManager.ISO_COUNTRY_CODE));
        // publicCardId is the publicly exposed int card ID
        int publicCardId = UiccController.getInstance().convertToPublicCardId(cardId);
        int publicCardId = mUiccController.convertToPublicCardId(cardId);
        boolean isEmbedded = cursor.getInt(cursor.getColumnIndexOrThrow(
                SubscriptionManager.IS_EMBEDDED)) == 1;
        int carrierId = cursor.getInt(cursor.getColumnIndexOrThrow(
@@ -1041,7 +1049,7 @@ public class SubscriptionController extends ISub.Stub {
                            value.put(SubscriptionManager.ICC_ID, uniqueId);
                        }

                        UiccCard card = UiccController.getInstance().getUiccCardForPhone(slotIndex);
                        UiccCard card = mUiccController.getUiccCardForPhone(slotIndex);
                        if (card != null) {
                            String cardId = card.getCardId();
                            if (cardId != null && cardId != oldCardId) {
@@ -1366,7 +1374,7 @@ public class SubscriptionController extends ISub.Stub {
        if (isSubscriptionForRemoteSim(subscriptionType)) {
            value.put(SubscriptionManager.DISPLAY_NAME, displayName);
        } else {
            UiccCard card = UiccController.getInstance().getUiccCardForPhone(slotIndex);
            UiccCard card = mUiccController.getUiccCardForPhone(slotIndex);
            if (card != null) {
                String cardId = card.getCardId();
                if (cardId != null) {