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

Commit 6453ef48 authored by lumark's avatar lumark Committed by Ming-Shin Lu
Browse files

Fix transition for non-wallpaper activity.

for task_close_enter / task_close_exit activity animation,
the default set showWallpaper as true,
so WallpaperController find wallpaper target will set
non-wallpaper activity as wallpaper target according
Animation.getShowWallpaper().

the case can see when tap an non-wallpaper activity start
another non-wallpaper activity, before transition finish then
press back quickly will found the animation will changed,

It result the transition type will be TRANSIT_WALLPAPER_CLOSE
rather then TRANSIT_TASK_CLOSE when 2 non-wallpaper activities
launch / finish case.

since we don't want to change the transition for this case,
check if wallpaper target has FLAG_SHOW_WALLPAPER, if don't,
won't need to change the transition type.

Bug: 75261877
Test: atest ActivityManagerTransitionSelectionTests
Change-Id: Ibbe09e9194b474d1221359ecc7dc62d9fbd5f462
parent e20cd739
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.wm;

import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
import static android.view.WindowManager.TRANSIT_ACTIVITY_CLOSE;
import static android.view.WindowManager.TRANSIT_ACTIVITY_OPEN;
import static android.view.WindowManager.TRANSIT_CRASHING_ACTIVITY_CLOSE;
@@ -636,10 +637,15 @@ class WindowSurfacePlacer {
            return transit;
        }

        // if wallpaper is animating in or out set oldWallpaper to null else to wallpaper
        final WindowState wallpaperTarget = mWallpaperControllerLocked.getWallpaperTarget();
        final WindowState oldWallpaper = mWallpaperControllerLocked.isWallpaperTargetAnimating()
                ? null : wallpaperTarget;
        final boolean showWallpaper = wallpaperTarget != null
                && (wallpaperTarget.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0;
        // If wallpaper is animating or wallpaperTarget doesn't have SHOW_WALLPAPER flag set,
        // don't consider upgrading to wallpaper transition.
        final WindowState oldWallpaper =
                (mWallpaperControllerLocked.isWallpaperTargetAnimating() || !showWallpaper)
                        ? null
                        : wallpaperTarget;
        final ArraySet<AppWindowToken> openingApps = mService.mOpeningApps;
        final ArraySet<AppWindowToken> closingApps = mService.mClosingApps;
        final AppWindowToken topOpeningApp = getTopApp(mService.mOpeningApps,