mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 18:46:18 +00:00
ipc/android: Force client entering resume state before IPC setup
This commit is contained in:
parent
c635375dc7
commit
6b8349c887
|
@ -19,8 +19,6 @@
|
|||
|
||||
#include "wrap/android.app.h"
|
||||
|
||||
#include <android/api-level.h>
|
||||
|
||||
using wrap::android::app::Activity;
|
||||
using wrap::org::freedesktop::monado::ipc::Client;
|
||||
using xrt::auxiliary::android::getAppInfo;
|
||||
|
@ -87,10 +85,9 @@ ipc_client_android_create(struct _JavaVM *vm, void *activity)
|
|||
int
|
||||
ipc_client_android_blocking_connect(struct ipc_client_android *ica)
|
||||
{
|
||||
// Before android Q, onServiceConnected always returns on main thread, which might cause deadlock.
|
||||
if (android_get_device_api_level() < __ANDROID_API_Q__) {
|
||||
android_looper_poll_until_activity_resumed();
|
||||
}
|
||||
// To avoid deadlock on main thread, force client entering resume state
|
||||
// before setting up IPC/surface
|
||||
android_looper_poll_until_activity_resumed();
|
||||
|
||||
try {
|
||||
int fd = ica->client.blockingConnect(ica->activity, XRT_ANDROID_PACKAGE);
|
||||
|
|
Loading…
Reference in a new issue