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

Commit cf9892b6 authored by Dimitry Ivanov's avatar Dimitry Ivanov
Browse files

nativeloader: Fix the case of search_path == null

When user creates custom classloader which does not extend
BaseDexClassLoader the librarySearchPath gets set to null
by java.lang.Runtime.doLoad().

This patch makes nativeloader correctly handle it.

Bug: http://b/28659864
Change-Id: I1b61c6bc952984d7c49775a9178fc3270948e62a
(cherry picked from commit 8a0425b8)
parent 08660a81
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -56,7 +56,12 @@ class LibraryNamespaces {
                              jstring java_library_path,
                              jstring java_permitted_path,
                              int32_t target_sdk_version) {
    ScopedUtfChars library_path(env, java_library_path);
    std::string library_path; // empty string by default.

    if (java_library_path != nullptr) {
      ScopedUtfChars library_path_utf_chars(env, java_library_path);
      library_path = library_path_utf_chars.c_str();
    }

    std::string permitted_path;
    if (java_permitted_path != nullptr) {