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

Commit 002e9353 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

No PiP position update when unlock

KeyguardService#wrap attempts to call TransitionUtil#createLeash for all
existing Tasks and reset them to (0, 0), which would cause flicker when
unlock with PiP being present.

Flag: EXEMPT bugfix
Bug: 416299223
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/fvJW62TYq575AS2SDcBYuA
Test: Repeatedly lock and unlock with PiP being represent, see Video
Change-Id: Id03554324ef50a94ac9767076f8668d6c7e1f0cf
parent 6e9fc6c7
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);