Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09bd4bf8 authored by Erik's avatar Erik
Browse files

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
parent 5ba5de93
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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) {