Methods Summary |
---|
private void | dispatchInputEventFinished(int seq, boolean handled)
onInputEventFinished(seq, handled);
|
public void | dispose()Disposes the receiver.
dispose(false);
|
private void | dispose(boolean finalized)
if (mCloseGuard != null) {
if (finalized) {
mCloseGuard.warnIfOpen();
}
mCloseGuard.close();
}
if (mSenderPtr != 0) {
nativeDispose(mSenderPtr);
mSenderPtr = 0;
}
mInputChannel = null;
mMessageQueue = null;
|
protected void | finalize()
try {
dispose(true);
} finally {
super.finalize();
}
|
private static native void | nativeDispose(long senderPtr)
|
private static native long | nativeInit(java.lang.ref.WeakReference sender, InputChannel inputChannel, android.os.MessageQueue messageQueue)
|
private static native boolean | nativeSendKeyEvent(long senderPtr, int seq, KeyEvent event)
|
private static native boolean | nativeSendMotionEvent(long senderPtr, int seq, MotionEvent event)
|
public void | onInputEventFinished(int seq, boolean handled)Called when an input event is finished.
|
public final boolean | sendInputEvent(int seq, InputEvent event)Sends an input event.
Must be called on the same Looper thread to which the sender is attached.
if (event == null) {
throw new IllegalArgumentException("event must not be null");
}
if (mSenderPtr == 0) {
Log.w(TAG, "Attempted to send an input event but the input event "
+ "sender has already been disposed.");
return false;
}
if (event instanceof KeyEvent) {
return nativeSendKeyEvent(mSenderPtr, seq, (KeyEvent)event);
} else {
return nativeSendMotionEvent(mSenderPtr, seq, (MotionEvent)event);
}
|