@@ -333,7 +333,7 @@ public String getPassword(final Account account) {
333333 try {
334334 return mService .getPassword (account );
335335 } catch (RemoteException e ) {
336- // won't ever happen
336+ // will never happen
337337 throw new RuntimeException (e );
338338 }
339339 }
@@ -362,7 +362,7 @@ public String getUserData(final Account account, final String key) {
362362 try {
363363 return mService .getUserData (account , key );
364364 } catch (RemoteException e ) {
365- // won't ever happen
365+ // will never happen
366366 throw new RuntimeException (e );
367367 }
368368 }
@@ -415,10 +415,8 @@ public AuthenticatorDescription[] getAuthenticatorTypesAsUser(int userId) {
415415 *
416416 * <p>It is safe to call this method from the main thread.
417417 *
418- * <p>Clients of this method that have not been granted the
419- * {@link android.Manifest.permission#GET_ACCOUNTS} permission,
420- * will only see those accounts managed by AbstractAccountAuthenticators whose
421- * signature matches the client.
418+ * <p>This method requires the caller to hold the permission
419+ * {@link android.Manifest.permission#GET_ACCOUNTS}.
422420 *
423421 * @return An array of {@link Account}, one for each account. Empty
424422 * (never null) if no accounts have been added.
@@ -440,10 +438,8 @@ public Account[] getAccounts() {
440438 *
441439 * <p>It is safe to call this method from the main thread.
442440 *
443- * <p>Clients of this method that have not been granted the
444- * {@link android.Manifest.permission#GET_ACCOUNTS} permission,
445- * will only see those accounts managed by AbstractAccountAuthenticators whose
446- * signature matches the client.
441+ * <p>This method requires the caller to hold the permission
442+ * {@link android.Manifest.permission#GET_ACCOUNTS}.
447443 *
448444 * @return An array of {@link Account}, one for each account. Empty
449445 * (never null) if no accounts have been added.
@@ -470,7 +466,7 @@ public Account[] getAccountsForPackage(String packageName, int uid) {
470466 try {
471467 return mService .getAccountsForPackage (packageName , uid );
472468 } catch (RemoteException re ) {
473- // won't ever happen
469+ // possible security exception
474470 throw new RuntimeException (re );
475471 }
476472 }
@@ -487,7 +483,7 @@ public Account[] getAccountsByTypeForPackage(String type, String packageName) {
487483 try {
488484 return mService .getAccountsByTypeForPackage (type , packageName );
489485 } catch (RemoteException re ) {
490- // won't ever happen
486+ // possible security exception
491487 throw new RuntimeException (re );
492488 }
493489 }
@@ -501,10 +497,9 @@ public Account[] getAccountsByTypeForPackage(String type, String packageName) {
501497 *
502498 * <p>It is safe to call this method from the main thread.
503499 *
504- * <p>Clients of this method that have not been granted the
505- * {@link android.Manifest.permission#GET_ACCOUNTS} permission,
506- * will only see those accounts managed by AbstractAccountAuthenticators whose
507- * signature matches the client.
500+ * <p>This method requires the caller to hold the permission
501+ * {@link android.Manifest.permission#GET_ACCOUNTS} or share a uid with the
502+ * authenticator that owns the account type.
508503 *
509504 * <p><b>NOTE:</b> If targeting your app to work on API level 22 and before,
510505 * GET_ACCOUNTS permission is needed for those platforms, irrespective of uid
@@ -590,8 +585,7 @@ public String bundleToResult(Bundle bundle) throws AuthenticatorException {
590585 * {@link AccountManagerFuture} must not be used on the main thread.
591586 *
592587 * <p>This method requires the caller to hold the permission
593- * {@link android.Manifest.permission#GET_ACCOUNTS} or be a signature
594- * match with the AbstractAccountAuthenticator that manages the account.
588+ * {@link android.Manifest.permission#GET_ACCOUNTS}.
595589 *
596590 * @param account The {@link Account} to test
597591 * @param features An array of the account features to check
@@ -634,10 +628,9 @@ public Boolean bundleToResult(Bundle bundle) throws AuthenticatorException {
634628 * <p>This method may be called from any thread, but the returned
635629 * {@link AccountManagerFuture} must not be used on the main thread.
636630 *
637- * <p>Clients of this method that have not been granted the
638- * {@link android.Manifest.permission#GET_ACCOUNTS} permission,
639- * will only see those accounts managed by AbstractAccountAuthenticators whose
640- * signature matches the client.
631+ * <p>This method requires the caller to hold the permission
632+ * {@link android.Manifest.permission#GET_ACCOUNTS} or share a uid with the
633+ * authenticator that owns the account type.
641634 *
642635 * @param type The type of accounts to return, must not be null
643636 * @param features An array of the account features to require,
@@ -708,7 +701,7 @@ public boolean addAccountExplicitly(Account account, String password, Bundle use
708701 try {
709702 return mService .addAccountExplicitly (account , password , userdata );
710703 } catch (RemoteException e ) {
711- // Can happen if there was a SecurityException was thrown.
704+ // won't ever happen
712705 throw new RuntimeException (e );
713706 }
714707 }
@@ -973,7 +966,7 @@ public boolean removeAccountExplicitly(Account account) {
973966 try {
974967 return mService .removeAccountExplicitly (account );
975968 } catch (RemoteException e ) {
976- // May happen if the caller doesn 't match the signature of the authenticator.
969+ // won 't ever happen
977970 throw new RuntimeException (e );
978971 }
979972 }
@@ -1121,7 +1114,7 @@ public void setUserData(final Account account, final String key, final String va
11211114 try {
11221115 mService .setUserData (account , key , value );
11231116 } catch (RemoteException e ) {
1124- // Will happen if there is not signature match.
1117+ // won't ever happen
11251118 throw new RuntimeException (e );
11261119 }
11271120 }
@@ -1740,7 +1733,7 @@ public void doWork() throws RemoteException {
17401733 * with these fields if an activity was supplied and the account
17411734 * credentials were successfully updated:
17421735 * <ul>
1743- * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account
1736+ * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account created
17441737 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
17451738 * </ul>
17461739 *
@@ -2508,13 +2501,11 @@ public void onReceive(final Context context, final Intent intent) {
25082501 * listeners are added in an Activity or Service's {@link Activity#onCreate}
25092502 * and removed in {@link Activity#onDestroy}.
25102503 *
2511- * <p>The listener will only be informed of accounts that would be returned
2512- * to the caller via {@link #getAccounts()}. Typically this means that to
2513- * get any accounts, the caller will need to be grated the GET_ACCOUNTS
2514- * permission.
2515- *
25162504 * <p>It is safe to call this method from the main thread.
25172505 *
2506+ * <p>This method requires the caller to hold the permission
2507+ * {@link android.Manifest.permission#GET_ACCOUNTS}.
2508+ *
25182509 * @param listener The listener to send notifications to
25192510 * @param handler {@link Handler} identifying the thread to use
25202511 * for notifications, null for the main thread
0 commit comments