mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 794642 - Avoid unnecessary GeckoApplication initialization in services r=kats
--HG-- extra : rebase_source : b406d8ee24c74b0185e9c31b15a4e6e20629d5f5
This commit is contained in:
parent
c863356300
commit
31cd926957
@ -1438,6 +1438,7 @@ abstract public class GeckoApp
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
((GeckoApplication)getApplication()).initialize();
|
||||
GeckoAppShell.registerGlobalExceptionHandler();
|
||||
|
||||
mAppContext = this;
|
||||
|
@ -10,22 +10,24 @@ import java.util.ArrayList;
|
||||
|
||||
public class GeckoApplication extends Application {
|
||||
|
||||
private boolean mInited;
|
||||
private boolean mInBackground;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
protected void initialize() {
|
||||
if (mInited)
|
||||
return;
|
||||
|
||||
// workaround for http://code.google.com/p/android/issues/detail?id=20915
|
||||
try {
|
||||
Class.forName("android.os.AsyncTask");
|
||||
} catch (ClassNotFoundException e) {}
|
||||
|
||||
super.onCreate();
|
||||
|
||||
GeckoConnectivityReceiver.getInstance().init(getApplicationContext());
|
||||
GeckoBatteryManager.getInstance().init(getApplicationContext());
|
||||
GeckoBatteryManager.getInstance().start();
|
||||
GeckoNetworkManager.getInstance().init(getApplicationContext());
|
||||
MemoryMonitor.getInstance().init(getApplicationContext());
|
||||
mInited = true;
|
||||
}
|
||||
|
||||
protected void onActivityPause(GeckoActivity activity) {
|
||||
|
@ -119,7 +119,7 @@ public class UpdateService extends IntentService {
|
||||
protected void onHandleIntent (Intent intent) {
|
||||
if (UpdateServiceHelper.ACTION_REGISTER_FOR_UPDATES.equals(intent.getAction())) {
|
||||
registerForUpdates(false);
|
||||
} if (UpdateServiceHelper.ACTION_CHECK_FOR_UPDATE.equals(intent.getAction())) {
|
||||
} else if (UpdateServiceHelper.ACTION_CHECK_FOR_UPDATE.equals(intent.getAction())) {
|
||||
startUpdate(intent.getIntExtra(UpdateServiceHelper.EXTRA_UPDATE_FLAGS_NAME, 0));
|
||||
} else if (UpdateServiceHelper.ACTION_APPLY_UPDATE.equals(intent.getAction())) {
|
||||
applyUpdate(intent.getStringExtra(UpdateServiceHelper.EXTRA_PACKAGE_PATH_NAME));
|
||||
|
Loading…
Reference in New Issue
Block a user