diff options
author | Todd Kennedy <toddke@google.com> | 2015-01-14 15:25:13 -0800 |
---|---|---|
committer | Todd Kennedy <toddke@google.com> | 2015-01-14 15:33:21 -0800 |
commit | 7dba93c0874a96ddeb617c93ad2ca454626acd34 (patch) | |
tree | 204c2e5793bb3102d1902a08bb3fd8e4c4cf92d6 | |
parent | 1c2b0d52144dc94a7d1dcefb7e4fbd7fb29f5202 (diff) | |
download | frameworks_base-7dba93c0874a96ddeb617c93ad2ca454626acd34.zip frameworks_base-7dba93c0874a96ddeb617c93ad2ca454626acd34.tar.gz frameworks_base-7dba93c0874a96ddeb617c93ad2ca454626acd34.tar.bz2 |
DO NOT MERGE 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.
Cherry picked from lmp. Fixes bug 15989465.
Change-Id: Iff08d04422bcc052a487194154f1fd0d727d38f4
-rw-r--r-- | services/java/com/android/server/am/ActivityStack.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index c344023..7306800 100644 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -3208,6 +3208,8 @@ final class ActivityStack { aInfo, resultTo, resultWho, requestCode, callingPid, callingUid, callingPackage, startFlags, options, componentSpecified, null); + Binder.restoreCallingIdentity(origId); + if (mConfigWillChange && mMainStack) { // If the caller also wants to switch to a new configuration, // do so now. This allows a clean switch, as we are waiting @@ -3221,8 +3223,6 @@ final class ActivityStack { mService.updateConfigurationLocked(config, null, false, false); } - Binder.restoreCallingIdentity(origId); - if (outResult != null) { outResult.result = res; if (res == ActivityManager.START_SUCCESS) { |