Commit Graph

10 Commits

Author SHA1 Message Date
Jiyong Park bb710ee6e4 Initialize pointer member of LibaryNamespaces
Explicitly initialize the pointer member `app_main_namespace_` of the
class LibraryNamespaces.

Test: atest libnativeloader_tests
Change-Id: I3932e7fb3c4074a127fcdbdedbd9c88652a7e36c
2019-08-15 08:10:55 +09:00
Jiyong Park b37c4818da Don't create anonymous namespace
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
2019-08-12 16:56:18 +09:00
Jiyong Park 8f4afc8298 Use android::base::Result in libnativeloader
Remove the out parameters for error messages using Result<T>.

Bug: 130388701
Test: libnativeloader_test
Change-Id: Idbaf391c183fb20d5e1d7c96f3a4ccbf9745b7e6
2019-07-26 08:06:46 +09:00
Jiyong Park 78cc06a22e Revert "Revert "add unittests for libnativeloader""
This reverts commit 4ec2b28983.

Bug: 137881576
Bug: 130388701
Test: libnativeloader_test
Test: m libnativeloader_test on full-eng
Change-Id: Ib96f7235845b68cde713af278313c5aa751ff738
2019-07-19 09:03:55 +09:00
Raman Tenneti 4ec2b28983 Revert "add unittests for libnativeloader"
This reverts commit 6b6437bab5.

Reason for revert: <INSERT REASONING HERE>

Change-Id: Ice571bf7379743d516e0185fd9f1f0ffb284240a
2019-07-18 21:48:36 +00:00
Jiyong Park 6b6437bab5 add unittests for libnativeloader
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
2019-07-18 16:04:55 +09:00
Jiyong Park 16a9896ff7 Fix style around header inclusion
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
2019-05-16 08:55:11 +09:00
Jiyong Park f8802e5f0a Introduce utils.h
Introduce utils.h to have common routines.

Bug: 130388701
Test: build & pass presubmit tests
Change-Id: Ic40da64fefc1f2216bdea9ea93a15e5abb8f23a4
2019-05-08 13:49:49 +09:00
Jiyong Park 40a6077244 Move public libraries list to a separate source file
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
2019-05-08 13:49:42 +09:00
Jiyong Park 6291da2936 move classes out of native_loader.cpp
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
2019-05-04 01:10:42 +09:00