From f900dd934876ab46d53f9068edafb149a3254afc Mon Sep 17 00:00:00 2001 From: Doug Turner Date: Tue, 29 Nov 2011 16:27:23 -0800 Subject: [PATCH] Backing out 09ad1564cd78. Wrong patch. --- mobile/android/base/GeckoApp.java | 49 ++++++++++++------------------- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 9d3be399b56b..c24804d3f65f 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -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 prefs = new ArrayList(); - 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 prefs = new ArrayList(); + 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")) {