diff options
author | Jeff Brown <jeffbrown@google.com> | 2010-11-05 15:02:16 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2010-11-08 12:49:43 -0800 |
commit | 3915bb845b032dc184dba5e60970b803390ca3ed (patch) | |
tree | 198a47c1d4ada990ef04d563b5e0caaec35abc18 /policy | |
parent | 60029771d26ca3c51288c3d92cab1d3537147acd (diff) | |
download | frameworks_base-3915bb845b032dc184dba5e60970b803390ca3ed.zip frameworks_base-3915bb845b032dc184dba5e60970b803390ca3ed.tar.gz frameworks_base-3915bb845b032dc184dba5e60970b803390ca3ed.tar.bz2 |
Tell system server whether the app handled input events.
Refactored ViewRoot, NativeActivity and related classes to tell the
dispatcher whether an input event was actually handled by the application.
This will be used to move more of the global default key processing
into the system server instead of the application.
Change-Id: If06b98b6f45c543e5ac5b1eae2b3baf9371fba28
Diffstat (limited to 'policy')
-rwxr-xr-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 30aab47..4bc7433 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -253,13 +253,19 @@ public class PhoneWindowManager implements WindowManagerPolicy { private final InputHandler mPointerLocationInputHandler = new BaseInputHandler() { @Override - public void handleMotion(MotionEvent event, Runnable finishedCallback) { - finishedCallback.run(); - - synchronized (mLock) { - if (mPointerLocationView != null) { - mPointerLocationView.addTouchEvent(event); + public void handleMotion(MotionEvent event, InputQueue.FinishedCallback finishedCallback) { + boolean handled = false; + try { + if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) { + synchronized (mLock) { + if (mPointerLocationView != null) { + mPointerLocationView.addTouchEvent(event); + handled = true; + } + } } + } finally { + finishedCallback.finished(handled); } } }; @@ -1329,6 +1335,19 @@ public class PhoneWindowManager implements WindowManagerPolicy { return false; } + /** {@inheritDoc} */ + @Override + public boolean dispatchUnhandledKey(WindowState win, int action, int flags, + int keyCode, int scanCode, int metaState, int repeatCount, int policyFlags) { + if (false) { + Slog.d(TAG, "Unhandled key: win=" + win + ", action=" + action + + ", flags=" + flags + ", keyCode=" + keyCode + + ", scanCode=" + scanCode + ", metaState=" + metaState + + ", repeatCount=" + repeatCount + ", policyFlags=" + policyFlags); + } + return false; + } + /** * A home key -> launch home action was detected. Take the appropriate action * given the situation with the keyguard. |