/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/ |
H A D | SingleCorpusResultsPromoter.java | 19 * Promotes non-web-search shortcuts and suggestions from a single corpus. 23 public SingleCorpusResultsPromoter(Corpus corpus, int maxShortcuts) { argument 24 super(corpus, maxShortcuts);
|
H A D | ShouldQueryStrategy.java | 44 // maps from corpus to the length of the query which returned 57 public boolean shouldQueryCorpus(Corpus corpus, String query) { argument 60 && !corpus.isWebCorpus() // always query web, to warm up connection 64 if (query.length() >= corpus.getQueryThreshold()) { 65 if (!corpus.queryAfterZeroResults() && mEmptyCorpora.containsKey(corpus)) { 66 if (DBG) Log.i(TAG, "Not querying " + corpus + ", returned 0 after " 67 + mEmptyCorpora.get(corpus)); 72 if (DBG) Log.d(TAG, "Query too short for corpus " + corpus); 79 onZeroResults(Corpus corpus, String query) argument [all...] |
H A D | SingleSourceCorpusResult.java | 29 public SingleSourceCorpusResult(Corpus corpus, String userQuery, SuggestionCursor cursor, argument 32 mCorpus = corpus;
|
H A D | SingleCorpusPromoter.java | 22 * Promotes shortcuts and suggestions from a single corpus. 32 public SingleCorpusPromoter(Corpus corpus, int maxShortcuts) { argument 33 mCorpus = corpus; 36 for (Source source : corpus.getSources()) {
|
H A D | VoiceSearch.java | 47 public boolean shouldShowVoiceSearch(Corpus corpus) { argument 48 return corpusSupportsVoiceSearch(corpus) && isVoiceSearchAvailable(); 51 protected boolean corpusSupportsVoiceSearch(Corpus corpus) { argument 52 return (corpus == null || corpus.voiceSearchEnabled());
|
H A D | DefaultCorpusRanker.java | 33 * A corpus ranker that uses corpus scores from the shortcut repository to rank 49 * Creates a new default corpus ranker. 52 * @param shortcuts Shortcut repository for getting corpus scores. 125 * Scores a corpus. Higher score is better. 127 private int getCorpusScore(Corpus corpus) { argument 128 // Web corpus always comes first 129 if (corpus.isWebCorpus()) { 133 return getClickScore(corpus); 136 private int getClickScore(Corpus corpus) { argument [all...] |
H A D | Logger.java | 40 void logStart(int onCreateLatency, int latency, String intentSource, Corpus corpus, argument 62 void logSearch(Corpus corpus, int startMethod, int numChars); argument 67 void logVoiceSearch(Corpus corpus); argument
|
H A D | SearchSettings.java | 35 public boolean isCorpusEnabled(Corpus corpus); argument
|
H A D | EventLogLogger.java | 60 public void logStart(int onCreateLatency, int latency, String intentSource, Corpus corpus, argument 64 String currentCorpus = getCorpusLogName(corpus); 79 public void logSearch(Corpus corpus, int startMethod, int numChars) { argument 80 String corpusName = getCorpusLogName(corpus); 84 public void logVoiceSearch(Corpus corpus) { argument 85 String corpusName = getCorpusLogName(corpus); 107 private String getCorpusLogName(Corpus corpus) { argument 108 if (corpus == null) return null; 109 return corpus.getName(); 130 for (Corpus corpus [all...] |
H A D | 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(); 133 if (isCorpusHighlyRanked(corpus)) { 142 private boolean isCorpusHighlyRanked(Corpus corpus) { argument 145 return corpus == null || corpus.isCorpusDefaultEnabled(); 159 * Promotes "stripes" of suggestions from each corpus [all...] |
H A D | SearchableCorpusFactory.java | 83 * Adds corpora for all sources that are not already used by a corpus. 104 private void addCorpus(ArrayList<Corpus> corpora, Corpus corpus) { argument 105 if (corpus != null) corpora.add(corpus);
|
H A D | CorpusSelectionDialog.java | 66 * Shows the corpus selection dialog. 68 * @param corpus The currently selected corpus. 70 public void show(Corpus corpus) { argument 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) { argument 184 String corpusName = corpus == null ? null : corpus.getName(); 191 Corpus corpus [all...] |
H A D | SearchSettingsImpl.java | 81 * Prefix of per-corpus enable preference 112 * Gets the preference key of the preference for whether the given corpus 116 public static String getCorpusEnabledPreference(Corpus corpus) { argument 117 return CORPUS_ENABLED_PREF_PREFIX + corpus.getName(); 120 public boolean isCorpusEnabled(Corpus corpus) { argument 121 boolean defaultEnabled = corpus.isCorpusDefaultEnabled(); 122 String sourceEnabledPref = getCorpusEnabledPreference(corpus);
|
H A D | Suggestions.java | 33 * Collects all corpus results for a single query. 75 // create a map of corpus name -> position in mExpectedCorpora for sorting later 110 public boolean expectsCorpus(Corpus corpus) { argument 112 if (expectedCorpus.equals(corpus)) return true; 188 * Adds a list of corpus results. Must be called on the UI thread, or before this 201 Log.d(TAG, "addCorpusResult["+ hashCode() + "] corpus:" + 210 Log.w(TAG, "Got unexpected CorpusResult from corpus " + 322 * Gets the list of corpus results reported so far. Do not modify or hang on to 335 public CorpusResult getCorpusResult(Corpus corpus) { argument 337 if (result != null && corpus [all...] |
H A D | SuggestionsProviderImpl.java | 82 // If there is only one corpus, always query it 85 for (Corpus corpus : corpora) { 86 if (shouldQueryCorpus(corpus, query)) { 87 if (DBG) Log.d(TAG, "should query corpus " + corpus); 88 corporaToQuery.add(corpus); 90 if (DBG) Log.d(TAG, "should NOT query corpus " + corpus); 97 protected boolean shouldQueryCorpus(Corpus corpus, String query) { argument 98 return mShouldQueryStrategy.shouldQueryCorpus(corpus, quer [all...] |
H A D | Config.java | 104 for (String corpus : corpora) { 105 if (DBG) Log.d(TAG, "Default corpus: " + corpus); 106 defaultCorpora.add(corpus); 114 public synchronized boolean isCorpusEnabledByDefault(Corpus corpus) { argument 115 if (DBG) Log.d(TAG, "isCorpusEnabledByDefault(" + corpus.getName() + ")"); 119 if (mDefaultCorpora.contains(corpus.getName())) { 120 if (DBG) Log.d(TAG, "Corpus " + corpus.getName() + " IS default"); 129 for (Source s : corpus.getSources()) { 131 if (DBG) Log.d(TAG, "Suggest URI for " + corpus [all...] |
H A D | QsbApplication.java | 253 * Gets the corpus ranker. 382 public Promoter createSingleCorpusPromoter(Corpus corpus) { argument 383 return new SingleCorpusPromoter(corpus, Integer.MAX_VALUE); 386 public Promoter createSingleCorpusResultsPromoter(Corpus corpus) { argument 387 return new SingleCorpusResultsPromoter(corpus, Integer.MAX_VALUE);
|
H A D | 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) { argument 257 if (corpus == null) return null; 260 .authority(corpus.getName()) 628 Corpus corpus = getCorpus(); 629 if (corpus == null) {
|
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/ui/ |
H A D | SearchActivityViewSinglePane.java | 75 protected void setCorpus(Corpus corpus) { argument 76 super.setCorpus(corpus); 80 if (corpus == null) { 83 sourceIcon = corpus.getCorpusIcon(); 91 Corpus corpus = getCorpus(); 92 if (corpus == null) { 95 return getQsbApplication().createSingleCorpusPromoter(corpus); 100 * Gets the corpus to use for any searches. This is the web corpus in "All" mode, 101 * and the selected corpus otherwis [all...] |
H A D | CorporaAdapter.java | 65 public void setCurrentCorpus(Corpus corpus) { argument 66 mCurrentCorpusName = corpus == null ? null : corpus.getName(); 73 for (Corpus corpus : enabledCorpora) { 74 if (!corpus.isCorpusHidden()) { 75 sorted.add(corpus); 85 // Comparing a corpus against itself 116 * Gets the position of the given corpus. 118 public int getCorpusPosition(Corpus corpus) { argument 119 if (corpus 143 bindView(CorpusView view, Corpus corpus) argument 153 getCorpusIcon(Corpus corpus) argument 161 getCorpusLabel(Corpus corpus) argument 169 isCurrentCorpus(Corpus corpus) argument [all...] |
H A D | SearchActivityViewTwoPane.java | 260 protected void setCorpus(Corpus corpus) { argument 261 super.setCorpus(corpus); 271 Corpus corpus = getCorpus(); 272 if (corpus == null) { 275 return getQsbApplication().createSingleCorpusResultsPromoter(corpus);
|
/packages/apps/QuickSearchBox/tests/src/com/android/quicksearchbox/ |
H A D | MockLogger.java | 30 public void logStart(int onCreateLatency, int latency, String intentSource, Corpus corpus, argument 39 public void logSearch(Corpus corpus, int startMethod, int numChars) { argument 42 public void logVoiceSearch(Corpus corpus) { argument
|
H A D | MockSearchSettings.java | 40 public boolean isCorpusEnabled(Corpus corpus) { argument
|
H A D | MockCorpora.java | 44 public void addCorpus(Corpus corpus) { argument 45 Corpus oldCorpus = mCorporaByName.put(corpus.getName(), corpus); 47 Log.d(TAG, "Replaced " + oldCorpus + " with " + corpus); 56 public void addDefaultCorpus(Corpus corpus) { argument 57 mDefaultCorpora.add(corpus); 73 for (Corpus corpus : mCorporaByName.values()) { 74 for (Source corpusSource : corpus.getSources()) { 76 return corpus; 92 for (Corpus corpus 102 isCorpusDefaultEnabled(Corpus corpus) argument 106 isCorpusEnabled(Corpus corpus) argument [all...] |
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/preferences/ |
H A D | SearchableItemsController.java | 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) { argument 104 sourcePref.setKey(SearchSettingsImpl.getCorpusEnabledPreference(corpus)); 105 // Put web corpus first. The rest are alphabetical. 106 if (corpus.isWebCorpus()) { 109 sourcePref.setDefaultValue(corpus [all...] |