Log async ranking state in Settings search ranking
Bug: 62072727 Test: RunSettingsRoboTests Change-Id: I2140c41d01f18a1e4b9e3f505e0afa4a8757d049
This commit is contained in:
@@ -418,6 +418,9 @@ public class SearchFragment extends InstrumentedFragment implements SearchView.O
|
||||
taggedData.add(Pair.create(
|
||||
MetricsEvent.FIELD_SETTINGS_SEARCH_RESULT_RANK,
|
||||
resultViewHolder.getAdapterPosition()));
|
||||
taggedData.add(Pair.create(
|
||||
MetricsEvent.FIELD_SETTINGS_SEARCH_RESULT_ASYNC_RANKING_STATE,
|
||||
mSearchAdapter.getAsyncRankingState()));
|
||||
taggedData.add(Pair.create(
|
||||
MetricsEvent.FIELD_SETTINGS_SEARCH_QUERY_LENGTH,
|
||||
TextUtils.isEmpty(mQuery) ? 0 : mQuery.length()));
|
||||
|
@@ -77,11 +77,16 @@ public class SearchResultsAdapter extends RecyclerView.Adapter<SearchViewHolder>
|
||||
@IntDef({DISABLED, PENDING_RESULTS, SUCCEEDED, FAILED, TIMED_OUT})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
private @interface AsyncRankingState {}
|
||||
private static final int DISABLED = 0;
|
||||
private static final int PENDING_RESULTS = 1;
|
||||
private static final int SUCCEEDED = 2;
|
||||
private static final int FAILED = 3;
|
||||
private static final int TIMED_OUT = 4;
|
||||
@VisibleForTesting
|
||||
static final int DISABLED = 0;
|
||||
@VisibleForTesting
|
||||
static final int PENDING_RESULTS = 1;
|
||||
@VisibleForTesting
|
||||
static final int SUCCEEDED = 2;
|
||||
@VisibleForTesting
|
||||
static final int FAILED = 3;
|
||||
@VisibleForTesting
|
||||
static final int TIMED_OUT = 4;
|
||||
private @AsyncRankingState int mAsyncRankingState;
|
||||
|
||||
public SearchResultsAdapter(SearchFragment fragment,
|
||||
@@ -244,6 +249,10 @@ public class SearchResultsAdapter extends RecyclerView.Adapter<SearchViewHolder>
|
||||
}
|
||||
}
|
||||
|
||||
@AsyncRankingState int getAsyncRankingState() {
|
||||
return mAsyncRankingState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge the results from each of the loaders into one list for the adapter.
|
||||
* Prioritizes results from the local database over installed apps.
|
||||
|
Reference in New Issue
Block a user