summaryrefslogtreecommitdiff
path: root/libs/WindowManager/Shell
diff options
context:
space:
mode:
author chaviw <chaviw@google.com> 2022-05-17 17:39:25 -0500
committer chaviw <chaviw@google.com> 2022-05-17 17:47:11 -0500
commit04efcbae292f59ab6f66f5126d2e3416486d5161 (patch)
tree66a27827c0a9a5d7ef4f5d481e347d218101d323 /libs/WindowManager/Shell
parent4304b4b03151a6550027bcfb1a9fb8e92b922c05 (diff)
Don't inflate mSplitDecorManager in sync transaction callback
The current code inflates the UI in the sync transaction callback. This can result in a deadlock since inflate could block waiting on RT. The RT could be blocked waiting for the sync transaction to get applied to free up a buffer. But since the sync transaction won't get applied until after the inflate, it would deadlock. Test: Not stuck in split Fixes: 231929473 Change-Id: I751aa2d68ec96f7f77ba4145d810cccf764075ea
Diffstat (limited to 'libs/WindowManager/Shell')
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
index 9fd5d2003873..7571e29a86a3 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
@@ -224,14 +224,12 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
if (mRootTaskInfo.taskId == taskInfo.taskId) {
// Inflates split decor view only when the root task is visible.
if (mRootTaskInfo.isVisible != taskInfo.isVisible) {
- mSyncQueue.runInSync(t -> {
- if (taskInfo.isVisible) {
- mSplitDecorManager.inflate(mContext, mRootLeash,
- taskInfo.configuration.windowConfiguration.getBounds());
- } else {
- mSplitDecorManager.release(t);
- }
- });
+ if (taskInfo.isVisible) {
+ mSplitDecorManager.inflate(mContext, mRootLeash,
+ taskInfo.configuration.windowConfiguration.getBounds());
+ } else {
+ mSyncQueue.runInSync(t -> mSplitDecorManager.release(t));
+ }
}
mRootTaskInfo = taskInfo;
} else if (taskInfo.parentTaskId == mRootTaskInfo.taskId) {