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

Commit 7127e800 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Android (Google) Code Review
Browse files

Merge "Add synchronous transaction to wait for setInputWindow to complete (2/n)"

parents 48a16830 a911b104
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -414,10 +414,13 @@ void InputWindowCommands::merge(const InputWindowCommands& other) {
            .insert(transferTouchFocusCommands.end(),
                    std::make_move_iterator(other.transferTouchFocusCommands.begin()),
                    std::make_move_iterator(other.transferTouchFocusCommands.end()));

    syncInputWindows |= other.syncInputWindows;
}

void InputWindowCommands::clear() {
    transferTouchFocusCommands.clear();
    syncInputWindows = false;
}

void InputWindowCommands::write(Parcel& output) const {
@@ -426,6 +429,8 @@ void InputWindowCommands::write(Parcel& output) const {
        output.writeStrongBinder(transferTouchFocusCommand.fromToken);
        output.writeStrongBinder(transferTouchFocusCommand.toToken);
    }

    output.writeBool(syncInputWindows);
}

void InputWindowCommands::read(const Parcel& input) {
@@ -437,6 +442,8 @@ void InputWindowCommands::read(const Parcel& input) {
        transferTouchFocusCommand.toToken = input.readStrongBinder();
        transferTouchFocusCommands.emplace_back(transferTouchFocusCommand);
    }

    syncInputWindows = input.readBool();
}

}; // namespace android
+5 −0
Original line number Diff line number Diff line
@@ -1083,6 +1083,11 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::transfer
    return *this;
}

SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::syncInputWindows() {
    mInputWindowCommands.syncInputWindows = true;
    return *this;
}

#endif

SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setColorTransform(
+1 −0
Original line number Diff line number Diff line
@@ -254,6 +254,7 @@ struct InputWindowCommands {
    };

    std::vector<TransferTouchFocusCommand> transferTouchFocusCommands;
    bool syncInputWindows;

    void merge(const InputWindowCommands& other);
    void clear();
+1 −0
Original line number Diff line number Diff line
@@ -378,6 +378,7 @@ public:
#ifndef NO_INPUT
        Transaction& setInputWindowInfo(const sp<SurfaceControl>& sc, const InputWindowInfo& info);
        Transaction& transferTouchFocus(const sp<IBinder>& fromToken, const sp<IBinder>& toToken);
        Transaction& syncInputWindows();
#endif

        // Set a color transform matrix on the given layer on the built-in display.
+4 −0
Original line number Diff line number Diff line
@@ -3977,6 +3977,10 @@ uint32_t SurfaceFlinger::addInputWindowCommands(const InputWindowCommands& input
        flags |= eTraversalNeeded;
    }

    if (inputWindowCommands.syncInputWindows) {
        flags |= eTraversalNeeded;
    }

    mPendingInputWindowCommands.merge(inputWindowCommands);
    return flags;
}