Bug 760152 - Start library decompression earlier. r=blassey

This commit is contained in:
Mike Hommey 2012-06-04 16:58:54 +02:00
parent 8afc14fa3f
commit 4f84d3cc37
2 changed files with 26 additions and 5 deletions

View File

@ -1773,6 +1773,11 @@ abstract public class GeckoApp
}
GeckoAppShell.loadMozGlue();
sGeckoThread = new GeckoThread();
String uri = getURIFromIntent(getIntent());
if (uri != null && uri.length() > 0 && !uri.equals("about:home"))
sGeckoThread.start();
mMainHandler = new Handler();
Log.w(LOGTAG, "zerdatime " + SystemClock.uptimeMillis() + " - onCreate");
@ -1871,17 +1876,17 @@ abstract public class GeckoApp
passedUri = "about:empty";
}
sGeckoThread = new GeckoThread(intent, passedUri, mRestoreMode);
sGeckoThread.init(intent, passedUri, mRestoreMode);
if (!ACTION_DEBUG.equals(action) &&
checkAndSetLaunchState(LaunchState.Launching, LaunchState.Launched)) {
sGeckoThread.start();
sGeckoThread.reallyStart();
} 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.start();
sGeckoThread.reallyStart();
}
}, 1000 * 5 /* 5 seconds */);
Log.i(LOGTAG, "Intent : ACTION_DEBUG - waiting 5s before launching");

View File

@ -18,6 +18,7 @@ import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Date;
import java.util.Locale;
import java.util.concurrent.CountDownLatch;
public class GeckoThread extends Thread {
private static final String LOGTAG = "GeckoThread";
@ -25,13 +26,23 @@ public class GeckoThread extends Thread {
Intent mIntent;
String mUri;
int mRestoreMode;
CountDownLatch mStartSignal;
GeckoThread(Intent intent, String uri, int restoreMode) {
GeckoThread() {
mStartSignal = new CountDownLatch(1);
setName("Gecko");
}
public void init(Intent intent, String uri, int restoreMode) {
mIntent = intent;
mUri = uri;
mRestoreMode = restoreMode;
}
setName("Gecko");
public void reallyStart() {
mStartSignal.countDown();
if (getState() == Thread.State.NEW)
start();
}
public void run() {
@ -48,6 +59,11 @@ 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;