summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/SuggestionsAdapter.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2010-11-10 11:57:04 -0800
committerJohn Reck <jreck@google.com>2010-11-10 11:57:04 -0800
commit40f720ecfd4ef7ebb657f0fc1906a9982b3bafbd (patch)
tree5064294545b26fa7ee046e45fe45626616bc75d1 /src/com/android/browser/SuggestionsAdapter.java
parente222fe87a6a582b283cbad0f6967e908c4bfe85e (diff)
downloadpackages_apps_Browser-40f720ecfd4ef7ebb657f0fc1906a9982b3bafbd.zip
packages_apps_Browser-40f720ecfd4ef7ebb657f0fc1906a9982b3bafbd.tar.gz
packages_apps_Browser-40f720ecfd4ef7ebb657f0fc1906a9982b3bafbd.tar.bz2
Omnibox supports search extra data
Bug: 3025590 Fix the omnibox to support passing on SearchManager.EXTRA_SEARCH_DATA in searches done from the suggestion adapter. Change-Id: Ica6462ef27722c3bbcc0508178ce431e87e27e86
Diffstat (limited to 'src/com/android/browser/SuggestionsAdapter.java')
-rw-r--r--src/com/android/browser/SuggestionsAdapter.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/browser/SuggestionsAdapter.java b/src/com/android/browser/SuggestionsAdapter.java
index 626283a..d3609b2 100644
--- a/src/com/android/browser/SuggestionsAdapter.java
+++ b/src/com/android/browser/SuggestionsAdapter.java
@@ -73,7 +73,7 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli
public void onSearch(String txt);
- public void onSelect(String txt);
+ public void onSelect(String txt, String extraData);
public void onFilterComplete(int count);
@@ -119,7 +119,8 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli
mListener.onSearch(item.title);
} else {
SuggestItem item = (SuggestItem) v.getTag();
- mListener.onSelect((TextUtils.isEmpty(item.url)? item.title : item.url));
+ mListener.onSelect((TextUtils.isEmpty(item.url)? item.title : item.url),
+ item.extra);
}
}
@@ -378,6 +379,7 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli
String title;
String url;
int type;
+ String extra;
public SuggestItem(String text, String u, int t) {
title = text;
@@ -541,7 +543,10 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli
String uri = mCursor.getString(
mCursor.getColumnIndex(SearchManager.SUGGEST_COLUMN_INTENT_DATA));
int type = (TextUtils.isEmpty(url)) ? TYPE_SUGGEST : TYPE_SUGGEST_URL;
- return new SuggestItem(title, url, type);
+ SuggestItem item = new SuggestItem(title, url, type);
+ item.extra = mCursor.getString(
+ mCursor.getColumnIndex(SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA));
+ return item;
}
return null;
}