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

This commit is contained in:
Jorim Jaggi
2018-03-16 12:14:48 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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();
}
}
}