Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3006256 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android Git Automerger
Browse files

am 119a7675: Merge change I83ba96fe into eclair

Merge commit '119a7675' into eclair-mr2

* commit '119a7675':
  Fix issue #2246723: Only one Application object gets onCreate called
parents 9d7e75eb 119a7675
Loading
Loading
Loading
Loading
+21 −6
Original line number Diff line number Diff line
@@ -485,7 +485,8 @@ public final class ActivityThread {
            return mResources;
        }

        public Application makeApplication(boolean forceDefaultAppClass) {
        public Application makeApplication(boolean forceDefaultAppClass,
                Instrumentation instrumentation) {
            if (mApplication != null) {
                return mApplication;
            }
@@ -512,7 +513,21 @@ public final class ActivityThread {
                }
            }
            mActivityThread.mAllApplications.add(app);
            return mApplication = app;
            mApplication = app;
            
            if (instrumentation != null) {
                try {
                    instrumentation.callApplicationOnCreate(app);
                } catch (Exception e) {
                    if (!instrumentation.onException(app, e)) {
                        throw new RuntimeException(
                            "Unable to create application " + app.getClass().getName()
                            + ": " + e.toString(), e);
                    }
                }
            }
            
            return app;
        }

        public void removeContextRegistrations(Context context,
@@ -2378,7 +2393,7 @@ public final class ActivityThread {
        }

        try {
            Application app = r.packageInfo.makeApplication(false);
            Application app = r.packageInfo.makeApplication(false, mInstrumentation);

            if (localLOGV) Log.v(TAG, "Performing launch of " + r);
            if (localLOGV) Log.v(
@@ -2576,7 +2591,7 @@ public final class ActivityThread {
        }

        try {
            Application app = packageInfo.makeApplication(false);
            Application app = packageInfo.makeApplication(false, mInstrumentation);

            if (localLOGV) Log.v(
                TAG, "Performing receive of " + data.intent
@@ -2730,7 +2745,7 @@ public final class ActivityThread {
            ApplicationContext context = new ApplicationContext();
            context.init(packageInfo, null, this);

            Application app = packageInfo.makeApplication(false);
            Application app = packageInfo.makeApplication(false, mInstrumentation);
            context.setOuterContext(service);
            service.attach(context, this, data.info.name, data.token, app,
                    ActivityManagerNative.getDefault());
@@ -3940,7 +3955,7 @@ public final class ActivityThread {

        // If the app is being launched for full backup or restore, bring it up in
        // a restricted environment with the base application class.
        Application app = data.info.makeApplication(data.restrictedBackupMode);
        Application app = data.info.makeApplication(data.restrictedBackupMode, null);
        mInitialApplication = app;

        List<ProviderInfo> providers = data.providers;