Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3555db9 authored by Mariia Sandrikova's avatar Mariia Sandrikova
Browse files

[6/n] Camera Compat UI: Dispatch pending events in task organiser to ensure state update in UI.

Without this change, Task#dispatchTaskInfoChangedIfNeeded led to a pending task event being added in TaskOrganizerController#onTaskInfoChanged but not dispatched which sometimes resulted in the stale state for the camera compat control.

Test: manual - no stale state.
Bug: 214429446
Change-Id: Ief8891b938ec6116fd3adbc260d3457817ba2e02
parent 265aab13
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1623,6 +1623,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }
        // Trigger TaskInfoChanged to update the camera compat UI.
        getTask().dispatchTaskInfoChangedIfNeeded(true /* force */);
        // TaskOrganizerController#onTaskInfoChanged adds pending task events to the queue waiting
        // for the surface placement to be ready. So need to trigger surface placement to dispatch
        // events to avoid stale state for the camera compat control.
        getDisplayContent().setLayoutNeeded();
        mWmService.mWindowPlacerLocked.performSurfacePlacement();
    }

    void updateCameraCompatStateFromUser(@CameraCompatControlState int state) {