From 9b3598f154ce9b80820165d74bbc73e344841ab5 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Thu, 14 Sep 2023 17:10:47 -0400 Subject: [PATCH] Provide bgExecutor for RotationButtonController Bug: 289341065 Test: Unfolded, checked perfetto trace, it shows up not on UI thread Change-Id: I9a080c9a5c3c57f38eb6719ed73952dde4f6bba1 --- .../taskbar/TaskbarActivityContext.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 1ef90079e6..b15dda2de1 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -226,20 +226,23 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } // Construct controllers. + RotationButtonController rotationButtonController = new RotationButtonController(this, + c.getColor(R.color.floating_rotation_button_light_color), + c.getColor(R.color.floating_rotation_button_dark_color), + R.drawable.ic_sysbar_rotate_button_ccw_start_0, + R.drawable.ic_sysbar_rotate_button_ccw_start_90, + R.drawable.ic_sysbar_rotate_button_cw_start_0, + R.drawable.ic_sysbar_rotate_button_cw_start_90, + () -> getDisplay().getRotation()); + rotationButtonController.setBgExecutor(Executors.THREAD_POOL_EXECUTOR); + mControllers = new TaskbarControllers(this, new TaskbarDragController(this), buttonController, isDesktopMode ? new DesktopNavbarButtonsViewController(this, navButtonsView) : new NavbarButtonsViewController(this, navButtonsView), - new RotationButtonController(this, - c.getColor(R.color.floating_rotation_button_light_color), - c.getColor(R.color.floating_rotation_button_dark_color), - R.drawable.ic_sysbar_rotate_button_ccw_start_0, - R.drawable.ic_sysbar_rotate_button_ccw_start_90, - R.drawable.ic_sysbar_rotate_button_cw_start_0, - R.drawable.ic_sysbar_rotate_button_cw_start_90, - () -> getDisplay().getRotation()), + rotationButtonController, new TaskbarDragLayerController(this, mDragLayer), new TaskbarViewController(this, taskbarView), new TaskbarScrimViewController(this, taskbarScrimView),