Tighten visibility in the -ListAdapter classes.
As noted in ag/19933554, client code occasionally reached directly
into these components to manipulate package-private members that
weren't obviously intended to be part of the API. This CL narrows
the visibility of those ivars (as described below), creating new
methods as necessary to expose the (now-encapsulated) data for the
clients that had previously been using it directly. This CL also
shows that some indirect dependencies (previously accessed via these
shared ivars) can be precomputed and injected, to avoid any
subsequent sharing. Finally, the CL includes some other minor
readability cleanups.
To narrow the visibilities, almost all ivars were marked `private`.
In some cases it's convenient to grant the subclass direct access to
collaborating components, so those were marked `protected` in the base
class; those are exclusively `final` members (and for the most part,
their APIs are even "logically stateless") so they should be much
easier to reason about when reading the base class source.
These classes still need substantial refactoring to define their
roles and responsibilities in the system, and especially to clarify
their inheritance contract; this CL is just a first step to making
the existing code more understandable.
Test: atest IntentResolverUnitTests
Bug: 202167050
Change-Id: I659197b3fe22f46813dc818e90ba78546a61bec3
9 files changed