ndk icon indicating copy to clipboard operation
ndk copied to clipboard

Import Java/JNI `Looper` into NDK `ForeignLooper`?

Open jhutchins opened this issue 3 years ago • 1 comments

Is there a way to take a JObject that represents an android.os.Looper that was obtained via JNI and turn that into a ForeignLooper? I feel like this should be possible, but I don't know if it actually is and I've failed in my attempts so far.

jhutchins avatar Sep 02 '22 22:09 jhutchins

I vaguely remember there being an API for this (or recently added) but that doesn't seem to be the case: https://developer.android.com/ndk/reference/group/looper.

MarijnS95 avatar Sep 06 '22 15:09 MarijnS95

@rib are you aware of any such API, besides communicating a Looper via TLS? Or are these entirely different concepts? The Java and C++ implementation seem to have different functionality and don't call into each other:

https://cs.android.com/android/platform/superproject/+/refs/heads/master:system/core/libutils/Looper.cpp https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/os/Looper.java

In which case I don't think there's anything that can be done here.

MarijnS95 avatar Jun 22 '23 09:06 MarijnS95