Bug 1265742 - Update Google search plugin; r=margaret, a=lizzard
authorMichael Kaply <mozilla@kaply.com>
Tue, 19 Apr 2016 15:57:50 -0500
changeset 324003 2aa1ab2957926a6e0ef0e1e9fe369da30f65bf0b
parent 324002 b2cc32b7bbe6a7a999dabacf600444169bc3b3e6
child 324004 940fa79188fc1cf919ff8b0f3a4bb306d378df25
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, lizzard
bugs1265742
milestone47.0a2
Bug 1265742 - Update Google search plugin; r=margaret, a=lizzard
mobile/android/base/java/org/mozilla/gecko/search/SearchEngineManager.java
mobile/locales/Makefile.in
mobile/locales/en-US/searchplugins/google-nocodes.xml
mobile/locales/en-US/searchplugins/google.xml
mobile/locales/en-US/searchplugins/list.txt
--- a/mobile/android/base/java/org/mozilla/gecko/search/SearchEngineManager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/search/SearchEngineManager.java
@@ -569,19 +569,23 @@ public class SearchEngineManager impleme
     private SearchEngine createEngineFromLocale(String name) {
         final InputStream in = getInputStreamFromSearchPluginsJar("list.txt");
         final BufferedReader br = getBufferedReader(in);
 
         try {
             String identifier;
             while ((identifier = br.readLine()) != null) {
                 final InputStream pluginIn = getInputStreamFromSearchPluginsJar(identifier + ".xml");
-                final SearchEngine engine = createEngineFromInputStream(identifier, pluginIn);
-                if (engine != null && engine.getName().equals(name)) {
-                    return engine;
+                // pluginIn can be null if the xml file doesn't exist which
+                // can happen with :hidden plugins
+                if (pluginIn != null) {
+                  final SearchEngine engine = createEngineFromInputStream(identifier, pluginIn);
+                  if (engine != null && engine.getName().equals(name)) {
+                      return engine;
+                  }
                 }
             }
         } catch (IOException e) {
             Log.e(LOG_TAG, "Error creating shipped search engine from name: " + name, e);
         } finally {
             try {
                 br.close();
             } catch (IOException e) {
--- a/mobile/locales/Makefile.in
+++ b/mobile/locales/Makefile.in
@@ -76,16 +76,17 @@ search-jar-common = tmp-search.jar.mn
 search-jar        = $(tgt-gendir)/$(search-jar-common)
 search-jar-ts     = $(search-jar).ts
 
 GARBAGE += $(search-jar) $(search-jar-ts) $(search-jar-common)
 # ---------------------------------------------------------------------------
 # search-jar contains a list of providers for the search plugin
 ###########################################################################
 SEARCH_PLUGINS = $(shell cat $(plugin_file))
+SEARCH_PLUGINS := $(subst :hidden,,$(SEARCH_PLUGINS))
 $(call errorIfEmpty,SEARCH_PLUGINS)
 
 search-jar-preqs = \
   $(plugin-file-ts) \
   $(if $(IS_LANGUAGE_REPACK),FORCE) \
   $(NULL)
 
 .PHONY: search-jar
copy from mobile/locales/en-US/searchplugins/google.xml
copy to mobile/locales/en-US/searchplugins/google-nocodes.xml
--- a/mobile/locales/en-US/searchplugins/google.xml
+++ b/mobile/locales/en-US/searchplugins/google.xml
@@ -6,11 +6,12 @@
 <ShortName>Google</ShortName>
 <InputEncoding>UTF-8</InputEncoding>
 <Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAHqklEQVR4Ae2dVXgbSRaFe5lelnnfluFlmCnMzMzMzMwMCjPMKOsxM7MVh5kTc0AMJePDWd+dT172WupuVXVc+b4zwZF0/9N1763qVpUS+AHgSzU1NWOrq6vPN8rr9/shihhj6v8fziKmxJYYE2sACon+Q/pp419mGAi4oQ0h1sQ8YMCXeMMnOPzfk4sJX1Iah8Q4AYNvFYZQOlIoL/EPtHWaQOwVfgVXitgrrfVqFyUGRcLnG4uix4cVH744cSl8A5NSZLrhG7Mi4fONXZHwuZjAvwZIiW+ANECmHf3ZKKLDZ3YbvJZ8uE8cgmP5PDhmjoN9zADY+nWCtdN7sLZ/C7Yen8A2oDMc4weD/o3rwE54kuPAykuFN0EREb7v3h249u+EfXR/WNu+AWub10OWbXB3OLeuhfeihb8JItcAZrXCE3EW9olDCZwuolFCI4lZX8gi3CS3C+4zx2Dr2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T49owAAAAAElFTkSuQmCC</Image>
 <Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/>
 <Url type="text/html" method="GET" template="https://www.google.com/search">
   <Param name="q" value="{searchTerms}"/>
   <Param name="ie" value="utf-8"/>
   <Param name="oe" value="utf-8"/>
+  <Param name="client" value="firefox-b"/>
 </Url>
 <SearchForm>https://www.google.com</SearchForm>
 </SearchPlugin>
--- a/mobile/locales/en-US/searchplugins/list.txt
+++ b/mobile/locales/en-US/searchplugins/list.txt
@@ -1,7 +1,8 @@
 amazondotcom
-google
+google:hidden
 twitter
 wikipedia
 yahoo
 bing
 duckduckgo
+google-nocodes