From 243e2e9af82700c76f743ee71e0f27fe1a3f4383 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Mon, 3 Apr 2023 15:27:38 -0500 Subject: DO NOT MERGE: Force input window updates when layer visibility changes This should fix a latency regression introduced by delaying input window visibility changes. See ag/22210759. Bug: 270894765 Bug: 275562923 Test: v2/android-crystalball-eng/health/microbench/instr_metric/input_method Change-Id: I0f64fa148eb4b02600eac9578d3d23ac00c78fa3 --- services/surfaceflinger/Layer.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'services/surfaceflinger/Layer.cpp') diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index aff94d132e..4593b40b7d 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -2391,16 +2391,7 @@ WindowInfo Layer::fillInputInfo(const InputDisplayArgs& displayArgs) { info.inputConfig |= WindowInfo::InputConfig::NOT_TOUCHABLE; } - // 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. - const bool visible = hasInputInfo() ? canReceiveInput() : isVisible(); - info.setInputConfig(WindowInfo::InputConfig::NOT_VISIBLE, !visible); + info.setInputConfig(WindowInfo::InputConfig::NOT_VISIBLE, !isVisibleForInput()); info.alpha = getAlpha(); fillTouchOcclusionMode(info); -- cgit v1.2.3-59-g8ed1b