Bug 1093220 - Remove standalone search activity code. r=margaret

CLOSED TREE
This commit is contained in:
Shashank Sabniveesu 2014-11-09 16:39:04 -05:00
Родитель a849d55568
Коммит aaad7da285
1 изменённых файлов: 0 добавлений и 30 удалений

Просмотреть файл

@ -133,15 +133,6 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference
// 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;
@ -185,11 +176,6 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference
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);
}
@ -209,22 +195,6 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference
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.