OSDN Git Service

Optimize hot launching recents
authorJorim Jaggi <jjaggi@google.com>
Fri, 12 May 2017 15:27:46 +0000 (17:27 +0200)
committerJorim Jaggi <jjaggi@google.com>
Tue, 16 May 2017 15:28:40 +0000 (17:28 +0200)
commit34795e31971b5495fcf91c1063dcb689957e2c9f
treeaee6b195a3a7db927a458eea6183b78120868df9
parentdc9385aad49bf2ba24c1221a5d4558a1ac69f97a
Optimize hot launching recents

Rearrange how we generate the transition specs, which involves
creating a thumbnail on the mainthread (about 10ms on large
devices): First, we put launching the activity onto a handler
thread (with default priority), to free up the main thread. Then,
we immediately start generating the thumbnail such that when the
future calls us we have the generated spec already handy.

For that we need to be able to supply a specs future into
ActivityOptions, to avoid race conditions. Furthermore we need to
make sure not to call into WM while creating specs, to avoid WM
lock contention.

Test: App -> Recents -> Same app, inspect app transition logs
Test: Double tap recents for quick switching

Bug: 32668632
Change-Id: I6001e29145f8e56deb9c4ead46c53c87c9191436
Merged-In: Ic6ec65c2560f67cade3b5ddde9f79ee13e9ba32c
core/java/android/app/ActivityOptions.java
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
packages/SystemUI/src/com/android/systemui/recents/views/RecentsTransitionHelper.java
packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
services/core/java/com/android/server/am/ActivityRecord.java