This source file includes following definitions.
- JNINamespace
- create
- start
- nativeInitializeThread
package org.chromium.base;
import android.os.Handler;
import android.os.HandlerThread;
@JNINamespace("base::android")
class JavaHandlerThread {
final HandlerThread mThread;
private JavaHandlerThread(String name) {
mThread = new HandlerThread(name);
}
@CalledByNative
private static JavaHandlerThread create(String name) {
return new JavaHandlerThread(name);
}
@CalledByNative
private void start(final long nativeThread, final long nativeEvent) {
mThread.start();
new Handler(mThread.getLooper()).post(new Runnable() {
@Override
public void run() {
nativeInitializeThread(nativeThread, nativeEvent);
}
});
}
private native void nativeInitializeThread(long nativeJavaHandlerThread, long nativeEvent);
}