Move `mLocator.prepareTestState()` to after `applyAnnotations()`.
This is to ensure that the `BedsteadServiceLocator`'s `dependenciesMap` is populated. Otherwise that call iterates over an empty collection and doesn't call `prepareTestState` on the dependencies.
One problem this causes is, `UsersComponent.prepareTestState()` is not called and `mOriginalSwitchedUser` is not set with `users().current()`, which causes the device be left with a different user in foreground other than the initial user if it involves a user switch.
Bug: 372002868
Bug: 369294724
Bug: 331853529
Bug: 360838273
Change-Id: I366b956aa50f44e89cedaecea9213877f6d96b7d
Test: atest UserManagerTest#testSwitchFromNonCredentialToCredentialUser
Flag: EXEMPT bugfix
1 file changed