| 6 | #define BASE_ANDROID_BUNDLE_UTILS_H_ |
| 7 |
| 8 | #include <string> |
| 9 |
| 10 | #include "base/base_export.h" |
| 11 |
| 12 | namespace base { |
| 13 | namespace android { |
| 14 |
| 15 | // Utils to help working with android app bundles. |
| 16 | class BASE_EXPORT BundleUtils { |
| 17 | public: |
| 18 | // Returns true if the current build is a bundle. |
| 19 | static bool IsBundle(); |
| 20 |
| 21 | // Helper function asking Java to resolve a library path. This is required for |
| 22 | // resolving a module library made available via SplitCompat, rather than in |
| 23 | // its eventual fully-installed state. |
| 24 | static std::string ResolveLibraryPath(const std::string& library_name); |
| 25 |
| 26 | // dlopen wrapper that works for partitioned native libraries in dynamic |
| 27 | // feature modules. This routine looks up the partition's address space in a |
| 28 | // table of main library symbols, and uses it when loading the feature |
| 29 | // library. It requires |library_name| (eg. chrome_foo) to resolve the file |
| 30 | // path (which may be in an interesting location due to SplitCompat) and |
| 31 | // |partition_name| to look up the load parameters in the main library. These |
| 32 | // two values may be identical, but since the partition name is set at compile |
| 33 | // time, and the code is linked into multiple libraries (eg. Chrome vs |
| 34 | // Monochrome), they may not be. |
| 35 | static void* DlOpenModuleLibraryPartition(const std::string& library_name, |
| 36 | const std::string& partition); |
| 37 | }; |
| 38 |
| 39 | } // namespace android |
| 40 | } // namespace base |
| 41 |
| 42 | #endif // BASE_ANDROID_BUNDLE_UTILS_H_ |
| 43 |