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

Commit 2db4e4bd authored by Adam Powell's avatar Adam Powell
Browse files

Fix bug 5557267 - [ViewPager] non-primary fragments unnecessary

stopped if "defer start" is enabled

Only revise the target state in moveToState if it would cross the
stopped/started boundary.

Change-Id: I8f6e400331157eac9343261117cf633611fc1e4d
parent 7a5a50c1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -725,8 +725,9 @@ final class FragmentManagerImpl extends FragmentManager {
            // While removing a fragment, we can't change it to a higher state.
            newState = f.mState;
        }
        // Defer start if requested; don't allow it to move to STARTED or higher.
        if (f.mDeferStart && newState > Fragment.STOPPED) {
        // Defer start if requested; don't allow it to move to STARTED or higher
        // if it's not already started.
        if (f.mDeferStart && f.mState < Fragment.STARTED && newState > Fragment.STOPPED) {
            newState = Fragment.STOPPED;
        }
        if (f.mState < newState) {