From 5bb5e82bb72c6080fdf4a1e3eca91514fbbfaa10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Ciche=C5=84ski?= Date: Thu, 16 Mar 2023 21:41:59 +0000 Subject: [PATCH] Use equals to compare Rect instead of reference comparison. For the particular test that caught this issue we try to double click on the PiP window, but interactions are disabled if there's ongoing animation. And since this incorrect comparison triggers a new animation, it would cause that test to fail 50% of the time, depending on whether the animation finished before the tapping begins. Bug: 183746978 Test: atest ExpandPipOnDoubleClickTest Change-Id: I4e700dfe96359381924ae4e4d5df523b56bfd24e --- .../Shell/src/com/android/wm/shell/pip/phone/PipController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java index f8ecd2e995e60..0864af624192f 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java @@ -191,7 +191,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb Rect destBounds = mPipKeepClearAlgorithm.adjust(mPipBoundsState, mPipBoundsAlgorithm); // only move if the bounds are actually different - if (destBounds != mPipBoundsState.getBounds()) { + if (!destBounds.equals(mPipBoundsState.getBounds())) { if (mPipTransitionState.hasEnteredPip()) { // if already in PiP, schedule separate animation mPipTaskOrganizer.scheduleAnimateResizePip(destBounds,