diff options
author | Fred Quintana <fredq@google.com> | 2011-10-24 14:51:40 -0700 |
---|---|---|
committer | Fred Quintana <fredq@google.com> | 2011-10-24 17:17:28 -0700 |
commit | 166466d483cc3d57e7d3d465fd92ce62409c8455 (patch) | |
tree | 14c8ba5e69736a5ba10e01c4d1a7c985a384dc12 /core/java/android/accounts | |
parent | 7a962fef2f26b941b916595562d5adfae943d432 (diff) | |
download | frameworks_base-166466d483cc3d57e7d3d465fd92ce62409c8455.zip frameworks_base-166466d483cc3d57e7d3d465fd92ce62409c8455.tar.gz frameworks_base-166466d483cc3d57e7d3d465fd92ce62409c8455.tar.bz2 |
Fixed a bug that causes AccountManager calls to hang forever, eventually
exhausting the binder threads in the gapps process, making it unusable.
Bug: 5486091
Change-Id: I82bd197e27c2be1bf82e4e5cc1468e1c6a3e4919
Diffstat (limited to 'core/java/android/accounts')
-rw-r--r-- | core/java/android/accounts/AccountManagerService.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java index 1ba8eee..4f3405b 100644 --- a/core/java/android/accounts/AccountManagerService.java +++ b/core/java/android/accounts/AccountManagerService.java @@ -499,7 +499,7 @@ public class AccountManagerService if (response != null) { try { if (result == null) { - onError(AccountManager.ERROR_CODE_INVALID_RESPONSE, "null bundle"); + response.onError(AccountManager.ERROR_CODE_INVALID_RESPONSE, "null bundle"); return; } if (Log.isLoggable(TAG, Log.VERBOSE)) { @@ -1541,8 +1541,15 @@ public class AccountManagerService mAuthenticator = null; IAccountManagerResponse response = getResponseAndClose(); if (response != null) { - onError(AccountManager.ERROR_CODE_REMOTE_EXCEPTION, - "disconnected"); + try { + response.onError(AccountManager.ERROR_CODE_REMOTE_EXCEPTION, + "disconnected"); + } catch (RemoteException e) { + if (Log.isLoggable(TAG, Log.VERBOSE)) { + Log.v(TAG, "Session.onServiceDisconnected: " + + "caught RemoteException while responding", e); + } + } } } @@ -1551,8 +1558,15 @@ public class AccountManagerService public void onTimedOut() { IAccountManagerResponse response = getResponseAndClose(); if (response != null) { - onError(AccountManager.ERROR_CODE_REMOTE_EXCEPTION, - "timeout"); + try { + response.onError(AccountManager.ERROR_CODE_REMOTE_EXCEPTION, + "timeout"); + } catch (RemoteException e) { + if (Log.isLoggable(TAG, Log.VERBOSE)) { + Log.v(TAG, "Session.onTimedOut: caught RemoteException while responding", + e); + } + } } } |