本文整理汇总了Java中android.accounts.IAccountManagerResponse.onError方法的典型用法代码示例。如果您正苦于以下问题:Java IAccountManagerResponse.onError方法的具体用法?Java IAccountManagerResponse.onError怎么用?Java IAccountManagerResponse.onError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.accounts.IAccountManagerResponse
的用法示例。
在下文中一共展示了IAccountManagerResponse.onError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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");
}
}
示例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: 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");
}
}
示例5: 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();
}
示例6: 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");
}
}
示例7: updateCredentials
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
@Override
public void updateCredentials(int userId, final IAccountManagerResponse response, final Account account,
final String authTokenType, final boolean expectActivityLaunch,
final Bundle loginOptions) {
if (response == null) throw new IllegalArgumentException("response is null");
if (account == null) throw new IllegalArgumentException("account is null");
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
AuthenticatorInfo info = this.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, false, account.name) {
@Override
public void run() throws RemoteException {
mAuthenticator.updateCredentials(this, account, authTokenType, loginOptions);
}
@Override
protected String toDebugString(long now) {
if (loginOptions != null) loginOptions.keySet();
return super.toDebugString(now) + ", updateCredentials"
+ ", " + account
+ ", authTokenType " + authTokenType
+ ", loginOptions " + loginOptions;
}
}.bind();
}
示例8: editProperties
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
@Override
public void editProperties(int userId, IAccountManagerResponse response, final String accountType,
final boolean expectActivityLaunch) {
if (response == null) throw new IllegalArgumentException("response is null");
if (accountType == null) throw new IllegalArgumentException("accountType is null");
AuthenticatorInfo info = this.getAuthenticatorInfo(accountType);
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, null) {
@Override
public void run() throws RemoteException {
mAuthenticator.editProperties(this, mAuthenticatorInfo.desc.type);
}
@Override
protected String toDebugString(long now) {
return super.toDebugString(now) + ", editProperties"
+ ", accountType " + accountType;
}
}.bind();
}
示例9: getAuthTokenLabel
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
@Override
public void getAuthTokenLabel(int userId, IAccountManagerResponse response, final String accountType,
final String authTokenType) {
if (accountType == null) throw new IllegalArgumentException("accountType is null");
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
AuthenticatorInfo info = getAuthenticatorInfo(accountType);
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, false, false, null) {
@Override
public void run() throws RemoteException {
mAuthenticator.getAuthTokenLabel(this, authTokenType);
}
@Override
public void onResult(Bundle result) throws RemoteException {
if (result != null) {
String label = result.getString(AccountManager.KEY_AUTH_TOKEN_LABEL);
Bundle bundle = new Bundle();
bundle.putString(AccountManager.KEY_AUTH_TOKEN_LABEL, label);
super.onResult(bundle);
} else {
super.onResult(null);
}
}
}.bind();
}
示例10: addAccount
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
@Override
public void addAccount(int userId, final IAccountManagerResponse response, final String accountType,
final String authTokenType, final String[] requiredFeatures,
final boolean expectActivityLaunch, final Bundle optionsIn) {
if (response == null) throw new IllegalArgumentException("response is null");
if (accountType == null) throw new IllegalArgumentException("accountType is null");
AuthenticatorInfo info = getAuthenticatorInfo(accountType);
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, null, false, true) {
@Override
public void run() throws RemoteException {
mAuthenticator.addAccount(this, mAuthenticatorInfo.desc.type, authTokenType, requiredFeatures,
optionsIn);
}
@Override
protected String toDebugString(long now) {
return super.toDebugString(now) + ", addAccount"
+ ", accountType " + accountType
+ ", requiredFeatures "
+ (requiredFeatures != null
? TextUtils.join(",", requiredFeatures)
: null);
}
}.bind();
}
示例11: updateCredentials
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
@Override
public void updateCredentials(int userId, final IAccountManagerResponse response, final Account account,
final String authTokenType, final boolean expectActivityLaunch,
final Bundle loginOptions) {
if (response == null) throw new IllegalArgumentException("response is null");
if (account == null) throw new IllegalArgumentException("account is null");
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
AuthenticatorInfo info = this.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, false, account.name) {
@Override
public void run() throws RemoteException {
mAuthenticator.updateCredentials(this, account, authTokenType, loginOptions);
}
@Override
protected String toDebugString(long now) {
if (loginOptions != null) loginOptions.keySet();
return super.toDebugString(now) + ", updateCredentials"
+ ", " + account
+ ", authTokenType " + authTokenType
+ ", loginOptions " + loginOptions;
}
}.bind();
}
示例12: editProperties
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
@Override
public void editProperties(int userId, IAccountManagerResponse response, final String accountType,
final boolean expectActivityLaunch) {
if (response == null) throw new IllegalArgumentException("response is null");
if (accountType == null) throw new IllegalArgumentException("accountType is null");
AuthenticatorInfo info = this.getAuthenticatorInfo(accountType);
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, null) {
@Override
public void run() throws RemoteException {
mAuthenticator.editProperties(this, mAuthenticatorInfo.desc.type);
}
@Override
protected String toDebugString(long now) {
return super.toDebugString(now) + ", editProperties"
+ ", accountType " + accountType;
}
}.bind();
}
示例13: getAuthTokenLabel
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
@Override
public void getAuthTokenLabel(int userId, IAccountManagerResponse response, final String accountType,
final String authTokenType) {
if (accountType == null) throw new IllegalArgumentException("accountType is null");
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
AuthenticatorInfo info = getAuthenticatorInfo(accountType);
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, false, false, null) {
@Override
public void run() throws RemoteException {
mAuthenticator.getAuthTokenLabel(this, authTokenType);
}
@Override
public void onResult(Bundle result) throws RemoteException {
if (result != null) {
String label = result.getString(AccountManager.KEY_AUTH_TOKEN_LABEL);
Bundle bundle = new Bundle();
bundle.putString(AccountManager.KEY_AUTH_TOKEN_LABEL, label);
super.onResult(bundle);
} else {
super.onResult(null);
}
}
}.bind();
}
示例14: addAccount
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
@Override
public void addAccount(int userId, final IAccountManagerResponse response, final String accountType,
final String authTokenType, final String[] requiredFeatures,
final boolean expectActivityLaunch, final Bundle optionsIn) {
if (response == null) throw new IllegalArgumentException("response is null");
if (accountType == null) throw new IllegalArgumentException("accountType is null");
AuthenticatorInfo info = getAuthenticatorInfo(accountType);
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, null, false, true) {
@Override
public void run() throws RemoteException {
mAuthenticator.addAccount(this, mAuthenticatorInfo.desc.type, authTokenType, requiredFeatures,
optionsIn);
}
@Override
protected String toDebugString(long now) {
return super.toDebugString(now) + ", addAccount"
+ ", accountType " + accountType
+ ", requiredFeatures "
+ (requiredFeatures != null
? TextUtils.join(",", requiredFeatures)
: null);
}
}.bind();
}
示例15: onServiceDisconnected
import android.accounts.IAccountManagerResponse; //导入方法依赖的package包/类
@Override
public void onServiceDisconnected(ComponentName name) {
mAuthenticator = null;
IAccountManagerResponse response = getResponseAndClose();
if (response != null) {
try {
response.onError(AccountManager.ERROR_CODE_REMOTE_EXCEPTION,
"disconnected");
} catch (RemoteException e) {
Log.v(TAG, "Session.onServiceDisconnected: "
+ "caught RemoteException while responding", e);
}
}
}