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

Commit 9471ea5f authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Ensure the calling identity is restored" into main

parents f9f6454c c1ac3581
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -707,7 +707,7 @@ class ActivityStarter {
                }
            }

            int res;
            int res = START_CANCELED;
            synchronized (mService.mGlobalLock) {
                final boolean globalConfigWillChange = mRequest.globalConfig != null
                        && mService.getGlobalConfiguration().diff(mRequest.globalConfig) != 0;
@@ -719,22 +719,20 @@ class ActivityStarter {
                        + "will change = %b", globalConfigWillChange);

                final long origId = Binder.clearCallingIdentity();

                try {
                    res = resolveToHeavyWeightSwitcherIfNeeded();
                    if (res != START_SUCCESS) {
                        return res;
                    }

                try {
                    res = executeRequest(mRequest);
                } finally {
                    Binder.restoreCallingIdentity(origId);
                    mRequest.logMessage.append(" result code=").append(res);
                    Slog.i(TAG, mRequest.logMessage.toString());
                    mRequest.logMessage.setLength(0);
                }

                Binder.restoreCallingIdentity(origId);

                if (globalConfigWillChange) {
                    // If the caller also wants to switch to a new configuration, do so now.
                    // This allows a clean switch, as we are waiting for the current activity