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

Commit 84ea42d2 authored by Aishwarya Mallampati's avatar Aishwarya Mallampati Committed by Automerger Merge Worker
Browse files

Merge "Clear calling identity before calling getSubscriptionUserHandle" into main am: 34573462

parents 689cc624 34573462
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);