Merge "nativeloader: Add Reset capabilities" into nyc-dev
This commit is contained in:
commit
3174bda7ac
2 changed files with 13 additions and 0 deletions
|
@ -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_
|
||||
|
|
|
@ -131,6 +131,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.
|
||||
|
@ -185,6 +189,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,
|
||||
|
|
Loading…
Reference in a new issue