Loading
Drawing app theme snapshot without hold wm lock.
A potential deadlock could happen when hold wm lock and require hardware buffer from createHardwareBitmap, the rendering thread can be blocked because it is waiting for dequeue buffer. Defer the create snapshot process in a supplier, to escape the wm lock if the snapshot should be draw by render thread. Also add a parameter allowAppTheme in captureSnapshot, then the caller can decide to not capture fake snapshot. Flag: com.android.window.flags.exclude_drawing_app_theme_snapshot_from_lock Bug: 373502791 Test: atest ActivitySnapshotControllerTests TransitionTests TaskSnapshotControllerTest Test: verify there won't block render thread while capture app snapshot for app theme mode. Change-Id: I7add8baecb0d068bac485fe9eee0c90f23d2f823