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

Commit 44688c9c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Cleanup drop input for AE during legacy transition"" into main

parents bcf1a9c3 fba736f1
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -813,6 +813,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    /** The last set {@link DropInputMode} for this activity surface. */
    @DropInputMode
    private int mLastDropInputMode = DropInputMode.NONE;
    /** Whether the input to this activity will be dropped during the current playing animation. */
    private boolean mIsInputDroppedForAnimation;

    /**
     * Whether the application has desk mode resources. Calculated and cached when
@@ -1647,6 +1649,15 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }
    }

    /** Sets if all input will be dropped as a protection during the client-driven animation. */
    void setDropInputForAnimation(boolean isInputDroppedForAnimation) {
        if (mIsInputDroppedForAnimation == isInputDroppedForAnimation) {
            return;
        }
        mIsInputDroppedForAnimation = isInputDroppedForAnimation;
        updateUntrustedEmbeddingInputProtection();
    }

    /**
     * Sets to drop input when obscured to activity if it is embedded in untrusted mode.
     *
@@ -1659,7 +1670,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (getSurfaceControl() == null) {
            return;
        }
        if (isEmbeddedInUntrustedMode()) {
        if (mIsInputDroppedForAnimation) {
            // Disable all input during the animation.
            setDropInputMode(DropInputMode.ALL);
        } else if (isEmbeddedInUntrustedMode()) {
            // Set drop input to OBSCURED when untrusted embedded.
            setDropInputMode(DropInputMode.OBSCURED);
        } else {
+5 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.function.Consumer;

/**
 * Helper class to run app animations in a remote process.
@@ -348,6 +349,10 @@ class RemoteAnimationController implements DeathRecipient {
            } finally {
                mIsFinishing = false;
            }
            // Reset input for all activities when the remote animation is finished.
            final Consumer<ActivityRecord> updateActivities =
                    activity -> activity.setDropInputForAnimation(false);
            mDisplayContent.forAllActivities(updateActivities);
        }
        setRunningRemoteAnimation(false);
        ProtoLog.i(WM_DEBUG_REMOTE_ANIMATIONS, "Finishing remote animation");