/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/preferences/ |
SearchableItemsController.java | 19 import com.android.quicksearchbox.Corpus; 88 for (Corpus corpus : getCorpora().getAllCorpora()) { 89 if (includeNonAllCorpora || corpus.includeInAll()) { 90 Preference pref = createCorpusPreference(corpus); 92 if (DBG) Log.d(TAG, "Adding corpus: " + corpus); 102 private Preference createCorpusPreference(Corpus corpus) { 104 sourcePref.setKey(SearchSettingsImpl.getCorpusEnabledPreference(corpus)); [all...] |
/packages/apps/QuickSearchBox/tests/src/com/android/quicksearchbox/ |
SingleCorpusPromoterTest.java | 32 private List<Corpus> mCorpora = Arrays.asList(MockCorpus.CORPUS_1, MockCorpus.CORPUS_2); 60 for (Corpus corpus : mCorpora) { 61 results.add(corpus.getSuggestions(query, 10, false));
|
RankAwarePromoterTest.java | 35 private final List<Corpus> mCorpora = createMockCorpora(5, MAX_PROMOTED_CORPORA); 36 private final Corpus mShortcuts = createMockShortcutsCorpus(); 82 // The promoted results. There's just one result from corpus 83 // 2 because only 2 test suggestions per corpus are generated 85 // for corpus 2 earlier than the rest. 125 for (Corpus corpus : mCorpora) { 126 results.add(corpus.getSuggestions(query, 10, false)); 131 private static List<Corpus> createMockCorpora(int count, int defaultCount) { 132 ArrayList<Corpus> corpora = new ArrayList<Corpus>() [all...] |
SuggestionsTest.java | 38 private List<Corpus> mExpectedCorpora; 59 List<Corpus> expectedCorpora = mSuggestions.getExpectedCorpora(); 78 Corpus corpus = MockCorpus.CORPUS_1; local 80 Collections.singletonList(corpus.getSuggestions("foo", 50, true))); 81 Set<Corpus> includedCorpora = mSuggestions.getIncludedCorpora(); 83 assertTrue(includedCorpora.contains(corpus)); 87 Corpus corpus = MockCorpus.CORPUS_1; local 91 Collections.singletonList(corpus.getSuggestions("foo", 50, true))) [all...] |
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/ |
SearchableCorpora.java | 47 // Maps corpus names to corpora 48 private HashMap<String,Corpus> mCorporaByName; 49 // Maps sources to the corpus that contains them 50 private HashMap<Source,Corpus> mCorporaBySource; 52 private List<Corpus> mEnabledCorpora; 53 // Web corpus 54 private Corpus mWebCorpus; 72 public Collection<Corpus> getAllCorpora() { 76 public List<Corpus> getEnabledCorpora() { 80 public List<Corpus> getCorporaInAll() 121 mCorporaByName.put(corpus.getName(), corpus); local [all...] |
RankAwarePromoter.java | 50 // suggestions, each corpus's cursor positioned at the first suggestion. 55 // Top results, evenly distributed between each high-ranking corpus. 87 * Tries to promote the same number of elements from each corpus. 116 * rank of the corpus the result is part of. 132 Corpus corpus = result.getCorpus(); local 133 if (isCorpusHighlyRanked(corpus)) { 142 private boolean isCorpusHighlyRanked(Corpus corpus) { 145 return corpus == null || corpus.isCorpusDefaultEnabled() [all...] |
CorpusSelectionDialog.java | 37 * Corpus selection dialog. 52 private Corpus mCorpus; 66 * Shows the corpus selection dialog. 68 * @param corpus The currently selected corpus. 70 public void show(Corpus corpus) { 71 mCorpus = corpus; 128 // Cancel dialog on any touch down event which is not handled by the corpus grid 181 protected void selectCorpus(Corpus corpus) 191 Corpus corpus = (Corpus) parent.getItemAtPosition(position); local [all...] |
ShortcutRepositoryImplLog.java | 269 public void getShortcutsForQuery(final String query, final Collection<Corpus> allowedCorpora, 316 ShortcutCursor getShortcutsForQuery(String query, Collection<Corpus> allowedCorpora, 331 for (Corpus corpus : allowedCorpora) { 332 for (Source source : corpus.getSources()) { 518 String name = cursor.getString(SourceStats.corpus.ordinal()); 650 Corpus corpus = mCorpora.getCorpusForSource(suggestion.getSuggestionSource()); local 651 if (corpus == null) { 652 Log.w(TAG, "no corpus for clicked suggestion") 727 corpus; enum constant in enum:ShortcutRepositoryImplLog.ClickLog 755 corpus, enum constant in enum:ShortcutRepositoryImplLog.SourceStats [all...] |
SearchActivity.java | 59 private static final String SCHEME_CORPUS = "qsb.corpus"; 67 private static final String INSTANCE_KEY_CORPUS = "corpus"; 244 * Removes corpus selector intent action, so that BACK works normally after 245 * dismissing and reopening the corpus selector. 256 public static Uri getCorpusUri(Corpus corpus) { 257 if (corpus == null) return null; 260 .authority(corpus.getName()) 270 private Corpus getCorpus() { 420 Corpus searchCorpus = getSearchCorpus() 628 Corpus corpus = getCorpus(); local [all...] |
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/ui/ |
SearchActivityViewSinglePane.java | 19 import com.android.quicksearchbox.Corpus; 75 protected void setCorpus(Corpus corpus) { 76 super.setCorpus(corpus); 80 if (corpus == null) { 83 sourceIcon = corpus.getCorpusIcon(); 91 Corpus corpus = getCorpus(); local 92 if (corpus == null) { 95 return getQsbApplication().createSingleCorpusPromoter(corpus); 105 Corpus corpus = getCorpus(); local [all...] |
CorporaAdapter.java | 20 import com.android.quicksearchbox.Corpus; 53 private List<Corpus> mSortedCorpora; 65 public void setCurrentCorpus(Corpus corpus) { 66 mCurrentCorpusName = corpus == null ? null : corpus.getName(); 71 List<Corpus> enabledCorpora = mCorpora.getEnabledCorpora(); 72 ArrayList<Corpus> sorted = new ArrayList<Corpus>(enabledCorpora.size()); 73 for (Corpus corpus : enabledCorpora) 137 Corpus corpus = getItem(position); local [all...] |
SearchActivityViewTwoPane.java | 19 import com.android.quicksearchbox.Corpus; 260 protected void setCorpus(Corpus corpus) { 261 super.setCorpus(corpus); 271 Corpus corpus = getCorpus(); local 272 if (corpus == null) { 275 return getQsbApplication().createSingleCorpusResultsPromoter(corpus); 308 public Corpus getSearchCorpus() {
|
SearchActivityView.java | 20 import com.android.quicksearchbox.Corpus; 62 private Corpus mCorpus; 174 public Corpus getCorpus() { 180 protected Corpus getCorpus(String sourceName) { 182 Corpus corpus = getCorpora().getCorpus(sourceName); 183 if (corpus == null) { 184 Log.w(TAG, "Unknown corpus " + sourceName); 187 return corpus; 198 Corpus corpus = getCorpus(corpusName) local 213 Corpus corpus = getCorpus(); local 350 Corpus corpus = getCorpus(); local 463 Corpus corpus = getSearchCorpus(); local [all...] |