Create whitelist for the most popular settings
As a temporary solution to getting the most popular settings to be the top rank, we have created a white list. If a prioritized setting shows up somewhere in the results then it will be given an elevated rank to be at the top. Bug: 35048659 Test: make RunSettingsRoboTests Change-Id: I92b563a17b42d8f91d980dd1d8e5f8f29ca5aa9c
This commit is contained in:
@@ -32,7 +32,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.android.settings.search2.SearchResult.MAX_RANK;
|
||||
import static com.android.settings.search2.SearchResult.TOP_RANK;
|
||||
import static com.android.settings.search2.SearchResult.BOTTOM_RANK;
|
||||
|
||||
public class SearchResultsAdapter extends Adapter<SearchViewHolder> {
|
||||
|
||||
@@ -117,9 +118,9 @@ public class SearchResultsAdapter extends Adapter<SearchViewHolder> {
|
||||
|
||||
int dbIndex = 0;
|
||||
int appIndex = 0;
|
||||
int rank = 1;
|
||||
int rank = TOP_RANK;
|
||||
|
||||
while (rank <= MAX_RANK) {
|
||||
while (rank <= BOTTOM_RANK) {
|
||||
while ((dbIndex < dbSize) && (databaseResults.get(dbIndex).rank == rank)) {
|
||||
results.add(databaseResults.get(dbIndex++));
|
||||
}
|
||||
|
Reference in New Issue
Block a user