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
Родитель d2f89f7275
Коммит 4b7421aabe
1 изменённых файлов: 14 добавлений и 2 удалений

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

@ -439,13 +439,25 @@ public class GeckoPreferences
// saved when the orientation changes. It uses the // saved when the orientation changes. It uses the
// "android.not_a_preference.privacy.clear" key - which doesn't // "android.not_a_preference.privacy.clear" key - which doesn't
// exist in Gecko - to satisfy this requirement. // exist in Gecko - to satisfy this requirement.
if (key != null && !key.startsWith(NON_PREF_PREFIX)) { if (isGeckoPref(key)) {
prefs.add(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. * 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 // Send Gecko-side pref changes to Gecko
if (!TextUtils.isEmpty(prefName) && !prefName.startsWith(NON_PREF_PREFIX)) { if (isGeckoPref(prefName)) {
PrefsHelper.setPref(prefName, newValue); PrefsHelper.setPref(prefName, newValue);
} }