diff options
author | 2024-01-30 21:33:09 +0000 | |
---|---|---|
committer | 2024-02-15 18:22:04 +0000 | |
commit | 8a9b51e34f3769a5e3ea3a4383e3f00489088738 (patch) | |
tree | 37b3705e0387d216b50bc2d1e027b1f8ccf5f914 /libnativeloader/native_loader_namespace.cpp | |
parent | 149b912110c31a2e1e69930e48fed8bbfbe04700 (diff) |
Refactorings to make more logic available at the top level in
native_loader.cpp.
- Make the code that determines the partition from the dex path
available to code in native_loader.cpp, and rename it since it'll be
applied to arbitrary paths, not just APK's.
- Move the linker namespace constants to a header file.
- Various other minor code cleanups.
To prepare for a later CL that needs to access these things from
OpenNativeLibrary. No functional changes.
Test: atest libnativeloader_e2e_tests libnativeloader_test
Bug: 237577392
Change-Id: Ifc762bf6d4664b2d477c4ed3af58f149fb4c1189
Diffstat (limited to 'libnativeloader/native_loader_namespace.cpp')
-rw-r--r-- | libnativeloader/native_loader_namespace.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libnativeloader/native_loader_namespace.cpp b/libnativeloader/native_loader_namespace.cpp index 669fa74dc2..cfb84b7d9e 100644 --- a/libnativeloader/native_loader_namespace.cpp +++ b/libnativeloader/native_loader_namespace.cpp @@ -52,12 +52,12 @@ std::string GetLinkerError(bool is_bridged) { Result<NativeLoaderNamespace> NativeLoaderNamespace::GetExportedNamespace(const std::string& name, bool is_bridged) { if (!is_bridged) { - auto raw = android_get_exported_namespace(name.c_str()); + android_namespace_t* raw = android_get_exported_namespace(name.c_str()); if (raw != nullptr) { return NativeLoaderNamespace(name, raw); } } else { - auto raw = NativeBridgeGetExportedNamespace(name.c_str()); + native_bridge_namespace_t* raw = NativeBridgeGetExportedNamespace(name.c_str()); if (raw != nullptr) { return NativeLoaderNamespace(name, raw); } @@ -69,7 +69,7 @@ Result<NativeLoaderNamespace> NativeLoaderNamespace::GetExportedNamespace(const // "system" for those in the Runtime APEX. Try "system" first since // "default" always exists. Result<NativeLoaderNamespace> NativeLoaderNamespace::GetSystemNamespace(bool is_bridged) { - auto ns = GetExportedNamespace(kSystemNamespaceName, is_bridged); + Result<NativeLoaderNamespace> ns = GetExportedNamespace(kSystemNamespaceName, is_bridged); if (ns.ok()) return ns; ns = GetExportedNamespace(kDefaultNamespaceName, is_bridged); if (ns.ok()) return ns; @@ -96,7 +96,7 @@ Result<NativeLoaderNamespace> NativeLoaderNamespace::Create( } // Fall back to the system namespace if no parent is set. - auto system_ns = GetSystemNamespace(is_bridged); + Result<NativeLoaderNamespace> system_ns = GetSystemNamespace(is_bridged); if (!system_ns.ok()) { return system_ns.error(); } |