diff options
author | Satish Sampath <satish@android.com> | 2009-06-23 17:05:35 +0100 |
---|---|---|
committer | Satish Sampath <satish@android.com> | 2009-06-23 22:15:09 +0100 |
commit | 41282a35568b51270440450c46bb31aa00e52caa (patch) | |
tree | 20512870fde7f148979e3af65d8383c8c643c8c2 /core/java/android/server/search/Searchables.java | |
parent | 1bee98af6532eba3c6cda636eee890530c95a2a7 (diff) | |
download | frameworks_base-41282a35568b51270440450c46bb31aa00e52caa.zip frameworks_base-41282a35568b51270440450c46bb31aa00e52caa.tar.gz frameworks_base-41282a35568b51270440450c46bb31aa00e52caa.tar.bz2 |
EnhancedGoogleSearch overrides GoogleSearch if present.
This is to fix bug http://b/issue?id=1929993. If user had GoogleSearch
earlier and that was the default, it will get overridden by
EnhancedGoogleSearch when the user installs the latter from the market.
Diffstat (limited to 'core/java/android/server/search/Searchables.java')
-rw-r--r-- | core/java/android/server/search/Searchables.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/server/search/Searchables.java b/core/java/android/server/search/Searchables.java index a27667b..c7cc8ed 100644 --- a/core/java/android/server/search/Searchables.java +++ b/core/java/android/server/search/Searchables.java @@ -57,6 +57,11 @@ public class Searchables { private SearchableInfo mDefaultSearchable = null; private SearchableInfo mDefaultSearchableForWebSearch = null; + public static String GOOGLE_SEARCH_COMPONENT_NAME = + "com.android.googlesearch/.GoogleSearch"; + public static String ENHANCED_GOOGLE_SEARCH_COMPONENT_NAME = + "com.google.android.providers.enhancedgooglesearch/.Launcher"; + /** * * @param context Context to use for looking up activities etc. @@ -341,6 +346,18 @@ public class Searchables { return component; } } + } else { + // If the current preferred activity is GoogleSearch, and we detect + // EnhancedGoogleSearch installed as well, set the latter as preferred since that + // is a superset and provides more functionality. + ComponentName cn = new ComponentName(ri.activityInfo.packageName, ri.activityInfo.name); + if (cn.flattenToShortString().equals(GOOGLE_SEARCH_COMPONENT_NAME)) { + ComponentName enhancedGoogleSearch = ComponentName.unflattenFromString( + ENHANCED_GOOGLE_SEARCH_COMPONENT_NAME); + if (setPreferredActivity(enhancedGoogleSearch, Intent.ACTION_WEB_SEARCH)) { + return enhancedGoogleSearch; + } + } } if (ri == null) return null; |