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

Commit 3a471757 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix Loader bugs"

parents b85f02e9 e6f7daeb
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -308,13 +308,11 @@ public abstract class FragmentHostCallback<E> extends FragmentContainer {
            mAllLoaderManagers = new ArrayMap<String, LoaderManager>();
        }
        LoaderManagerImpl lm = (LoaderManagerImpl) mAllLoaderManagers.get(who);
        if (lm == null) {
            if (create) {
        if (lm == null && create) {
            lm = new LoaderManagerImpl(who, this, started);
            mAllLoaderManagers.put(who, lm);
            }
        } else {
            lm.updateHostController(this);
        } else if (started && lm != null && !lm.mStarted){
            lm.doStart();
        }
        return lm;
    }
+8 −6
Original line number Diff line number Diff line
@@ -1536,6 +1536,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
            boolean loadersRunning = false;

            // Must add them in the proper order. mActive fragments may be out of order
            if (mAdded != null) {
                final int numAdded = mAdded.size();
                for (int i = 0; i < numAdded; i++) {
                    Fragment f = mAdded.get(i);
@@ -1544,6 +1545,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                        loadersRunning |= f.mLoaderManager.hasRunningLoaders();
                    }
                }
            }

            // Now iterate through all active fragments. These will include those that are removed
            // and detached.
+1 −0
Original line number Diff line number Diff line
@@ -852,6 +852,7 @@ class LoaderManagerImpl extends LoaderManager {
            mInactiveLoaders.valueAt(i).destroy();
        }
        mInactiveLoaders.clear();
        mHost = null;
    }

    @Override