diff options
author | Mathew Inwood <mathewi@google.com> | 2010-08-11 13:36:52 +0100 |
---|---|---|
committer | Mathew Inwood <mathewi@google.com> | 2010-08-12 10:19:19 +0100 |
commit | 9038d65a5a8ebcfada1ec3067f81a26f05622088 (patch) | |
tree | 67ddad1cfb1858e5926b169234e786884c73ebea /tests | |
parent | b1d058c5fb5dca0d5f0df5bf3433feaad65478bb (diff) | |
download | QuickSearchBox-9038d65a5a8ebcfada1ec3067f81a26f05622088.tar.gz |
Only refresh shortcuts that are displayed in the UI.
Change I6413d82f9051bb64487c65817bfbcdea0f0c3097 introduced a problem whereby
*all* the shortcuts were updated, as the shortcut repository did not filter them,
and it refreshed all the shortcuts it returned. Now, the refreshing is started
after the suggestion promotion stage, so that only shortcuts that are actually
displayed in the suggestions list will be refreshed. This results in far fewer
refreshes and database updates (which can be time consuming).
Change-Id: I4b4cac522d12a4e304ddebfca7466f670cc3811b
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/quicksearchbox/MockShortcutRefresher.java | 2 | ||||
-rw-r--r-- | tests/src/com/android/quicksearchbox/MockShortcutRepository.java | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/src/com/android/quicksearchbox/MockShortcutRefresher.java b/tests/src/com/android/quicksearchbox/MockShortcutRefresher.java index 9fb417b..d5c1f11 100644 --- a/tests/src/com/android/quicksearchbox/MockShortcutRefresher.java +++ b/tests/src/com/android/quicksearchbox/MockShortcutRefresher.java @@ -28,7 +28,7 @@ public class MockShortcutRefresher implements ShortcutRefresher { public void markShortcutRefreshed(Source source, String shortcutId) { } - public void refresh(SuggestionCursor shortcuts, Listener listener) { + public void refresh(Suggestion shortcut, Listener listener) { } public void reset() { diff --git a/tests/src/com/android/quicksearchbox/MockShortcutRepository.java b/tests/src/com/android/quicksearchbox/MockShortcutRepository.java index 6ccb1dc..ff8cbce 100644 --- a/tests/src/com/android/quicksearchbox/MockShortcutRepository.java +++ b/tests/src/com/android/quicksearchbox/MockShortcutRepository.java @@ -31,14 +31,17 @@ public class MockShortcutRepository implements ShortcutRepository { public void close() { } - public SuggestionCursor getShortcutsForQuery(String query, Collection<Corpus> corporaToQuery) { + public ShortcutCursor getShortcutsForQuery(String query, Collection<Corpus> corporaToQuery) { // TODO: should look at corporaToQuery - ListSuggestionCursor cursor = new ListSuggestionCursor(query); + ShortcutCursor cursor = new ShortcutCursor(query, null, null, null); cursor.add(MockSource.SOURCE_1.createSuggestion(query + "_1_shortcut")); cursor.add(MockSource.SOURCE_2.createSuggestion(query + "_2_shortcut")); return cursor; } + public void updateShortcut(Source source, String shortcutId, SuggestionCursor refreshed) { + } + public Map<String, Integer> getCorpusScores() { return null; } |