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

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

Merge "Polish close translucent task animation when combines with other changes." into main

parents 90517fae b9df0ebc
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -461,6 +461,16 @@ flag {
    }
}

flag {
    name: "polish_close_wallpaper_includes_open_change"
    namespace: "windowing_frontend"
    description: "Record the initial z-order while collecting window containers, keep the wallpaper always at the bottom, and use a cross-fade animation when a close wallpaper transition includes an open target."
    bug: "421436197"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "predictive_back_callback_cancellation_fix"
    namespace: "windowing_frontend"
+15 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.window.TransitionInfo.FLAGS_IS_NON_APP_WINDOW;
import static android.window.TransitionInfo.FLAG_IS_DISPLAY;
import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
import static android.window.TransitionInfo.FLAG_TRANSLUCENT;

import static com.android.internal.policy.TransitionAnimation.WALLPAPER_TRANSITION_CLOSE;
@@ -46,6 +47,7 @@ import android.view.InsetsSource;
import android.view.InsetsState;
import android.view.SurfaceControl;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.window.TransitionInfo;

@@ -163,6 +165,19 @@ public class TransitionAnimationHelper {
        }

        Animation a = null;
        if (com.android.window.flags.Flags.polishCloseWallpaperIncludesOpenChange()) {
            if (animAttr == R.styleable.WindowAnimation_wallpaperCloseExitAnimation) {
                // A closing wallpaper doesn't need an animation.
                if (change.hasFlags(FLAG_IS_WALLPAPER)) {
                    animAttr = 0;
                } else {
                    // TODO (b/421436197): Modify wallpaper_close_exit.xml when clean up the flag.
                    a = new AlphaAnimation(1.0f /* fromAlpha */, 0.0f /* toAlpha */);
                    a.setDuration(275 /* durationMillis */);
                    return a;
                }
            }
        }
        if (animAttr != 0) {
            if (overrideType == ANIM_FROM_STYLE && !isTask) {
                final TransitionInfo.AnimationOptions.CustomActivityTransition customTransition =
+2 −1
Original line number Diff line number Diff line
@@ -618,7 +618,8 @@ public class Transitions implements RemoteCallable<Transitions>,
                return zSplitLine + numChanges - i;
            }
        } else if (mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK) {
            if (isOpening) {
            if (isOpening || (change.hasFlags(FLAG_IS_WALLPAPER)
                    && com.android.window.flags.Flags.polishCloseWallpaperIncludesOpenChange())) {
                // put on bottom and leave visible
                return zSplitLine - i;
            } else {
+2 −1
Original line number Diff line number Diff line
@@ -3571,7 +3571,8 @@ final class ActivityRecord extends WindowToken {
        }

        final Task rootTask = getRootTask();
        final boolean mayAdjustTop = (isState(RESUMED) || rootTask.getTopResumedActivity() == null)
        final boolean mayAdjustTop = !Flags.polishCloseWallpaperIncludesOpenChange()
                && (isState(RESUMED) || rootTask.getTopResumedActivity() == null)
                && rootTask.isFocusedRootTaskOnDisplay()
                // Do not adjust focus task because the task will be reused to launch new activity.
                && !task.isClearingToReuseTask();