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

Commit cc0a45a6 authored by Jack Yu's avatar Jack Yu Committed by android-build-merger
Browse files

Merge changes from topic "cbrs_tethering_failed" am: f604f167

am: 46eed9be

Change-Id: Iabb55836254ac1e7c2905a0829859bbaa1184655
parents a9039fa1 46eed9be
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1301,6 +1301,13 @@ public class PhoneSwitcher extends Handler {
        }
    }

    /**
     * @return The active data subscription id
     */
    public int getActiveDataSubId() {
        return mPreferredDataSubId;
    }

    public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
        final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ");
        pw.println("PhoneSwitcher:");
+27 −0
Original line number Diff line number Diff line
@@ -3688,4 +3688,31 @@ public class SubscriptionController extends ISub.Stub {
        return TextUtils.emptyIfNull(getSubscriptionProperty(subId,
                SubscriptionManager.DATA_ENABLED_OVERRIDE_RULES));
    }

    /**
     * Get active data subscription id.
     *
     * @return Active data subscription id
     *
     * @hide
     */
    @Override
    public int getActiveDataSubscriptionId() {
        final long token = Binder.clearCallingIdentity();

        try {
            PhoneSwitcher phoneSwitcher = PhoneSwitcher.getInstance();
            if (phoneSwitcher != null) {
                int activeDataSubId = phoneSwitcher.getActiveDataSubId();
                if (SubscriptionManager.isUsableSubscriptionId(activeDataSubId)) {
                    return activeDataSubId;
                }
            }
            // If phone switcher isn't ready, or active data sub id is not available, use default
            // sub id from settings.
            return getDefaultDataSubId();
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }
}