Merge Google and Browser sources and call them Web
This required a gigantic refactoring of QuickSearchBox to work nicely.
This change also reduces the number of promoted source to 3,
since Web is now one source instead of two.
As a side effect of the recatoring, VoiceSearch now searches
the selected corpus (fixes http://b/issue?id=2438309)
Fixes http://b/issue?id=2365770
Change-Id: Ife8d40ef62ea004e8d0f20a60e9196fc589f01fc
diff --git a/src/com/android/quicksearchbox/SourceResult.java b/src/com/android/quicksearchbox/SourceResult.java
index fce01fe..20ea48f 100644
--- a/src/com/android/quicksearchbox/SourceResult.java
+++ b/src/com/android/quicksearchbox/SourceResult.java
@@ -16,47 +16,11 @@
package com.android.quicksearchbox;
-import android.database.Cursor;
-
/**
* The result of getting suggestions from a single source.
- *
- * This class is similar to a cursor, in that it is moved to a suggestion, and then
- * the suggestion info can be read out.
- *
*/
-public class SourceResult extends CursorBackedSuggestionCursor {
+public interface SourceResult extends SuggestionCursor {
- /** The suggestion source. */
- private final Source mSource;
+ Source getSource();
- /**
- * Creates a result for a failed or canceled query.
- */
- public SourceResult(Source source, String userQuery) {
- this(source, userQuery, null);
- }
-
- /**
- * Creates a new source result.
- *
- * @param source The suggestion source. Must be non-null.
- * @param cursor The cursor containing the suggestions. May be null.
- */
- public SourceResult(Source source, String userQuery, Cursor cursor) {
- super(userQuery, cursor);
- if (source == null) {
- throw new NullPointerException("source is null");
- }
- mSource = source;
- }
-
- protected Source getSource() {
- return mSource;
- }
-
- @Override
- public String toString() {
- return "SourceResult{source=" + mSource + ",query=" + getUserQuery() + "}";
- }
}