History log of /packages/apps/Contacts/src/com/android/contacts/list/ProviderStatusWatcher.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e0b2f1e2d01d1ac52ba207dc7ce76971d853298e 12-Jun-2012 Chiao Cheng <chiaocheng@google.com> Global import order fix.

Changed import order to be in accordance with style guide:
http://source.android.com/source/code-style.html#order-import-statements

Static imports will be placed at the top since most existing files used that
convention. It is also a style that can be handled by both eclipse and intellij.

Change-Id: Ia7013c7a2d88e5fefb8f4975d121f7fcd3fcc462
/packages/apps/Contacts/src/com/android/contacts/list/ProviderStatusWatcher.java
d8fa716e5428791f79f54437087df3005cc907bf 16-May-2012 Makoto Onuki <omakoto@google.com> Improve provider status query wait

Follow-up to I9bc34e7d.

Don't wait for the provider status to be loaded more than once in a single
call tree.

Before, in order to update ContactsUnavailableFragment from
PeopleActivity.updateViewConfiguration(),
ProviderStatusWatcher.getProviderStatus() may have been called multiple times
in a single call tree, and each call could block the UI thread at most 1 second,
so in total the UI thread may have been blocked >= 2 seconds.

Now we only call ProviderStatusWatcher.getProviderStatus() once per the
updateViewConfiguration() call and pass around the result, so the UI
thread is blocked at most 1 second per call.

Bug 6503283

Change-Id: Ife55d3c6f9e052d82387629c082e41aaad737543
/packages/apps/Contacts/src/com/android/contacts/list/ProviderStatusWatcher.java
c2bd6138e19fdcf734843eb55c83d6ffe00e91da 28-Apr-2012 Makoto Onuki <omakoto@google.com> Don't load provider status on the ui thread

The provider status query isn't backed by the filesystem, so is usually pretty
fast, but still, we occasionally get ANRs.

We can't just use a loder to load it in the background, because as long as it's
fast, we *do* want to wait on the UI thread, as the status is needed to decide
whether we should show the "contacts unavailable" fragment.

Added a singleton watcher class that keeps track of the last known provider
status.

start() starts wathcing the status, and stop() stops it.

Once we get a provider status, getProviderStatus()/getProviderStatusData()
will return the last known status, unblocked. Until we get the first status,
they will block at most 1 second. If we can't get the status within this
timeout, it'll just return STATUS_UPGRADING, and the people app shows
"Contacts list is being updated."

Bug 6337646

Change-Id: I9bc34e7d43e8e4bd5e1a11898137e8422b689582
/packages/apps/Contacts/src/com/android/contacts/list/ProviderStatusWatcher.java