summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Valdivia <carlosvaldivia@google.com>2013-10-15 04:03:30 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-15 04:03:30 -0700
commit34f5b35feb47cd9feedd37d76cef0d58e08c0822 (patch)
tree14b260039d87b9c93279b3b5abb1b3d2ffe43fc4
parent6353ea33ad37382e4123d8871fc7cb8db0bd71c0 (diff)
parent8d983713db4583d8062dc499efc3896aaf36d65e (diff)
downloadframeworks_base-34f5b35feb47cd9feedd37d76cef0d58e08c0822.zip
frameworks_base-34f5b35feb47cd9feedd37d76cef0d58e08c0822.tar.gz
frameworks_base-34f5b35feb47cd9feedd37d76cef0d58e08c0822.tar.bz2
am 8d983713: am 5505706c: am cdb9ea79: Merge "Package checks for resloving recovery tokens should be user sensitive." into klp-dev
* commit '8d983713db4583d8062dc499efc3896aaf36d65e': Package checks for resloving recovery tokens should be user sensitive.
-rw-r--r--services/java/com/android/server/accounts/AccountManagerService.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/services/java/com/android/server/accounts/AccountManagerService.java b/services/java/com/android/server/accounts/AccountManagerService.java
index cc43a9c..f972f70 100644
--- a/services/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/java/com/android/server/accounts/AccountManagerService.java
@@ -2167,15 +2167,20 @@ public class AccountManagerService
* this can be very bad when those apps are in the system like
* the System Settings.
*/
- PackageManager pm = mContext.getPackageManager();
- ResolveInfo resolveInfo = pm.resolveActivity(intent, 0);
- int targetUid = resolveInfo.activityInfo.applicationInfo.uid;
int authenticatorUid = Binder.getCallingUid();
- if (PackageManager.SIGNATURE_MATCH !=
- pm.checkSignatures(authenticatorUid, targetUid)) {
- throw new SecurityException(
- "Activity to be started with KEY_INTENT must " +
- "share Authenticator's signatures");
+ long bid = Binder.clearCallingIdentity();
+ try {
+ PackageManager pm = mContext.getPackageManager();
+ ResolveInfo resolveInfo = pm.resolveActivityAsUser(intent, 0, mAccounts.userId);
+ int targetUid = resolveInfo.activityInfo.applicationInfo.uid;
+ if (PackageManager.SIGNATURE_MATCH !=
+ pm.checkSignatures(authenticatorUid, targetUid)) {
+ throw new SecurityException(
+ "Activity to be started with KEY_INTENT must " +
+ "share Authenticator's signatures");
+ }
+ } finally {
+ Binder.restoreCallingIdentity(bid);
}
}
if (result != null