Do not record snapshot when snapshots are disabled

Bug: 285198903
Test: manual testing, switching apps
Change-Id: I70d0a654b2bb6cd9bde4d0be5fe42d5b1e941987
This commit is contained in:
Hongguang Chen
2023-05-31 20:42:06 -07:00
parent 720e8081d3
commit 0a68ae7eae

View File

@@ -167,6 +167,9 @@ abstract class AbsAppSnapshotController<TYPE extends WindowContainer,
}
final TaskSnapshot recordSnapshotInner(TYPE source, boolean allowSnapshotHome) {
if (shouldDisableSnapshots()) {
return null;
}
final boolean snapshotHome = allowSnapshotHome && source.isActivityTypeHome();
final TaskSnapshot snapshot = captureSnapshot(source, snapshotHome);
if (snapshot == null) {