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

Commit 899ca323 authored by George Mount's avatar George Mount
Browse files

Fix stale data due to stopped loader.

Bug 33185424

When stopping an CursorLoader while data is being loaded,
the load task will be canceled. This CL marks the data as
changed if the cancel is called while the loader is stopped.

Test: I63b48210a25be72d13a2a6182eb1757cbe6a1949
Change-Id: Ibf9c5facdcc5160f6ed146c5fdd063549ac2a7a8
parent 62dd27ab
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -170,6 +170,9 @@ public abstract class AsyncTaskLoader<D> extends Loader<D> {
    protected boolean onCancelLoad() {
        if (DEBUG) Log.v(TAG, "onCancelLoad: mTask=" + mTask);
        if (mTask != null) {
            if (!mStarted) {
                mContentChanged = true;
            }
            if (mCancellingTask != null) {
                // There was a pending task already waiting for a previous
                // one being canceled; just drop it.