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

Commit 4a238273 authored by Ming-Shin Lu's avatar Ming-Shin Lu
Browse files

Keeps activity in visible state when LiveTiles task is animating

When enabling LiveTile and tapping side task from recents view,
RecentsAnimationController will dispatch the corresponding
RemoteAnimationTarget to launcher though
IRecentsAnimationRunner#onTaskApeared, and then launcher side will
animate both tasks after launched side task by CL[1].

This CL is to refine some code logic to simplified the call path
of onTaskApeared callback and ensure the visiblity of LiveTile task
keeps visible during recents animating.

[1]: Ibffb6a9c74c235efc8615a22b0306551532c7b61

Bug: 165394366
Test: manual as below step
     1) Enabling LiveTile from Home setting -> Developer options.
     2) Launch youtube app and swipe up to overview, make sure youbute
        still plays video
     3) Tapping side task from left side.
     4) verify if the live tile task (Youtube) is still visible and
        animates

Change-Id: I2acf12129782e853bf8c807553d2fdaba31b687e
parent ae31181f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ import static com.android.server.wm.IdentifierProto.HASH_CODE;
import static com.android.server.wm.IdentifierProto.TITLE;
import static com.android.server.wm.IdentifierProto.USER_ID;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_WINDOW_ANIMATION;
import static com.android.server.wm.Task.ActivityState.DESTROYED;
import static com.android.server.wm.Task.ActivityState.DESTROYING;
@@ -4216,7 +4217,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // Note that we ignore display frozen since we want the opening / closing transition type
        // can be updated correctly even display frozen, and it's safe since in applyAnimation will
        // still check DC#okToAnimate again if the transition animation is fine to apply.
        if (okToAnimate(true /* ignoreFrozen */) && appTransition.isTransitionSet()) {
        final boolean recentsAnimating = isAnimating(PARENTS, ANIMATION_TYPE_RECENTS);
        if (okToAnimate(true /* ignoreFrozen */) && (appTransition.isTransitionSet()
                || (recentsAnimating && !isActivityTypeHome()))) {
            if (visible) {
                displayContent.mOpeningApps.add(this);
                mEnteringAnimation = true;
@@ -6086,7 +6089,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    @Override
    void prepareSurfaces() {
        final boolean show = isVisible() || isAnimating(PARENTS, ANIMATION_TYPE_APP_TRANSITION);
        final boolean show = isVisible() || isAnimating(PARENTS,
                ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_RECENTS);

        if (mSurfaceControl != null) {
            if (show && !mLastSurfaceShowing) {
+1 −1
Original line number Diff line number Diff line
@@ -3945,7 +3945,7 @@ class Task extends WindowContainer<WindowContainer> {
        if (control != null) {
            // We let the transition to be controlled by RecentsAnimation, and callback task's
            // RemoteAnimationTarget for remote runner to animate.
            if (enter) {
            if (enter && !isHomeOrRecentsStack()) {
                ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
                        "applyAnimationUnchecked, control: %s, task: %s, transit: %s",
                        control, asTask(), AppTransition.appTransitionToString(transit));