/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/ |
D | ShouldQueryStrategy.java | 57 public boolean shouldQueryCorpus(Corpus corpus, String query) { in shouldQueryCorpus() argument 58 updateQuery(query); in shouldQueryCorpus() 59 if (query.length() == 0 in shouldQueryCorpus() 64 if (query.length() >= corpus.getQueryThreshold()) { in shouldQueryCorpus() 79 public void onZeroResults(Corpus corpus, String query) { in onZeroResults() argument 81 if (mLastQuery.startsWith(query) && !corpus.queryAfterZeroResults() in onZeroResults() 82 && !TextUtils.isEmpty(query)) { in onZeroResults() 83 if (DBG) Log.d(TAG, corpus + " returned 0 results for '" + query + "'"); in onZeroResults() 84 mEmptyCorpora.put(corpus, query.length()); in onZeroResults() 88 private void updateQuery(String query) { in updateQuery() argument [all …]
|
D | WebCorpus.java | 79 private boolean isUrl(String query) { in isUrl() argument 80 return Patterns.WEB_URL.matcher(query).matches(); in isUrl() 83 public Intent createSearchIntent(String query, Bundle appData) { in createSearchIntent() argument 84 if (isUrl(query)) { in createSearchIntent() 85 return createBrowseIntent(query); in createSearchIntent() 87 return mWebSearchSource.createSearchIntent(query, appData); in createSearchIntent() 93 private Intent createBrowseIntent(String query) { in createBrowseIntent() argument 98 String url = URLUtil.guessUrl(query); in createBrowseIntent() 153 protected List<Source> getSourcesToQuery(String query, boolean onlyCorpus) { in getSourcesToQuery() argument 156 if (mBrowserSource != null && query.length() > 0) { in getSourcesToQuery() [all …]
|
D | SuggestionsProviderImpl.java | 81 private List<Corpus> filterCorpora(String query, List<Corpus> corpora) { in filterCorpora() argument 86 if (shouldQueryCorpus(corpus, query)) { in filterCorpora() 97 protected boolean shouldQueryCorpus(Corpus corpus, String query) { in shouldQueryCorpus() argument 98 return mShouldQueryStrategy.shouldQueryCorpus(corpus, query); in shouldQueryCorpus() 108 public Suggestions getSuggestions(String query, List<Corpus> corporaToQuery) { in getSuggestions() argument 109 if (DBG) Log.d(TAG, "getSuggestions(" + query + ")"); in getSuggestions() 110 corporaToQuery = filterCorpora(query, corporaToQuery); in getSuggestions() 111 final Suggestions suggestions = new Suggestions(query, corporaToQuery); in getSuggestions() 112 Log.i(TAG, "chars:" + query.length() + ",corpora:" + corporaToQuery); in getSuggestions() 129 if (shouldDisplayResults(query)) { in getSuggestions() [all …]
|
D | SearchActivity.java | 208 String query = savedInstanceState.getString(INSTANCE_KEY_QUERY); in restoreInstanceState() local 210 setQuery(query, false); in restoreInstanceState() 226 String query = intent.getStringExtra(SearchManager.QUERY); in setupFromIntent() local 231 setQuery(query, selectAll); in setupFromIntent() 395 protected void setQuery(String query, boolean selectAll) { in setQuery() argument 396 mSearchActivityView.setQuery(query, selectAll); in setQuery() 414 String query = CharMatcher.WHITESPACE.trimAndCollapseFrom(getQuery(), ' '); in onSearchClicked() local 415 if (DBG) Log.d(TAG, "Search clicked, query=" + query); in onSearchClicked() 418 if (TextUtils.getTrimmedLength(query) == 0) return false; in onSearchClicked() 426 getLogger().logSearch(getCorpus(), method, query.length()); in onSearchClicked() [all …]
|
D | MultiSourceCorpus.java | 78 protected Result createResult(String query, ArrayList<SourceResult> results, int latency) { in createResult() argument 79 return new Result(query, results, latency); in createResult() 89 protected List<Source> getSourcesToQuery(String query, boolean onlyCorpus) { in getSourcesToQuery() argument 92 if (candidate.getQueryThreshold() <= query.length()) { in getSourcesToQuery() 137 public CorpusResult getSuggestions(String query, int queryLimit, boolean onlyCorpus) { in getSuggestions() argument 139 List<Source> sources = getSourcesToQuery(query, onlyCorpus); in getSuggestions() 144 QueryTask<SourceResult> task = new QueryTask<SourceResult>(query, queryLimit, in getSuggestions() 150 Result result = createResult(query, results, latency); in getSuggestions()
|
D | QueryTask.java | 52 public QueryTask(String query, int queryLimit, SuggestionCursorProvider<C> provider, in QueryTask() argument 54 mQuery = query; in QueryTask() 77 public static <C extends SuggestionCursor> void startQueries(String query, in startQueries() argument 84 QueryTask.startQuery(query, maxResultsPerProvider, provider, in startQueries() 89 public static <C extends SuggestionCursor> void startQuery(String query, in startQuery() argument 95 QueryTask<C> task = new QueryTask<C>(query, maxResultsPerProvider, provider, handler, in startQuery()
|
D | LevenshteinSuggestionFormatter.java | 40 public Spanned formatSuggestion(String query, String suggestion) { in formatSuggestion() argument 41 if (DBG) Log.d(TAG, "formatSuggestion('" + query + "', '" + suggestion + "')"); in formatSuggestion() 42 query = normalizeQuery(query); in formatSuggestion() 43 final Token[] queryTokens = tokenize(query); in formatSuggestion() 68 private String normalizeQuery(String query) { in normalizeQuery() argument 69 return query.toLowerCase(); in normalizeQuery()
|
D | SingleSourceCorpus.java | 60 public CorpusResult getSuggestions(String query, int queryLimit, boolean onlyCorpus) { in getSuggestions() argument 62 SourceResult sourceResult = mSource.getSuggestions(query, queryLimit, true); in getSuggestions() 64 return new SingleSourceCorpusResult(this, query, sourceResult, latency); in getSuggestions() 83 public Intent createSearchIntent(String query, Bundle appData) { in createSearchIntent() argument 84 return mSource.createSearchIntent(query, appData); in createSearchIntent()
|
D | SuggestionUtils.java | 38 String query = suggestion.getSuggestionQuery(); in getSuggestionIntent() local 52 if (query != null) { in getSuggestionIntent() 53 intent.putExtra(SearchManager.QUERY, query); in getSuggestionIntent() 73 String query = makeKeyComponent(normalizeUrl(suggestion.getSuggestionQuery())); in getSuggestionKey() local 76 int size = action.length() + 2 + data.length() + query.length(); in getSuggestionKey() 82 .append(query) in getSuggestionKey()
|
/packages/apps/QuickSearchBox/tests/src/com/android/quicksearchbox/ |
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) { in getSuggestions() argument 137 if (query.length() == 0) { in getSuggestions() 140 ListSuggestionCursor cursor = new ListSuggestionCursor(query); in getSuggestions() 141 cursor.add(createSuggestion(query + "_1")); in getSuggestions() 142 cursor.add(createSuggestion(query + "_2")); in getSuggestions() 143 return new Result(query, cursor); in getSuggestions() 146 public SuggestionData createSuggestion(String query) { in createSuggestion() argument [all …]
|
D | MockShortcutRepository.java | 45 public void getShortcutsForQuery(String query, Collection<Corpus> corporaToQuery, in getShortcutsForQuery() argument 47 ShortcutCursor cursor = getShortcutsForQuery(query, corporaToQuery); in getShortcutsForQuery() 54 public ShortcutCursor getShortcutsForQuery(String query, Collection<Corpus> corporaToQuery) { in getShortcutsForQuery() argument 56 ShortcutCursor cursor = new ShortcutCursor(query, null, null, null); in getShortcutsForQuery() 57 cursor.add(MockSource.SOURCE_1.createSuggestion(query + "_1_shortcut")); in getShortcutsForQuery() 58 cursor.add(MockSource.SOURCE_2.createSuggestion(query + "_2_shortcut")); in getShortcutsForQuery()
|
D | ShortcutRepositoryTest.java | 773 protected ListSuggestionCursor makeCursor(String query, SuggestionData... suggestions) { in makeCursor() argument 774 ListSuggestionCursor cursor = new ListSuggestionCursor(query); in makeCursor() 781 protected void reportClick(String query, SuggestionData suggestion) { in reportClick() argument 782 reportClick(new ListSuggestionCursor(query, suggestion), 0); in reportClick() 785 protected void reportClick(String query, SuggestionData suggestion, long now) { in reportClick() argument 786 reportClickAtTime(new ListSuggestionCursor(query, suggestion), 0, now); in reportClick() 852 void assertNoShortcuts(String query) { in assertNoShortcuts() argument 853 assertNoShortcuts("", query); in assertNoShortcuts() 856 void assertNoShortcuts(String message, String query) { in assertNoShortcuts() argument 857 SuggestionCursor cursor = getShortcuts(query, mAllowedCorpora); in assertNoShortcuts() [all …]
|
/packages/providers/CalendarProvider/src/com/android/providers/calendar/ |
D | QueryParameterUtils.java | 36 String query = uri.getEncodedQuery(); in getQueryParameter() local 37 if (query == null) { in getQueryParameter() 41 int queryLength = query.length(); in getQueryParameter() 47 index = query.indexOf(parameter, index); in getQueryParameter() 58 if (query.charAt(index) == '=') { in getQueryParameter() 64 int ampIndex = query.indexOf('&', index); in getQueryParameter() 66 value = query.substring(index); in getQueryParameter() 68 value = query.substring(index, ampIndex); in getQueryParameter()
|
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/google/ |
D | AbstractGoogleSource.java | 56 public abstract SourceResult queryInternal(String query); in queryInternal() argument 61 public abstract SourceResult queryExternal(String query); in queryExternal() argument 92 public SourceResult getSuggestions(String query, int queryLimit, boolean onlySource) { in getSuggestions() argument 93 return emptyIfNull(queryInternal(query), query); in getSuggestions() 96 public SourceResult getSuggestionsExternal(String query) { in getSuggestionsExternal() argument 97 return emptyIfNull(queryExternal(query), query); in getSuggestionsExternal() 100 private SourceResult emptyIfNull(SourceResult result, String query) { in emptyIfNull() argument 101 return result == null ? new CursorBackedSourceResult(this, query) : result; in emptyIfNull()
|
D | GoogleSuggestClient.java | 84 public SourceResult queryInternal(String query) { in queryInternal() argument 85 return query(query); in queryInternal() 89 public SourceResult queryExternal(String query) { in queryExternal() argument 90 return query(query); in queryExternal() 97 private SourceResult query(String query) { in query() argument 98 if (TextUtils.isEmpty(query)) { in query() 106 query = URLEncoder.encode(query, "UTF-8"); in query() 114 String suggestUri = mSuggestUri + query; in query() 129 return new GoogleSuggestCursor(this, query, suggestions, popularity); in query()
|
D | GoogleSuggestionProvider.java | 66 private SourceResult emptyIfNull(SourceResult result, Source source, String query) { in emptyIfNull() argument 67 return result == null ? new CursorBackedSourceResult(source, query) : result; in emptyIfNull() 71 public Cursor query(Uri uri, String[] projection, String selection, in query() method in GoogleSuggestionProvider 78 String query = getQuery(uri); in query() local 80 emptyIfNull(mSource.queryExternal(query), mSource, query)); in query()
|
/packages/apps/QuickSearchBox/benchmarks/src/com/android/quicksearchbox/benchmarks/ |
D | SourceLatency.java | 90 String query, long delay) { in checkSourceConcurrent() argument 93 int length = query.length(); in checkSourceConcurrent() 95 final String prefix = query.substring(0, end); in checkSourceConcurrent() 133 public long checkSource(String src, ComponentName componentName, String query) { in checkSource() argument 135 return checkSourceInternal(src, searchable, query); in checkSource() 138 private long checkSourceInternal(String src, SearchableInfo searchable, String query) { in checkSourceInternal() argument 142 cursor = getSuggestions(searchable, query); in checkSourceInternal() 147 + " for '" + query + "'"); in checkSourceInternal() 150 + " for '" + query + "'"); in checkSourceInternal() 160 public Cursor getSuggestions(SearchableInfo searchable, String query) { in getSuggestions() argument [all …]
|
/packages/apps/Browser/tests/src/com/android/browser/ |
D | BrowserProviderTests.java | 97 String query = "\u30ae\u30e3\u30e9\u30ea\u30fc"; in testPartialTitleJapanese() local 98 assertInsertQuery("http://www.example.com/sdaga", title, query); in testPartialTitleJapanese() 104 String query = "\u30ad\u30e3\u30e9\u30ea\u30fc"; in testSoundmarkTitleJapanese() local 105 assertInsertQuery("http://www.example.com/sdaga", title, query); in testSoundmarkTitleJapanese() 112 private void assertInsertQuery(String url, String title, String query) { in assertInsertQuery() argument 114 assertQueryReturns(url, title, query); in assertInsertQuery() 117 private void assertQueryReturns(String url, String title, String query) { in assertQueryReturns() argument 118 Cursor c = getBookmarksSuggest(query); in assertQueryReturns() 120 assertTrue(title + " not matched by " + query, c.getCount() > 0); in assertQueryReturns() 121 assertTrue("More than one result for " + query, c.getCount() == 1); in assertQueryReturns() [all …]
|
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/ |
D | GlobalSearchSupportTest.java | 62 Cursor c = mResolver.query(searchUri, null, null, null, null); in testSearchSuggestionsNotInDefaultDirectory() 70 new SuggestionTesterBuilder(contact).query("D").expectIcon1Uri(true).expectedText1( in testSearchSuggestionsByNameWithPhoto() 77 new SuggestionTesterBuilder(contact).query("foo@ac").expectIcon1Uri(true).expectedIcon2( in testSearchSuggestionsByEmailWithPhoto() 85 new SuggestionTesterBuilder(contact).query("D").expectedText1("Deer Dough").expectedText2( in testSearchSuggestionsByName() 92 new SuggestionTesterBuilder(contact).query("L").expectedText1("Deer Dough").expectedText2( in testSearchByNickname() 99 new SuggestionTesterBuilder(contact).query("G").expectedText1("Deer Dough").expectedText2( in testSearchByCompany() 106 new SuggestionTesterBuilder(contact).query("S").expectIcon1Uri(false).expectedText1( in testSearchByTitleWithCompany() 115 new SuggestionTesterBuilder(contact).query("1800").expectIcon1Uri(true).expectedText1( in testSearchSuggestionsByPhoneNumberOnNonPhone() 141 private final String query; field in GlobalSearchSupportTest.SuggestionTester 153 query = builder.query; in SuggestionTester() [all …]
|
/packages/apps/Browser/src/com/android/browser/ |
D | PreloadedTabControl.java | 42 private void maybeSetQuery(final String query, SearchBox sb) { in maybeSetQuery() argument 43 if (!TextUtils.equals(mLastQuery, query)) { in maybeSetQuery() 45 if (LOGD_ENABLED) Log.d(LOGTAG, "Changing searchbox query to " + query); in maybeSetQuery() 47 sb.setQuery(query); in maybeSetQuery() 54 mLastQuery = query; in maybeSetQuery() 64 public void setQuery(String query) { in setQuery() argument 65 maybeSetQuery(query, mTab.getWebViewClassic().getSearchBox()); in setQuery() 68 public boolean searchBoxSubmit(final String query, in searchBoxSubmit() argument 76 maybeSetQuery(query, sb); in searchBoxSubmit() 77 if (LOGD_ENABLED) Log.d(LOGTAG, "Submitting query " + query); in searchBoxSubmit()
|
/packages/apps/QuickSearchBox/tests/naughty/src/com/android/quicksearchbox/tests/naughty/ |
D | CrashingSuggestionProvider.java | 48 public Cursor query(Uri uri, String[] projectionIn, String selection, in query() method in CrashingSuggestionProvider 53 String query = null; in query() local 55 query = path.get(path.size()-1); in query() 58 if ("crash".equals(query)) { in query() 61 } else if ("exit".equals(query)) { in query() 66 if ("icon".equals(query)) { in query() 79 } else if ("icon2".equals(query)) { in query()
|
D | HangingSuggestionProvider.java | 43 public Cursor query(Uri uri, String[] projectionIn, String selection, in query() method in HangingSuggestionProvider 48 String query = null; in query() local 50 query = path.get(path.size()-1); in query() 53 if ("hang".equals(query)) { in query() 58 if ("icon".equals(query)) { in query() 71 } else if ("icon2".equals(query)) { in query()
|
/packages/apps/Contacts/tests/src/com/android/contacts/tests/mocks/ |
D | MockContentProvider.java | 239 Query query = new Query(contentUri); in expectQuery() local 240 mExpectedQueries.add(query); in expectQuery() 241 return query; in expectQuery() 249 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() method in MockContentProvider 253 Query query = iterator.next(); in query() local 254 if (query.equals(uri, projection, selection, selectionArgs, sortOrder)) { in query() 255 query.mExecuted = true; in query() 256 if (!query.mAnyNumberOfTimes) { in query() 259 return query.getResult(projection); in query() 333 for (Query query : mExpectedQueries) { in verify() [all …]
|
/packages/apps/Browser/src/com/android/browser/search/ |
D | SearchEngineInfo.java | 124 public String getSearchUriForQuery(String query) { in getSearchUriForQuery() argument 125 return getFormattedUri(searchUri(), query); in getSearchUriForQuery() 132 public String getSuggestUriForQuery(String query) { in getSuggestUriForQuery() argument 133 return getFormattedUri(suggestUri(), query); in getSuggestUriForQuery() 156 private String getFormattedUri(String templateUri, String query) { in getFormattedUri() argument 164 return templateUri.replace(PARAMETER_SEARCH_TERMS, URLEncoder.encode(query, enc)); in getFormattedUri() 166 Log.e(TAG, "Exception occured when encoding query " + query + " to " + enc); in getFormattedUri()
|
/packages/apps/Browser/tests/src/com/android/browser/tests/ |
D | BP1to2UpgradeTests.java | 55 Cursor c = mBp1.query(Browser.BOOKMARKS_URI, in testStockUpgrade() 64 c = getMockContentResolver().query(Browser.BOOKMARKS_URI, in testStockUpgrade() 74 c = getMockContentResolver().query(Bookmarks.CONTENT_URI, in testStockUpgrade() 92 Cursor c = getMockContentResolver().query(History.CONTENT_URI, in testPreserveHistory() 101 c = getMockContentResolver().query(Browser.BOOKMARKS_URI, in testPreserveHistory() 121 Cursor c = getMockContentResolver().query(Bookmarks.CONTENT_URI, in testPreserveBookmarks() 130 c = getMockContentResolver().query(Browser.BOOKMARKS_URI, in testPreserveBookmarks() 142 Cursor c = getMockContentResolver().query(Bookmarks.CONTENT_URI, in testEmptyUpgrade()
|