summaryrefslogtreecommitdiff
path: root/libnativebridge/include/nativebridge/native_bridge.h
diff options
context:
space:
mode:
author dimitry <dimitry@google.com> 2024-03-27 11:55:07 +0100
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-04-05 13:26:56 +0000
commit5fe81fd246fe073c5d903a4cb50182fb7132a939 (patch)
tree9aafbad282304a2edfe6886166d82d2f79586214 /libnativebridge/include/nativebridge/native_bridge.h
parent4e6db6efb36ab9cb9a5990346e77d7976e1b3c66 (diff)
Add getTrampolineForFunctionPointer method to native bridge
Add a function to native bridge that generates trampolines for guest pointers and call it for native-bridged namespaces. Bug: http://b/330367443 Test: art/libnativebridge/tests/runtests.sh --skip-target Test: ./android-cts/tools/cts-tradefed run cts -m CtsJniTestCases Change-Id: I02cab5ea6c87cb4d5065033a4b6793eb57fe0f52
Diffstat (limited to 'libnativebridge/include/nativebridge/native_bridge.h')
-rw-r--r--libnativebridge/include/nativebridge/native_bridge.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/libnativebridge/include/nativebridge/native_bridge.h b/libnativebridge/include/nativebridge/native_bridge.h
index a87b04fa36..b2e4d2219b 100644
--- a/libnativebridge/include/nativebridge/native_bridge.h
+++ b/libnativebridge/include/nativebridge/native_bridge.h
@@ -95,6 +95,11 @@ void* NativeBridgeGetTrampoline2(void* handle,
uint32_t len,
enum JNICallType jni_call_type);
+void* NativeBridgeGetTrampolineForFunctionPointer(const void* method,
+ const char* shorty,
+ uint32_t len,
+ enum JNICallType jni_call_type);
+
// True if native library paths are valid and is for an ABI that is supported by native bridge.
// The *libpath* must point to a library.
//
@@ -421,6 +426,20 @@ struct NativeBridgeCallbacks {
const char* shorty,
uint32_t len,
enum JNICallType jni_call_type);
+
+ // Get a native bridge trampoline for specified native method implementation pointer.
+ //
+ // Parameters:
+ // method [IN] pointer to method implementation (ususally registered via call to
+ // RegisterNatives).
+ // shorty [IN] short descriptor of native method len [IN] length of shorty
+ // jni_call_type [IN] the type of JNI call
+ // Returns:
+ // address of trampoline if successful, otherwise NULL
+ void* (*getTrampolineForFunctionPointer)(const void* method,
+ const char* shorty,
+ uint32_t len,
+ enum JNICallType jni_call_type);
};
// Runtime interfaces to native bridge.