diff options
| author | 2020-06-17 22:21:37 +0000 | |
|---|---|---|
| committer | 2020-06-17 22:21:37 +0000 | |
| commit | d2cf83eb1eee7016a18d9cc5ef6e45d09036a579 (patch) | |
| tree | 46f6c109df8f0b9a74de43466d0dc88841c553b1 | |
| parent | 50039559ad0bb19b4ad866083723c622b8f9d179 (diff) | |
| parent | 19824afef3b9634b6d94e26da785f5a1e633ea01 (diff) | |
Merge changes Iadcd5d8f,Ife2a5a9f into rvc-dev am: 19824afef3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/11826888
Change-Id: I29b6c47d1fd48d3e6a4b2858588e694861b93cd1
| -rw-r--r-- | services/inputflinger/dispatcher/InputDispatcher.cpp | 11 | ||||
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 10 |
2 files changed, 12 insertions, 9 deletions
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp index 677bf7e2ec..323e538908 100644 --- a/services/inputflinger/dispatcher/InputDispatcher.cpp +++ b/services/inputflinger/dispatcher/InputDispatcher.cpp @@ -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; diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 3255aac8e5..c1463151f8 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -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) { |