summaryrefslogtreecommitdiff
path: root/runtime/native/dalvik_system_BaseDexClassLoader.h
diff options
context:
space:
mode:
author Dan Zimmerman <danzimm@fb.com> 2019-12-23 06:59:06 -0800
committer Calin Juravle <calin@google.com> 2020-02-08 00:01:36 +0000
commitb682ea4d1f9f88ef41589007f385398033d61b65 (patch)
treeb843077f05e2fe37ce5f566dfc823552f289f562 /runtime/native/dalvik_system_BaseDexClassLoader.h
parent77aa6807053a830fe5c951c7cb700813d7e2e27b (diff)
Introduce BaseDexClassLoader.computeClassLoaderContextsNative
This will be used to compute the contexts that should be sent over to the dex load reporter. See associated changes in libcore & frameworks/base. Motivation: At the moment of committing there are two classloader context encoders- one in ART and one in the package manager. The duplicate logic is susceptible to divergences. For example at the moment if a package uses shared libraries and has secondary dex files then the context encoded for secondary dex files will be incorrect[1]. In order to eliminate this bug and future possible bugs lets centralize where all classloader context computation is done. [1]: The context will be incorrect because it doesn't take into account the shared libraries that are loaded at runtime. Test: m test-art-host-gtest-class_loader_context_test Test: m test-art-host-gtest Test: ./test/testrunner/testrunner.py --host -b Test: Introduced a set of tests for the new API(s) Test: See tests in associated libcore & framework/base commits Bug: 148494302 Change-Id: Id39293a2e1d3d05194f2864f4febb3e652bce075
Diffstat (limited to 'runtime/native/dalvik_system_BaseDexClassLoader.h')
-rw-r--r--runtime/native/dalvik_system_BaseDexClassLoader.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/runtime/native/dalvik_system_BaseDexClassLoader.h b/runtime/native/dalvik_system_BaseDexClassLoader.h
new file mode 100644
index 0000000000..4ec03ef7a6
--- /dev/null
+++ b/runtime/native/dalvik_system_BaseDexClassLoader.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_RUNTIME_NATIVE_DALVIK_SYSTEM_BASEDEXCLASSLOADER_H_
+#define ART_RUNTIME_NATIVE_DALVIK_SYSTEM_BASEDEXCLASSLOADER_H_
+
+#include <jni.h>
+#include <unistd.h>
+
+namespace art {
+
+void register_dalvik_system_BaseDexClassLoader(JNIEnv* env);
+
+} // namespace art
+
+#endif // ART_RUNTIME_NATIVE_DALVIK_SYSTEM_BASEDEXCLASSLOADER_H_