diff options
author | John Reck <jreck@google.com> | 2010-12-21 11:37:43 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2010-12-21 11:37:43 -0800 |
commit | 5ddb484848f19e22ee648a0e03c7f3ffdabf4146 (patch) | |
tree | 47730f7d528f97ca7f6d4b2c4f1f7b881450a5dd /src/com/android | |
parent | db49cab0d3e12ec1e99306ef78c7b8d8a2785724 (diff) | |
download | packages_apps_Browser-5ddb484848f19e22ee648a0e03c7f3ffdabf4146.zip packages_apps_Browser-5ddb484848f19e22ee648a0e03c7f3ffdabf4146.tar.gz packages_apps_Browser-5ddb484848f19e22ee648a0e03c7f3ffdabf4146.tar.bz2 |
Readds support for browser/search_suggest_query
Bug: 3303267
BrowserProvider2 wasn't handling a URI that BP1 was. It will be handled
the same way as browser/bookmarks/search_suggest_query
Change-Id: I02acd5d2bdb16ec2335a8e3181f0f652d478971d
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/provider/BrowserProvider2.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/browser/provider/BrowserProvider2.java b/src/com/android/browser/provider/BrowserProvider2.java index 849426a..be9db9a 100644 --- a/src/com/android/browser/provider/BrowserProvider2.java +++ b/src/com/android/browser/provider/BrowserProvider2.java @@ -155,6 +155,9 @@ public class BrowserProvider2 extends SQLiteContentProvider { matcher.addURI(authority, "bookmarks/folder", BOOKMARKS_FOLDER); matcher.addURI(authority, "bookmarks/folder/#", BOOKMARKS_FOLDER_ID); matcher.addURI(authority, + SearchManager.SUGGEST_URI_PATH_QUERY, + BOOKMARKS_SUGGESTIONS); + matcher.addURI(authority, "bookmarks/" + SearchManager.SUGGEST_URI_PATH_QUERY, BOOKMARKS_SUGGESTIONS); matcher.addURI(authority, "history", HISTORY); @@ -174,6 +177,9 @@ public class BrowserProvider2 extends SQLiteContentProvider { matcher.addURI(LEGACY_AUTHORITY, "bookmarks", LEGACY); matcher.addURI(LEGACY_AUTHORITY, "bookmarks/#", LEGACY_ID); matcher.addURI(LEGACY_AUTHORITY, + SearchManager.SUGGEST_URI_PATH_QUERY, + BOOKMARKS_SUGGESTIONS); + matcher.addURI(LEGACY_AUTHORITY, "bookmarks/" + SearchManager.SUGGEST_URI_PATH_QUERY, BOOKMARKS_SUGGESTIONS); @@ -1457,6 +1463,7 @@ public class BrowserProvider2 extends SQLiteContentProvider { } static class SuggestionsCursor extends AbstractCursor { + private static final int ID_INDEX = 0; private static final int URL_INDEX = 1; private static final int TITLE_INDEX = 2; // shared suggestion array index, make sure to match COLUMNS @@ -1491,7 +1498,7 @@ public class BrowserProvider2 extends SQLiteContentProvider { @Override public String getString(int columnIndex) { switch (columnIndex) { - case 0: + case ID_INDEX: return mSource.getString(columnIndex); case SUGGEST_COLUMN_INTENT_ACTION_ID: return Intent.ACTION_VIEW; @@ -1529,6 +1536,10 @@ public class BrowserProvider2 extends SQLiteContentProvider { @Override public long getLong(int column) { + switch (column) { + case ID_INDEX: + return mSource.getLong(ID_INDEX); + } throw new UnsupportedOperationException(); } @@ -1539,7 +1550,7 @@ public class BrowserProvider2 extends SQLiteContentProvider { @Override public boolean isNull(int column) { - return getString(column) == null; + return mSource.isNull(column); } @Override |