Fix an issue where bubbles didn't collapse onTaskMovedToFront

I noticed when opening settings while stack is expanded wouldn't
cause the stack to collapse. This was because we skipped the collapse
if the shade was expanded. I don't think there's any reason to be
doing this, I think this was accidentally added during the refactor
to move bubbles into shell.

Test: manual - have bubbles expanded, pull down the shade, tap on
               the settings gear or long press on a tile, ensure that
               when the settings screen opens that the stack collapsed
Bug: 223635739
Change-Id: Ia3476e694a8e64c95eed63dea4a3729e83766683
This commit is contained in:
Mady Mellor
2022-03-10 22:54:17 +00:00
parent 4ab407e5fe
commit ba395508c5

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);
}
});
}