From d1f6cda7685191d02286d1b03dcd7c9854a59604 Mon Sep 17 00:00:00 2001 From: Liran Binyamin Date: Thu, 1 Aug 2024 09:02:29 -0400 Subject: Fix manage menu after theme change If the manage menu was visible before changing the theme, make sure it gets re-shown after the theme change. Previously what happened was, after a theme change, we end up in an inconsistent state where the manage menu is removed, but the internal state field indicates the menu is visible, which leads to issues. This also fixes another issue where the manage menu gets positioned incorrectly if the device is folded after a theme change. Flag: EXEMPT bug fix Fixes: 354641768 Fixes: 354634320 Test: manual - create some bubbles - expand a bubble - tap on the manage button - change the theme to light or dark - observe manage menu is displayed correctly Change-Id: I78026025a1d958c971a8e744445d628e9ac1e8a3 --- .../Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index efa1031bf814..f002d8904626 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -1601,6 +1601,11 @@ public class BubbleStackView extends FrameLayout getResources().getColor(android.R.color.system_neutral1_1000))); mManageMenuScrim.setBackgroundDrawable(new ColorDrawable( getResources().getColor(android.R.color.system_neutral1_1000))); + if (mShowingManage) { + // the manage menu location depends on the manage button location which may need a + // layout pass, so post this to the looper + post(() -> showManageMenu(true)); + } } /** -- cgit v1.2.3-59-g8ed1b