@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); } } }
@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"); } }
@Override public void onResult(Bundle result) throws RemoteException { IAccountManagerResponse response = getResponseAndClose(); if (response != null) { try { if (result == null) { response.onError(AccountManager.ERROR_CODE_INVALID_RESPONSE, "null bundle"); return; } Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response " + response); final Bundle newResult = new Bundle(); newResult.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT, false)); response.onResult(newResult); } 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); } } } }.bind();
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(); }
Log.v(TAG, getClass().getSimpleName() + " calling onError() on response " + response); response.onError(AccountManager.ERROR_CODE_INVALID_RESPONSE, "null bundle returned"); } else { (intent == null)) { response.onError(result.getInt(AccountManager.KEY_ERROR_CODE), result.getString(AccountManager.KEY_ERROR_MESSAGE)); } else {
if (info == null) { try { response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist"); } catch (RemoteException e) { e.printStackTrace();
@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(); }
if (info == null) { try { response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist"); } catch (RemoteException e) { e.printStackTrace();
if (info == null) { try { response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist"); } catch (RemoteException e) { e.printStackTrace();
if (info == null) { try { response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist"); } catch (RemoteException e) { e.printStackTrace();
if (info == null) { try { response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist"); } catch (RemoteException e) { e.printStackTrace();
if (account == null) { VLog.w(TAG, "getAuthToken called with null account"); response.onError(ERROR_CODE_BAD_ARGUMENTS, "account is null"); return; response.onError(ERROR_CODE_BAD_ARGUMENTS, "authTokenType is null"); return; if (info == null) { try { response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist"); } catch (RemoteException e) { e.printStackTrace();
@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); } } }
@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); } } }
@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"); } }
@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"); } }
@Override public void onResult(Bundle result) throws RemoteException { IAccountManagerResponse response = getResponseAndClose(); if (response != null) { try { if (result == null) { response.onError(AccountManager.ERROR_CODE_INVALID_RESPONSE, "null bundle"); return; } Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response " + response); final Bundle newResult = new Bundle(); newResult.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT, false)); response.onResult(newResult); } 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); } } } }.bind();
@Override public void onResult(Bundle result) throws RemoteException { IAccountManagerResponse response = getResponseAndClose(); if (response != null) { try { if (result == null) { response.onError(AccountManager.ERROR_CODE_INVALID_RESPONSE, "null bundle"); return; } Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response " + response); final Bundle newResult = new Bundle(); newResult.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT, false)); response.onResult(newResult); } 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); } } } }.bind();
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(); }
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(); }