Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(853)

Unified Diff: build/android/incremental_install/java/org/chromium/incrementalinstall/BootstrapApplication.java

Issue 2790453003: Android: Make incremental install work for two <instrumentation> (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/android/incremental_install/java/org/chromium/incrementalinstall/BootstrapApplication.java
diff --git a/build/android/incremental_install/java/org/chromium/incrementalinstall/BootstrapApplication.java b/build/android/incremental_install/java/org/chromium/incrementalinstall/BootstrapApplication.java
index 1fb5e40b83b813aea7bae8ed88c3fc2d6f4049d3..6aa142434949f6c6e90db976c25de1f9f939d8d1 100644
--- a/build/android/incremental_install/java/org/chromium/incrementalinstall/BootstrapApplication.java
+++ b/build/android/incremental_install/java/org/chromium/incrementalinstall/BootstrapApplication.java
@@ -32,8 +32,10 @@ public final class BootstrapApplication extends Application {
private static final String TAG = "cr.incrementalinstall";
private static final String MANAGED_DIR_PREFIX = "/data/local/tmp/incremental-app-";
private static final String REAL_APP_META_DATA_NAME = "incremental-install-real-app";
- private static final String REAL_INSTRUMENTATION_META_DATA_NAME =
- "incremental-install-real-instrumentation";
+ private static final String REAL_INSTRUMENTATION_META_DATA_NAME0 =
+ "incremental-install-real-instrumentation-0";
+ private static final String REAL_INSTRUMENTATION_META_DATA_NAME1 =
+ "incremental-install-real-instrumentation-1";
private ClassLoaderPatcher mClassLoaderPatcher;
private Application mRealApplication;
@@ -113,9 +115,11 @@ public final class BootstrapApplication extends Application {
// mInstrumentationAppDir is one of a set of fields that is initialized only when
// instrumentation is active.
if (Reflect.getField(mActivityThread, "mInstrumentationAppDir") != null) {
- String realInstrumentationName =
- getClassNameFromMetadata(REAL_INSTRUMENTATION_META_DATA_NAME, instContext);
- initInstrumentation(realInstrumentationName);
+ String metaDataName = REAL_INSTRUMENTATION_META_DATA_NAME0;
+ if (mOrigInstrumentation instanceof SecondInstrumentation) {
+ metaDataName = REAL_INSTRUMENTATION_META_DATA_NAME1;
+ }
+ initInstrumentation(getClassNameFromMetadata(metaDataName, instContext));
} else {
Log.i(TAG, "No instrumentation active.");
}

Powered by Google App Engine
This is Rietveld 408576698