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

Commit 390459b1 authored by Xiangyu/Malcolm Chen's avatar Xiangyu/Malcolm Chen Committed by Android (Google) Code Review
Browse files

Merge "Clear calling identity after permission check of setDefaultDataSubId."

parents 75654877 39911f54
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