Searched refs:promoted (Results 1 - 14 of 14) sorted by relevance

/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/
H A DPromoter.java27 * Gets the promoted suggestions.
31 * @param promoted List to add the promoted suggestions to.
33 void pickPromoted(Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted); argument
H A DRankAwarePromoter.java40 int maxPromoted, ListSuggestionCursor promoted) {
41 promoteSuggestions(suggestions.getCorpusResults(), maxPromoted, promoted);
46 ListSuggestionCursor promoted) {
56 promoteTopSuggestions(highRankingSuggestions, promoted, maxPromoted);
58 // Then try to fill promoted list with the remaining high-ranking suggestions,
60 promoteEquallyFromEachCorpus(highRankingSuggestions, promoted, maxPromoted);
61 promoteEquallyFromEachCorpus(lowRankingSuggestions, promoted, maxPromoted);
63 if (DBG) Log.d(TAG, "Returning " + promoted.toString());
69 * The corpora will appear in the promoted list in the order they are listed
73 ListSuggestionCursor promoted, in
39 doPickPromoted(Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted) argument
45 promoteSuggestions(Iterable<CorpusResult> suggestions, int maxPromoted, ListSuggestionCursor promoted) argument
72 promoteTopSuggestions(LinkedList<CorpusResult> highRankingSuggestions, ListSuggestionCursor promoted, int maxPromoted) argument
92 promoteEquallyFromEachCorpus(LinkedList<CorpusResult> suggestions, ListSuggestionCursor promoted, int maxPromoted) argument
148 getSlotsLeft(ListSuggestionCursor promoted, int maxPromoted) argument
168 roundRobin(LinkedList<CorpusResult> results, int maxPromoted, int stripeSize, ListSuggestionCursor promoted) argument
192 promote(SuggestionCursor cursor, int count, ListSuggestionCursor promoted) argument
[all...]
H A DAbstractPromoter.java34 Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted) {
35 doPickPromoted(suggestions, maxPromoted, promoted);
37 mNext.pickPromoted(suggestions, maxPromoted, promoted);
42 Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted);
33 pickPromoted( Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted) argument
41 doPickPromoted( Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted) argument
H A DSingleCorpusPromoter.java42 ListSuggestionCursor promoted) {
45 promoteUntilFull(shortcuts, mMaxShortcuts, promoted);
48 promoteUntilFull(corpusResult, maxPromoted, promoted);
51 private void promoteUntilFull(SuggestionCursor c, int maxSize, ListSuggestionCursor promoted) { argument
54 for (int i = 0; i < count && promoted.getCount() < maxSize; i++) {
57 promoted.add(new SuggestionPosition(c, i));
41 pickPromoted(Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted) argument
H A DShortcutPromoter.java35 ListSuggestionCursor promoted) {
36 promoteShortcuts(suggestions.getShortcuts(), maxPromoted, promoted);
41 ListSuggestionCursor promoted) {
45 for (int i = 0; i < shortcutCount && promoted.getCount() < maxPromoted; i++) {
52 promoted.add(new SuggestionPosition(shortcuts));
34 doPickPromoted(Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted) argument
40 promoteShortcuts(SuggestionCursor shortcuts, int maxPromoted, ListSuggestionCursor promoted) argument
H A DWebPromoter.java34 ListSuggestionCursor promoted) {
40 for (int i = 0; i < shortcutCount && promoted.getCount() < maxShortcutCount; i++) {
44 promoted.add(new SuggestionPosition(shortcuts, i));
54 for (int i = 0; i < webCount && promoted.getCount() < maxPromoted; i++) {
58 promoted.add(new SuggestionPosition(webResult, i));
33 pickPromoted(Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted) argument
H A DSuggestions.java281 private void refreshShortcuts(SuggestionCursor promoted) { argument
282 if (DBG) Log.d(TAG, "refreshShortcuts(" + promoted + ")");
283 for (int i = 0; i < promoted.getCount(); ++i) {
284 promoted.moveTo(i);
285 if (promoted.isSuggestionShortcut()) {
286 getShortcuts().refresh(promoted);
303 SuggestionCursor promoted = buildPromoted(promoter, maxPromoted);
304 refreshShortcuts(promoted);
305 return promoted;
309 ListSuggestionCursor promoted
[all...]
/packages/apps/QuickSearchBox/tests/src/com/android/quicksearchbox/
H A DRankAwarePromoterTest.java51 ListSuggestionCursorNoDuplicates promoted =
53 mPromoter.promoteSuggestions(suggestions, MAX_PROMOTED_SUGGESTIONS, promoted);
58 assertRightSuggestionsWerePromoted(promoted, expectedSource, expectedSuggestion);
63 ListSuggestionCursorNoDuplicates promoted =
67 // (e.g. a shortcut) into the promoted suggestions list, and the current
75 promoted.add(shortcut);
77 mPromoter.promoteSuggestions(suggestions, MAX_PROMOTED_SUGGESTIONS, promoted);
82 // The promoted results. There's just one result from corpus
90 // The promoted results.
93 assertRightSuggestionsWerePromoted(promoted, expectedSourc
96 assertRightSuggestionsWerePromoted(ListSuggestionCursorNoDuplicates promoted, int[] expectedSource, int[] expectedSuggestion) argument
[all...]
H A DBlendingPromoterTest.java58 SuggestionCursor promoted = limit(cursor(mS11, mS12, mS21, mS22), 0, 0);
60 assertSameSuggestions(expected, promoted);
64 SuggestionCursor promoted = limit(cursor(mS11, mS12, mS21, mS22), 1, 1);
66 assertSameSuggestions(expected, promoted);
70 SuggestionCursor promoted = limit(cursor(mS11, mS12, mS21, mS22), 2, 2);
72 assertSameSuggestions(expected, promoted);
76 SuggestionCursor promoted = limit(cursor(mS11, mS12, mS21, mS22), 3, 3);
78 assertSameSuggestions(expected, promoted);
82 SuggestionCursor promoted = limit(cursor(mS11, mS12), 0, 0);
84 assertSameSuggestions(expected, promoted);
[all...]
H A DSingleCorpusPromoterTest.java43 ListSuggestionCursor promoted = new ListSuggestionCursor(TEST_QUERY);
44 mPromoter.pickPromoted(suggestions, 4, promoted);
46 assertEquals(2, promoted.getCount());
50 for (int i = 0; i < promoted.getCount(); i++) {
51 promoted.moveTo(i);
53 expectedSource[i], promoted.getSuggestionSource());
H A DResultPromoterTest.java72 SuggestionCursor promoted = promoteShortcuts(mShortcuts);
74 assertSameSuggestions(expected, promoted);
78 SuggestionCursor promoted = promoteSuggestions(mCorpusResults);
80 assertSameSuggestionsNoOrder(expected, promoted);
91 ListSuggestionCursor promoted = new ListSuggestionCursor(mQuery);
92 promoter.promoteShortcuts(shortcuts, MAX_PROMOTED_SUGGESTIONS, promoted);
93 return promoted;
99 ListSuggestionCursor promoted = new ListSuggestionCursor(mQuery);
100 promoter.promoteSuggestions(suggestions, MAX_PROMOTED_SUGGESTIONS, promoted);
101 return promoted;
[all...]
H A DWebPromoterTest.java77 SuggestionCursor promoted = promote(mSuggestions, 0, 1);
81 assertSameSuggestions(expected, promoted);
85 SuggestionCursor promoted = promote(mSuggestions, 1, 1);
89 assertSameSuggestions(expected, promoted);
93 SuggestionCursor promoted = promote(mSuggestions, 1, 2);
97 assertSameSuggestions(expected, promoted);
103 ListSuggestionCursor promoted = new ListSuggestionCursor(mQuery);
104 promoter.pickPromoted(suggestions, maxSuggestions, promoted);
105 return promoted;
H A DSuggestionsProviderImplTest.java90 assertEquals("Incorrect promoted: " + promote(suggestions),
94 assertEquals("Incorrect promoted: " + promote(suggestions),
108 ListSuggestionCursor promoted) {
112 if (promoted.getCount() >= maxPromoted) {
115 promoted.add(new SuggestionPosition(c, i));
107 pickPromoted(Suggestions suggestions, int maxPromoted, ListSuggestionCursor promoted) argument
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/ui/
H A DClusteredSuggestionsAdapter.java97 SuggestionCursor promoted = getCurrentPromotedSuggestions();
99 if (promoted != null && promoted.getCount() > 0) {
100 promoted.moveTo(0);
102 promotedSuggestions.add(SuggestionUtils.getSuggestionKey(promoted));
103 } while (promoted.moveToNext());
204 SuggestionCursor promoted = getCurrentPromotedSuggestions();
205 return (promoted == null ? 0 : promoted.getCount());

Completed in 166 milliseconds