Backout changeset d945ae198516 (bug 760152). r=kats

This commit is contained in:
Mike Hommey 2012-08-01 09:51:12 +02:00
Родитель 5ba1b43b1b
Коммит aa10c6de4f
2 изменённых файлов: 8 добавлений и 28 удалений

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

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

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

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