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

Commit 99f7da7d authored by Ming-Shin Lu's avatar Ming-Shin Lu
Browse files

Fix AlwaysOnTop stack may covered by RemoteAnimation

Now with hierarachical animation, the layer of
RecentsAnimation / RemoteAnimation are controlled by system.

Now Launcher side don't need to have other way to set layer for ZBoost
case, so remove setLayer & withLayer related logics for cleaning up.

Fix: 151024899
Test: manual, launch google map app -> enter PiP mode,
      swipe up to overview screen or launch activity from shortcut,
      make sure the PiP window is not covered by other apps.

Change-Id: I8028cd50d66f7d77e5d1ec6514e953c8be9935d6
parent b20995ba
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -214,7 +214,6 @@ public class AppWindowAnimationHelper {
            float alpha;
            float cornerRadius = 0f;
            float scale = Math.max(mCurrentRect.width(), mTargetRect.width()) / crop.width();
            int layer = RemoteAnimationProvider.getLayer(app, mBoostModeTargetLayers);
            if (app.mode == params.mTargetSet.targetMode) {
                alpha = mTaskAlphaCallback.getAlpha(app, params.mTargetAlpha);
                if (app.activityType != RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME) {
@@ -251,13 +250,11 @@ public class AppWindowAnimationHelper {
                alpha = mBaseAlphaCallback.getAlpha(app, progress);
                if (ENABLE_QUICKSTEP_LIVE_TILE.get() && params.mLauncherOnTop) {
                    crop = null;
                    layer = Integer.MAX_VALUE;
                }
            }
            builder.withAlpha(alpha)
                    .withMatrix(mTmpMatrix)
                    .withWindowCrop(crop)
                    .withLayer(layer)
                    // Since radius is in Surface space, but we draw the rounded corners in screen
                    // space, we have to undo the scale
                    .withCornerRadius(cornerRadius / scale);
+0 −3
Original line number Diff line number Diff line
@@ -602,7 +602,6 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
                                .withWindowCrop(target.screenSpaceBounds)
                                .withAlpha(1f);
                    }
                    builder.withLayer(RemoteAnimationProvider.getLayer(target, MODE_OPENING));
                    params[i] = builder.build();
                }
                surfaceApplier.scheduleApply(params);
@@ -709,7 +708,6 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
                    params[i] = new SurfaceParams.Builder(target.leash)
                            .withAlpha(1f)
                            .withWindowCrop(target.screenSpaceBounds)
                            .withLayer(RemoteAnimationProvider.getLayer(target, MODE_OPENING))
                            .withCornerRadius(cornerRadius)
                            .build();
                }
@@ -766,7 +764,6 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
                    }
                    params[i] = builder
                            .withWindowCrop(target.screenSpaceBounds)
                            .withLayer(RemoteAnimationProvider.getLayer(target, MODE_CLOSING))
                            .build();
                }
                surfaceApplier.scheduleApply(params);
+1 −4
Original line number Diff line number Diff line
@@ -62,15 +62,12 @@ public abstract class RemoteAnimationProvider {
    static void prepareTargetsForFirstFrame(RemoteAnimationTargetCompat[] targets,
            TransactionCompat t, int boostModeTargets) {
        for (RemoteAnimationTargetCompat target : targets) {
            t.setLayer(target.leash, getLayer(target, boostModeTargets));
            t.show(target.leash);
        }
    }

    public static int getLayer(RemoteAnimationTargetCompat target, int boostModeTarget) {
        return target.mode == boostModeTarget
                ? Z_BOOST_BASE + target.prefixOrderIndex
                : target.prefixOrderIndex;
        return target.prefixOrderIndex;
    }

    /**