From 32027abac9089dce70381953a6ba48d2e702d72a Mon Sep 17 00:00:00 2001 From: Yunfan Chen Date: Tue, 23 Jun 2020 14:07:42 +0000 Subject: [PATCH] Only apply server visible to split screen When the app windows switching, the control target can temporarily updated to the remote control target and the insets will become server controlled in that case. However, we don't want to apply the server visibility for that case as it's not a real insets update. This patch changed the insets visibility calculation, to consider server visibility only if the display is in multi window mode and the insets is not client controlled. Test: atest InsetsSourceProviderTest Test: go/wm-smoke Test: See reproduce steps in the bug. Bug: 158447971 Change-Id: I0525813459b367d23d8300d122c72a2b49bac967 --- .../java/com/android/server/wm/InsetsSourceProvider.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/InsetsSourceProvider.java b/services/core/java/com/android/server/wm/InsetsSourceProvider.java index c8d9fe0f0a659..1762b62299904 100644 --- a/services/core/java/com/android/server/wm/InsetsSourceProvider.java +++ b/services/core/java/com/android/server/wm/InsetsSourceProvider.java @@ -351,9 +351,13 @@ class InsetsSourceProvider { } private void updateVisibility() { + // TODO(b/159699383): remove the client controlled check when the insets visibility can be + // driven by the system UI. final boolean isClientControlled = mControlTarget != null && mControlTarget.isClientControlled(); - mSource.setVisible(mServerVisible && (!isClientControlled || mClientVisible)); + mSource.setVisible(mServerVisible + && ((!isClientControlled && mDisplayContent.inMultiWindowMode()) + || mClientVisible)); ProtoLog.d(WM_DEBUG_IME, "InsetsSource updateVisibility serverVisible: %s clientVisible: %s", mServerVisible, mClientVisible);