diff options
author | Bjorn Bringert <bringert@android.com> | 2011-08-10 16:16:46 -0700 |
---|---|---|
committer | Bjorn Bringert <bringert@android.com> | 2011-08-10 16:19:46 -0700 |
commit | 6747e0a22235ee1652e81f40e62828268f30c1cb (patch) | |
tree | 9b78930f3d09bb8cdf713e53af7f3c2777b9284e | |
parent | e3da7d615be4710da92a79e6ed70dc1982deda4c (diff) | |
download | packages_apps_Browser-6747e0a22235ee1652e81f40e62828268f30c1cb.zip packages_apps_Browser-6747e0a22235ee1652e81f40e62828268f30c1cb.tar.gz packages_apps_Browser-6747e0a22235ee1652e81f40e62828268f30c1cb.tar.bz2 |
Use EXTRA_WEB_SEARCH_PENDINGINTENT
This avoids a chooser dialog when web searches are
done in the address bar when there are multiple browsers
installed.
Bug: 4988580
Change-Id: I3afb5f7dc10acf1aa2a0107e76061de0e534d8fe
-rw-r--r-- | src/com/android/browser/search/.DefaultSearchEngine.java.swp | bin | 16384 -> 0 bytes | |||
-rw-r--r-- | src/com/android/browser/search/DefaultSearchEngine.java | 7 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/browser/search/.DefaultSearchEngine.java.swp b/src/com/android/browser/search/.DefaultSearchEngine.java.swp Binary files differdeleted file mode 100644 index 441153c..0000000 --- a/src/com/android/browser/search/.DefaultSearchEngine.java.swp +++ /dev/null diff --git a/src/com/android/browser/search/DefaultSearchEngine.java b/src/com/android/browser/search/DefaultSearchEngine.java index 0a7afcf..a575404 100644 --- a/src/com/android/browser/search/DefaultSearchEngine.java +++ b/src/com/android/browser/search/DefaultSearchEngine.java @@ -15,6 +15,7 @@ */ package com.android.browser.search; +import android.app.PendingIntent; import android.app.SearchManager; import android.app.SearchableInfo; import android.content.ActivityNotFoundException; @@ -92,6 +93,12 @@ public class DefaultSearchEngine implements SearchEngine { intent.putExtra(SearchManager.EXTRA_DATA_KEY, extraData); } intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName()); + Intent viewIntent = new Intent(Intent.ACTION_VIEW); + viewIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + viewIntent.setPackage(context.getPackageName()); + PendingIntent pending = PendingIntent.getActivity(context, 0, viewIntent, + PendingIntent.FLAG_ONE_SHOT); + intent.putExtra(SearchManager.EXTRA_WEB_SEARCH_PENDINGINTENT, pending); context.startActivity(intent); } catch (ActivityNotFoundException ex) { Log.e(TAG, "Web search activity not found: " + mSearchable.getSearchActivity()); |