Introduce android.anim thread in system_server

We create a new thread on which everything is running that
directly impacts window animations, i.e. layout, anim tick and
starting window creation. This is such that any work on
android.display can not lead to jank in the window animation,
specifically lock contention on activity manager lock that blocks
callbacks from android.display into AM can not lead to window
animation jank.

Test: Run animation, take systrace, make sure animation is on
android.anim
Test: AppWindowContainerControllerTestTest: AppWindowContainerControllerTestss
Fixes: 36792959

Change-Id: I5d41419a709b7984724e7053a3afdcc1ffe1aaa2
This commit is contained in:
Jorim Jaggi
2017-03-28 18:50:01 +01:00
parent 5515b12bee
commit ed7993b5d1
12 changed files with 132 additions and 44 deletions

View File

@@ -31,7 +31,7 @@ public class SurfaceFlingerVsyncChoreographer {
private static final long ONE_S_IN_NS = ONE_MS_IN_NS * 1000;
private final Handler mHandler;
private final Choreographer mChoreographer = Choreographer.getInstance();
private final Choreographer mChoreographer;
/**
* The offset between vsync-app and vsync-surfaceflinger. See
@@ -39,8 +39,10 @@ public class SurfaceFlingerVsyncChoreographer {
*/
private long mSurfaceFlingerOffsetMs;
public SurfaceFlingerVsyncChoreographer(Handler handler, Display display) {
public SurfaceFlingerVsyncChoreographer(Handler handler, Display display,
Choreographer choreographer) {
mHandler = handler;
mChoreographer = choreographer;
mSurfaceFlingerOffsetMs = calculateAppSurfaceFlingerVsyncOffsetMs(display);
}