diff options
author | Dimitry Ivanov <dimitry@google.com> | 2016-05-09 18:12:00 -0700 |
---|---|---|
committer | Dimitry Ivanov <dimitry@google.com> | 2016-05-09 18:12:00 -0700 |
commit | 80ddb8f5517b4632307705858c3402081583a456 (patch) | |
tree | a6473b1fd9f078db48c0dbc808a80e3a2652f417 /libnativeloader | |
parent | 179fea40bb1ed2da183f3a2a6398d1c68b9f6f32 (diff) | |
download | core-80ddb8f5517b4632307705858c3402081583a456.tar.gz core-80ddb8f5517b4632307705858c3402081583a456.tar.bz2 core-80ddb8f5517b4632307705858c3402081583a456.zip |
Check if public namespace has already been initialized
There is no point in reading/loading the list of public
libraries once public namespace is already initialized.
Change-Id: I5a53c46bb57b8de241ba521a6321c12e94a76476
Diffstat (limited to 'libnativeloader')
-rw-r--r-- | libnativeloader/native_loader.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp index 33d5b62a4..9a24714bd 100644 --- a/libnativeloader/native_loader.cpp +++ b/libnativeloader/native_loader.cpp @@ -105,6 +105,13 @@ class LibraryNamespaces { } void Initialize() { + // Once public namespace is initialized there is no + // point in running this code - it will have no effect + // on the current list of public libraries. + if (initialized_) { + return; + } + std::vector<std::string> sonames; const char* android_root_env = getenv("ANDROID_ROOT"); std::string root_dir = android_root_env != nullptr ? android_root_env : "/system"; |