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

Commit b2e77e08 authored by Rob Carr's avatar Rob Carr Committed by Automerger Merge Worker
Browse files

Merge "SurfaceFlinger: Send all BufferedLayers to InputFlinger" into rvc-dev...

Merge "SurfaceFlinger: Send all BufferedLayers to InputFlinger" into rvc-dev am: e0d9770d am: 4e5109c2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/11039839

Change-Id: If0016d39a980304f955b8bc41f1b78f11a7df257
parents cb30bb5f 4e5109c2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3640,7 +3640,8 @@ void InputDispatcher::updateWindowHandlesForDisplayLocked(
            continue;
        }

        if (oldHandlesById.find(handle->getId()) != oldHandlesById.end()) {
        if ((oldHandlesById.find(handle->getId()) != oldHandlesById.end()) &&
                (oldHandlesById.at(handle->getId())->getToken() == handle->getToken())) {
            const sp<InputWindowHandle>& oldHandle = oldHandlesById.at(handle->getId());
            oldHandle->updateFrom(handle);
            newHandles.push_back(oldHandle);
+5 −0
Original line number Diff line number Diff line
@@ -148,6 +148,11 @@ private:
    virtual status_t updateActiveBuffer() = 0;
    virtual status_t updateFrameNumber(nsecs_t latchTime) = 0;

    // We generate InputWindowHandles for all buffered layers regardless of whether they
    // have an InputChannel. This is to enable the InputDispatcher to do PID based occlusion
    // detection.
    bool needsInputInfo() const override { return true; }

protected:
    struct BufferInfo {
        nsecs_t mDesiredPresentTime;
+11 −1
Original line number Diff line number Diff line
@@ -2343,6 +2343,16 @@ bool Layer::isRemovedFromCurrentState() const {
}

InputWindowInfo Layer::fillInputInfo() {
    if (!hasInputInfo()) {
        mDrawingState.inputInfo.name = getName();
        mDrawingState.inputInfo.ownerUid = mCallingUid;
        mDrawingState.inputInfo.ownerPid = mCallingPid;
        mDrawingState.inputInfo.inputFeatures =
            InputWindowInfo::INPUT_FEATURE_NO_INPUT_CHANNEL;
        mDrawingState.inputInfo.layoutParamsFlags = InputWindowInfo::FLAG_NOT_TOUCH_MODAL;
        mDrawingState.inputInfo.displayId = getLayerStack();
    }

    InputWindowInfo info = mDrawingState.inputInfo;
    info.id = sequence;

@@ -2424,7 +2434,7 @@ sp<Layer> Layer::getClonedRoot() {
    return mDrawingParent.promote()->getClonedRoot();
}

bool Layer::hasInput() const {
bool Layer::hasInputInfo() const {
    return mDrawingState.inputInfo.token != nullptr;
}

+11 −1
Original line number Diff line number Diff line
@@ -947,7 +947,17 @@ public:
    void setInputInfo(const InputWindowInfo& info);

    InputWindowInfo fillInputInfo();
    bool hasInput() const;
    /**
     * Returns whether this layer has an explicitly set input-info.
     */
    bool hasInputInfo() const;
    /**
     * Return whether this layer needs an input info. For most layer types
     * this is only true if they explicitly set an input-info but BufferLayer
     * overrides this so we can generate input-info for Buffered layers that don't
     * have them (for input occlusion detection checks).
     */
    virtual bool needsInputInfo() const { return hasInputInfo(); }

protected:
    compositionengine::OutputLayer* findOutputLayerForDisplay(const DisplayDevice*) const;
+1 −1
Original line number Diff line number Diff line
@@ -2901,7 +2901,7 @@ void SurfaceFlinger::updateInputWindowInfo() {
    std::vector<InputWindowInfo> inputHandles;

    mDrawingState.traverseInReverseZOrder([&](Layer* layer) {
        if (layer->hasInput()) {
        if (layer->needsInputInfo()) {
            // When calculating the screen bounds we ignore the transparent region since it may
            // result in an unwanted offset.
            inputHandles.push_back(layer->fillInputInfo());