Commit 388c0d43 authored by Ryan Pavlik's avatar Ryan Pavlik
Browse files

IPC WIP

parent ab18632f
Pipeline #733042 failed with stages
in 2 minutes and 54 seconds
......@@ -12,6 +12,8 @@
#include "org.freedesktop.monado.ipc.hpp"
#include "xrt/xrt_config_android.h"
#include "android/android_load_class.hpp"
#include "android/android_custom_surface.h"
#include "util/u_logging.h"
#include "android/android_load_class.hpp"
......@@ -27,13 +29,15 @@ struct ipc_client_android
ipc_client_android(jobject act) : activity(act) {}
~ipc_client_android();
struct android_custom_surface *custom_surface;
Activity activity{};
Client client{nullptr};
};
ipc_client_android::~ipc_client_android()
{
android_custom_surface_destroy(&custom_surface);
// Tell Java that native code is done with this.
try {
if (!client.isNull()) {
......@@ -64,6 +68,7 @@ ipc_client_android_create(struct _JavaVM *vm, void *activity)
ret->client = Client::construct(ret.get());
ret->custom_surface = android_custom_surface_async_start(vm, activity);
return ret.release();
} catch (std::exception const &e) {
......
......@@ -142,6 +142,11 @@ public class Client implements ServiceConnection {
public int blockingConnect(Context context_, String packageName) {
Log.i(TAG, "blockingConnect");
Activity activity = (Activity) context_;
MonadoView monadoView = MonadoView.attachToActivity(activity);
surfaceHolder = monadoView.waitGetSurfaceHolder(2000);
synchronized (binderSync) {
if (!bind(context_, packageName)) {
Log.e(TAG, "Bind failed immediately");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment