diff options
| author | Jeff Brown <jeffbrown@google.com> | 2010-08-18 17:42:47 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2010-08-18 17:42:47 -0700 |
| commit | d25f0aea1cebe93aff55a75374e172f87115f1b3 (patch) | |
| tree | 90c403a7ce880dcd32ba9e7216e2d309e1906556 /include/ui/InputDispatcher.h | |
| parent | d172594e3a1e25f1f2c190e99421cb7d4963389b (diff) | |
| parent | 99401b29c3f39488a058d3eb616009b751879a77 (diff) | |
| download | frameworks_base-d25f0aea1cebe93aff55a75374e172f87115f1b3.zip frameworks_base-d25f0aea1cebe93aff55a75374e172f87115f1b3.tar.gz frameworks_base-d25f0aea1cebe93aff55a75374e172f87115f1b3.tar.bz2 | |
am 99401b29: Merge "Add support for throttling motion events." into gingerbread
Merge commit '99401b29c3f39488a058d3eb616009b751879a77' into gingerbread-plus-aosp
* commit '99401b29c3f39488a058d3eb616009b751879a77':
Add support for throttling motion events.
Diffstat (limited to 'include/ui/InputDispatcher.h')
| -rw-r--r-- | include/ui/InputDispatcher.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/ui/InputDispatcher.h b/include/ui/InputDispatcher.h index 2505cb0..aed4fa1 100644 --- a/include/ui/InputDispatcher.h +++ b/include/ui/InputDispatcher.h @@ -159,6 +159,12 @@ public: virtual int32_t waitForMotionEventTargets(MotionEvent* motionEvent, uint32_t policyFlags, int32_t injectorPid, int32_t injectorUid, Vector<InputTarget>& outTargets) = 0; + + /* Gets the maximum suggested event delivery rate per second. + * This value is used to throttle motion event movement actions on a per-device + * basis. It is not intended to be a hard limit. + */ + virtual int32_t getMaxEventsPerSecond() = 0; }; @@ -332,6 +338,8 @@ private: // Linked list of motion samples associated with this motion event. MotionSample firstSample; MotionSample* lastSample; + + uint32_t countSamples() const; }; // Tracks the progress of dispatching a particular event to a particular connection. @@ -587,6 +595,17 @@ private: Condition mInjectionSyncFinishedCondition; void decrementPendingSyncDispatchesLocked(EventEntry* entry); + // Throttling state. + struct ThrottleState { + nsecs_t minTimeBetweenEvents; + + nsecs_t lastEventTime; + int32_t lastDeviceId; + uint32_t lastSource; + + uint32_t originalSampleCount; // only collected during debugging + } mThrottleState; + // Key repeat tracking. // XXX Move this up to the input reader instead. struct KeyRepeatState { |
