diff options
Diffstat (limited to 'services/java/com/android/server/accounts/AccountManagerService.java')
-rw-r--r-- | services/java/com/android/server/accounts/AccountManagerService.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/services/java/com/android/server/accounts/AccountManagerService.java b/services/java/com/android/server/accounts/AccountManagerService.java index fd7cd78..241b224 100644 --- a/services/java/com/android/server/accounts/AccountManagerService.java +++ b/services/java/com/android/server/accounts/AccountManagerService.java @@ -30,6 +30,7 @@ import android.accounts.IAccountManager; import android.accounts.IAccountManagerResponse; import android.app.ActivityManager; import android.app.ActivityManagerNative; +import android.app.AppGlobals; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; @@ -1874,6 +1875,20 @@ public class AccountManagerService return getAccountsAsUser(null, UserHandle.getCallingUserId(), packageName, uid); } + @Override + public Account[] getAccountsByTypeForPackage(String type, String packageName) { + checkBinderPermission(android.Manifest.permission.INTERACT_ACROSS_USERS); + int packageUid = -1; + try { + packageUid = AppGlobals.getPackageManager().getPackageUid( + packageName, UserHandle.getCallingUserId()); + } catch (RemoteException re) { + Slog.e(TAG, "Couldn't determine the packageUid for " + packageName + re); + return new Account[0]; + } + return getAccountsAsUser(type, UserHandle.getCallingUserId(), packageName, packageUid); + } + public void getAccountsByFeatures(IAccountManagerResponse response, String type, String[] features) { if (Log.isLoggable(TAG, Log.VERBOSE)) { |