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

Commit 19824afe authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes Iadcd5d8f,Ife2a5a9f into rvc-dev

* changes:
  SurfaceFlinger-Input: Ignore invisible layers for occlusion detection
  InputDispatcher: Don't occlude windows with the same PID.
parents c75b0777 5dc426e6
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -2097,14 +2097,9 @@ static bool canBeObscuredBy(const sp<InputWindowHandle>& windowHandle,
    auto otherInfo = otherHandle->getInfo();
    if (!otherInfo->visible) {
        return false;
    } else if (info->ownerPid == otherInfo->ownerPid && otherHandle->getToken() == nullptr) {
      // In general, if ownerPid is the same we don't want to generate occlusion
      // events. This line is now necessary since we are including all Surfaces
      // in occlusion calculation, so if we didn't check PID like this SurfaceView
      // would occlude their parents. On the other hand before we started including
      // all surfaces in occlusion calculation and had this line, we would count
      // windows with an input channel from the same PID as occluding, and so we
      // preserve this behavior with the getToken() == null check.
    } else if (info->ownerPid == otherInfo->ownerPid) {
        // If ownerPid is the same we don't generate occlusion events as there
        // is no in-process security boundary.
        return false;
    } else if (otherInfo->isTrustedOverlay()) {
        return false;
+9 −1
Original line number Diff line number Diff line
@@ -2408,7 +2408,15 @@ InputWindowInfo Layer::fillInputInfo() {
    // Position the touchable region relative to frame screen location and restrict it to frame
    // bounds.
    info.touchableRegion = info.touchableRegion.translate(info.frameLeft, info.frameTop);
    info.visible = canReceiveInput();
    // For compatibility reasons we let layers which can receive input
    // receive input before they have actually submitted a buffer. Because
    // of this we use canReceiveInput instead of isVisible to check the
    // policy-visibility, ignoring the buffer state. However for layers with
    // hasInputInfo()==false we can use the real visibility state.
    // We are just using these layers for occlusion detection in
    // InputDispatcher, and obviously if they aren't visible they can't occlude
    // anything.
    info.visible = hasInputInfo() ? canReceiveInput() : isVisible();

    auto cropLayer = mDrawingState.touchableRegionCrop.promote();
    if (info.replaceTouchableRegionWithCrop) {