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

Commit a8f15be6 authored by Aishwarya Mallampati's avatar Aishwarya Mallampati Committed by Android (Google) Code Review
Browse files

Merge "Clear calling identity before calling getSubscriptionUserHandle" into main

parents cc96c24f 470051c4
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2544,7 +2544,13 @@ public abstract class SMSDispatcher extends Handler {
        /** Return if the SMS was originated from the default SMS application. */
        public boolean isFromDefaultSmsApplication(Context context) {
            if (mIsFromDefaultSmsApplication == null) {
                UserHandle userHandle = TelephonyUtils.getSubscriptionUserHandle(context, mSubId);
                UserHandle userHandle;
                final long identity = Binder.clearCallingIdentity();
                try {
                    userHandle = TelephonyUtils.getSubscriptionUserHandle(context, mSubId);
                } finally {
                    Binder.restoreCallingIdentity(identity);
                }
                // Perform a lazy initialization, due to the cost of the operation.
                mIsFromDefaultSmsApplication = SmsApplication.isDefaultSmsApplicationAsUser(context,
                                    getAppPackageName(), userHandle);