summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-10-13 17:02:48 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-13 17:02:48 -0700
commitcd4af421ca6b102cabd2cf1ff63488e086c32c44 (patch)
tree65c60516db0a95bb1eb6ae4d0b751c36cbc676e4 /libs/ui
parentbad553ba34dbf9b6764c9c6b72f0082f011b577c (diff)
parent4b255a23041225103a6870e77a236f78c2816eda (diff)
downloadframeworks_base-cd4af421ca6b102cabd2cf1ff63488e086c32c44.zip
frameworks_base-cd4af421ca6b102cabd2cf1ff63488e086c32c44.tar.gz
frameworks_base-cd4af421ca6b102cabd2cf1ff63488e086c32c44.tar.bz2
am 4b255a23: am 03aa28fb: Merge "Improve the input policy handling a bit." into gingerbread
Merge commit '4b255a23041225103a6870e77a236f78c2816eda' * commit '4b255a23041225103a6870e77a236f78c2816eda': Improve the input policy handling a bit.
Diffstat (limited to 'libs/ui')
-rw-r--r--libs/ui/InputDispatcher.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp
index 3b9ef6d..84c3db8 100644
--- a/libs/ui/InputDispatcher.cpp
+++ b/libs/ui/InputDispatcher.cpp
@@ -432,10 +432,9 @@ void InputDispatcher::dropInboundEventLocked(EventEntry* entry, DropReason dropR
switch (dropReason) {
case DROP_REASON_POLICY:
#if DEBUG_INBOUND_EVENT_DETAILS
- LOGD("Dropped event because policy requested that it not be delivered to the application.");
+ LOGD("Dropped event because policy consumed it.");
#endif
- reason = "inbound event was dropped because the policy requested that it not be "
- "delivered to the application";
+ reason = "inbound event was dropped because the policy consumed it";
break;
case DROP_REASON_DISABLED:
LOGI("Dropped event because input dispatch is disabled.");
@@ -625,15 +624,13 @@ bool InputDispatcher::dispatchKeyLocked(
if (*dropReason == DROP_REASON_NOT_DROPPED) {
*dropReason = DROP_REASON_POLICY;
}
- resetTargetsLocked();
- setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_SUCCEEDED);
- return true;
}
// Clean up if dropping the event.
if (*dropReason != DROP_REASON_NOT_DROPPED) {
resetTargetsLocked();
- setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED);
+ setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY
+ ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED);
return true;
}
@@ -713,7 +710,8 @@ bool InputDispatcher::dispatchMotionLocked(
// Clean up if dropping the event.
if (*dropReason != DROP_REASON_NOT_DROPPED) {
resetTargetsLocked();
- setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED);
+ setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY
+ ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED);
return true;
}