TaskOrganizer: Implement lifetime changes for testing.
Here we implement three new lifetime semantics:
1. If there is a TaskOrganizer registered for a given windowing mode but
a second organizer is registered, the first organizer will no longer be
totally deregistered. It will no longer receive new tasks but will continue
to manage its old Tasks. This lets us run CTS tests that test TaskOrganizer
without totally breaking SysUI.
2. Implement unregisterTaskOrganizer, if you unregister the organizer it's
just finished. SysUI probably wont use but CTS will.
3. Implement a sort of registration chaining semantic. When unregistering
an organizer, the controller will attempt to restore the previous
organizer for the given windowing mode. This means that when CTS tests
unregister themselves SysUI can return to control.
Test: TaskOrganizerTests
Bug: 139371701
Change-Id: Ide240c707755b279ce6316f50ca8e023e38b7d66
3 files changed