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

Commit f9d9688f authored by Orhan Uysal's avatar Orhan Uysal
Browse files

Add a flag for DesktopWallpaperActivity changes.

Add a new flag to mark changes on DesktopWallpaperActivity. Then use
then use this flag to set the launcher alpha to 0 on legacy
RemoteAnimationRunnerCompat.

Fix: 380868195
Test: m & Use back navigation on settings app in desktop mode, observe
that there is no launcher appearing twice
Flag: EXEMPT Bugfix

Change-Id: I2e184e4e78a4a3951f7faa1531a9bc17495ff8a5
parent dd8976be
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ public final class TransitionInfo implements Parcelable {
            FLAG_CONFIG_AT_END,
            FLAG_IS_TASK_DISPLAY_AREA,
            FLAG_FIRST_CUSTOM
    }, flag = true)
    })
    public @interface ChangeFlags {}

    private final @TransitionType int mType;
+3 −1
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.TaskInfo;
import android.app.WindowConfiguration;
import android.graphics.Rect;
import android.util.ArrayMap;
@@ -57,6 +56,9 @@ public class TransitionUtil {
    /** Flag applied to a transition change to identify it as a divider bar for animation. */
    public static final int FLAG_IS_DIVIDER_BAR = FLAG_FIRST_CUSTOM;

    /** Flag applied to a transition change to identify it as a desktop wallpaper activity. */
    public static final int FLAG_IS_DESKTOP_WALLPAPER_ACTIVITY = FLAG_FIRST_CUSTOM << 1;

    /** @return true if the transition was triggered by opening something vs closing something */
    public static boolean isOpeningType(@WindowManager.TransitionType int type) {
        return type == TRANSIT_OPEN
+10 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPI

import static com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived;
import static com.android.window.flags.Flags.ensureWallpaperInTransitions;
import static com.android.wm.shell.shared.TransitionUtil.FLAG_IS_DESKTOP_WALLPAPER_ACTIVITY;
import static com.android.wm.shell.shared.TransitionUtil.isClosingType;
import static com.android.wm.shell.shared.TransitionUtil.isOpeningType;

@@ -84,6 +85,7 @@ import com.android.wm.shell.common.ExternalInterfaceBinder;
import com.android.wm.shell.common.RemoteCallable;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.desktopmode.DesktopModeTransitionTypes;
import com.android.wm.shell.desktopmode.DesktopWallpaperActivity;
import com.android.wm.shell.keyguard.KeyguardTransitionHandler;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
import com.android.wm.shell.shared.FocusTransitionListener;
@@ -795,6 +797,14 @@ public class Transitions implements RemoteCallable<Transitions>,
            mReadyDuringSync.remove(active);
        }

        // If any of the changes are on DesktopWallpaperActivity, add the flag to the change.
        for (TransitionInfo.Change change : info.getChanges()) {
            if (change.getTaskInfo() != null
                    && DesktopWallpaperActivity.isWallpaperTask(change.getTaskInfo())) {
                change.setFlags(FLAG_IS_DESKTOP_WALLPAPER_ACTIVITY);
            }
        }

        final Track track = getOrCreateTrack(info.getTrack());
        track.mReadyTransitions.add(active);

+1 −0
Original line number Diff line number Diff line
@@ -1781,6 +1781,7 @@ public class ShellTransitionTests extends ShellTestCase {
        taskInfo.configuration.windowConfiguration.setWindowingMode(windowingMode);
        taskInfo.configuration.windowConfiguration.setActivityType(activityType);
        taskInfo.token = mock(WindowContainerToken.class);
        taskInfo.baseIntent = mock(Intent.class);
        return taskInfo;
    }

+3 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import static android.window.DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_EXIT_TRAN
import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;

import static com.android.internal.util.Preconditions.checkArgument;
import static com.android.wm.shell.shared.TransitionUtil.FLAG_IS_DESKTOP_WALLPAPER_ACTIVITY;
import static com.android.wm.shell.shared.TransitionUtil.isClosingMode;
import static com.android.wm.shell.shared.TransitionUtil.isClosingType;
import static com.android.wm.shell.shared.TransitionUtil.isOpeningMode;
@@ -270,7 +271,8 @@ public abstract class RemoteAnimationRunnerCompat extends IRemoteAnimationRunner
            // skip changes that we didn't wrap
            if (!leashMap.containsKey(change.getLeash())) continue;
            // Only make the update if we are closing Desktop tasks.
            if (change.getTaskInfo() != null && change.getTaskInfo().isFreeform()
            if (change.getTaskInfo() != null && (change.getTaskInfo().isFreeform()
                    || change.hasFlags(FLAG_IS_DESKTOP_WALLPAPER_ACTIVITY))
                    && isClosingMode(change.getMode())) {
                startTransaction.setAlpha(leashMap.get(launcherChange.getLeash()), 0f);
                return;