diff options
author | Fred Quintana <fredq@google.com> | 2010-02-05 15:28:12 -0800 |
---|---|---|
committer | Fred Quintana <fredq@google.com> | 2010-02-08 16:54:43 -0800 |
commit | 53bd2522ca7767f46646606123b6e2689b811850 (patch) | |
tree | 40a43c4d19ee0c6af8443878e3e889307f33652a /core/java/android/accounts | |
parent | 9be54d400d68c735013bc8069fbcb66c3f98c3ee (diff) | |
download | frameworks_base-53bd2522ca7767f46646606123b6e2689b811850.zip frameworks_base-53bd2522ca7767f46646606123b6e2689b811850.tar.gz frameworks_base-53bd2522ca7767f46646606123b6e2689b811850.tar.bz2 |
- change the SyncManager to retry MANUAL syncs that encounter a soft error
- make the sync dump handle the case where there are no accounts
- fix a bug that caused the SyncManager to burn up CPU in the system process
The following was implemented:
scheduler offers:
- settings to disable sync
- retries of certain errors
- backoffs
want a way to control these when scheduling a sync
- "ignore_settings"
- "ignore initial backoff"
- "manual" : ignore settings, ignore initial backoff
- "do not retry"
- need to change the default behavior of not retrying manual syncs to retry regardless
Diffstat (limited to 'core/java/android/accounts')
-rw-r--r-- | core/java/android/accounts/AccountManager.java | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/core/java/android/accounts/AccountManager.java b/core/java/android/accounts/AccountManager.java index 19e741a..652f405 100644 --- a/core/java/android/accounts/AccountManager.java +++ b/core/java/android/accounts/AccountManager.java @@ -837,14 +837,11 @@ public class AccountManager { private void ensureNotOnMainThread() { final Looper looper = Looper.myLooper(); if (looper != null && looper == mContext.getMainLooper()) { - // We really want to throw an exception here, but GTalkService exercises this - // path quite a bit and needs some serious rewrite in order to work properly. - //noinspection ThrowableInstanceNeverThrow -// Log.e(TAG, "calling this from your main thread can lead to deadlock and/or ANRs", -// new Exception()); - // TODO remove the log and throw this exception when the callers are fixed -// throw new IllegalStateException( -// "calling this from your main thread can lead to deadlock"); + final IllegalStateException exception = new IllegalStateException( + "calling this from your main thread can lead to deadlock"); + Log.e(TAG, "calling this from your main thread can lead to deadlock and/or ANRs", + exception); + throw exception; } } @@ -909,7 +906,9 @@ public class AccountManager { private Bundle internalGetResult(Long timeout, TimeUnit unit) throws OperationCanceledException, IOException, AuthenticatorException { - ensureNotOnMainThread(); + if (!isDone()) { + ensureNotOnMainThread(); + } try { if (timeout == null) { return get(); @@ -1075,7 +1074,9 @@ public class AccountManager { private T internalGetResult(Long timeout, TimeUnit unit) throws OperationCanceledException, IOException, AuthenticatorException { - ensureNotOnMainThread(); + if (!isDone()) { + ensureNotOnMainThread(); + } try { if (timeout == null) { return get(); |