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

Commit 57f0c3e5 authored by wilsonshih's avatar wilsonshih
Browse files

Allow to use snapshot starting window when launch translucent activity.

There won't create splash screen if the theme of top actiivty is
declared as translucent or floating. But if there already has snapshot
for this task, it should be allowed to choose the snapshot as starting
window while switching this task to top.

Flag: EXEMPT bugfix
Bug: 357208242
Test: launch activity A, while A stop, launch a translucent activity B
in the same task. Launch the app from home again and verify there will
create splash screen.

Change-Id: I1562eef3026aaa2d2c563c0863450f12bb56985f
parent a3292406
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2641,8 +2641,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // trampoline that will be always created and finished immediately. Then give a chance to
        // see if the snapshot is usable for the current running activity so the transition will
        // look smoother, instead of showing a splash screen on the second launch.
        if (!newTask && taskSwitch && processRunning && !activityCreated && task.intent != null
                && mActivityComponent.equals(task.intent.getComponent())) {
        if (!newTask && taskSwitch && !activityCreated && task.intent != null
                // Another case where snapshot is allowed to be used is if this activity has not yet
                // been created && is translucent or floating.
                // The component isn't necessary to be matched in this case.
                && (!mOccludesParent || mActivityComponent.equals(task.intent.getComponent()))) {
            final ActivityRecord topAttached = task.getActivity(ActivityRecord::attachedToProcess);
            if (topAttached != null) {
                if (topAttached.isSnapshotCompatible(snapshot)