Extract TargetPresentationGetter hierarchy
These were inner classes of `ResolverListAdapter`, even though they're
neither really related to the core responsibilities of that class, nor
used exclusively in the implementation of that class (i.e., they're
public APIs with clients in unrelated components of the app). This CL
pulls the abstract base class (along with the two implementations) to
a new component, and builds out comprehensive unit tests that address
more edge-cases than the existing coverage in `ResolverActivityTest`.
There are still opportunities to simplify the logic in the
`TargetPresentationGetter` implementations, but this CL leaves the
code roughly as-is so we can check in the unit test coverage in
advance of any more significant refactorings.
This CL:
* Pulls the two implementations to static inner classes of their
base class (the newly-non-inner-class) `TargetPresentationGetter`.
* Introduces a new `TargetPresentationGetter.Factory` component to
encapsulate the type-based overloads that were previously part of
the `ResolverListAdapter` API.
* Reworks client/test code to make calls in terms of the generic
`TargetPresentationGetter` interface, then tightens the visibility
of the subclasses (now private, instantiable only through the new
`Factory` API).
* Expands unit test coverage of the `TargetPresentationGetter` API,
and removes the legacy tests from `ResolverActivityTest`.
* Makes _some_ minor readability improvements (e.g. expanding
acronyms in variable names) where convenient -- not consistently.
Test: atest IntentResolverUnitTests
Bug: 202167050
Change-Id: I4793f1149b698ddde8b3bbaa8bf23e0d7b962ce1
10 files changed