Bug 1093220 - Remove standalone search activity code. r=margaret, a=lsblakk
authorShashank Sabniveesu <shashank@linux.com>
Sun, 09 Nov 2014 16:39:04 -0500
changeset 235265 134e4af41d652a5d3002cd5c5f80d96411c88e7d
parent 235264 6181e6dc51b07e860e37f4b10431ea2645bc90b7
child 235266 503c939cc2fc146ffcf1b3f1129581779e527d39
push id611
push userraliiev@mozilla.com
push dateMon, 05 Jan 2015 23:23:16 +0000
treeherdermozilla-release@345cd3b9c445 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, lsblakk
bugs1093220
milestone35.0a2
Bug 1093220 - Remove standalone search activity code. r=margaret, a=lsblakk
mobile/android/search/java/org/mozilla/search/providers/SearchEngineManager.java
--- a/mobile/android/search/java/org/mozilla/search/providers/SearchEngineManager.java
+++ b/mobile/android/search/java/org/mozilla/search/providers/SearchEngineManager.java
@@ -128,25 +128,16 @@ public class SearchEngineManager impleme
      * This method does disk I/O, call it from a background thread.
      *
      * @return List of SearchEngine instances
      */
     public List<SearchEngine> getAllEngines() {
         // First try to read the engine list from the jar.
         InputStream in = getInputStreamFromJar("list.txt");
 
-        // Fallback for standalone search activity.
-        if (in == null) {
-            try {
-                in = context.getResources().getAssets().open("engines/list.txt");
-            } catch (IOException e) {
-                throw new IllegalStateException("Error reading list.txt");
-            }
-        }
-
         final List<SearchEngine> list = new ArrayList<SearchEngine>();
         InputStreamReader isr = null;
 
         try {
             isr = new InputStreamReader(in);
             BufferedReader br = new BufferedReader(isr);
             String identifier;
             while ((identifier = br.readLine()) != null) {
@@ -180,21 +171,16 @@ public class SearchEngineManager impleme
      */
     private SearchEngine createEngine(String identifier) {
         InputStream in = getInputStreamFromJar(identifier + ".xml");
 
         if (in == null) {
             in = getEngineFromProfile(identifier);
         }
 
-        // Fallback for standalone search activity.
-        if (in == null) {
-            in = getEngineFromAssets(identifier);
-        }
-
         if (in == null) {
             throw new IllegalArgumentException("Couldn't find search engine for identifier: " + identifier);
         }
 
         try {
             try {
                 return new SearchEngine(identifier, in);
             } finally {
@@ -205,32 +191,16 @@ public class SearchEngineManager impleme
         } catch (XmlPullParserException e) {
             Log.e(LOG_TAG, "Exception creating search engine", e);
         }
 
         return null;
     }
 
     /**
-     * Fallback for standalone search activity. These assets are not included
-     * in mozilla-central.
-     *
-     * @param identifier search engine identifier (e.g. "google")
-     * @return InputStream for open search plugin XML
-     */
-    private InputStream getEngineFromAssets(String identifier) {
-        try {
-            return context.getResources().getAssets().open("engines/" + identifier + ".xml");
-        } catch (IOException e) {
-            Log.e(LOG_TAG, "Exception getting search engine from assets", e);
-            return null;
-        }
-    }
-
-    /**
      * Reads a file from the searchplugins directory in the Gecko jar. This will only work
      * if the search activity is built as part of mozilla-central.
      *
      * @param fileName name of the file to read
      * @return InputStream for file
      */
     private InputStream getInputStreamFromJar(String fileName) {
         final Locale locale = Locale.getDefault();