Pass through SearchManager.APP_DATA bundle in web searches.
This got missed when we made the change to invoke the system default web search handler instead of the browser directing all searches to Google. This makes sure that the receiving web search providers can pass on the source parameter appropriately as part of the results page that they launch.
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 4fce8c2..8e79573 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -905,7 +905,7 @@
|| Intent.ACTION_WEB_SEARCH.equals(action)) {
url = intent.getStringExtra(SearchManager.QUERY);
}
- return handleWebSearchRequest(url);
+ return handleWebSearchRequest(url, intent.getBundleExtra(SearchManager.APP_DATA));
}
/**
@@ -913,7 +913,7 @@
* was identified as plain search terms and not URL/shortcut.
* @return true if the request was handled and web search activity was launched, false if not.
*/
- private boolean handleWebSearchRequest(String inUrl) {
+ private boolean handleWebSearchRequest(String inUrl, Bundle appData) {
if (inUrl == null) return false;
// In general, we shouldn't modify URL from Intent.
@@ -934,6 +934,9 @@
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.putExtra(SearchManager.QUERY, url);
+ if (appData != null) {
+ intent.putExtra(SearchManager.APP_DATA, appData);
+ }
startActivity(intent);
return true;