Use isInTransition() to detect animations

Shell transitions and isAnimating aren't friends. isInTransition
captures both legacy animations and shell transitions

Bug: 208662670
Bug: 216199003
Test: atest android.server.wm.WindowUntrustedTouchTest (with and without
shell transitions enabled)

Change-Id: I0b7595d2ff69205ed7ffaf2f647677cabe6edde8
This commit is contained in:
Linus Tufvesson
2022-02-28 15:45:52 +00:00
parent 09076f0af2
commit 13c21a5ccf

View File

@@ -16,10 +16,6 @@
package com.android.server.wm;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
import android.app.compat.CompatChanges;
import android.compat.annotation.ChangeId;
import android.os.IBinder;
@@ -101,8 +97,7 @@ class ActivityRecordInputSink {
mToken = inputChannel.getToken();
mInputEventReceiver = createInputEventReceiver(inputChannel);
}
if (mDisabled || !mIsCompatEnabled || mActivityRecord.isAnimating(TRANSITION | PARENTS,
ANIMATION_TYPE_APP_TRANSITION)) {
if (mDisabled || !mIsCompatEnabled || mActivityRecord.isInTransition()) {
// TODO(b/208662670): Investigate if we can have feature active during animations.
mInputWindowHandleWrapper.setToken(null);
} else {