Backout changeset d945ae198516 (bug 760152). r=kats

This commit is contained in:
Mike Hommey 2012-08-01 09:51:12 +02:00
parent 2b0f26004e
commit 19ddb6ee61
2 changed files with 8 additions and 28 deletions

View File

@ -1514,12 +1514,7 @@ abstract public class GeckoApp
}
GeckoAppShell.loadMozGlue();
if (sGeckoThread == null) {
sGeckoThread = new GeckoThread();
String uri = getURIFromIntent(getIntent());
if (uri != null && uri.length() > 0 && !uri.equals("about:home"))
sGeckoThread.start();
} else {
if (sGeckoThread != null) {
// this happens when the GeckoApp activity is destroyed by android
// without killing the entire application (see bug 769269)
mIsRestoringActivity = true;
@ -1627,17 +1622,19 @@ abstract public class GeckoApp
passedUri = "about:empty";
}
sGeckoThread.init(intent, passedUri, mRestoreMode);
if (!mIsRestoringActivity) {
sGeckoThread = new GeckoThread(intent, passedUri, mRestoreMode);
}
if (!ACTION_DEBUG.equals(action) &&
checkAndSetLaunchState(LaunchState.Launching, LaunchState.Launched)) {
sGeckoThread.reallyStart();
sGeckoThread.start();
} else if (ACTION_DEBUG.equals(action) &&
checkAndSetLaunchState(LaunchState.Launching, LaunchState.WaitForDebugger)) {
mMainHandler.postDelayed(new Runnable() {
public void run() {
Log.i(LOGTAG, "Launching from debug intent after 5s wait");
setLaunchState(LaunchState.Launching);
sGeckoThread.reallyStart();
sGeckoThread.start();
}
}, 1000 * 5 /* 5 seconds */);
Log.i(LOGTAG, "Intent : ACTION_DEBUG - waiting 5s before launching");

View File

@ -14,7 +14,6 @@ import android.os.SystemClock;
import android.util.Log;
import java.util.Locale;
import java.util.concurrent.CountDownLatch;
public class GeckoThread extends Thread {
private static final String LOGTAG = "GeckoThread";
@ -22,23 +21,12 @@ public class GeckoThread extends Thread {
Intent mIntent;
String mUri;
int mRestoreMode;
CountDownLatch mStartSignal;
GeckoThread() {
mStartSignal = new CountDownLatch(1);
setName("Gecko");
}
public void init(Intent intent, String uri, int restoreMode) {
GeckoThread(Intent intent, String uri, int restoreMode) {
mIntent = intent;
mUri = uri;
mRestoreMode = restoreMode;
}
public void reallyStart() {
mStartSignal.countDown();
if (getState() == Thread.State.NEW)
start();
setName("Gecko");
}
public void run() {
@ -65,11 +53,6 @@ public class GeckoThread extends Thread {
GeckoAppShell.loadGeckoLibs(resourcePath);
Locale.setDefault(locale);
try {
mStartSignal.await();
} catch (Exception e) { }
Resources res = app.getBaseContext().getResources();
Configuration config = res.getConfiguration();
config.locale = locale;