Extact Chooser intent processing; remove delegate
This CL makes two small cleanups with no observable behavior changes:
1. Extract a helper (in a new component) to handle the intent
processing that was previously inline in ChooserActivity's
onCreate(), storing the validated request data immutably. There's
a lot of boilerplate in the processing that was too verbose
inline in such an important lifecycle hook, and this refactoring
clarifies the lifecycle -- many of the extracted parameters had
been individual ivars on ChooserActivity, and it wasn't obvious
that they were all assigned in a batch and then never modified.
2. In previous code reviews, ayepin@ and I have discussed the
opportunity to remove the ChooserListCommunicator interface now
that it's clearly only responsible for providing values that we
can precompute and inject upfront; that precomputation mostly
involves the parameters extracted in this CL, so I've gone ahead
and made that change here. (It's not as straightforward to
replace the base ResolverListCommunicator, so for now we're still
passing through the same "communicator object" as before, but
without the enhanced "chooser-specific" API.
Test: atest IntentResolverUnitTests
Bug: 202167050
Change-Id: I7c3d47d282591f86ab1fae5e04c3d7d83f2fea0d
5 files changed