diff options
author | Craig Mautner <cmautner@google.com> | 2014-07-17 12:38:18 -0700 |
---|---|---|
committer | Craig Mautner <cmautner@google.com> | 2014-07-17 12:38:18 -0700 |
commit | 85c11a8831ba9572813f122674b3680ae4d14010 (patch) | |
tree | 49b75ce53c5a2a220a4c0540280a36dec0185523 | |
parent | 738177caf6a755a59ca6b17bb968be0aa4e8e10f (diff) | |
download | frameworks_base-85c11a8831ba9572813f122674b3680ae4d14010.zip frameworks_base-85c11a8831ba9572813f122674b3680ae4d14010.tar.gz frameworks_base-85c11a8831ba9572813f122674b3680ae4d14010.tar.bz2 |
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
-rw-r--r-- | services/core/java/com/android/server/am/ActivityStackSupervisor.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index b0dfe4a..0310962 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -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) { |