am 73094fbc: Merge "Don\'t allow non-authorized apps to access auth tokens" into jb-mr2-dev

* commit '73094fbc23a4f6142f790f63b66ae5b553fb6e55':
  Don't allow non-authorized apps to access auth tokens
This commit is contained in:
Amith Yamasani
2013-05-09 10:47:08 -07:00
committed by Android Git Automerger

View File

@@ -1265,6 +1265,11 @@ public class AccountManagerService
final boolean customTokens =
authenticatorInfo != null && authenticatorInfo.type.customTokens;
// Check to see that the app is authorized to access the account, in case it's a
// restricted account.
if (!ArrayUtils.contains(getAccounts((String) null), account)) {
throw new IllegalArgumentException("no such account");
}
// skip the check if customTokens
final int callerUid = Binder.getCallingUid();
final boolean permissionGranted = customTokens ||