Merge "Fix regression in adding recents input consumer leading to ANR" into rvc-dev
This commit is contained in:
@@ -469,8 +469,12 @@ final class InputMonitor {
|
|||||||
public void accept(WindowState w) {
|
public void accept(WindowState w) {
|
||||||
final InputChannel inputChannel = w.mInputChannel;
|
final InputChannel inputChannel = w.mInputChannel;
|
||||||
final InputWindowHandle inputWindowHandle = w.mInputWindowHandle;
|
final InputWindowHandle inputWindowHandle = w.mInputWindowHandle;
|
||||||
|
final RecentsAnimationController recentsAnimationController =
|
||||||
|
mService.getRecentsAnimationController();
|
||||||
|
final boolean shouldApplyRecentsInputConsumer = recentsAnimationController != null
|
||||||
|
&& recentsAnimationController.shouldApplyInputConsumer(w.mActivityRecord);
|
||||||
if (inputChannel == null || inputWindowHandle == null || w.mRemoved
|
if (inputChannel == null || inputWindowHandle == null || w.mRemoved
|
||||||
|| w.cantReceiveTouchInput()) {
|
|| (w.cantReceiveTouchInput() && !shouldApplyRecentsInputConsumer)) {
|
||||||
if (w.mWinAnimator.hasSurface()) {
|
if (w.mWinAnimator.hasSurface()) {
|
||||||
mInputTransaction.setInputWindowInfo(
|
mInputTransaction.setInputWindowInfo(
|
||||||
w.mWinAnimator.mSurfaceController.getClientViewRootSurface(),
|
w.mWinAnimator.mSurfaceController.getClientViewRootSurface(),
|
||||||
@@ -486,22 +490,16 @@ final class InputMonitor {
|
|||||||
final boolean hasFocus = w.isFocused();
|
final boolean hasFocus = w.isFocused();
|
||||||
final boolean isVisible = w.isVisibleLw();
|
final boolean isVisible = w.isVisibleLw();
|
||||||
|
|
||||||
if (mAddRecentsAnimationInputConsumerHandle) {
|
if (mAddRecentsAnimationInputConsumerHandle && shouldApplyRecentsInputConsumer) {
|
||||||
final RecentsAnimationController recentsAnimationController =
|
if (recentsAnimationController.updateInputConsumerForApp(
|
||||||
mService.getRecentsAnimationController();
|
mRecentsAnimationInputConsumer.mWindowHandle, hasFocus)) {
|
||||||
if (recentsAnimationController != null
|
mRecentsAnimationInputConsumer.show(mInputTransaction, w);
|
||||||
&& recentsAnimationController.shouldApplyInputConsumer(w.mActivityRecord)) {
|
mAddRecentsAnimationInputConsumerHandle = false;
|
||||||
if (recentsAnimationController.updateInputConsumerForApp(
|
|
||||||
mRecentsAnimationInputConsumer.mWindowHandle, hasFocus)) {
|
|
||||||
mRecentsAnimationInputConsumer.show(mInputTransaction, w);
|
|
||||||
mAddRecentsAnimationInputConsumerHandle = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w.inPinnedWindowingMode()) {
|
if (w.inPinnedWindowingMode()) {
|
||||||
if (mAddPipInputConsumerHandle) {
|
if (mAddPipInputConsumerHandle) {
|
||||||
|
|
||||||
final Task rootTask = w.getTask().getRootTask();
|
final Task rootTask = w.getTask().getRootTask();
|
||||||
mPipInputConsumer.mWindowHandle.replaceTouchableRegionWithCrop(
|
mPipInputConsumer.mWindowHandle.replaceTouchableRegionWithCrop(
|
||||||
rootTask.getSurfaceControl());
|
rootTask.getSurfaceControl());
|
||||||
|
|||||||
@@ -799,7 +799,8 @@ public class RecentsAnimationController implements DeathRecipient {
|
|||||||
// Only apply the input consumer if it is enabled, it is not the target (home/recents)
|
// Only apply the input consumer if it is enabled, it is not the target (home/recents)
|
||||||
// being revealed with the transition, and we are actively animating the app as a part of
|
// being revealed with the transition, and we are actively animating the app as a part of
|
||||||
// the animation
|
// the animation
|
||||||
return mInputConsumerEnabled && !isTargetApp(activity) && isAnimatingApp(activity);
|
return mInputConsumerEnabled && activity != null
|
||||||
|
&& !isTargetApp(activity) && isAnimatingApp(activity);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean updateInputConsumerForApp(InputWindowHandle inputWindowHandle,
|
boolean updateInputConsumerForApp(InputWindowHandle inputWindowHandle,
|
||||||
|
|||||||
Reference in New Issue
Block a user