diff options
| author | 2022-03-22 15:55:50 +0000 | |
|---|---|---|
| committer | 2022-03-22 15:55:50 +0000 | |
| commit | 493666178c22aa6e53ba31b17ef74776a2e27aad (patch) | |
| tree | 7176b4686ffafbe4b1cba9b0a6f3aca83886ea46 | |
| parent | 2da047710dccd24ba01090faa43b245ef0593b84 (diff) | |
| parent | 7fcda60a9986d9398ec6da4e353065ddb83b0f3f (diff) | |
Merge "Set Manage button click listener using postDelayed" into tm-dev
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java | 9 |
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 13d12b3589c0..677c1c7d7759 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 @@ -2802,7 +2802,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(() -> { |