Loading
Handle case when snapshot dimensions don't match
If the snapshot starting window has different dimensions than the snapshots we have taken, we do the following: - Create a child Surface that has exactly the dimensions of the snapshot. - We fill the parent surface with the app background color, as well as all screen background decorations (status bar background, navigation bar background). - We also clip of the status bar/navigation bar background in some cases, as it looks ugly if it's not behind the system bars. - Furthermore, we inherit all layout flags on the window and all layout relevant SystemUI flags on the window such that it's very likely that the size will match, and the system bars are drawn correctly. - In order to make the transition from the snapshot to the real window a bit more predictable/less messy, we enforce a minimum duration the snapshot is visible, which is slightly more than our app transitions. Test: TaskSnapshotSurfaceTest Test: Open app, go home, go landscape, open app again Test: Go to multi-window, open app from recents with a snapshot taken in fullscreen. Fixes: 36703868 Change-Id: Ia2d4add6971a18ab7aa2942d2b644d6e87a402af