diff options
| author | Calin Juravle <calin@google.com> | 2017-11-01 22:27:29 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2017-11-01 22:27:29 +0000 |
| commit | a47c4440fd4daa1c67c19191e89c9c6762e00ccc (patch) | |
| tree | 578fee64a75e84ac804e5ffc2accaaf48ef9a87a /core/java | |
| parent | 71ae6b3aabcf0588069c79bedf4bf9d5dd2a7890 (diff) | |
| parent | fe177b78d78470f1dd3801f50486f7b2b3876b7f (diff) | |
Merge changes Ie8b78c7c,If02081d2
am: fe177b78d7
Change-Id: I2720d1e1433367e9f584451408951dce0b61e0da
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/DexLoadReporter.java | 11 | ||||
| -rw-r--r-- | core/java/android/content/pm/IPackageManager.aidl | 14 |
2 files changed, 19 insertions, 6 deletions
diff --git a/core/java/android/app/DexLoadReporter.java b/core/java/android/app/DexLoadReporter.java index fc697a30e6ae..d15dd6d71f94 100644 --- a/core/java/android/app/DexLoadReporter.java +++ b/core/java/android/app/DexLoadReporter.java @@ -31,7 +31,7 @@ import libcore.io.Libcore; import java.io.File; import java.io.IOException; -import java.util.Arrays; +import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -116,13 +116,18 @@ import java.util.Set; registerSecondaryDexForProfiling(dexPathsForRegistration); } - private void notifyPackageManager(List<BaseDexClassLoader> ignored, + private void notifyPackageManager(List<BaseDexClassLoader> classLoadersChain, List<String> classPaths) { + // Get the class loader names for the binder call. + List<String> classLoadersNames = new ArrayList<>(classPaths.size()); + for (BaseDexClassLoader bdc : classLoadersChain) { + classLoadersNames.add(bdc.getClass().getName()); + } String packageName = ActivityThread.currentPackageName(); try { // Notify only the paths of the first class loader for now. ActivityThread.getPackageManager().notifyDexLoad( - packageName, Arrays.asList(classPaths.get(0).split(File.pathSeparator)), + packageName, classLoadersNames, classPaths, VMRuntime.getRuntime().vmInstructionSet()); } catch (RemoteException re) { Slog.e(TAG, "Failed to notify PM about dex load for package " + packageName, re); diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl index 64d687e9d3de..c9afd6b7e930 100644 --- a/core/java/android/content/pm/IPackageManager.aidl +++ b/core/java/android/content/pm/IPackageManager.aidl @@ -469,11 +469,19 @@ interface IPackageManager { * Notify the package manager that a list of dex files have been loaded. * * @param loadingPackageName the name of the package who performs the load - * @param dexPats the list of the dex files paths that have been loaded + * @param classLoadersNames the names of the class loaders present in the loading chain. The + * list encodes the class loader chain in the natural order. The first class loader has + * the second one as its parent and so on. The dex files present in the class path of the + * first class loader will be recorded in the usage file. + * @param classPaths the class paths corresponding to the class loaders names from + * {@param classLoadersNames}. The the first element corresponds to the first class loader + * and so on. A classpath is represented as a list of dex files separated by + * {@code File.pathSeparator}. + * The dex files found in the first class path will be recorded in the usage file. * @param loaderIsa the ISA of the loader process */ - oneway void notifyDexLoad(String loadingPackageName, in List<String> dexPaths, - String loaderIsa); + oneway void notifyDexLoad(String loadingPackageName, in List<String> classLoadersNames, + in List<String> classPaths, String loaderIsa); /** * Register an application dex module with the package manager. |
