Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90c86f58 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Add WRITE_TO_PARCEL reference before creash snapshot starting window." into main

parents 33dc56ec 95180ce9
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -2326,13 +2326,16 @@ final class ActivityRecord extends WindowToken {
            if (isActivityTypeHome()) {
            if (isActivityTypeHome()) {
                // The snapshot of home is only used once because it won't be updated while screen
                // The snapshot of home is only used once because it won't be updated while screen
                // is on (see {@link TaskSnapshotController#screenTurningOff}).
                // is on (see {@link TaskSnapshotController#screenTurningOff}).
                mWmService.mTaskSnapshotController.removeSnapshotCache(task.mTaskId);
                final Transition transition = mTransitionController.getCollectingTransition();
                final Transition transition = mTransitionController.getCollectingTransition();
                if (transition != null && (transition.getFlags()
                if (transition != null && (transition.getFlags()
                        & WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION) == 0) {
                        & WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION) == 0) {
                    mWmService.mTaskSnapshotController.removeSnapshotCache(task.mTaskId);
                    // Only use snapshot of home as starting window when unlocking directly.
                    // Only use snapshot of home as starting window when unlocking directly.
                    return false;
                    return false;
                }
                }
                // Add a reference before removing snapshot from cache.
                snapshot.addReference(TaskSnapshot.REFERENCE_WRITE_TO_PARCEL);
                mWmService.mTaskSnapshotController.removeSnapshotCache(task.mTaskId);
            }
            }
            return createSnapshot(snapshot, typeParameter);
            return createSnapshot(snapshot, typeParameter);
        }
        }