Loading core/java/android/accounts/AbstractAccountAuthenticator.java +17 −6 Original line number Diff line number Diff line Loading @@ -138,7 +138,9 @@ public abstract class AbstractAccountAuthenticator { new AccountAuthenticatorResponse(response), accountType, authTokenType, features, options); if (Log.isLoggable(TAG, Log.VERBOSE)) { if (result != null) { result.keySet(); // force it to be unparcelled } Log.v(TAG, "addAccount: result " + AccountManager.sanitizeResult(result)); } if (result != null) { Loading @@ -160,7 +162,9 @@ public abstract class AbstractAccountAuthenticator { final Bundle result = AbstractAccountAuthenticator.this.confirmCredentials( new AccountAuthenticatorResponse(response), account, options); if (Log.isLoggable(TAG, Log.VERBOSE)) { if (result != null) { result.keySet(); // force it to be unparcelled } Log.v(TAG, "confirmCredentials: result " + AccountManager.sanitizeResult(result)); } Loading @@ -185,7 +189,9 @@ public abstract class AbstractAccountAuthenticator { result.putString(AccountManager.KEY_AUTH_TOKEN_LABEL, AbstractAccountAuthenticator.this.getAuthTokenLabel(authTokenType)); if (Log.isLoggable(TAG, Log.VERBOSE)) { if (result != null) { result.keySet(); // force it to be unparcelled } Log.v(TAG, "getAuthTokenLabel: result " + AccountManager.sanitizeResult(result)); } Loading @@ -209,7 +215,9 @@ public abstract class AbstractAccountAuthenticator { new AccountAuthenticatorResponse(response), account, authTokenType, loginOptions); if (Log.isLoggable(TAG, Log.VERBOSE)) { if (result != null) { result.keySet(); // force it to be unparcelled } Log.v(TAG, "getAuthToken: result " + AccountManager.sanitizeResult(result)); } if (result != null) { Loading @@ -234,7 +242,10 @@ public abstract class AbstractAccountAuthenticator { new AccountAuthenticatorResponse(response), account, authTokenType, loginOptions); if (Log.isLoggable(TAG, Log.VERBOSE)) { // Result may be null. if (result != null) { result.keySet(); // force it to be unparcelled } Log.v(TAG, "updateCredentials: result " + AccountManager.sanitizeResult(result)); } Loading Loading @@ -490,7 +501,7 @@ public abstract class AbstractAccountAuthenticator { * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_ACCOUNT_NAME} and {@link AccountManager#KEY_ACCOUNT_TYPE} of * the account that was added, or * the account whose credentials were updated, or * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> Loading core/java/android/accounts/AccountManager.java +31 −22 Original line number Diff line number Diff line Loading @@ -333,7 +333,7 @@ public class AccountManager { try { return mService.getPassword(account); } catch (RemoteException e) { // will never happen // won't ever happen throw new RuntimeException(e); } } Loading Loading @@ -362,7 +362,7 @@ public class AccountManager { try { return mService.getUserData(account, key); } catch (RemoteException e) { // will never happen // won't ever happen throw new RuntimeException(e); } } Loading Loading @@ -415,8 +415,10 @@ public class AccountManager { * * <p>It is safe to call this method from the main thread. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS}. * <p>Clients of this method that have not been granted the * {@link android.Manifest.permission#GET_ACCOUNTS} permission, * will only see those accounts managed by AbstractAccountAuthenticators whose * signature matches the client. * * @return An array of {@link Account}, one for each account. Empty * (never null) if no accounts have been added. Loading @@ -438,8 +440,10 @@ public class AccountManager { * * <p>It is safe to call this method from the main thread. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS}. * <p>Clients of this method that have not been granted the * {@link android.Manifest.permission#GET_ACCOUNTS} permission, * will only see those accounts managed by AbstractAccountAuthenticators whose * signature matches the client. * * @return An array of {@link Account}, one for each account. Empty * (never null) if no accounts have been added. Loading @@ -466,7 +470,7 @@ public class AccountManager { try { return mService.getAccountsForPackage(packageName, uid); } catch (RemoteException re) { // possible security exception // won't ever happen throw new RuntimeException(re); } } Loading @@ -483,7 +487,7 @@ public class AccountManager { try { return mService.getAccountsByTypeForPackage(type, packageName); } catch (RemoteException re) { // possible security exception // won't ever happen throw new RuntimeException(re); } } Loading @@ -497,9 +501,10 @@ public class AccountManager { * * <p>It is safe to call this method from the main thread. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS} or share a uid with the * authenticator that owns the account type. * <p>Clients of this method that have not been granted the * {@link android.Manifest.permission#GET_ACCOUNTS} permission, * will only see those accounts managed by AbstractAccountAuthenticators whose * signature matches the client. * * <p><b>NOTE:</b> If targeting your app to work on API level 22 and before, * GET_ACCOUNTS permission is needed for those platforms, irrespective of uid Loading Loading @@ -585,7 +590,8 @@ public class AccountManager { * {@link AccountManagerFuture} must not be used on the main thread. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS}. * {@link android.Manifest.permission#GET_ACCOUNTS} or be a signature * match with the AbstractAccountAuthenticator that manages the account. * * @param account The {@link Account} to test * @param features An array of the account features to check Loading Loading @@ -628,9 +634,10 @@ public class AccountManager { * <p>This method may be called from any thread, but the returned * {@link AccountManagerFuture} must not be used on the main thread. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS} or share a uid with the * authenticator that owns the account type. * <p>Clients of this method that have not been granted the * {@link android.Manifest.permission#GET_ACCOUNTS} permission, * will only see those accounts managed by AbstractAccountAuthenticators whose * signature matches the client. * * @param type The type of accounts to return, must not be null * @param features An array of the account features to require, Loading Loading @@ -701,7 +708,7 @@ public class AccountManager { try { return mService.addAccountExplicitly(account, password, userdata); } catch (RemoteException e) { // won't ever happen // Can happen if there was a SecurityException was thrown. throw new RuntimeException(e); } } Loading Loading @@ -966,7 +973,7 @@ public class AccountManager { try { return mService.removeAccountExplicitly(account); } catch (RemoteException e) { // won't ever happen // May happen if the caller doesn't match the signature of the authenticator. throw new RuntimeException(e); } } Loading Loading @@ -1114,7 +1121,7 @@ public class AccountManager { try { mService.setUserData(account, key, value); } catch (RemoteException e) { // won't ever happen // Will happen if there is not signature match. throw new RuntimeException(e); } } Loading Loading @@ -1733,7 +1740,7 @@ public class AccountManager { * with these fields if an activity was supplied and the account * credentials were successfully updated: * <ul> * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account created * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account * </ul> * Loading Loading @@ -2501,10 +2508,12 @@ public class AccountManager { * listeners are added in an Activity or Service's {@link Activity#onCreate} * and removed in {@link Activity#onDestroy}. * * <p>It is safe to call this method from the main thread. * <p>The listener will only be informed of accounts that would be returned * to the caller via {@link #getAccounts()}. Typically this means that to * get any accounts, the caller will need to be grated the GET_ACCOUNTS * permission. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS}. * <p>It is safe to call this method from the main thread. * * @param listener The listener to send notifications to * @param handler {@link Handler} identifying the thread to use Loading services/core/java/com/android/server/accounts/AccountManagerService.java +151 −99 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
core/java/android/accounts/AbstractAccountAuthenticator.java +17 −6 Original line number Diff line number Diff line Loading @@ -138,7 +138,9 @@ public abstract class AbstractAccountAuthenticator { new AccountAuthenticatorResponse(response), accountType, authTokenType, features, options); if (Log.isLoggable(TAG, Log.VERBOSE)) { if (result != null) { result.keySet(); // force it to be unparcelled } Log.v(TAG, "addAccount: result " + AccountManager.sanitizeResult(result)); } if (result != null) { Loading @@ -160,7 +162,9 @@ public abstract class AbstractAccountAuthenticator { final Bundle result = AbstractAccountAuthenticator.this.confirmCredentials( new AccountAuthenticatorResponse(response), account, options); if (Log.isLoggable(TAG, Log.VERBOSE)) { if (result != null) { result.keySet(); // force it to be unparcelled } Log.v(TAG, "confirmCredentials: result " + AccountManager.sanitizeResult(result)); } Loading @@ -185,7 +189,9 @@ public abstract class AbstractAccountAuthenticator { result.putString(AccountManager.KEY_AUTH_TOKEN_LABEL, AbstractAccountAuthenticator.this.getAuthTokenLabel(authTokenType)); if (Log.isLoggable(TAG, Log.VERBOSE)) { if (result != null) { result.keySet(); // force it to be unparcelled } Log.v(TAG, "getAuthTokenLabel: result " + AccountManager.sanitizeResult(result)); } Loading @@ -209,7 +215,9 @@ public abstract class AbstractAccountAuthenticator { new AccountAuthenticatorResponse(response), account, authTokenType, loginOptions); if (Log.isLoggable(TAG, Log.VERBOSE)) { if (result != null) { result.keySet(); // force it to be unparcelled } Log.v(TAG, "getAuthToken: result " + AccountManager.sanitizeResult(result)); } if (result != null) { Loading @@ -234,7 +242,10 @@ public abstract class AbstractAccountAuthenticator { new AccountAuthenticatorResponse(response), account, authTokenType, loginOptions); if (Log.isLoggable(TAG, Log.VERBOSE)) { // Result may be null. if (result != null) { result.keySet(); // force it to be unparcelled } Log.v(TAG, "updateCredentials: result " + AccountManager.sanitizeResult(result)); } Loading Loading @@ -490,7 +501,7 @@ public abstract class AbstractAccountAuthenticator { * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_ACCOUNT_NAME} and {@link AccountManager#KEY_ACCOUNT_TYPE} of * the account that was added, or * the account whose credentials were updated, or * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> Loading
core/java/android/accounts/AccountManager.java +31 −22 Original line number Diff line number Diff line Loading @@ -333,7 +333,7 @@ public class AccountManager { try { return mService.getPassword(account); } catch (RemoteException e) { // will never happen // won't ever happen throw new RuntimeException(e); } } Loading Loading @@ -362,7 +362,7 @@ public class AccountManager { try { return mService.getUserData(account, key); } catch (RemoteException e) { // will never happen // won't ever happen throw new RuntimeException(e); } } Loading Loading @@ -415,8 +415,10 @@ public class AccountManager { * * <p>It is safe to call this method from the main thread. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS}. * <p>Clients of this method that have not been granted the * {@link android.Manifest.permission#GET_ACCOUNTS} permission, * will only see those accounts managed by AbstractAccountAuthenticators whose * signature matches the client. * * @return An array of {@link Account}, one for each account. Empty * (never null) if no accounts have been added. Loading @@ -438,8 +440,10 @@ public class AccountManager { * * <p>It is safe to call this method from the main thread. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS}. * <p>Clients of this method that have not been granted the * {@link android.Manifest.permission#GET_ACCOUNTS} permission, * will only see those accounts managed by AbstractAccountAuthenticators whose * signature matches the client. * * @return An array of {@link Account}, one for each account. Empty * (never null) if no accounts have been added. Loading @@ -466,7 +470,7 @@ public class AccountManager { try { return mService.getAccountsForPackage(packageName, uid); } catch (RemoteException re) { // possible security exception // won't ever happen throw new RuntimeException(re); } } Loading @@ -483,7 +487,7 @@ public class AccountManager { try { return mService.getAccountsByTypeForPackage(type, packageName); } catch (RemoteException re) { // possible security exception // won't ever happen throw new RuntimeException(re); } } Loading @@ -497,9 +501,10 @@ public class AccountManager { * * <p>It is safe to call this method from the main thread. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS} or share a uid with the * authenticator that owns the account type. * <p>Clients of this method that have not been granted the * {@link android.Manifest.permission#GET_ACCOUNTS} permission, * will only see those accounts managed by AbstractAccountAuthenticators whose * signature matches the client. * * <p><b>NOTE:</b> If targeting your app to work on API level 22 and before, * GET_ACCOUNTS permission is needed for those platforms, irrespective of uid Loading Loading @@ -585,7 +590,8 @@ public class AccountManager { * {@link AccountManagerFuture} must not be used on the main thread. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS}. * {@link android.Manifest.permission#GET_ACCOUNTS} or be a signature * match with the AbstractAccountAuthenticator that manages the account. * * @param account The {@link Account} to test * @param features An array of the account features to check Loading Loading @@ -628,9 +634,10 @@ public class AccountManager { * <p>This method may be called from any thread, but the returned * {@link AccountManagerFuture} must not be used on the main thread. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS} or share a uid with the * authenticator that owns the account type. * <p>Clients of this method that have not been granted the * {@link android.Manifest.permission#GET_ACCOUNTS} permission, * will only see those accounts managed by AbstractAccountAuthenticators whose * signature matches the client. * * @param type The type of accounts to return, must not be null * @param features An array of the account features to require, Loading Loading @@ -701,7 +708,7 @@ public class AccountManager { try { return mService.addAccountExplicitly(account, password, userdata); } catch (RemoteException e) { // won't ever happen // Can happen if there was a SecurityException was thrown. throw new RuntimeException(e); } } Loading Loading @@ -966,7 +973,7 @@ public class AccountManager { try { return mService.removeAccountExplicitly(account); } catch (RemoteException e) { // won't ever happen // May happen if the caller doesn't match the signature of the authenticator. throw new RuntimeException(e); } } Loading Loading @@ -1114,7 +1121,7 @@ public class AccountManager { try { mService.setUserData(account, key, value); } catch (RemoteException e) { // won't ever happen // Will happen if there is not signature match. throw new RuntimeException(e); } } Loading Loading @@ -1733,7 +1740,7 @@ public class AccountManager { * with these fields if an activity was supplied and the account * credentials were successfully updated: * <ul> * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account created * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account * </ul> * Loading Loading @@ -2501,10 +2508,12 @@ public class AccountManager { * listeners are added in an Activity or Service's {@link Activity#onCreate} * and removed in {@link Activity#onDestroy}. * * <p>It is safe to call this method from the main thread. * <p>The listener will only be informed of accounts that would be returned * to the caller via {@link #getAccounts()}. Typically this means that to * get any accounts, the caller will need to be grated the GET_ACCOUNTS * permission. * * <p>This method requires the caller to hold the permission * {@link android.Manifest.permission#GET_ACCOUNTS}. * <p>It is safe to call this method from the main thread. * * @param listener The listener to send notifications to * @param handler {@link Handler} identifying the thread to use Loading
services/core/java/com/android/server/accounts/AccountManagerService.java +151 −99 File changed.Preview size limit exceeded, changes collapsed. Show changes