summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2011-03-25 15:09:55 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-03-25 15:09:55 -0700
commit3a98ffe22a0cf4d2a78baff31909aa7727fcc163 (patch)
tree61bacbd995908acb5c376ce7a360de3e2855fcad
parent1453f0926f4e0dee99963eb28c86767194ea968c (diff)
parenta2cc28d732577dd48a02de637c635e9764400248 (diff)
Merge "Fix focused application handle."
-rw-r--r--services/input/InputDispatcher.cpp8
-rw-r--r--services/jni/com_android_server_InputManager.cpp1
2 files changed, 5 insertions, 4 deletions
diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp
index eaa7fa854abc..feca58d4ff79 100644
--- a/services/input/InputDispatcher.cpp
+++ b/services/input/InputDispatcher.cpp
@@ -1239,7 +1239,7 @@ int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime,
mTempTouchState.copyFrom(mTouchState);
}
if (wrongDevice) {
-#if DEBUG_INPUT_DISPATCHER_POLICY
+#if DEBUG_FOCUS
LOGD("Dropping event because a pointer for a different device is already down.");
#endif
injectionResult = INPUT_EVENT_INJECTION_FAILED;
@@ -1380,7 +1380,7 @@ int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime,
// If the pointer is not currently down, then ignore the event.
if (! mTempTouchState.down) {
-#if DEBUG_INPUT_DISPATCHER_POLICY
+#if DEBUG_FOCUS
LOGD("Dropping event because the pointer is not down or we previously "
"dropped the pointer down event.");
#endif
@@ -1428,7 +1428,7 @@ int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime,
}
}
if (! haveForegroundWindow) {
-#if DEBUG_INPUT_DISPATCHER_POLICY
+#if DEBUG_FOCUS
LOGD("Dropping event because there is no touched foreground window to receive it.");
#endif
injectionResult = INPUT_EVENT_INJECTION_FAILED;
@@ -1445,7 +1445,7 @@ int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime,
if (touchedWindow.targetFlags & InputTarget::FLAG_FOREGROUND) {
// If the touched window is paused then keep waiting.
if (touchedWindow.window->paused) {
-#if DEBUG_INPUT_DISPATCHER_POLICY
+#if DEBUG_FOCUS
LOGD("Waiting because touched window is paused.");
#endif
injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
diff --git a/services/jni/com_android_server_InputManager.cpp b/services/jni/com_android_server_InputManager.cpp
index e7e1fa2f35a8..c0221231c176 100644
--- a/services/jni/com_android_server_InputManager.cpp
+++ b/services/jni/com_android_server_InputManager.cpp
@@ -600,6 +600,7 @@ void NativeInputManager::setFocusedApplication(JNIEnv* env, jobject applicationO
android_server_InputApplication_toNative(env, applicationObj, &application);
if (application.inputApplicationHandle != NULL) {
mInputManager->getDispatcher()->setFocusedApplication(&application);
+ return;
}
}
mInputManager->getDispatcher()->setFocusedApplication(NULL);