diff options
Diffstat (limited to 'libnativebridge/native_bridge.cc')
-rw-r--r-- | libnativebridge/native_bridge.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libnativebridge/native_bridge.cc b/libnativebridge/native_bridge.cc index 4461f79919..af85d4ee35 100644 --- a/libnativebridge/native_bridge.cc +++ b/libnativebridge/native_bridge.cc @@ -133,6 +133,8 @@ enum NativeBridgeImplementationVersion { PRE_ZYGOTE_FORK_VERSION = 6, // The version with critical_native support CRITICAL_NATIVE_SUPPORT_VERSION = 7, + // The version with native bridge detection fallback for function pointers + IDENTIFY_NATIVELY_BRIDGED_FUNCTION_POINTERS_VERSION = 8, }; // Whether we had an error at some point. @@ -732,6 +734,18 @@ void* NativeBridgeLoadLibraryExt(const char* libpath, int flag, native_bridge_na return nullptr; } +bool NativeBridgeIsNativeBridgeFunctionPointer(const void* method) { + if (NativeBridgeInitialized()) { + if (isCompatibleWith(IDENTIFY_NATIVELY_BRIDGED_FUNCTION_POINTERS_VERSION)) { + return callbacks->isNativeBridgeFunctionPointer(method); + } else { + ALOGW("not compatible with version %d, unable to call isNativeBridgeFunctionPointer", + IDENTIFY_NATIVELY_BRIDGED_FUNCTION_POINTERS_VERSION); + } + } + return false; +} + } // extern "C" } // namespace android |