Loading include/input/InputTransport.h +7 −0 Original line number Original line Diff line number Diff line Loading @@ -404,6 +404,13 @@ public: */ */ bool hasPendingBatch() const; bool hasPendingBatch() const; /* Returns the source of first pending batch if exist. * * Should be called after calling consume() with consumeBatches == false to determine * whether consume() should be called again later on with consumeBatches == true. */ int32_t getPendingBatchSource() const; private: private: // True if touch resampling is enabled. // True if touch resampling is enabled. const bool mResampleTouch; const bool mResampleTouch; Loading libs/input/InputTransport.cpp +10 −0 Original line number Original line Diff line number Diff line Loading @@ -1130,6 +1130,16 @@ bool InputConsumer::hasPendingBatch() const { return !mBatches.isEmpty(); return !mBatches.isEmpty(); } } int32_t InputConsumer::getPendingBatchSource() const { if (mBatches.isEmpty()) { return AINPUT_SOURCE_CLASS_NONE; } const Batch& batch = mBatches.itemAt(0); const InputMessage& head = batch.samples.itemAt(0); return head.body.motion.source; } ssize_t InputConsumer::findBatch(int32_t deviceId, int32_t source) const { ssize_t InputConsumer::findBatch(int32_t deviceId, int32_t source) const { for (size_t i = 0; i < mBatches.size(); i++) { for (size_t i = 0; i < mBatches.size(); i++) { const Batch& batch = mBatches.itemAt(i); const Batch& batch = mBatches.itemAt(i); Loading Loading
include/input/InputTransport.h +7 −0 Original line number Original line Diff line number Diff line Loading @@ -404,6 +404,13 @@ public: */ */ bool hasPendingBatch() const; bool hasPendingBatch() const; /* Returns the source of first pending batch if exist. * * Should be called after calling consume() with consumeBatches == false to determine * whether consume() should be called again later on with consumeBatches == true. */ int32_t getPendingBatchSource() const; private: private: // True if touch resampling is enabled. // True if touch resampling is enabled. const bool mResampleTouch; const bool mResampleTouch; Loading
libs/input/InputTransport.cpp +10 −0 Original line number Original line Diff line number Diff line Loading @@ -1130,6 +1130,16 @@ bool InputConsumer::hasPendingBatch() const { return !mBatches.isEmpty(); return !mBatches.isEmpty(); } } int32_t InputConsumer::getPendingBatchSource() const { if (mBatches.isEmpty()) { return AINPUT_SOURCE_CLASS_NONE; } const Batch& batch = mBatches.itemAt(0); const InputMessage& head = batch.samples.itemAt(0); return head.body.motion.source; } ssize_t InputConsumer::findBatch(int32_t deviceId, int32_t source) const { ssize_t InputConsumer::findBatch(int32_t deviceId, int32_t source) const { for (size_t i = 0; i < mBatches.size(); i++) { for (size_t i = 0; i < mBatches.size(); i++) { const Batch& batch = mBatches.itemAt(i); const Batch& batch = mBatches.itemAt(i); Loading