Backing out 09ad1564cd78. Wrong patch.

This commit is contained in:
Doug Turner 2011-11-29 16:27:23 -08:00
parent f53c92f50f
commit 452482d6cb

View File

@ -843,38 +843,25 @@ abstract public class GeckoApp
} else if (event.equals("Gecko:Ready")) {
setLaunchState(GeckoApp.LaunchState.GeckoRunning);
GeckoAppShell.sendPendingEventsToGecko();
// request the preferences. doing it here
// means we don't need to wait when we open
// the GeckoPreferences activity. But keep
// this out of the startup path!
mMainHandler.postDelayed(new Runnable() {
public void run() {
try {
// retrieve the list of preferences from our preferences.xml file
XmlResourceParser parser = getResources().getXml(R.xml.preferences);
ArrayList<String> prefs = new ArrayList<String>();
while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {
if (parser.getEventType() == XmlPullParser.START_TAG) {
String attr = parser.getAttributeValue("http://schemas.android.com/apk/res/android", "key");
if (attr != null) {
prefs.add(attr);
}
}
parser.next();
}
parser.close();
JSONArray jsonPrefs = new JSONArray(prefs);
GeckoEvent getPrefsEvent = new GeckoEvent("Preferences:Get", jsonPrefs.toString());
GeckoAppShell.sendEventToGecko(getPrefsEvent);
} catch (org.xmlpull.v1.XmlPullParserException e) {
Log.i(LOGTAG, "Could not parse preferences.xml:" + e);
} catch (java.io.IOException ioe) {
Log.i(LOGTAG, "Could not read preferences.xml:" + ioe);
}
// retrieve the list of preferences from our preferences.xml file
XmlResourceParser parser = getResources().getXml(R.xml.preferences);
ArrayList<String> prefs = new ArrayList<String>();
while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {
if (parser.getEventType() == XmlPullParser.START_TAG) {
String attr = parser.getAttributeValue("http://schemas.android.com/apk/res/android", "key");
if (attr != null) {
prefs.add(attr);
}
}, 5000);
}
parser.next();
}
parser.close();
// request the preferences. doing it here means we don't need
// to wait when we open the GeckoPreferences activity.
JSONArray jsonPrefs = new JSONArray(prefs);
GeckoEvent getPrefsEvent = new GeckoEvent("Preferences:Get", jsonPrefs.toString());
GeckoAppShell.sendEventToGecko(getPrefsEvent);
connectGeckoLayerClient();
} else if (event.equals("ToggleChrome:Hide")) {