OSDN Git Service

Fix Google suggest and search URLs when Google Search is not installed
authorBjorn Bringert <bringert@android.com>
Wed, 15 Sep 2010 19:46:42 +0000 (20:46 +0100)
committerandroid-build SharedAccount <android-build@sekiwake.mtv.corp.google.com>
Thu, 16 Sep 2010 20:32:20 +0000 (13:32 -0700)
Bug: 3002110
Change-Id: Id49365bf53623c45bfa6f5d96d1938b801948396

res/values/all_search_engines.xml
tools/get_search_engines.py

index 3a17bd9..08cf763 100644 (file)
@@ -206,11 +206,11 @@ http://www.opensearch.org/Specifications/OpenSearch/1.1/Draft_4#OpenSearch_1.1_p
   </string-array>
   <string-array name="google" translatable="false">
     <item>Google</item>
-    <item></item>
+    <item>google.com</item>
     <item>http://www.google.com/favicon.ico</item>
-    <item>{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}{google:originalQueryForSuggestion}sourceid=chrome&amp;ie={inputEncoding}&amp;q={searchTerms}</item>
+    <item>http://www.google.com/m?hl={language}&amp;ie={inputEncoding}&amp;source=android-browser&amp;q={searchTerms}</item>
     <item>UTF-8</item>
-    <item>{google:baseSuggestURL}search?client=chrome&amp;hl={language}&amp;q={searchTerms}</item>
+    <item>http://www.google.com/complete/search?hl={language}&amp;json=true&amp;q={searchTerms}</item>
   </string-array>
   <string-array name="bing_en_NZ" translatable="false">
     <item>Bing</item>
index 2eecec3..cd73423 100755 (executable)
@@ -37,6 +37,12 @@ locales = ["cs-CZ", "da-DK", "de-AT", "de-CH", "de-DE", "el-GR", "en-AU",
     "it-IT", "ja-JP", "ko-KR", "nb-NO", "nl-BE", "nl-NL", "pl-PL", "pt-PT",
     "pt-BR", "ru-RU", "sv-SE", "tr-TR", "zh-CN", "zh-HK", "zh-MO", "zh-TW"]
 
+google_data = ["google", "Google", "google.com",
+  "http://www.google.com/favicon.ico",
+  "http://www.google.com/m?hl={language}&amp;ie={inputEncoding}&amp;source=android-browser&amp;q={searchTerms}",
+  "UTF-8",
+  "http://www.google.com/complete/search?hl={language}&amp;json=true&amp;q={searchTerms}"]
+
 class SearchEngineManager(object):
   """Manages list of search engines and creates locale specific lists.
 
@@ -92,6 +98,10 @@ class SearchEngineManager(object):
     except that the internal name of the search engine is inserted at the
     beginning of the list.
     """
+
+    if name == "google":
+      return google_data
+
     # Find the first occurance of this search engine name in the form
     # " <name> =" in the chrome data file.
     re_exp = '\s' + name + '\s*='