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

Commit 40d02283 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

[sf] input snapshot fixes

- update inputflinger if the visibility changes
- use passed in uid/pid for input info
- fix touchOcclusionMode propagation to layers

Test: atest InputSurfacesTest
Bug: 238781169

Change-Id: If037270c8b54176dfcb32efef424d2289ead1704
parent ef68d6d4
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ void updateVisibility(LayerSnapshot& snapshot, bool visible) {
    // InputDispatcher, and obviously if they aren't visible they can't occlude
    // anything.
    const bool visibleForInput =
            (snapshot.inputInfo.token != nullptr) ? snapshot.canReceiveInput() : snapshot.isVisible;
            snapshot.hasInputInfo() ? snapshot.canReceiveInput() : snapshot.isVisible;
    snapshot.inputInfo.setInputConfig(gui::WindowInfo::InputConfig::NOT_VISIBLE, !visibleForInput);
}

@@ -955,12 +955,13 @@ void LayerSnapshotBuilder::updateInput(LayerSnapshot& snapshot,
        snapshot.inputInfo = *requested.windowInfoHandle->getInfo();
    } else {
        snapshot.inputInfo = {};
    }

        // b/271132344 revisit this and see if we can always use the layers uid/pid
        snapshot.inputInfo.name = requested.name;
    snapshot.inputInfo.id = static_cast<int32_t>(snapshot.uniqueSequence);
        snapshot.inputInfo.ownerUid = static_cast<int32_t>(requested.ownerUid);
        snapshot.inputInfo.ownerPid = requested.ownerPid;
    }

    snapshot.inputInfo.id = static_cast<int32_t>(snapshot.uniqueSequence);
    snapshot.inputInfo.displayId = static_cast<int32_t>(snapshot.outputFilter.layerStack.id);
    if (!needsInputInfo(snapshot, requested)) {
        return;
@@ -984,7 +985,9 @@ void LayerSnapshotBuilder::updateInput(LayerSnapshot& snapshot,
    }

    snapshot.inputInfo.alpha = snapshot.color.a;
    snapshot.inputInfo.touchOcclusionMode = parentSnapshot.inputInfo.touchOcclusionMode;
    snapshot.inputInfo.touchOcclusionMode = requested.hasInputInfo()
            ? requested.windowInfoHandle->getInfo()->touchOcclusionMode
            : parentSnapshot.inputInfo.touchOcclusionMode;
    if (requested.dropInputMode == gui::DropInputMode::ALL ||
        parentSnapshot.dropInputMode == gui::DropInputMode::ALL) {
        snapshot.dropInputMode = gui::DropInputMode::ALL;
+1 −1
Original line number Diff line number Diff line
@@ -2251,7 +2251,7 @@ bool SurfaceFlinger::updateLayerSnapshots(VsyncId vsyncId, LifecycleUpdate& upda
    }

    if (mLayerLifecycleManager.getGlobalChanges().any(Changes::Geometry | Changes::Input |
                                                      Changes::Hierarchy)) {
                                                      Changes::Hierarchy | Changes::Visibility)) {
        mUpdateInputInfo = true;
    }
    if (mLayerLifecycleManager.getGlobalChanges().any(Changes::VisibleRegion | Changes::Hierarchy |