本文整理匯總了Java中android.accounts.IAccountManagerResponse類的典型用法代碼示例。如果您正苦於以下問題:Java IAccountManagerResponse類的具體用法?Java IAccountManagerResponse怎麽用?Java IAccountManagerResponse使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IAccountManagerResponse類屬於android.accounts包,在下文中一共展示了IAccountManagerResponse類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onError
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
@Override
public void onError(int errorCode, String errorMessage) {
mNumErrors++;
IAccountManagerResponse response = getResponseAndClose();
if (response != null) {
Log.v(TAG, getClass().getSimpleName()
+ " calling onError() on response " + response);
try {
response.onError(errorCode, errorMessage);
} catch (RemoteException e) {
Log.v(TAG, "Session.onError: caught RemoteException while responding", e);
}
} else {
Log.v(TAG, "Session.onError: already closed");
}
}
示例2: Session
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
Session(IAccountManagerResponse response, int userId, AuthenticatorInfo info, boolean expectActivityLaunch, boolean stripAuthTokenFromResult, String accountName, boolean authDetailsRequired, boolean updateLastAuthenticatedTime) {
if (info == null) throw new IllegalArgumentException("accountType is null");
this.mStripAuthTokenFromResult = stripAuthTokenFromResult;
this.mResponse = response;
this.mUserId = userId;
this.mAuthenticatorInfo = info;
this.mExpectActivityLaunch = expectActivityLaunch;
this.mCreationTime = SystemClock.elapsedRealtime();
this.mAccountName = accountName;
this.mAuthDetailsRequired = authDetailsRequired;
this.mUpdateLastAuthenticatedTime = updateLastAuthenticatedTime;
synchronized (mSessions) {
mSessions.put(toString(), this);
}
if (response != null) {
try {
response.asBinder().linkToDeath(this, 0 /* flags */);
} catch (RemoteException e) {
mResponse = null;
binderDied();
}
}
}
示例3: confirmCredentials
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
public void confirmCredentials(int userId, IAccountManagerResponse response, final Account account, final Bundle options, final boolean expectActivityLaunch) {
if (response == null) throw new IllegalArgumentException("response is null");
if (account == null) throw new IllegalArgumentException("account is null");
AuthenticatorInfo info = getAuthenticatorInfo(account.type);
if (info == null) {
try {
response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist");
} catch (RemoteException e) {
e.printStackTrace();
}
return;
}
new Session(response, userId, info, expectActivityLaunch, true, account.name, true, true) {
@Override
public void run() throws RemoteException {
mAuthenticator.confirmCredentials(this, account, options);
}
}.bind();
}
示例4: confirmCredentials
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
public void confirmCredentials(int userId, IAccountManagerResponse response, final Account account, final Bundle options, final boolean expectActivityLaunch) {
if (response == null) throw new IllegalArgumentException("response is null");
if (account == null) throw new IllegalArgumentException("account is null");
AuthenticatorInfo info = getAuthenticatorInfo(account.type);
if(info == null) {
try {
response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist");
} catch(RemoteException e) {
e.printStackTrace();
}
return;
}
new Session(response, userId, info, expectActivityLaunch, true, account.name, true, true) {
@Override
public void run() throws RemoteException {
mAuthenticator.confirmCredentials(this, account, options);
}
}.bind();
}
示例5: onError
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
@Override
public void onError(int errorCode, String errorMessage) {
mNumErrors++;
IAccountManagerResponse response = getResponseAndClose();
if (response != null) {
Log.v(TAG, getClass().getSimpleName()
+ " calling onError() on response " + response);
try {
response.onError(errorCode, errorMessage);
} catch (RemoteException e) {
Log.v(TAG, "Session.onError: caught RemoteException while responding", e);
}
} else {
Log.v(TAG, "Session.onError: already closed");
}
}
示例6: sendResult
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
public void sendResult() {
IAccountManagerResponse response = getResponseAndClose();
if (response != null) {
try {
Account[] accounts = new Account[mAccountsWithFeatures.size()];
for (int i = 0; i < accounts.length; i++) {
accounts[i] = mAccountsWithFeatures.get(i);
}
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response "
+ response);
}
Bundle result = new Bundle();
result.putParcelableArray(AccountManager.KEY_ACCOUNTS, accounts);
response.onResult(result);
} catch (RemoteException e) {
// if the caller is dead then there is no one to care about remote exceptions
Log.v(TAG, "failure while notifying response", e);
}
}
}
示例7: confirmCredentials
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
public void confirmCredentials(int userId, IAccountManagerResponse response, final Account account, final Bundle options, final boolean expectActivityLaunch) {
if (response == null) throw new IllegalArgumentException("response is null");
if (account == null) throw new IllegalArgumentException("account is null");
AuthenticatorInfo info = getAuthenticatorInfo(account.type);
if (info == null) {
try {
response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist");
} catch (RemoteException e) {
e.printStackTrace();
}
return;
}
new Session(response, userId, info, expectActivityLaunch, true, account.name, true, true) {
@Override
public void run() throws RemoteException {
mAuthenticator.confirmCredentials(this, account, options);
}
}.bind();
}
示例8: Session
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
Session(IAccountManagerResponse response, int userId, AuthenticatorInfo info, boolean expectActivityLaunch, boolean stripAuthTokenFromResult, String accountName, boolean authDetailsRequired, boolean updateLastAuthenticatedTime) {
if (info == null) throw new IllegalArgumentException("accountType is null");
this.mStripAuthTokenFromResult = stripAuthTokenFromResult;
this.mResponse = response;
this.mUserId = userId;
this.mAuthenticatorInfo = info;
this.mExpectActivityLaunch = expectActivityLaunch;
this.mCreationTime = SystemClock.elapsedRealtime();
this.mAccountName = accountName;
this.mAuthDetailsRequired = authDetailsRequired;
this.mUpdateLastAuthenticatedTime = updateLastAuthenticatedTime;
synchronized (mSessions) {
mSessions.put(toString(), this);
}
if (response != null) {
try {
response.asBinder().linkToDeath(this, 0 /* flags */);
} catch (RemoteException e) {
mResponse = null;
binderDied();
}
}
}
示例9: onError
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
@Override
public void onError(int errorCode, String errorMessage) {
mNumErrors++;
IAccountManagerResponse response = getResponseAndClose();
if (response != null) {
Log.v(TAG, getClass().getSimpleName()
+ " calling onError() on response " + response);
try {
response.onError(errorCode, errorMessage);
} catch (RemoteException e) {
Log.v(TAG, "Session.onError: caught RemoteException while responding", e);
}
} else {
Log.v(TAG, "Session.onError: already closed");
}
}
示例10: sendResult
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
public void sendResult() {
IAccountManagerResponse response = getResponseAndClose();
if (response != null) {
try {
Account[] accounts = new Account[mAccountsWithFeatures.size()];
for (int i = 0; i < accounts.length; i++) {
accounts[i] = mAccountsWithFeatures.get(i);
}
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response "
+ response);
}
Bundle result = new Bundle();
result.putParcelableArray(AccountManager.KEY_ACCOUNTS, accounts);
response.onResult(result);
} catch (RemoteException e) {
// if the caller is dead then there is no one to care about remote exceptions
Log.v(TAG, "failure while notifying response", e);
}
}
}
示例11: call
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
IAccountManagerResponse response = (IAccountManagerResponse) args[0];
Account account = (Account) args[1];
String[] features = (String[]) args[2];
Mgr.hasFeatures(response, account, features);
return 0;
}
示例12: removeAccount
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
public void removeAccount(IAccountManagerResponse response, Account account, boolean expectActivityLaunch) {
try {
getRemote().removeAccount(VUserHandle.myUserId(), response, account, expectActivityLaunch);
} catch (RemoteException e) {
e.printStackTrace();
}
}
示例13: getAuthToken
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
public void getAuthToken(IAccountManagerResponse response, Account account, String authTokenType, boolean notifyOnAuthFailure, boolean expectActivityLaunch, Bundle loginOptions) {
try {
getRemote().getAuthToken(VUserHandle.myUserId(), response, account, authTokenType, notifyOnAuthFailure, expectActivityLaunch, loginOptions);
} catch (RemoteException e) {
e.printStackTrace();
}
}
示例14: hasFeatures
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
public void hasFeatures(IAccountManagerResponse response, Account account, String[] features) {
try {
getRemote().hasFeatures(VUserHandle.myUserId(), response, account, features);
} catch (RemoteException e) {
e.printStackTrace();
}
}
示例15: addAccount
import android.accounts.IAccountManagerResponse; //導入依賴的package包/類
public void addAccount(IAccountManagerResponse response, String accountType, String authTokenType, String[] requiredFeatures, boolean expectActivityLaunch, Bundle optionsIn) {
try {
getRemote().addAccount(VUserHandle.myUserId(), response, accountType, authTokenType, requiredFeatures, expectActivityLaunch, optionsIn);
} catch (RemoteException e) {
e.printStackTrace();
}
}