Explicitly initialize the pointer member `app_main_namespace_` of the
class LibraryNamespaces.
Test: atest libnativeloader_tests
Change-Id: I3932e7fb3c4074a127fcdbdedbd9c88652a7e36c
Don't create anonymous namespace separately, use the first namespace
that is created for app classloader as the anonymous namespace.
Note that the anonymous namespace is set via the new
ANDROID_NAMESPACE_TYPE_ALSO_USED_AS_ANONYMOUS. I didn't creat a new
function like android_set_anonymous_namespace as it requires uprev of
the libnativebridge interface and makes it harder to delete the old
android_init_anonymous_namespace as we have to keep it until all
proprietary bridged loaders are updated.
Bug: 130388701
Test: CtsBionicTestCases
Test: run games on http://www.monogame.net/showcase/?Android
Change-Id: I0fdd614365eaa56c4ab47538bf3772d94bd9ae55
Remove the out parameters for error messages using Result<T>.
Bug: 130388701
Test: libnativeloader_test
Change-Id: Idbaf391c183fb20d5e1d7c96f3a4ccbf9745b7e6
libnativeloader hasn't had a unit test. Now we have it. The unittest
mocks calls to libdl, libbridgedloader, and JNI using gmock.
Not all tests are added yet. To ease the review, a few tests for core
scenarios are added.
Bug: 130388701
Test: libnativeloader_test
Change-Id: I518512047da66b44bc99cec26e2c34ba4985cca3
This change is to be in sync with other libraries in system/core.
External headers are included via #include <...> rather
than #include "...", which is for headers from the current library.
Bug: 130388701
Test: build & pass presubmit tests
Change-Id: Ifb87ebaea1b0ff95e2e79352e6a42e3bfd949c52
Functions for reading the public libraries list are moved out of
library_namespace.cpp to public_libraries.cpp.
In addition, library-local symbols are moved from android namespace to
android::nativeloader namespace.
Bug: 130388701
Test: build & pass presubmit tests
Change-Id: If82419598304d56d29bfec4ef553443c788d0f53
native_loader.cpp is too crowded. Move the classes
NativeLoaderNamespaces and LibraryNamespaces out of native_loader.cpp to
their own source files.
This change does not alter any functionality.
Bug: 130388701
Test: m, presubmit tests
Change-Id: Ibc61ec0dc6727af7cac865b1971ebf1befac6855