VirtualDisplayTaskEmbedder: Post background color change callback

Otherwise we will end up calling SurfaceView#setResizeBackgroundColor
from a Binder thread and potentially cause a crash. This mirrors the
behavior of TaskOrganizerTaskEmbedder.

Bug: 157605189
Test: Existing tests pass
Change-Id: Iafe9e4c3eb4d32a52a6a1479aa9a2b295cd4ad6f
This commit is contained in:
Robert Carr
2020-06-03 15:37:32 -07:00
parent 54eec4b7f6
commit e52f809126

View File

@@ -365,8 +365,8 @@ public class VirtualDisplayTaskEmbedder extends TaskEmbedder {
// Found the topmost stack on target display. Now check if the topmost task's
// description changed.
if (taskInfo.taskId == stackInfo.taskIds[stackInfo.taskIds.length - 1]) {
mHost.onTaskBackgroundColorChanged(VirtualDisplayTaskEmbedder.this,
taskInfo.taskDescription.getBackgroundColor());
mHost.post(()-> mHost.onTaskBackgroundColorChanged(VirtualDisplayTaskEmbedder.this,
taskInfo.taskDescription.getBackgroundColor()));
}
}