Monado OpenXR Runtime
|
Provides the client-side code to initiate connection to Monado IPC service. More...
Public Member Functions | |
Client (long nativePointer) | |
Constructor. More... | |
void | markAsDiscardedByNative () |
Let the native code notify us that it is no longer using this class. More... | |
int | blockingConnect (Context context_, String packageName) |
Bind to the Monado IPC service, and block until it is fully connected. More... | |
boolean | bind (Context context_, String packageName) |
Bind to the Monado IPC service - this asynchronously starts connecting (and launching the service if it's not already running) More... | |
void | onServiceConnected (ComponentName name, IBinder service) |
Handle the asynchronous connection of the binder IPC. More... | |
void | onServiceDisconnected (ComponentName name) |
Handle asynchronous disconnect. More... | |
Data Fields | |
IMonado | monado = null |
Pointer to local IPC proxy: calling methods on it automatically transports arguments across binder IPC. More... | |
boolean | failed = false |
Indicates that we tried to connect but failed. More... | |
Provides the client-side code to initiate connection to Monado IPC service.
This class will get loaded into the OpenXR client application by our native code.
|
inline |
Constructor.
nativePointer | the corresponding native object's pointer. |
References org.freedesktop.monado.auxiliary.NativeCounterpart.markAsUsedByNativeCode().
|
inline |
Bind to the Monado IPC service - this asynchronously starts connecting (and launching the service if it's not already running)
context_ | Context to use to make the connection. (We get the application context from it.) |
packageName | The package name containing the Monado runtime. The caller is guaranteed to know this because it had to load this class from that package. There's a define in xrt_config_android.h to use for this. |
Various builds, variants, etc. will have different package names, but we must specify the package name explicitly to avoid violating security restrictions.
Referenced by org.freedesktop.monado.ipc.Client.blockingConnect().
|
inline |
Bind to the Monado IPC service, and block until it is fully connected.
The IPC client code on Android should load this class (from the right package), instantiate this class (retaining a reference to it!), and call this method.
This method must not be called from the main (UI) thread.
context_ | Context to use to make the connection. (We get the application context from it.) |
packageName | The package name containing the Monado runtime. The caller is guaranteed to know this because it had to load this class from that package. There's a define in xrt_config_android.h to use for this. |
Various builds, variants, etc. will have different package names, but we must specify the package name explicitly to avoid violating security restrictions.
References org.freedesktop.monado.ipc.Client.bind(), and org.freedesktop.monado.ipc.Client.monado.
|
inline |
Let the native code notify us that it is no longer using this class.
References org.freedesktop.monado.auxiliary.NativeCounterpart.markAsDiscardedByNative().
|
inline |
Handle the asynchronous connection of the binder IPC.
name | should match the preceding intent, but not used. |
service | the associated service, which we cast in this function. |
References org.freedesktop.monado.ipc.Client.monado.
|
inline |
Handle asynchronous disconnect.
name | should match the preceding intent, but not used. |
boolean org.freedesktop.monado.ipc.Client.failed = false |
Indicates that we tried to connect but failed.
Used to distinguish a "not yet fully connected" null monado member from a "tried and failed" null monado member.
IMonado org.freedesktop.monado.ipc.Client.monado = null |
Pointer to local IPC proxy: calling methods on it automatically transports arguments across binder IPC.
May be null!
Referenced by org.freedesktop.monado.ipc.Client.blockingConnect(), and org.freedesktop.monado.ipc.Client.onServiceConnected().