From 344efe80a96ba804533f0fc7c17a02ee8ffaaf2d Mon Sep 17 00:00:00 2001 From: Heemin Seog Date: Thu, 3 Dec 2020 09:48:33 -0800 Subject: [PATCH] DO NOT MERGE Do not update bar control target when application is starting Handling the bar control target even when the application is starting causes there to be a flicker in system bar visibility when switching from one immersive mode app to another immersive mode app. Bug: 149312861 Test: manual Change-Id: If5de2ff97d4ad177e5fc58baa82b3f43ed118c2e --- services/core/java/com/android/server/wm/InsetsPolicy.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/wm/InsetsPolicy.java b/services/core/java/com/android/server/wm/InsetsPolicy.java index fd67db1d5cc9f..a6a44a9f68e69 100644 --- a/services/core/java/com/android/server/wm/InsetsPolicy.java +++ b/services/core/java/com/android/server/wm/InsetsPolicy.java @@ -27,6 +27,7 @@ import static android.view.InsetsState.ITYPE_STATUS_BAR; import static android.view.SyncRtSurfaceTransactionApplier.applyParams; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_SHOW_STATUS_BAR; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_STATUS_FORCE_SHOW_NAVIGATION; +import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; import android.annotation.Nullable; import android.app.StatusBarManager; @@ -127,6 +128,9 @@ class InsetsPolicy { /** Updates the target which can control system bars. */ void updateBarControlTarget(@Nullable WindowState focusedWin) { + if (focusedWin != null && (focusedWin.mAttrs.type == TYPE_APPLICATION_STARTING)) { + return; + } if (mFocusedWin != focusedWin){ abortTransient(); }