From e4a346ad0b2976d25223695ec890a9d0510ce9a0 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Thu, 12 Nov 2020 11:29:46 -0600 Subject: [PATCH] ipc/android: Clean ups and debug messages --- .../src/main/java/org/freedesktop/monado/ipc/Client.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/xrt/ipc/android/src/main/java/org/freedesktop/monado/ipc/Client.java b/src/xrt/ipc/android/src/main/java/org/freedesktop/monado/ipc/Client.java index 503725250..349862871 100644 --- a/src/xrt/ipc/android/src/main/java/org/freedesktop/monado/ipc/Client.java +++ b/src/xrt/ipc/android/src/main/java/org/freedesktop/monado/ipc/Client.java @@ -108,8 +108,10 @@ public class Client implements ServiceConnection { */ @Keep public int blockingConnect(Context context_, String packageName) { + Log.i(TAG, "blockingConnect"); synchronized (connectSync) { if (!bind(context_, packageName)) { + Log.e(TAG, "Bind failed immediately"); // Bind failed immediately return -1; } @@ -118,6 +120,7 @@ public class Client implements ServiceConnection { connectSync.wait(); } } catch (InterruptedException e) { + Log.e(TAG, "Interrupted: " + e.toString()); return -1; } } @@ -139,13 +142,15 @@ public class Client implements ServiceConnection { * restrictions. */ public boolean bind(Context context_, String packageName) { + Log.i(TAG, "bind"); context = context_.getApplicationContext(); if (context == null) { // in case app context returned null context = context_; } try { - runtimePackageContext = context.createPackageContext(packageName, Context.CONTEXT_IGNORE_SECURITY | Context.CONTEXT_INCLUDE_CODE); + runtimePackageContext = context.createPackageContext(packageName, + Context.CONTEXT_IGNORE_SECURITY | Context.CONTEXT_INCLUDE_CODE); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); Log.e(TAG, "bind: Could not find package " + packageName); @@ -183,6 +188,7 @@ public class Client implements ServiceConnection { */ @Override public void onServiceConnected(ComponentName name, IBinder service) { + Log.i(TAG, "onServiceConnected"); monado = IMonado.Stub.asInterface(service); ParcelFileDescriptor theirs; ParcelFileDescriptor ours;