Create ResolverComparatorModel interface.
Define the API for interacting with comparator model data; provide implementations for our two current model types; and (as a first step) re-write our legacy ResolverComparators to be implemented internally in terms of their new model types. This is the first CL in a multi-part cleanup of the AbstractResolverComparator design. This demonstrates that the role of an AbstractResolverComparator sub-class amounts to (i.e., Ctrl+F "@Override") some amount of work to prepare model data; some cleanup; and a set query methods against data that *really should be* immutable (separated in this CL as the new ResolverComparatorModel interace). Any remaining responsibilities of the abstract base class would be better handled (in a subsequent CL) by an external controller operating on a ResolverComparatorModel (i.e., preferring composition to inheritance). The async model-preparation steps should also be separated and cleaned up (in a later CL). I believe this to be a pure refactoring with no observable side effects. While the new design aids in implementing the correct "immutable snapshot" style, for now I've written the new ResolverComparatorModel implementations to preserve any possible quirks in the legacy implementations. Nevertheless, if some inadvertant behavior change is introduced as a result of this CL, it's most likely to be a bug-fix where we previously would've mixed in stale data. A later CL will intentionally pursue those fixes. Test: atest ResolverActivityTest ChooserActivityTest Bug: 227486788 Change-Id: If88bf7a5a6394d81c021782d5d9bce7955f1c0e6 Merged-In: If88bf7a5a6394d81c021782d5d9bce7955f1c0e6 (cherry picked from commit 8b5d279d)
Loading
Please register or sign in to comment