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

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

Issue 1729973002: Reland of Add increment install native libraries first in lookup paths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed Created 4 years, 10 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
« no previous file with comments | « no previous file | build/android/incremental_install/java/org/chromium/incrementalinstall/Reflect.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java
diff --git a/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java b/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java
index c382799003489ba328a4b60fd7290c5218b53554..8bf37799a3aeea72d1950c8cd63d1cbfa3bb3753 100644
--- a/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java
+++ b/build/android/incremental_install/java/org/chromium/incrementalinstall/ClassLoaderPatcher.java
@@ -94,8 +94,8 @@ final class ClassLoaderPatcher {
Object dexPathList = Reflect.getField(mClassLoader, "pathList");
Object[] dexElements = (Object[]) Reflect.getField(dexPathList, "dexElements");
Object[] additionalElements = makeDexElements(dexFilesArr, optimizedDir);
- Reflect.setField(
- dexPathList, "dexElements", Reflect.concatArrays(dexElements, additionalElements));
+ Reflect.setField(dexPathList, "dexElements",
+ Reflect.concatArrays(dexElements, dexElements, additionalElements));
}
/**
@@ -150,11 +150,11 @@ final class ClassLoaderPatcher {
// Switched from an array to an ArrayList in Lollipop.
if (currentDirs instanceof List) {
List<File> dirsAsList = (List<File>) currentDirs;
- dirsAsList.add(nativeLibDir);
+ dirsAsList.add(0, nativeLibDir);
} else {
File[] dirsAsArray = (File[]) currentDirs;
Reflect.setField(dexPathList, "nativeLibraryDirectories",
- Reflect.concatArrays(dirsAsArray, newDirs));
+ Reflect.concatArrays(newDirs, newDirs, dirsAsArray));
}
Object[] nativeLibraryPathElements;
@@ -166,9 +166,9 @@ final class ClassLoaderPatcher {
return;
}
Object[] additionalElements = makeNativePathElements(newDirs);
- Reflect.setField(
- dexPathList, "nativeLibraryPathElements",
- Reflect.concatArrays(nativeLibraryPathElements, additionalElements));
+ Reflect.setField(dexPathList, "nativeLibraryPathElements",
+ Reflect.concatArrays(nativeLibraryPathElements, additionalElements,
+ nativeLibraryPathElements));
}
private static void copyChangedFiles(File srcDir, File dstDir) throws IOException {
« no previous file with comments | « no previous file | build/android/incremental_install/java/org/chromium/incrementalinstall/Reflect.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698