diff options
| author | Makoto Onuki <omakoto@google.com> | 2022-03-09 16:05:37 -0800 |
|---|---|---|
| committer | Makoto Onuki <omakoto@google.com> | 2022-03-09 16:14:40 -0800 |
| commit | 169aeafb2d97b810ae123ad036d0c58336961c55 (patch) | |
| tree | 87c83a9a8035097a726f68a9d37a2ca3d6915ed1 /core/java/android/app/ActivityThread.java | |
| parent | 836db75e0f49b39a648eaa3d21e22c4c4333b0a3 (diff) | |
Fix compat issue with apps directly calling LoadedApk.makeApplication().
Unfortuantely, it seems apps may be calling makeApplication() directly,
in which case returning the cached instance would break their expectation.
So let's not return the cached instance for external callers.
Test: Launch the kr.go.kdca.coov-19 app
Fix: 222737976
Change-Id: Idd7d2873d71edad182a7877117745fe021e18a80
Diffstat (limited to 'core/java/android/app/ActivityThread.java')
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 64f0301fab22..b1a4e4148eec 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -3587,7 +3587,7 @@ public final class ActivityThread extends ClientTransactionHandler } try { - Application app = r.packageInfo.makeApplication(false, mInstrumentation); + Application app = r.packageInfo.makeApplicationInner(false, mInstrumentation); if (localLOGV) Slog.v(TAG, "Performing launch of " + r); if (localLOGV) Slog.v( @@ -4286,7 +4286,7 @@ public final class ActivityThread extends ClientTransactionHandler BroadcastReceiver receiver; ContextImpl context; try { - app = packageInfo.makeApplication(false, mInstrumentation); + app = packageInfo.makeApplicationInner(false, mInstrumentation); context = (ContextImpl) app.getBaseContext(); if (data.info.splitName != null) { context = (ContextImpl) context.createContextForSplit(data.info.splitName); @@ -4475,7 +4475,7 @@ public final class ActivityThread extends ClientTransactionHandler try { if (localLOGV) Slog.v(TAG, "Creating service " + data.info.name); - Application app = packageInfo.makeApplication(false, mInstrumentation); + Application app = packageInfo.makeApplicationInner(false, mInstrumentation); final java.lang.ClassLoader cl; if (data.info.splitName != null) { @@ -6695,7 +6695,7 @@ public final class ActivityThread extends ClientTransactionHandler try { // If the app is being launched for full backup or restore, bring it up in // a restricted environment with the base application class. - app = data.info.makeApplication(data.restrictedBackupMode, null); + app = data.info.makeApplicationInner(data.restrictedBackupMode, null); // Propagate autofill compat state app.setAutofillOptions(data.autofillOptions); @@ -7565,7 +7565,7 @@ public final class ActivityThread extends ClientTransactionHandler mInstrumentation.basicInit(this); ContextImpl context = ContextImpl.createAppContext( this, getSystemContext().mPackageInfo); - mInitialApplication = context.mPackageInfo.makeApplication(true, null); + mInitialApplication = context.mPackageInfo.makeApplicationInner(true, null); mInitialApplication.onCreate(); } catch (Exception e) { throw new RuntimeException( |
