Bug 1093220 - Remove standalone search activity code. r=margaret
authorShashank Sabniveesu <shashank@linux.com>
Sun, 09 Nov 2014 16:39:04 -0500
changeset 214858 2da1175e49c8dfe78c7f053bf2ae6450886a0b82
parent 214857 a6dc5b5496fb7723abaade313560aa4f107bf8be
child 214872 35c81bff3c42e41966e0be5df23ebddb888d3c0d
child 214932 be214496ac59a1b8c777ee7ace7e5f41781c4ad5
push id27797
push userkwierso@gmail.com
push dateTue, 11 Nov 2014 01:54:04 +0000
treeherdermozilla-central@2da1175e49c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1093220
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1093220 - Remove standalone search activity code. r=margaret CLOSED TREE
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();