Why does AccountManager.invalidateAuthToken require AccountType instead of AccountName?

When cancellation allowed tokens with AccountManagerusing invalidateAuthToken,

Q1: Why does a function require an Typeaccount when using an Nameaccount makes sense?

Q2: giving it Type, invalidateAuthTokendestroys all authentication tokens under this type of account?

+5
source share
1 answer

Q1: the type is not as restrictive as the name, it implicitly indicates that you are dealing with a group, not with a person, IMHO.

accountType , AccountManager. : "www.google" Google. , accountType, :

private class GetAuthTokenCallback implements AccountManagerCallback<Bundle> {
    public void run(AccountManagerFuture<Bundle> result) {
        try {
           bundle = result.getResult();
           String auth_token = bundle.getString(AccountManager.KEY_AUTHTOKEN);
           String auth_account_type = bundle.getString(AccountManager.KEY_ACCOUNT_TYPE);

Q2: , :

public void invalidateAuthToken (String accountType, String authToken)

accountType , authToken . authToken, .

+2

All Articles