diff options
author | Andreas Gampe <agampe@google.com> | 2014-09-02 21:17:03 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-09-08 11:12:13 -0700 |
commit | 41df668c7be461f461b3d70951dee7634ded868f (patch) | |
tree | 18f63fba57fc7311a19f30027d2ea0063400d110 /include | |
parent | 97b536f1fbfd1fa711833b7dc92aed902dea4bdf (diff) | |
download | system_core-41df668c7be461f461b3d70951dee7634ded868f.tar.gz system_core-41df668c7be461f461b3d70951dee7634ded868f.tar.bz2 system_core-41df668c7be461f461b3d70951dee7634ded868f.zip |
NativeBridge: Refactor for new initialization flow
Setup becomes Load, have explicit Initialize and Unload.
(cherry picked from commit 035bd7541ed909344348b6a4e17a7ef01a434653)
Change-Id: I5a20de1cb68dd1802937b369b14c50c9c1031c67
Diffstat (limited to 'include')
-rw-r--r-- | include/nativebridge/native_bridge.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/include/nativebridge/native_bridge.h b/include/nativebridge/native_bridge.h index c588bbc0e..16939f1e1 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); |