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

Commit 93c23595 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Boost thread priorities when running recents anim" into pi-dev

parents ec243338 c8cc2292
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();
            }
        }
    }