diff options
| author | 2023-06-24 22:32:51 +0530 | |
|---|---|---|
| committer | 2023-06-24 22:32:51 +0530 | |
| commit | 59eaf312d5f0ec250adfe7aa60b79ee2cbdddb2c (patch) | |
| tree | 0c6921528a5b73d4b3117d970837ccd4428dce12 | |
| parent | 037244751d7bfb728dd51265b251e3a24da38556 (diff) | |
Avoid CalledFromWrongThreadException in BubbleController
Problem: {
1.CalledFromWrongThreadException can happen if OneHandedTransitionCallback is called from another thread
}
Solution: {
1. Update the views in UI thread to avoid CalledFromWrongThreadException
}
Bug: 288588813
Change-Id: I23f535f89be9a14491d19dd16ec844d946dc486a
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java | 16 |
1 files changed, 10 insertions, 6 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 dd8afff0df2c..805d1efead57 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 @@ -277,16 +277,20 @@ public class BubbleController implements ConfigurationChangeListener { new OneHandedTransitionCallback() { @Override public void onStartFinished(Rect bounds) { - if (mStackView != null) { - mStackView.onVerticalOffsetChanged(bounds.top); - } + mMainExecutor.execute(() -> { + if (mStackView != null) { + mStackView.onVerticalOffsetChanged(bounds.top); + } + }); } @Override public void onStopFinished(Rect bounds) { - if (mStackView != null) { - mStackView.onVerticalOffsetChanged(bounds.top); - } + mMainExecutor.execute(() -> { + if (mStackView != null) { + mStackView.onVerticalOffsetChanged(bounds.top); + } + }); } }); } |