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

Commit 85c11a88 authored by Craig Mautner's avatar Craig Mautner
Browse files

Restore calling identity before checking permission

Using the system service identity to check the CHANGE_CONFIGURATION
permission isn't likely to catch a security violation. Changing
back to the original caller and then checking permissions is
preferred.

Fixes bug 16215650.

Change-Id: Iff08d04422bcc052a487194154f1fd0d727d38f4
parent 738177ca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -886,6 +886,8 @@ public final class ActivityStackSupervisor implements DisplayListener {
                    requestCode, callingPid, callingUid, callingPackage, startFlags, options,
                    componentSpecified, null, container);

            Binder.restoreCallingIdentity(origId);

            if (stack.mConfigWillChange) {
                // If the caller also wants to switch to a new configuration,
                // do so now.  This allows a clean switch, as we are waiting
@@ -899,8 +901,6 @@ public final class ActivityStackSupervisor implements DisplayListener {
                mService.updateConfigurationLocked(config, null, false, false);
            }

            Binder.restoreCallingIdentity(origId);

            if (outResult != null) {
                outResult.result = res;
                if (res == ActivityManager.START_SUCCESS) {