mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 906088 - part 1b - add ArrayList getPrefs method to PrefsHelper; r=bnicholson
This commit is contained in:
parent
064e6210e6
commit
303238ab30
@ -664,9 +664,7 @@ public class GeckoPreferences
|
||||
|
||||
// Initialize preferences by requesting the preference values from Gecko
|
||||
private int getGeckoPreferences(final PreferenceGroup screen, ArrayList<String> prefs) {
|
||||
JSONArray jsonPrefs = new JSONArray(prefs);
|
||||
|
||||
return PrefsHelper.getPrefs(jsonPrefs, new PrefsHelper.PrefHandlerBase() {
|
||||
return PrefsHelper.getPrefs(prefs, new PrefsHelper.PrefHandlerBase() {
|
||||
private Preference getField(String prefName) {
|
||||
return screen.findPreference(prefName);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import org.json.JSONObject;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -40,6 +41,14 @@ public final class PrefsHelper {
|
||||
return getPrefs(prefs, callback);
|
||||
}
|
||||
|
||||
public static int getPrefs(ArrayList<String> prefNames, PrefHandler callback) {
|
||||
JSONArray prefs = new JSONArray();
|
||||
for (String p : prefNames) {
|
||||
prefs.put(p);
|
||||
}
|
||||
return getPrefs(prefs, callback);
|
||||
}
|
||||
|
||||
public static int getPrefs(JSONArray prefNames, PrefHandler callback) {
|
||||
int requestId;
|
||||
synchronized (PrefsHelper.class) {
|
||||
|
Loading…
Reference in New Issue
Block a user