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

Commit a86ce4f7 authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge "Put recents input consumer to the top of the display area" into...

Merge "Put recents input consumer to the top of the display area" into sc-v2-dev am: ac8017a9 am: 5237e622

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15937736

Change-Id: Iab278773ffb2d114955657a50d97aaa0a45d0592
parents 0e0b0ba1 5237e622
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@ import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_INPUT;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.LOGTAG_INPUT_FOCUS;

import static java.lang.Integer.MAX_VALUE;

import android.annotation.Nullable;
import android.graphics.Rect;
import android.graphics.Region;
@@ -580,10 +582,11 @@ final class InputMonitor {
            if (mAddRecentsAnimationInputConsumerHandle && shouldApplyRecentsInputConsumer) {
                if (recentsAnimationController.updateInputConsumerForApp(
                        mRecentsAnimationInputConsumer.mWindowHandle)) {
                    final WindowState highestLayerWindow =
                            recentsAnimationController.getHighestLayerWindow();
                    if (highestLayerWindow != null) {
                        mRecentsAnimationInputConsumer.show(mInputTransaction, highestLayerWindow);
                    final DisplayArea targetDA =
                            recentsAnimationController.getTargetAppDisplayArea();
                    if (targetDA != null) {
                        mRecentsAnimationInputConsumer.reparent(mInputTransaction, targetDA);
                        mRecentsAnimationInputConsumer.show(mInputTransaction, MAX_VALUE - 1);
                        mAddRecentsAnimationInputConsumerHandle = false;
                    }
                }
@@ -596,7 +599,7 @@ final class InputMonitor {
                            rootTask.getSurfaceControl());
                    // We set the layer to z=MAX-1 so that it's always on top.
                    mPipInputConsumer.reparent(mInputTransaction, rootTask);
                    mPipInputConsumer.show(mInputTransaction, Integer.MAX_VALUE - 1);
                    mPipInputConsumer.show(mInputTransaction, MAX_VALUE - 1);
                    mAddPipInputConsumerHandle = false;
                }
            }
+4 −14
Original line number Diff line number Diff line
@@ -1125,21 +1125,11 @@ public class RecentsAnimationController implements DeathRecipient {
        return mTargetActivityRecord.findMainWindow();
    }

    /**
     * Returns the window with the highest layer, or null if none is found.
     */
    public WindowState getHighestLayerWindow() {
        int highestLayer = Integer.MIN_VALUE;
        Task highestLayerTask = null;
        for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
            TaskAnimationAdapter adapter = mPendingAnimations.get(i);
            int layer = adapter.mTask.getPrefixOrderIndex();
            if (layer > highestLayer) {
                highestLayer = layer;
                highestLayerTask = adapter.mTask;
            }
    DisplayArea getTargetAppDisplayArea() {
        if (mTargetActivityRecord == null) {
            return null;
        }
        return highestLayerTask.getTopMostActivity().getTopChild();
        return mTargetActivityRecord.getDisplayArea();
    }

    boolean isAnimatingTask(Task task) {