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

Commit f89024eb authored by Pengquan Meng's avatar Pengquan Meng Committed by android-build-merger
Browse files

Merge "Fix getAvailableSubscriotion issue." am: 235bbd82 am: aa498c05

am: 466c82fb

Change-Id: I376d6b61c74313e37316f099e7f7fbc48f81fab2
parents 6e1c85e7 466c82fb
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -771,19 +771,17 @@ public class SubscriptionController extends ISub.Stub {
        // Now that all security checks pass, perform the operation as ourselves.
        final long identity = Binder.clearCallingIdentity();
        try {
            String selection = SubscriptionManager.SIM_SLOT_INDEX + ">=0 OR "
                    + SubscriptionManager.SUBSCRIPTION_TYPE + "="
                    + SubscriptionManager.SUBSCRIPTION_TYPE_REMOTE_SIM;

            EuiccManager euiccManager =
                    (EuiccManager) mContext.getSystemService(Context.EUICC_SERVICE);
            if (!euiccManager.isEnabled()) {
                if (DBG) logdl("[getAvailableSubInfoList] Embedded subscriptions are disabled");
                return null;
            if (euiccManager.isEnabled()) {
                selection += " OR " + SubscriptionManager.IS_EMBEDDED + "=1";
            }

            List<SubscriptionInfo> subList = getSubInfo(
                    SubscriptionManager.SIM_SLOT_INDEX + ">=0 OR "
                            + SubscriptionManager.IS_EMBEDDED + "=1 OR "
                            + SubscriptionManager.SUBSCRIPTION_TYPE + "="
                            + SubscriptionManager.SUBSCRIPTION_TYPE_REMOTE_SIM,
                    null);
            List<SubscriptionInfo> subList = getSubInfo(selection, null /* queryKey */);

            if (subList != null) {
                subList.sort(SUBSCRIPTION_INFO_COMPARATOR);