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

Commit 78d38fc8 authored by George Mount's avatar George Mount
Browse files

Check for target SDK version for out-of-order fragment creation.

Bug 30230667

Ensure that pre-N applications initialize in the proper order,
but allow N and above applications to be created prior to
asking for a Transition.

Change-Id: I859f22a7c5518e4b496cbd7ee58ef1d3206a5c86
parent 0979352b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -868,7 +868,9 @@ final class BackStackRecord extends FragmentTransaction implements
             * Ensure that fragments that are entering are at least at the CREATED state
             * so that they may load Transitions using TransitionInflater.
             */
            if (fragment.mState < Fragment.CREATED && mManager.mCurState >= Fragment.CREATED) {
            if (fragment.mState < Fragment.CREATED && mManager.mCurState >= Fragment.CREATED &&
                    mManager.mHost.getContext().getApplicationInfo().targetSdkVersion >=
                    Build.VERSION_CODES.N) {
                mManager.makeActive(fragment);
                mManager.moveToState(fragment, Fragment.CREATED, 0, 0, false);
            }