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

Commit 50245713 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
Change-Id: I0b83d2d06580ea9f571dd1dd2608ba3a5d40d79e
parent 29a1cf04
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1083,6 +1083,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
@@ -3693,4 +3693,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);
        }
    }
}