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

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

Merge "Make sure recents animation input consumer is above the top task" into...

Merge "Make sure recents animation input consumer is above the top task" into sc-v2-dev am: 97c59ee5 am: 099ac81c

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

Change-Id: I0837055493284d60056737722ccd109df154ea8f
parents 0087d025 099ac81c
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -538,7 +538,8 @@ final class InputMonitor {
            if (mAddRecentsAnimationInputConsumerHandle && shouldApplyRecentsInputConsumer) {
            if (mAddRecentsAnimationInputConsumerHandle && shouldApplyRecentsInputConsumer) {
                if (recentsAnimationController.updateInputConsumerForApp(
                if (recentsAnimationController.updateInputConsumerForApp(
                        mRecentsAnimationInputConsumer.mWindowHandle)) {
                        mRecentsAnimationInputConsumer.mWindowHandle)) {
                    mRecentsAnimationInputConsumer.show(mInputTransaction, w.mActivityRecord);
                    mRecentsAnimationInputConsumer.show(mInputTransaction,
                            recentsAnimationController.getHighestLayerTask());
                    mAddRecentsAnimationInputConsumerHandle = false;
                    mAddRecentsAnimationInputConsumerHandle = false;
                }
                }
            }
            }
+17 −0
Original line number Original line Diff line number Diff line
@@ -1102,6 +1102,23 @@ public class RecentsAnimationController implements DeathRecipient {
        return mTargetActivityRecord.findMainWindow();
        return mTargetActivityRecord.findMainWindow();
    }
    }


    /**
     * Returns the task with the highest layer, or null if none is found.
     */
    public Task getHighestLayerTask() {
        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;
            }
        }
        return highestLayerTask;
    }

    boolean isAnimatingTask(Task task) {
    boolean isAnimatingTask(Task task) {
        for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
        for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
            if (task == mPendingAnimations.get(i).mTask) {
            if (task == mPendingAnimations.get(i).mTask) {