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

Skip to content
Commit d1d4d9cb authored by Adam Powell's avatar Adam Powell
Browse files

Eagerly update fragment state when moving between states

As seen in frameworks/support!

Previously we would not set a fragment's new state until the move to a
new target state was fully complete. This causes problems when other
parts of the fragment manager infrastructure (such as lazily
initializing a child fragment manager) read that state while we're
dispatching a state change call to a fragment.

In this situation, adding a child fragment and then calling
executePendingTransactions on the child FragmentManager would not have
the intended effect, as the child FragmentManager would still be in
state INITIALIZING. The expected lifecycle callbacks to the child
fragment would then occur later.

Fix this by updating the fragment state as we go through each phase of
moveToState before we dispatch to the associated onState method,
matching our usual pattern of invoking onFoo methods after foo has
occurred. Delete the redundant resumed field as we now can use the
state directly.

Bug 25019275

Change-Id: I97fe45578d59ab643c9779eaeb475a331e446335
parent 7c132d82
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment