Merge "Set Manage button click listener using postDelayed" into tm-dev am: 493666178c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17258121

Change-Id: I240d16cc8459050afd733cc6bc8593d7107342c4
This commit is contained in:
Sergey Serokurov
2022-03-22 15:59:52 +00:00
committed by Automerger Merge Worker

View File

@@ -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(() -> {