diff options
| author | 2025-03-11 16:30:39 -0700 | |
|---|---|---|
| committer | 2025-03-12 14:06:16 -0700 | |
| commit | 4f031ef692c152252cdee4ed5ceb82a22b0cfe4b (patch) | |
| tree | 1a4f403a8c478afecf555872d40b10bf1699c788 | |
| parent | 620d39409e53609318b35e5c69c4cf42a549c34f (diff) | |
Fix some crashes when going between fold / unfold with bubble bar
There were two issues here:
1 - that the current task view listener could be unset, so check for
that and use the value on the bubbleTaskView in that case.
2 - the post delay call we have assumes that we'll have stackview, which
is the case in prod, but not with bubble bar.
Flag: EXEMPT trivial bug fixesi
Test: atest BubbleExpandedViewTest
Test: manual - expand a bubble while folded, unfold
=> observe nothing crashes
Bug: 402550443
Change-Id: I4aa35c7cc29dbec052a082232636cc862d1e2608
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java | 6 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index 60573965208a..81eff6f7399a 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -1306,7 +1306,11 @@ public class BubbleController implements ConfigurationChangeListener, // TODO b/392893178: Merge the unfold and the task view transition so that we don't // have to post a delayed runnable to the looper to update the bounds if (mStackView.isExpanded()) { - mStackView.postDelayed(() -> mStackView.updateExpandedView(), 500); + mStackView.postDelayed(() -> { + if (mStackView != null) { + mStackView.updateExpandedView(); + } + } , 500); } } if (newConfig.fontScale != mFontScale) { diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java index cbd1e9671825..426c3ee5b853 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java @@ -468,9 +468,12 @@ public class BubbleExpandedView extends LinearLayout { public void onTaskCreated() { // The taskId is saved to use for removeTask, // preventing appearance in recent tasks. - mTaskId = ((BubbleTaskViewListener) mCurrentTaskViewListener) - .getTaskId(); - + BubbleTaskViewListener listener = mCurrentTaskViewListener != null + ? ((BubbleTaskViewListener) mCurrentTaskViewListener) + : null; + mTaskId = listener != null + ? listener.getTaskId() + : bubbleTaskView.getTaskId(); setContentVisibility(true); } |