diff options
| author | Jae Seo <jaeseo@google.com> | 2014-04-17 21:35:29 -0700 |
|---|---|---|
| committer | Jae Seo <jaeseo@google.com> | 2014-04-29 14:18:55 +0900 |
| commit | 6a6059a29edf31e65541b3d8927a46f5846fb0a2 (patch) | |
| tree | da667bb3062a0945c36f63d6c62e16598852399b /core/java/android/view/ViewRootImpl.java | |
| parent | 6d50c3ff8815e6fedd1f80ba7afb8f1d22ea45b7 (diff) | |
| download | frameworks_base-6a6059a29edf31e65541b3d8927a46f5846fb0a2.zip frameworks_base-6a6059a29edf31e65541b3d8927a46f5846fb0a2.tar.gz frameworks_base-6a6059a29edf31e65541b3d8927a46f5846fb0a2.tar.bz2 | |
Dispatch input events to the TV input
TvInputManagerService now creates an InputChannel pair and passes one
end to the app and the other end to the service. Then the TvInputManager
in the app creates an InputEventSender around one end of the channel to
send events and the service creates an InputEventReceiver around the
other end of the channel to receive events.
Most of the newly added code here was borrowed heavily from the IME.
Change-Id: I0bd83847cba0033ccb6f4b6dad267ebeaf5e9c7c
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 246905d..020086f 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -3204,8 +3204,11 @@ public final class ViewRootImpl implements ViewParent, doDie(); break; case MSG_DISPATCH_INPUT_EVENT: { - InputEvent event = (InputEvent)msg.obj; - enqueueInputEvent(event, null, 0, true); + SomeArgs args = (SomeArgs)msg.obj; + InputEvent event = (InputEvent)args.arg1; + InputEventReceiver receiver = (InputEventReceiver)args.arg2; + enqueueInputEvent(event, receiver, 0, true); + args.recycle(); } break; case MSG_DISPATCH_KEY_FROM_IME: { if (LOCAL_LOGV) Log.v( @@ -5787,7 +5790,14 @@ public final class ViewRootImpl implements ViewParent, } public void dispatchInputEvent(InputEvent event) { - Message msg = mHandler.obtainMessage(MSG_DISPATCH_INPUT_EVENT, event); + dispatchInputEvent(event, null); + } + + public void dispatchInputEvent(InputEvent event, InputEventReceiver receiver) { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = event; + args.arg2 = receiver; + Message msg = mHandler.obtainMessage(MSG_DISPATCH_INPUT_EVENT, args); msg.setAsynchronous(true); mHandler.sendMessage(msg); } |
