diff options
| author | keunyoung <keunyoung@google.com> | 2013-08-02 14:23:10 -0700 |
|---|---|---|
| committer | keunyoung <keunyoung@google.com> | 2013-08-08 19:45:21 -0700 |
| commit | 30f420fd6a74ffa28b351b4aba74d44f5ea48dda (patch) | |
| tree | a45e1874145db8c77267e21221e6593c7b5e07e2 /core/java/android/view/Window.java | |
| parent | 37ee68fc091f64e17c0ef29b123b782b6daecf16 (diff) | |
add local focus mode and input event injection API to Window
- This enables keyboard navigation for window without focus.
- FLAG_LOCAL_FOCUS_MODE puts window into local focus mode.
- Application needs to put window in local focus mode, control focus, and
inject events to make dpad navigation work.
- Window in local focus mode does not interact with window manager or ime
regarding focus related events.
- Also renamed ViewRootImpl.dispatchKey to dispatchInputEvent to allow both key and touch events injection.
Change-Id: I8e8561f29e0dade3797fb7ae3ee7690e6b7f8895
Diffstat (limited to 'core/java/android/view/Window.java')
| -rw-r--r-- | core/java/android/view/Window.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java index 39d48a7d8de3..7a2424371724 100644 --- a/core/java/android/view/Window.java +++ b/core/java/android/view/Window.java @@ -1290,4 +1290,18 @@ public abstract class Window { * @hide */ public void setDefaultLogo(int resId) { } + + /** + * Set focus locally. The window should have the + * {@link WindowManager.LayoutParams#FLAG_LOCAL_FOCUS_MODE} flag set already. + * @param hasFocus Whether this window has focus or not. + * @param inTouchMode Whether this window is in touch mode or not. + */ + public void setLocalFocus(boolean hasFocus, boolean inTouchMode) { } + + /** + * Inject an event to window locally. + * @param event A key or touch event to inject to this window. + */ + public void injectInputEvent(InputEvent event) { } } |
