diff options
author | 2024-02-13 16:38:49 +0000 | |
---|---|---|
committer | 2024-02-20 17:43:35 +0000 | |
commit | 8701bf5f321ccad60ee948833fc3208ae6ea51df (patch) | |
tree | 8b0137a386b01bf003b9dccaad2c218542928dc5 /libnativeloader/library_namespaces.h | |
parent | 9414a6383eb60ad0c2b0332e7e066a84413b07f9 (diff) |
Separate handling of a single path and a list of paths when determining
API domains.
Becomes necessary in a later CL where it gets used on more or less
arbitrary paths where we shouldn't treat colons specially.
The old code crashed with a fatal if a list of paths had both vendor
and product directories in it. This changes that to a more appropriate
error that gets propagated to the java level and becomes an exception
where the classloader is created.
Test: atest libnativeloader_test
Bug: 237577392
Change-Id: I783af87a03de18c65fadcd1fd5a71423ec0c786b
Diffstat (limited to 'libnativeloader/library_namespaces.h')
-rw-r--r-- | libnativeloader/library_namespaces.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libnativeloader/library_namespaces.h b/libnativeloader/library_namespaces.h index 741d4116b8..ae1cd88f20 100644 --- a/libnativeloader/library_namespaces.h +++ b/libnativeloader/library_namespaces.h @@ -24,6 +24,7 @@ #include <list> #include <optional> #include <string> +#include <string_view> #include "android-base/result.h" #include "jni.h" @@ -54,7 +55,8 @@ using ApiDomain = enum { API_DOMAIN_PRODUCT = 2, // Product partition }; -nativeloader::ApiDomain GetApiDomainFromPath(const std::string& path); +ApiDomain GetApiDomainFromPath(const std::string_view path); +Result<ApiDomain> GetApiDomainFromPathList(const std::string& path_list); // LibraryNamespaces is a singleton object that manages NativeLoaderNamespace // objects for an app process. Its main job is to create (and configure) a new |