Commit 8ea0345a authored by Eric Stevenson's avatar Eric Stevenson Committed by Commit Bot

Android: Fix incremental install failure on KitKat.

Reference to BootstrapApplication in ActivityThread needed to be
updated to the RealApplication.

Bug: 765773
Change-Id: I2d26dd691a09bc18b4b409a0d9a3d928609a0671
Reviewed-on: https://chromium-review.googlesource.com/677281Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Eric Stevenson <estevenson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503535}
parent f70f605d
......@@ -80,7 +80,7 @@ public final class BootstrapApplication extends Application {
File instLibDir = new File(instIncrementalRootDir, "lib");
File instDexDir = new File(instIncrementalRootDir, "dex");
File instInstallLockFile = new File(instIncrementalRootDir, "install.lock");
File instFirstRunLockFile = new File(instIncrementalRootDir , "firstrun.lock");
File instFirstRunLockFile = new File(instIncrementalRootDir, "firstrun.lock");
boolean isFirstRun = LockFile.installerLockExists(appFirstRunLockFile)
|| (instPackageNameDiffers
......@@ -271,7 +271,12 @@ public final class BootstrapApplication extends Application {
}
}
for (String fieldName : new String[] { "mPackages", "mResourcePackages" }) {
// Contains a reference to BootstrapApplication and will cause BroadCastReceivers to fail
// if not replaced.
Object contextWrapperBase = Reflect.getField(mRealApplication, "mBase");
Reflect.setField(contextWrapperBase, "mOuterContext", mRealApplication);
for (String fieldName : new String[] {"mPackages", "mResourcePackages"}) {
Map<String, WeakReference<?>> packageMap =
(Map<String, WeakReference<?>>) Reflect.getField(mActivityThread, fieldName);
for (Map.Entry<String, WeakReference<?>> entry : packageMap.entrySet()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment