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

Commit 39911f54 authored by Malcolm Chen's avatar Malcolm Chen
Browse files

Clear calling identity after permission check of setDefaultDataSubId.

Bug: 129362133
Test: manual -- switch default data in dsds device
Change-Id: I8bd91f3e4c17bf4aa0a9967ed4cd42d3c1af7674
parent 5698b715
Loading
Loading
Loading
Loading
+42 −36
Original line number Diff line number Diff line
@@ -2050,6 +2050,8 @@ public class SubscriptionController extends ISub.Stub {
    public void setDefaultDataSubId(int subId) {
        enforceModifyPhoneState("setDefaultDataSubId");

        final long identity = Binder.clearCallingIdentity();
        try {
            if (subId == SubscriptionManager.DEFAULT_SUBSCRIPTION_ID) {
                throw new RuntimeException("setDefaultDataSubId called with DEFAULT_SUB_ID");
            }
@@ -2074,7 +2076,8 @@ public class SubscriptionController extends ISub.Stub {
                        // TODO Handle the general case of N modems and M subscriptions.
                        raf = proxyController.getMinRafSupported();
                    }
                logdl("[setDefaultDataSubId] phoneId=" + phoneId + " subId=" + id + " RAF=" + raf);
                    logdl("[setDefaultDataSubId] phoneId=" + phoneId + " subId=" + id + " RAF="
                            + raf);
                    rafs[phoneId] = new RadioAccessFamily(phoneId, raf);
                }
                if (atLeastOneMatch) {
@@ -2091,6 +2094,9 @@ public class SubscriptionController extends ISub.Stub {
                    Settings.Global.MULTI_SIM_DATA_CALL_SUBSCRIPTION, subId);
            MultiSimSettingController.getInstance().onDefaultDataSettingChanged();
            broadcastDefaultDataSubIdChanged(subId);
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
    }

    @UnsupportedAppUsage