Bug 1255461 - Use PrefsHelper to set master password; r=margaret a=ritu

MozReview-Commit-ID: CqKTWUyWxqS
This commit is contained in:
Jim Chen 2016-03-18 15:18:51 -04:00
parent 6a7c2133d6
commit b72c12cd79

View File

@ -1388,19 +1388,9 @@ OnSharedPreferenceChangeListener
.setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
JSONObject jsonPref = new JSONObject();
try {
jsonPref.put("name", PREFS_MP_ENABLED);
jsonPref.put("flush", true);
jsonPref.put("type", "string");
jsonPref.put("value", input1.getText().toString());
GeckoEvent event = GeckoEvent.createBroadcastEvent("Preferences:Set", jsonPref.toString());
GeckoAppShell.sendEventToGecko(event);
} catch(Exception ex) {
Log.e(LOGTAG, "Error setting master password", ex);
}
return;
PrefsHelper.setPref(PREFS_MP_ENABLED,
input1.getText().toString(),
/* flush */ true);
}
})
.setNegativeButton(R.string.button_cancel, new DialogInterface.OnClickListener() {