Merge "Fix an issue where bubbles didn't collapse onTaskMovedToFront" into tm-dev

This commit is contained in:
Mady Mellor
2022-03-11 01:20:04 +00:00
committed by Android (Google) Code Review

View File

@@ -383,23 +383,15 @@ public class BubbleController {
mTaskStackListener.addListener(new TaskStackListenerCallback() {
@Override
public void onTaskMovedToFront(int taskId) {
if (mSysuiProxy == null) {
return;
}
mSysuiProxy.isNotificationShadeExpand((expand) -> {
mMainExecutor.execute(() -> {
int expandedId = INVALID_TASK_ID;
if (mStackView != null && mStackView.getExpandedBubble() != null
&& isStackExpanded() && !mStackView.isExpansionAnimating()
&& !expand) {
expandedId = mStackView.getExpandedBubble().getTaskId();
}
if (expandedId != INVALID_TASK_ID && expandedId != taskId) {
mBubbleData.setExpanded(false);
}
});
mMainExecutor.execute(() -> {
int expandedId = INVALID_TASK_ID;
if (mStackView != null && mStackView.getExpandedBubble() != null
&& isStackExpanded() && !mStackView.isExpansionAnimating()) {
expandedId = mStackView.getExpandedBubble().getTaskId();
}
if (expandedId != INVALID_TASK_ID && expandedId != taskId) {
mBubbleData.setExpanded(false);
}
});
}