diff options
author | Amith Yamasani <yamasani@google.com> | 2013-04-18 18:40:07 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2013-04-19 12:07:46 -0700 |
commit | 3b458ad9ee5f2d6b7cf28a13bc29123cdf540763 (patch) | |
tree | c4337769df97e9ec86dc34cb9590a208916f96d6 /services/java/com/android/server/accounts | |
parent | 7f6fc12997d67ae80a044bc0b4cc17797d887911 (diff) | |
download | frameworks_base-3b458ad9ee5f2d6b7cf28a13bc29123cdf540763.zip frameworks_base-3b458ad9ee5f2d6b7cf28a13bc29123cdf540763.tar.gz frameworks_base-3b458ad9ee5f2d6b7cf28a13bc29123cdf540763.tar.bz2 |
Improve API and documentation
API for querying accounts visible to a specific package.
Improve API and docs for device owner.
Bug: 8657158
Change-Id: I01b8701534f64b383391508a49ae93ed21f22ae0
Diffstat (limited to 'services/java/com/android/server/accounts')
-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)) { |