summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-09-02 21:17:03 -0700
committerAndreas Gampe <agampe@google.com>2014-09-04 12:57:54 -0700
commit035bd7541ed909344348b6a4e17a7ef01a434653 (patch)
tree81254329fce6375215ddb1844673aeb072b022ff /include
parent35a76df583a07524bec5ccaae8082a00e0c06867 (diff)
downloadsystem_core-035bd7541ed909344348b6a4e17a7ef01a434653.zip
system_core-035bd7541ed909344348b6a4e17a7ef01a434653.tar.gz
system_core-035bd7541ed909344348b6a4e17a7ef01a434653.tar.bz2
NativeBridge: Refactor for new initialization flow
Setup becomes Load, have explicit Initialize and Unload. Change-Id: I5a20de1cb68dd1802937b369b14c50c9c1031c67
Diffstat (limited to 'include')
-rw-r--r--include/nativebridge/native_bridge.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/include/nativebridge/native_bridge.h b/include/nativebridge/native_bridge.h
index c588bbc..16939f1 100644
--- a/include/nativebridge/native_bridge.h
+++ b/include/nativebridge/native_bridge.h
@@ -24,15 +24,25 @@ namespace android {
struct NativeBridgeRuntimeCallbacks;
-// Initialize the native bridge, if any. Should be called by Runtime::Init().
-// A null library filename signals that we do not want to load a native bridge.
-void SetupNativeBridge(const char* native_bridge_library_filename,
- const NativeBridgeRuntimeCallbacks* runtime_callbacks);
+// Open the native bridge, if any. Should be called by Runtime::Init(). A null library filename
+// signals that we do not want to load a native bridge.
+bool LoadNativeBridge(const char* native_bridge_library_filename,
+ const NativeBridgeRuntimeCallbacks* runtime_callbacks);
-// Check whether a native bridge is available (initialized). Requires a prior call to
-// SetupNativeBridge to make sense.
+// Initialize the native bridge, if any. Should be called by Runtime::DidForkFromZygote.
+bool InitializeNativeBridge();
+
+// Unload the native bridge, if any. Should be called by Runtime::DidForkFromZygote.
+void UnloadNativeBridge();
+
+// Check whether a native bridge is available (opened or initialized). Requires a prior call to
+// LoadNativeBridge.
bool NativeBridgeAvailable();
+// Check whether a native bridge is available (initialized). Requires a prior call to
+// LoadNativeBridge & InitializeNativeBridge.
+bool NativeBridgeInitialized();
+
// Load a shared library that is supported by the native bridge.
void* NativeBridgeLoadLibrary(const char* libpath, int flag);