diff options
author | Vishnu Nair <vishnun@google.com> | 2019-10-17 09:50:58 -0700 |
---|---|---|
committer | Vishnu Nair <vishnun@google.com> | 2019-10-17 09:50:58 -0700 |
commit | 46698591a3d0ecab1216810c79a7b303aaa7314b (patch) | |
tree | fb12103767dc085dc0676fc813b64284fbc17f67 | |
parent | 036ea7795e4a1f8ea67d473d5c44d382a8565e5f (diff) | |
download | native-46698591a3d0ecab1216810c79a7b303aaa7314b.tar.gz |
Changed BufferLayer's canReceiveInput to check if its hidden by policy
WM does not consider window size or alpha value when setting it as the focused window. However, SF
will check if the window has a buffer and that its alpha is not 0. Because of this difference,
Input Dispatcher will not be able to send input to the window while WM thinks the window is
focused. This will cause apps to stop responding.
While we define what the intended behavior should be, this fix reverts
to previous behavior in P.
Bug: 139494112
Test: adb shell monkey 10000; make sure monkey does not get stuck
Test: check test app from can receive input b/140478820
Merged-In: I4160b49161dd1780713980707a5c911034f414b5
Change-Id: I4160b49161dd1780713980707a5c911034f414b5
-rw-r--r-- | services/surfaceflinger/ContainerLayer.cpp | 4 | ||||
-rw-r--r-- | services/surfaceflinger/ContainerLayer.h | 2 | ||||
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 2 |
3 files changed, 1 insertions, 7 deletions
diff --git a/services/surfaceflinger/ContainerLayer.cpp b/services/surfaceflinger/ContainerLayer.cpp index 7927fa95b6..e33bedbfce 100644 --- a/services/surfaceflinger/ContainerLayer.cpp +++ b/services/surfaceflinger/ContainerLayer.cpp @@ -35,11 +35,7 @@ bool ContainerLayer::isVisible() const { return false; } -bool ContainerLayer::canReceiveInput() const { - return !isHiddenByPolicy(); -} void ContainerLayer::setPerFrameData(const sp<const DisplayDevice>&, const ui::Transform&, const Rect&, int32_t, const ui::Dataspace) {} - } // namespace android diff --git a/services/surfaceflinger/ContainerLayer.h b/services/surfaceflinger/ContainerLayer.h index 7222a3e15a..e6dbfcce4e 100644 --- a/services/surfaceflinger/ContainerLayer.h +++ b/services/surfaceflinger/ContainerLayer.h @@ -31,8 +31,6 @@ public: const char* getTypeId() const override { return "ContainerLayer"; } bool isVisible() const override; - bool canReceiveInput() const override; - void setPerFrameData(const sp<const DisplayDevice>& display, const ui::Transform& transform, const Rect& viewport, int32_t supportedPerFrameMetadata, const ui::Dataspace targetDataspace) override; diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index fdf9da342f..44f3eae1ea 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -2129,7 +2129,7 @@ std::shared_ptr<compositionengine::Layer> Layer::getCompositionLayer() const { } bool Layer::canReceiveInput() const { - return isVisible(); + return !isHiddenByPolicy(); } compositionengine::OutputLayer* Layer::findOutputLayerForDisplay( |