diff options
| author | Tarandeep Singh <tarandeep@google.com> | 2017-07-10 18:50:00 -0700 |
|---|---|---|
| committer | Tarandeep Singh <tarandeep@google.com> | 2017-08-02 10:46:22 -0700 |
| commit | e1cfcf4c4d15417bc912d36d487b4454c19b30fa (patch) | |
| tree | d8b9fff7c0059a07fb864f53f7f16e99ef9bccde /core/java/android/inputmethodservice/IInputMethodSessionWrapper.java | |
| parent | 06802167e5b8c82c07ea69479aadf57f45e8fc15 (diff) | |
Fix keyboard focus in VR
Consider this VirtualDisplay (VD) scenario:
HostActivity creates a VD which holds SettingsActivity. When EditText
on SettingsActivity is tapped, it gains focus.
On eventual taps, it loses focus i.e. the Window in VD loses focus and
the host activity in primary display gets the focus instead. This
happens because WM's TaskTapPointerEventListener.onPointerEvent()
is called on the default display only.
Root cause:
1. Tap detector isn't registered for non-default display.
2. Tap detector has no info on which displayId touch was received.
3. InputFlinger doesn't deliver InputMonitor events for
non-default displays (fixed in a separate CL)
Fixing above results in onPointerEvent(MotionEvent) to deliver the
Touch events successfully to VD. We restrict these changes to physical
multi-displays and VR VirtualDisplays (which uses virtual touch device).
[VrManagerService calls WMInternal.setVr2dDisplayId(int)]
In future, displayId should be part of InputEvent. Bug: 64258305
Bug: 62033391
Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Change-Id: I3626f4de5aa9bcf905da9abd39f3ab1baefc4c48
Diffstat (limited to 'core/java/android/inputmethodservice/IInputMethodSessionWrapper.java')
| -rw-r--r-- | core/java/android/inputmethodservice/IInputMethodSessionWrapper.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/java/android/inputmethodservice/IInputMethodSessionWrapper.java b/core/java/android/inputmethodservice/IInputMethodSessionWrapper.java index ed223d1fd503..d2e3510ee3b1 100644 --- a/core/java/android/inputmethodservice/IInputMethodSessionWrapper.java +++ b/core/java/android/inputmethodservice/IInputMethodSessionWrapper.java @@ -16,10 +16,6 @@ package android.inputmethodservice; -import com.android.internal.os.HandlerCaller; -import com.android.internal.os.SomeArgs; -import com.android.internal.view.IInputMethodSession; - import android.content.Context; import android.graphics.Rect; import android.os.Bundle; @@ -34,9 +30,13 @@ import android.view.InputEventReceiver; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.inputmethod.CompletionInfo; +import android.view.inputmethod.CursorAnchorInfo; import android.view.inputmethod.ExtractedText; import android.view.inputmethod.InputMethodSession; -import android.view.inputmethod.CursorAnchorInfo; + +import com.android.internal.os.HandlerCaller; +import com.android.internal.os.SomeArgs; +import com.android.internal.view.IInputMethodSession; class IInputMethodSessionWrapper extends IInputMethodSession.Stub implements HandlerCaller.Callback { @@ -218,7 +218,7 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub } @Override - public void onInputEvent(InputEvent event) { + public void onInputEvent(InputEvent event, int displayId) { if (mInputMethodSession == null) { // The session has been finished. finishInputEvent(event, false); |
