Bug 917480 - Part 0: refactor checking of isGeckoPref inside GeckoPreferences. r=liuche

This commit is contained in:
Richard Newman 2014-05-13 20:50:26 -07:00
parent ff0fbdecbb
commit bd644d2628

View File

@ -439,13 +439,25 @@ public class GeckoPreferences
// saved when the orientation changes. It uses the
// "android.not_a_preference.privacy.clear" key - which doesn't
// exist in Gecko - to satisfy this requirement.
if (key != null && !key.startsWith(NON_PREF_PREFIX)) {
if (isGeckoPref(key)) {
prefs.add(key);
}
}
}
}
private boolean isGeckoPref(String key) {
if (TextUtils.isEmpty(key)) {
return false;
}
if (key.startsWith(NON_PREF_PREFIX)) {
return false;
}
return true;
}
/**
* Restore default search engines in Gecko and retrigger a search engine refresh.
*/
@ -612,7 +624,7 @@ public class GeckoPreferences
}
// Send Gecko-side pref changes to Gecko
if (!TextUtils.isEmpty(prefName) && !prefName.startsWith(NON_PREF_PREFIX)) {
if (isGeckoPref(prefName)) {
PrefsHelper.setPref(prefName, newValue);
}