Readability cleanup in AppPrediction comparator.
(i.e., in AppPredictionServiceResolverComparator) This is believed to be a pure refactoring; no behavioral changes. This is relatively simple compared to the ongoing cleanup of the other comparator (e.g. in ag/17697713) because the AppPrediction comparator already used simple immutable model data. This should be more clear after this CL, which shows that the updated model instance is derived from the sorted list we receive from the service, along with immutable data that was provided when the AppPredictionServiceResolverComparator was initialized. The only parts that remain in the legacy ...ResolverComparator code are responsible either for fetching the model data from the remote service (which uses a somewhat sloppy/ad-hoc concurrency model that should be cleaned up in a future CL as part of removing the AbstractResolverComparator's Handler design), or for implementing a fallback to use a ResolverRankerServiceResolverComparator if there's a problem with the AppPredictionService (which should also be cleaned up in a future CL, since the AppPredictionService comparator really doesn't need to take on ownership responsibilities for some completely different model). Note that this CL also removes the bookkeeping of mTargetScores (including the `checkAppTargetRankValid()` method) because it wasn't used for anything. Test: atest ResolverActivityTest ChooserActivityTest Bug: 227486788 Change-Id: I419a73bf094c14276b0c5791edacaa27797b215c
Loading
Please register or sign in to comment