Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29b980f5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Pass source to dispatchBatchedInputEventPending (2/2)" into rvc-dev am: 89260bd4

Change-Id: Icaa973953743c10bd01dfc82ae6921c61e920a5f
parents 4a61ebb9 89260bd4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -404,6 +404,13 @@ public:
     */
    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:
    // True if touch resampling is enabled.
    const bool mResampleTouch;
+10 −0
Original line number Diff line number Diff line
@@ -1130,6 +1130,16 @@ bool InputConsumer::hasPendingBatch() const {
    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 {
    for (size_t i = 0; i < mBatches.size(); i++) {
        const Batch& batch = mBatches.itemAt(i);