Methods Summary |
---|
public void | dispose()
dispose(false);
|
public void | dispose(boolean finalized)
if (mCloseGuard != null) {
if (finalized) {
mCloseGuard.warnIfOpen();
}
mCloseGuard.close();
}
if (mPtr != 0) {
nativeDispose(mPtr);
mPtr = 0;
}
|
protected void | finalize()
try {
dispose(true);
} finally {
super.finalize();
}
|
private void | finishInputEvent(long id, boolean handled)
int index = mActiveEventArray.indexOfKey(id);
if (index >= 0) {
ActiveInputEvent e = mActiveEventArray.valueAt(index);
mActiveEventArray.removeAt(index);
e.mCallback.onFinishedInputEvent(e.mToken, handled);
recycleActiveInputEvent(e);
}
|
public long | getNativePtr()
return mPtr;
|
private static native void | nativeDispose(long ptr)
|
private static native long | nativeInit(java.lang.ref.WeakReference weakQueue, android.os.MessageQueue messageQueue)
|
private static native long | nativeSendKeyEvent(long ptr, KeyEvent e, boolean preDispatch)
|
private static native long | nativeSendMotionEvent(long ptr, MotionEvent e)
|
private android.view.InputQueue$ActiveInputEvent | obtainActiveInputEvent(java.lang.Object token, android.view.InputQueue$FinishedInputEventCallback callback)
ActiveInputEvent e = mActiveInputEventPool.acquire();
if (e == null) {
e = new ActiveInputEvent();
}
e.mToken = token;
e.mCallback = callback;
return e;
|
private void | recycleActiveInputEvent(android.view.InputQueue$ActiveInputEvent e)
e.recycle();
mActiveInputEventPool.release(e);
|
public void | sendInputEvent(InputEvent e, java.lang.Object token, boolean predispatch, android.view.InputQueue$FinishedInputEventCallback callback)
ActiveInputEvent event = obtainActiveInputEvent(token, callback);
long id;
if (e instanceof KeyEvent) {
id = nativeSendKeyEvent(mPtr, (KeyEvent) e, predispatch);
} else {
id = nativeSendMotionEvent(mPtr, (MotionEvent) e);
}
mActiveEventArray.put(id, event);
|