зеркало из https://github.com/mozilla/pjs.git
bug 710751 - Updater is broken, backout aebdec71790e r=mfinle a=java-only
This commit is contained in:
Родитель
0adc044ca9
Коммит
8fff220ee1
|
@ -913,7 +913,6 @@ abstract public class GeckoApp
|
|||
setLaunchState(GeckoApp.LaunchState.GeckoRunning);
|
||||
GeckoAppShell.sendPendingEventsToGecko();
|
||||
connectGeckoLayerClient();
|
||||
Looper.myQueue().addIdleHandler(new UpdateIdleHandler());
|
||||
} else if (event.equals("ToggleChrome:Hide")) {
|
||||
mMainHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
|
@ -1431,7 +1430,32 @@ abstract public class GeckoApp
|
|||
mSmsReceiver = new GeckoSmsManager();
|
||||
registerReceiver(mSmsReceiver, smsFilter);
|
||||
|
||||
final GeckoApp self = this;
|
||||
final GeckoApp self = this;
|
||||
|
||||
mMainHandler.postDelayed(new Runnable() {
|
||||
public void run() {
|
||||
|
||||
Log.w(LOGTAG, "zerdatime " + new Date().getTime() + " - pre checkLaunchState");
|
||||
|
||||
/*
|
||||
XXXX see bug 635342
|
||||
We want to disable this code if possible. It is about 145ms in runtime
|
||||
SharedPreferences settings = getPreferences(Activity.MODE_PRIVATE);
|
||||
String localeCode = settings.getString(getPackageName() + ".locale", "");
|
||||
if (localeCode != null && localeCode.length() > 0)
|
||||
GeckoAppShell.setSelectedLocale(localeCode);
|
||||
*/
|
||||
|
||||
if (!checkLaunchState(LaunchState.Launched)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// it would be good only to do this if MOZ_UPDATER was defined
|
||||
long startTime = new Date().getTime();
|
||||
checkAndLaunchUpdate();
|
||||
Log.w(LOGTAG, "checking for an update took " + (new Date().getTime() - startTime) + "ms");
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1696,21 +1720,6 @@ abstract public class GeckoApp
|
|||
GeckoAppShell.handleNotification(action, alertName, alertCookie);
|
||||
}
|
||||
|
||||
// it would be good only to do this if MOZ_UPDATER was defined
|
||||
private class UpdateIdleHandler implements MessageQueue.IdleHandler {
|
||||
public boolean queueIdle() {
|
||||
mMainHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
long startTime = new Date().getTime();
|
||||
checkAndLaunchUpdate();
|
||||
Log.w(LOGTAG, "checking for an update took " + (new Date().getTime() - startTime) + "ms");
|
||||
}
|
||||
});
|
||||
// only need to run this once.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAndLaunchUpdate() {
|
||||
Log.i(LOGTAG, "Checking for an update");
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче