summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Sergey Serokurov <serokurov@google.com> 2022-03-18 09:54:58 -0700
committer Sergey Serokurov <serokurov@google.com> 2022-03-21 12:53:07 -0700
commit7fcda60a9986d9398ec6da4e353065ddb83b0f3f (patch)
treec5d5fc7fda74b0b2448176153f6e4a35dc59961e /libs
parentfe5ac369f95d2350ff9183f8226b09facbbaeb95 (diff)
Set Manage button click listener using postDelayed
Bug: 223901921 Test: manual Change-Id: If4db2a7872ead26cfd02a3e8f5f752cb6f111503
Diffstat (limited to 'libs')
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java9
1 files changed, 8 insertions, 1 deletions
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 58f79f3600de..b98395baa277 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
@@ -2795,7 +2795,14 @@ public class BubbleStackView extends FrameLayout
mExpandedViewContainer.setVisibility(View.INVISIBLE);
mExpandedViewContainer.setAlpha(0f);
mExpandedViewContainer.addView(bev);
- bev.setManageClickListener((view) -> showManageMenu(!mShowingManage));
+
+ postDelayed(() -> {
+ // Set the Manage button click handler from postDelayed. This appears to resolve
+ // a race condition with adding the BubbleExpandedView view to the expanded view
+ // container. Due to the race condition the click handler sometimes is not set up
+ // correctly and is never called.
+ bev.setManageClickListener((view) -> showManageMenu(true /* show */));
+ }, 0);
if (!mIsExpansionAnimating) {
mSurfaceSynchronizer.syncSurfaceAndRun(() -> {