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

Commit 7a4f2d25 authored by Jack Yu's avatar Jack Yu
Browse files

Fixed tethering failed when device is on CBRS

Fixed by using the correct sub id for CBRS subscription

Bug: 133852860
Test: Manual
Merged-In: I0b83d2d06580ea9f571dd1dd2608ba3a5d40d79e
Change-Id: I0b83d2d06580ea9f571dd1dd2608ba3a5d40d79e
(cherry picked from commit 50245713)
parent 548eab37
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1082,6 +1082,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:");
+23 −0
Original line number Diff line number Diff line
@@ -3683,4 +3683,27 @@ 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() {
        enforceReadPrivilegedPhoneState("getActiveDataSubscriptionId");
        final long token = Binder.clearCallingIdentity();

        try {
            int subId = PhoneSwitcher.getInstance().getActiveDataSubId();
            if (!SubscriptionManager.isUsableSubscriptionId(subId)) {
                subId = getDefaultDataSubId();
            }
            return subId;
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }
}