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

Commit 9fab55b1 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:...

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

Change-Id: I9614bf4ad384dee0ee457567833ba1595ca30b97
parents 9bdd2ebc 920c6b88
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -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;
+10 −0
Original line number Original line Diff line number Diff line
@@ -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);