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

Commit 7c66d275 authored by Hongwei Wang's avatar Hongwei Wang Committed by Android (Google) Code Review
Browse files

Merge "No PiP position update when unlock" into main

parents 56b7341b 002e9353
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.wm.shell.shared;

import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.view.RemoteAnimationTarget.MODE_CHANGING;
import static android.view.RemoteAnimationTarget.MODE_CLOSING;
import static android.view.RemoteAnimationTarget.MODE_OPENING;
@@ -124,6 +125,12 @@ public class TransitionUtil {
        return isNonApp(change) && change.hasFlags(FLAG_IS_DIVIDER_BAR);
    }

    /** Returns `true` if `change` is a pinned Task. */
    private static boolean isPipTask(TransitionInfo.Change change) {
        return change.getTaskInfo() != null
                && change.getTaskInfo().getWindowingMode() == WINDOWING_MODE_PINNED;
    }

    /** Returns `true` if `change` is an app's dim layer. */
    public static boolean isDimLayer(TransitionInfo.Change change) {
        return isNonApp(change) && change.hasFlags(FLAG_IS_DIM_LAYER);
@@ -310,9 +317,10 @@ public class TransitionUtil {
            // actual dim value).
            t.setAlpha(change.getLeash(), 1.0f);
        }
        if (!isDividerBar(change)) {
            // For divider, don't modify its inner leash position when creating the outer leash
            // for the transition. In case the position being wrong after the transition finished.
        if (!isDividerBar(change) && !isPipTask(change)) {
            // For certain components such as Divider and PiP, don't modify its inner leash
            // position when creating the outer leash for the transition. In case the position
            // being wrong after the transition finished.
            t.setPosition(change.getLeash(), 0, 0);
        }
        t.setLayer(change.getLeash(), 0);