/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/ |
H A D | ShouldQueryStrategy.java | 27 * Decides whether a given source should be queried for a given query, taking 28 * into account the source's query threshold and query after zero results flag. 37 // The last query we've seen 43 // returned zero results for some prefix of the current query. mEmptyCorpora 44 // maps from corpus to the length of the query which returned 45 // zero results. When a query is shortened (e.g., by deleting characters) 55 * Returns whether we should query the given source for the given query. 57 public boolean shouldQueryCorpus(Corpus corpus, String query) { argument 79 onZeroResults(Corpus corpus, String query) argument 88 updateQuery(String query) argument [all...] |
H A D | SuggestionCursorProvider.java | 21 * Interface for objects that can produce a SuggestionCursor given a query. 34 * @param query The user query. 36 * @param onlyOne Indicates if this provider is the only one being used for the query. 39 C getSuggestions(String query, int queryLimit, boolean onlyOne); argument
|
H A D | SuggestionNonFormatter.java | 30 public CharSequence formatSuggestion(String query, String suggestion) { argument
|
H A D | SuggestionsProvider.java | 23 * Provides a set of suggestion results for a query.. 29 * Gets suggestions for a query. 31 * @param query The query. 32 * @param corporaToQuery The corpora to query. Must be non-null. 34 Suggestions getSuggestions(String query, List<Corpus> corporaToQuery); argument
|
H A D | WebCorpus.java | 79 private boolean isUrl(String query) { argument 80 return Patterns.WEB_URL.matcher(query).matches(); 83 public Intent createSearchIntent(String query, Bundle appData) { argument 84 if (isUrl(query)) { 85 return createBrowseIntent(query); 87 return mWebSearchSource.createSearchIntent(query, appData); 93 private Intent createBrowseIntent(String query) { argument 98 String url = URLUtil.guessUrl(query); 153 protected List<Source> getSourcesToQuery(String query, boolean onlyCorpus) { argument 156 if (mBrowserSource != null && query 164 createResult(String query, ArrayList<SourceResult> results, int latency) argument 170 WebResult(String query, ArrayList<SourceResult> results, int latency) argument [all...] |
H A D | SingleSourceCorpus.java | 60 public CorpusResult getSuggestions(String query, int queryLimit, boolean onlyCorpus) { argument 62 SourceResult sourceResult = mSource.getSuggestions(query, queryLimit, true); 64 return new SingleSourceCorpusResult(this, query, sourceResult, latency); 83 public Intent createSearchIntent(String query, Bundle appData) { argument 84 return mSource.createSearchIntent(query, appData);
|
H A D | QueryTask.java | 42 * Creates a new query task. 44 * @param query Query to run. 48 * get called on. If null, the method is called on the query thread. 52 public QueryTask(String query, int queryLimit, SuggestionCursorProvider<C> provider, argument 54 mQuery = query; 77 public static <C extends SuggestionCursor> void startQueries(String query, argument 84 QueryTask.startQuery(query, maxResultsPerProvider, provider, 89 public static <C extends SuggestionCursor> void startQuery(String query, argument 95 QueryTask<C> task = new QueryTask<C>(query, maxResultsPerProvider, provider, handler,
|
H A D | LevenshteinSuggestionFormatter.java | 40 public Spanned formatSuggestion(String query, String suggestion) { argument 41 if (DBG) Log.d(TAG, "formatSuggestion('" + query + "', '" + suggestion + "')"); 42 query = normalizeQuery(query); 43 final Token[] queryTokens = tokenize(query); 68 private String normalizeQuery(String query) { argument 69 return query.toLowerCase(); 75 * @param source List of source tokens (i.e. user query)
|
H A D | SuggestionUtils.java | 38 String query = suggestion.getSuggestionQuery(); 52 if (query != null) { 53 intent.putExtra(SearchManager.QUERY, query); 73 String query = makeKeyComponent(normalizeUrl(suggestion.getSuggestionQuery())); 76 int size = action.length() + 2 + data.length() + query.length(); 82 .append(query)
|
H A D | SuggestionsProviderImpl.java | 33 * The provider will only handle a single query at a time. If a new query comes 69 * Cancels all pending query tasks. 79 * Gets the sources that should be queried for the given query. 81 private List<Corpus> filterCorpora(String query, List<Corpus> corpora) { argument 82 // If there is only one corpus, always query it 86 if (shouldQueryCorpus(corpus, query)) { 87 if (DBG) Log.d(TAG, "should query corpus " + corpus); 90 if (DBG) Log.d(TAG, "should NOT query corpus " + corpus); 97 protected boolean shouldQueryCorpus(Corpus corpus, String query) { argument 108 getSuggestions(String query, List<Corpus> corporaToQuery) argument 156 shouldDisplayResults(String query) argument [all...] |
/packages/apps/QuickSearchBox/benchmarks/src/com/android/quicksearchbox/benchmarks/ |
H A D | ApplicationsLatency.java | 51 for (String query : queries) { 52 checkSource("APPS", APPS_COMPONENT, query);
|
H A D | ContactsLatency.java | 50 for (String query : queries) { 51 checkSource("CONTACTS", CONTACTS_COMPONENT, query);
|
H A D | SourceLatency.java | 90 String query, long delay) { 93 int length = query.length(); 95 final String prefix = query.substring(0, end); 133 public long checkSource(String src, ComponentName componentName, String query) { argument 135 return checkSourceInternal(src, searchable, query); 138 private long checkSourceInternal(String src, SearchableInfo searchable, String query) { argument 142 cursor = getSuggestions(searchable, query); 147 + " for '" + query + "'"); 150 + " for '" + query + "'"); 160 public Cursor getSuggestions(SearchableInfo searchable, String query) { argument 89 checkSourceConcurrent(final String src, final ComponentName componentName, String query, long delay) argument 164 getSuggestions(SearchableInfo searchable, String query, int limit) argument 214 checkLiveSource(String src, ComponentName componentName, String query) argument 225 LiveSourceCheck(String src, ComponentName componentName, String query) argument [all...] |
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/google/ |
H A D | GoogleSource.java | 30 * Called by QSB to get web suggestions for a query. 32 SourceResult queryInternal(String query); argument 35 * Called by external apps to get web suggestions for a query. 37 SourceResult queryExternal(String query); argument
|
H A D | AbstractGoogleSource.java | 54 * Called by QSB to get web suggestions for a query. 56 public abstract SourceResult queryInternal(String query); argument 59 * Called by external apps to get web suggestions for a query. 61 public abstract SourceResult queryExternal(String query); argument 92 public SourceResult getSuggestions(String query, int queryLimit, boolean onlySource) { argument 93 return emptyIfNull(queryInternal(query), query); 96 public SourceResult getSuggestionsExternal(String query) { argument 97 return emptyIfNull(queryExternal(query), query); 100 emptyIfNull(SourceResult result, String query) argument [all...] |
H A D | GoogleSuggestionProvider.java | 66 private SourceResult emptyIfNull(SourceResult result, Source source, String query) { argument 67 return result == null ? new CursorBackedSourceResult(source, query) : result; 71 public Cursor query(Uri uri, String[] projection, String selection, method in class:GoogleSuggestionProvider 74 if (DBG) Log.d(TAG, "query uri=" + uri); 78 String query = getQuery(uri); 80 emptyIfNull(mSource.queryExternal(query), mSource, query));
|
H A D | GoogleSuggestClient.java | 84 public SourceResult queryInternal(String query) { argument 85 return query(query); 89 public SourceResult queryExternal(String query) { argument 90 return query(query); 97 private SourceResult query(String query) { argument 98 if (TextUtils.isEmpty(query)) { 106 query [all...] |
/packages/providers/CalendarProvider/src/com/android/providers/calendar/ |
H A D | QueryParameterUtils.java | 36 String query = uri.getEncodedQuery(); 37 if (query == null) { 41 int queryLength = query.length(); 47 index = query.indexOf(parameter, index); 58 if (query.charAt(index) == '=') { 64 int ampIndex = query.indexOf('&', index); 66 value = query.substring(index); 68 value = query.substring(index, ampIndex);
|
/packages/apps/Browser/src/com/android/browser/search/ |
H A D | SearchEngine.java | 43 public void startSearch(Context context, String query, Bundle appData, String extraData); argument 48 public Cursor getSuggestions(Context context, String query); argument 61 * Checks whether this search engine should be sent zero char query.
|
/packages/apps/QuickSearchBox/tests/src/com/android/quicksearchbox/ |
H A D | MockShortcutRepository.java | 45 public void getShortcutsForQuery(String query, Collection<Corpus> corporaToQuery, argument 47 ShortcutCursor cursor = getShortcutsForQuery(query, corporaToQuery); 54 public ShortcutCursor getShortcutsForQuery(String query, Collection<Corpus> corporaToQuery) { argument 56 ShortcutCursor cursor = new ShortcutCursor(query, null, null, null); 57 cursor.add(MockSource.SOURCE_1.createSuggestion(query + "_1_shortcut")); 58 cursor.add(MockSource.SOURCE_2.createSuggestion(query + "_2_shortcut"));
|
H A D | MockSource.java | 43 public SuggestionData createSuggestion(String query) { 45 .setText1(query) 47 .setSuggestionQuery(query); 136 public SourceResult getSuggestions(String query, int queryLimit, boolean onlySource) { argument 137 if (query.length() == 0) { 140 ListSuggestionCursor cursor = new ListSuggestionCursor(query); 141 cursor.add(createSuggestion(query + "_1")); 142 cursor.add(createSuggestion(query + "_2")); 143 return new Result(query, cursor); 146 public SuggestionData createSuggestion(String query) { argument 201 createSearchIntent(String query, Bundle appData) argument [all...] |
/packages/apps/QuickSearchBox/tests/naughty/src/com/android/quicksearchbox/tests/naughty/ |
H A D | CrashingSuggestionProvider.java | 48 public Cursor query(Uri uri, String[] projectionIn, String selection, method in class:CrashingSuggestionProvider 50 Log.d(TAG, "query(" + uri + ")"); 53 String query = null; 55 query = path.get(path.size()-1); 58 if ("crash".equals(query)) { 61 } else if ("exit".equals(query)) { 66 if ("icon".equals(query)) { 79 } else if ("icon2".equals(query)) {
|
H A D | HangingSuggestionProvider.java | 43 public Cursor query(Uri uri, String[] projectionIn, String selection, method in class:HangingSuggestionProvider 45 Log.d(TAG, "query(" + uri + ")"); 48 String query = null; 50 query = path.get(path.size()-1); 53 if ("hang".equals(query)) { 58 if ("icon".equals(query)) { 71 } else if ("icon2".equals(query)) {
|
/packages/apps/Browser/tests/src/com/android/browser/ |
H A D | BrowserProviderTests.java | 97 String query = "\u30ae\u30e3\u30e9\u30ea\u30fc"; 98 assertInsertQuery("http://www.example.com/sdaga", title, query); 104 String query = "\u30ad\u30e3\u30e9\u30ea\u30fc"; 105 assertInsertQuery("http://www.example.com/sdaga", title, query); 112 private void assertInsertQuery(String url, String title, String query) { argument 114 assertQueryReturns(url, title, query); 117 private void assertQueryReturns(String url, String title, String query) { argument 118 Cursor c = getBookmarksSuggest(query); 120 assertTrue(title + " not matched by " + query, c.getCount() > 0); 121 assertTrue("More than one result for " + query, 137 getBookmarksSuggest(String query) argument [all...] |
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/ |
H A D | GlobalSearchSupportTest.java | 62 Cursor c = mResolver.query(searchUri, null, null, null, null); 70 new SuggestionTesterBuilder(contact).query("D").expectIcon1Uri(true).expectedText1( 77 new SuggestionTesterBuilder(contact).query("foo@ac").expectIcon1Uri(true).expectedIcon2( 85 new SuggestionTesterBuilder(contact).query("D").expectedText1("Deer Dough").expectedText2( 92 new SuggestionTesterBuilder(contact).query("L").expectedText1("Deer Dough").expectedText2( 99 new SuggestionTesterBuilder(contact).query("G").expectedText1("Deer Dough").expectedText2( 106 new SuggestionTesterBuilder(contact).query("S").expectIcon1Uri(false).expectedText1( 115 new SuggestionTesterBuilder(contact).query("1800").expectIcon1Uri(true).expectedText1( 127 private final String query; field in class:GlobalSearchSupportTest.SuggestionTester 139 query 294 private String query; field in class:GlobalSearchSupportTest.SuggestionTesterBuilder 319 public SuggestionTesterBuilder query(String value) { method in class:GlobalSearchSupportTest.SuggestionTesterBuilder [all...] |