summaryrefslogtreecommitdiffstats
path: root/include/ui
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-02-13 13:18:09 -0800
committerJeff Brown <jeffbrown@google.com>2012-02-13 13:59:32 -0800
commita18829ab231384858456a8a67b06a3f1e37d2794 (patch)
treef200e6c9f63d54186a2ecb6ea93f42b819cb41b4 /include/ui
parent0a63adaff2ffa945f5e105ee39aec9dcf22954e7 (diff)
downloadframeworks_native-a18829ab231384858456a8a67b06a3f1e37d2794.zip
frameworks_native-a18829ab231384858456a8a67b06a3f1e37d2794.tar.gz
frameworks_native-a18829ab231384858456a8a67b06a3f1e37d2794.tar.bz2
Accurately track the sequence numbers of batched events.
Instead of sending finished signals immediately when appending to a batch, record the chain of sequence numbers that were part of the batch and then send finished signals all at once when done. This change helps the dispatcher keep track of the true state of the application and can improve ANR detection slightly. This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I463c2221e2aa8fdf1c3d670c18e39e59ab69b0db
Diffstat (limited to 'include/ui')
-rw-r--r--include/ui/InputTransport.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/ui/InputTransport.h b/include/ui/InputTransport.h
index 46b56ff..1f738cd 100644
--- a/include/ui/InputTransport.h
+++ b/include/ui/InputTransport.h
@@ -306,12 +306,23 @@ private:
// Batched motion events per device and source.
struct Batch {
- uint32_t seq;
+ uint32_t seq; // sequence number of last input message batched in the event
MotionEvent event;
};
Vector<Batch> mBatches;
+ // Chain of batched sequence numbers. When multiple input messages are combined into
+ // a batch, we append a record here that associates the last sequence number in the
+ // batch with the previous one. When the finished signal is sent, we traverse the
+ // chain to individually finish all input messages that were part of the batch.
+ struct SeqChain {
+ uint32_t seq; // sequence number of batched input message
+ uint32_t chain; // sequence number of previous batched input message
+ };
+ Vector<SeqChain> mSeqChains;
+
ssize_t findBatch(int32_t deviceId, int32_t source) const;
+ status_t sendUnchainedFinishedSignal(uint32_t seq, bool handled);
static void initializeKeyEvent(KeyEvent* event, const InputMessage* msg);
static void initializeMotionEvent(MotionEvent* event, const InputMessage* msg);