mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-06 09:05:45 +00:00
Bug 1058352 - Correctly specify "other" instead of "null" for non-built-in search engines. r=mfinkle
This commit is contained in:
parent
899fdc0fd9
commit
418d76fd43
@ -37,7 +37,7 @@ public class SearchEnginePreference extends CustomListPreference {
|
|||||||
|
|
||||||
private FaviconView mFaviconView;
|
private FaviconView mFaviconView;
|
||||||
|
|
||||||
// Search engine identifier specified by the gecko search service. This will be null
|
// Search engine identifier specified by the gecko search service. This will be "other"
|
||||||
// for engines that are not shipped with the app.
|
// for engines that are not shipped with the app.
|
||||||
private String mIdentifier;
|
private String mIdentifier;
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ public class SearchEnginePreference extends CustomListPreference {
|
|||||||
* @return Identifier of built-in search engine, or "other" if engine is not built-in.
|
* @return Identifier of built-in search engine, or "other" if engine is not built-in.
|
||||||
*/
|
*/
|
||||||
public String getIdentifier() {
|
public String getIdentifier() {
|
||||||
return (mIdentifier == null) ? "other" : mIdentifier;
|
return mIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -134,6 +134,11 @@ public class SearchEnginePreference extends CustomListPreference {
|
|||||||
public void setSearchEngineFromJSON(JSONObject geckoEngineJSON) throws JSONException {
|
public void setSearchEngineFromJSON(JSONObject geckoEngineJSON) throws JSONException {
|
||||||
mIdentifier = geckoEngineJSON.getString("identifier");
|
mIdentifier = geckoEngineJSON.getString("identifier");
|
||||||
|
|
||||||
|
// A null JS value gets converted into a string.
|
||||||
|
if (mIdentifier.equals("null")) {
|
||||||
|
mIdentifier = "other";
|
||||||
|
}
|
||||||
|
|
||||||
final String engineName = geckoEngineJSON.getString("name");
|
final String engineName = geckoEngineJSON.getString("name");
|
||||||
final SpannableString titleSpannable = new SpannableString(engineName);
|
final SpannableString titleSpannable = new SpannableString(engineName);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user