summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-10-11 14:20:19 -0700
committerJeff Brown <jeffbrown@google.com>2010-10-11 17:54:12 -0700
commit33d54ce97d4ac84ce0e1a84e2710b45de5e1d41d (patch)
tree677b4128a9a64fbd0b71ec6ed4aa7452e1a26547 /include
parent9f90cffa30cf8c12bc7c4fa6f92d0298e039aed6 (diff)
downloadframeworks_native-33d54ce97d4ac84ce0e1a84e2710b45de5e1d41d.zip
frameworks_native-33d54ce97d4ac84ce0e1a84e2710b45de5e1d41d.tar.gz
frameworks_native-33d54ce97d4ac84ce0e1a84e2710b45de5e1d41d.tar.bz2
Fix an event injection bug when the policy is bypassed.
Added the concept of a "trusted" event to distinguish between events from attached input devices or trusted injectors vs. other applications. This change enables us to move certain policy decisions out of the dispatcher and into the policy itself where they can be handled more systematically. Cherry pick of b931a1b4 from gingerbread into master. Change-Id: I700a5f07b8b227878cea9437a289a45a245c0424
Diffstat (limited to 'include')
-rw-r--r--include/ui/Input.h4
-rw-r--r--include/ui/InputDispatcher.h5
2 files changed, 6 insertions, 3 deletions
diff --git a/include/ui/Input.h b/include/ui/Input.h
index 66061fd..8c6018b 100644
--- a/include/ui/Input.h
+++ b/include/ui/Input.h
@@ -95,6 +95,10 @@ enum {
// Indicates that the input event was injected.
POLICY_FLAG_INJECTED = 0x01000000,
+ // Indicates that the input event is from a trusted source such as a directly attached
+ // input device or an application with system-wide event injection permission.
+ POLICY_FLAG_TRUSTED = 0x02000000,
+
/* These flags are set by the input reader policy as it intercepts each event. */
// Indicates that the screen was off when the event was received and the event
diff --git a/include/ui/InputDispatcher.h b/include/ui/InputDispatcher.h
index 6743d13..2c22cad 100644
--- a/include/ui/InputDispatcher.h
+++ b/include/ui/InputDispatcher.h
@@ -924,7 +924,6 @@ private:
void drainInboundQueueLocked();
void releasePendingEventLocked();
void releaseInboundEventLocked(EventEntry* entry);
- bool isEventFromTrustedSourceLocked(EventEntry* entry);
// Dispatch state.
bool mDispatchEnabled;
@@ -971,10 +970,10 @@ private:
nsecs_t currentTime, ConfigurationChangedEntry* entry);
bool dispatchKeyLocked(
nsecs_t currentTime, KeyEntry* entry, nsecs_t keyRepeatTimeout,
- bool dropEvent, nsecs_t* nextWakeupTime);
+ DropReason* dropReason, nsecs_t* nextWakeupTime);
bool dispatchMotionLocked(
nsecs_t currentTime, MotionEntry* entry,
- bool dropEvent, nsecs_t* nextWakeupTime);
+ DropReason* dropReason, nsecs_t* nextWakeupTime);
void dispatchEventToCurrentInputTargetsLocked(
nsecs_t currentTime, EventEntry* entry, bool resumeWithAppendedMotionSample);