Loading include/nativebridge/native_bridge.h +12 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,9 @@ bool NativeBridgeLinkNamespaces(native_bridge_namespace_t* from, native_bridge_n // Use NativeBridgeLoadLibrary() instead in non-namespace scenario. void* NativeBridgeLoadLibraryExt(const char* libpath, int flag, native_bridge_namespace_t* ns); // Returns vendor namespace if it is enabled for the device and null otherwise native_bridge_namespace_t* NativeBridgeGetVendorNamespace(); // Native bridge interfaces to runtime. struct NativeBridgeCallbacks { // Version number of the interface. Loading Loading @@ -348,6 +351,15 @@ struct NativeBridgeCallbacks { // Starting with v3, NativeBridge has two scenarios: with/without namespace. // Use loadLibrary instead in non-namespace scenario. void* (*loadLibraryExt)(const char* libpath, int flag, native_bridge_namespace_t* ns); // Get native bridge version of vendor namespace. // The vendor namespace is the namespace used to load vendor public libraries. // With O release this namespace can be different from the default namespace. // For the devices without enable vendor namespaces this function should return null // // Returns: // vendor namespace or null if it was not set up for the device native_bridge_namespace_t* (*getVendorNamespace)(); }; // Runtime interfaces to native bridge. Loading libnativebridge/.clang-format 0 → 120000 +1 −0 Original line number Diff line number Diff line ../.clang-format-2 No newline at end of file libnativebridge/native_bridge.cc +16 −6 Original line number Diff line number Diff line Loading @@ -91,6 +91,8 @@ enum NativeBridgeImplementationVersion { SIGNAL_VERSION = 2, // The version which namespace semantic is introduced. NAMESPACE_VERSION = 3, // The version with vendor namespaces VENDOR_NAMESPACE_VERSION = 4, }; // Whether we had an error at some point. Loading Loading @@ -621,6 +623,14 @@ bool NativeBridgeLinkNamespaces(native_bridge_namespace_t* from, native_bridge_n return false; } native_bridge_namespace_t* NativeBridgeGetVendorNamespace() { if (!NativeBridgeInitialized() || !isCompatibleWith(VENDOR_NAMESPACE_VERSION)) { return nullptr; } return callbacks->getVendorNamespace(); } void* NativeBridgeLoadLibraryExt(const char* libpath, int flag, native_bridge_namespace_t* ns) { if (NativeBridgeInitialized()) { if (isCompatibleWith(NAMESPACE_VERSION)) { Loading libnativeloader/.clang-format 0 → 120000 +1 −0 Original line number Diff line number Diff line ../.clang-format-2 No newline at end of file libnativeloader/include/nativeloader/dlext_namespaces.h +2 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,8 @@ extern bool android_link_namespaces(android_namespace_t* from, */ extern void android_get_LD_LIBRARY_PATH(char* buffer, size_t buffer_size); extern android_namespace_t* android_get_exported_namespace(const char* name); __END_DECLS #endif /* __ANDROID_DLEXT_NAMESPACES_H__ */ Loading
include/nativebridge/native_bridge.h +12 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,9 @@ bool NativeBridgeLinkNamespaces(native_bridge_namespace_t* from, native_bridge_n // Use NativeBridgeLoadLibrary() instead in non-namespace scenario. void* NativeBridgeLoadLibraryExt(const char* libpath, int flag, native_bridge_namespace_t* ns); // Returns vendor namespace if it is enabled for the device and null otherwise native_bridge_namespace_t* NativeBridgeGetVendorNamespace(); // Native bridge interfaces to runtime. struct NativeBridgeCallbacks { // Version number of the interface. Loading Loading @@ -348,6 +351,15 @@ struct NativeBridgeCallbacks { // Starting with v3, NativeBridge has two scenarios: with/without namespace. // Use loadLibrary instead in non-namespace scenario. void* (*loadLibraryExt)(const char* libpath, int flag, native_bridge_namespace_t* ns); // Get native bridge version of vendor namespace. // The vendor namespace is the namespace used to load vendor public libraries. // With O release this namespace can be different from the default namespace. // For the devices without enable vendor namespaces this function should return null // // Returns: // vendor namespace or null if it was not set up for the device native_bridge_namespace_t* (*getVendorNamespace)(); }; // Runtime interfaces to native bridge. Loading
libnativebridge/.clang-format 0 → 120000 +1 −0 Original line number Diff line number Diff line ../.clang-format-2 No newline at end of file
libnativebridge/native_bridge.cc +16 −6 Original line number Diff line number Diff line Loading @@ -91,6 +91,8 @@ enum NativeBridgeImplementationVersion { SIGNAL_VERSION = 2, // The version which namespace semantic is introduced. NAMESPACE_VERSION = 3, // The version with vendor namespaces VENDOR_NAMESPACE_VERSION = 4, }; // Whether we had an error at some point. Loading Loading @@ -621,6 +623,14 @@ bool NativeBridgeLinkNamespaces(native_bridge_namespace_t* from, native_bridge_n return false; } native_bridge_namespace_t* NativeBridgeGetVendorNamespace() { if (!NativeBridgeInitialized() || !isCompatibleWith(VENDOR_NAMESPACE_VERSION)) { return nullptr; } return callbacks->getVendorNamespace(); } void* NativeBridgeLoadLibraryExt(const char* libpath, int flag, native_bridge_namespace_t* ns) { if (NativeBridgeInitialized()) { if (isCompatibleWith(NAMESPACE_VERSION)) { Loading
libnativeloader/.clang-format 0 → 120000 +1 −0 Original line number Diff line number Diff line ../.clang-format-2 No newline at end of file
libnativeloader/include/nativeloader/dlext_namespaces.h +2 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,8 @@ extern bool android_link_namespaces(android_namespace_t* from, */ extern void android_get_LD_LIBRARY_PATH(char* buffer, size_t buffer_size); extern android_namespace_t* android_get_exported_namespace(const char* name); __END_DECLS #endif /* __ANDROID_DLEXT_NAMESPACES_H__ */