b/3004029 Fixed content resolver loss

We were creating a static AsyncQueryHandler which only held a
weak reference to the content resolver. This caused db updates
to be dropped once the original context had been gc'd. This
fix creates a new handler for each update to ensure we have a
valid resolver.

Change-Id: I049d8390ac0215e12e63d57b0bae4d3f6df64b6a
This commit is contained in:
Erik
2010-09-15 15:45:19 -07:00
parent 5ba5de93c7
commit 09bd4bf85e

View File

@@ -206,11 +206,11 @@ public class CalendarUtils {
// Update the db
ContentValues values = new ContentValues();
if (mHandler == null) {
mHandler = new AsyncTZHandler(context.getContentResolver());
if (mHandler != null) {
mHandler.cancelOperation(mToken);
}
mHandler.cancelOperation(mToken);
mHandler = new AsyncTZHandler(context.getContentResolver());
// skip 0 so query can use it
if (++mToken == 0) {