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

Commit 34573462 authored by Aishwarya Mallampati's avatar Aishwarya Mallampati Committed by Gerrit Code Review
Browse files

Merge "Clear calling identity before calling getSubscriptionUserHandle" into main

parents 7f28fd57 d9db861b
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2466,7 +2466,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);