Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75701b0d authored by Dimitry Ivanov's avatar Dimitry Ivanov Committed by android-build-merger
Browse files

Merge "nativeloader: Add Reset capabilities"

am: 27d75e8b

* commit '27d75e8b':
  nativeloader: Add Reset capabilities

Change-Id: I32eb61966c3cdbeef3ac909fcd402447929af40e
parents 755244f9 27d75e8b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -50,6 +50,9 @@ __attribute__((visibility("default")))
android_namespace_t* FindNamespaceByClassLoader(JNIEnv* env, jobject class_loader);
#endif

__attribute__((visibility("default")))
void ResetNativeLoader();

};  // namespace android

#endif  // NATIVE_BRIDGE_H_
+10 −0
Original line number Diff line number Diff line
@@ -121,6 +121,10 @@ class LibraryNamespaces {
    public_libraries_ = base::Join(sonames, ':');
  }

  void Reset() {
    namespaces_.clear();
  }

 private:
  bool ReadConfig(const std::string& configFile, std::vector<std::string>* sonames) {
    // Read list of public native libraries from the config file.
@@ -172,6 +176,12 @@ void InitializeNativeLoader() {
#endif
}

void ResetNativeLoader() {
#if defined(__ANDROID__)
  std::lock_guard<std::mutex> guard(g_namespaces_mutex);
  g_namespaces->Reset();
#endif
}

jstring CreateClassLoaderNamespace(JNIEnv* env,
                                   int32_t target_sdk_version,