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

Commit c8cc2292 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Boost thread priorities when running recents anim

To improve scheduling in WM to improve latency.

Bug: 73651529

Test: go/wm-smoke
Test: Trace swiping up, make sure threads have right priority
Change-Id: Ic35c00b70be4877abfe07de4ba1f18648cabd812
parent a3178fc4
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -469,10 +469,16 @@ public class AppTransition implements Dump {
     * boost the priorities to a more important value whenever an app transition is going to happen
     * soon or an app transition is running.
     */
    private void updateBooster() {
        WindowManagerService.sThreadPriorityBooster.setAppTransitionRunning(
                mNextAppTransition != TRANSIT_UNSET || mAppTransitionState == APP_STATE_READY
                        || mAppTransitionState == APP_STATE_RUNNING);
    void updateBooster() {
        WindowManagerService.sThreadPriorityBooster.setAppTransitionRunning(needsBoosting());
    }

    private boolean needsBoosting() {
        final boolean recentsAnimRunning = mService.getRecentsAnimationController() != null;
        return mNextAppTransition != TRANSIT_UNSET
                || mAppTransitionState == APP_STATE_READY
                || mAppTransitionState == APP_STATE_RUNNING
                || recentsAnimRunning;
    }

    void registerListenerLocked(AppTransitionListener listener) {
+2 −0
Original line number Diff line number Diff line
@@ -2651,6 +2651,7 @@ public class WindowManagerService extends IWindowManager.Stub
        synchronized (mWindowMap) {
            mRecentsAnimationController = new RecentsAnimationController(this,
                    recentsAnimationRunner, callbacks, displayId);
            mAppTransition.updateBooster();
            mRecentsAnimationController.initialize(recentTaskIds);
        }
    }
@@ -2687,6 +2688,7 @@ public class WindowManagerService extends IWindowManager.Stub
            if (mRecentsAnimationController != null) {
                mRecentsAnimationController.cleanupAnimation();
                mRecentsAnimationController = null;
                mAppTransition.updateBooster();
            }
        }
    }