diff options
| author | 2022-12-19 22:39:17 +0000 | |
|---|---|---|
| committer | 2022-12-19 22:39:17 +0000 | |
| commit | 976aca3b08336d770afe8c22f7e1f985d875c1cb (patch) | |
| tree | 83e36d917cd0ada329a5dc136fae8f51719dd6b6 | |
| parent | 6982e2fa42e37362e039ed48346eccd8f8e17319 (diff) | |
| parent | fae175b75f53551af25f6916e03eb45fd142094f (diff) | |
Merge "Ensure Bubbles get removed at the end of the test" into tm-qpr-dev am: fae175b75f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20622127
Change-Id: I1a2d5f48e3c017626a1c64d0871b672efc87b920
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java | 6 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index 2b7600cbfe53..f2afefe243bc 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -2923,8 +2923,10 @@ public class BubbleStackView extends FrameLayout .withEndActions(() -> { View child = mManageMenu.getChildAt(0); child.requestAccessibilityFocus(); - // Update the AV's obscured touchable region for the new visibility state. - mExpandedBubble.getExpandedView().updateObscuredTouchableRegion(); + if (mExpandedBubble != null && mExpandedBubble.getExpandedView() != null) { + // Update the AV's obscured touchable region for the new state. + mExpandedBubble.getExpandedView().updateObscuredTouchableRegion(); + } }) .start(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java index b9dfc27483b8..2e06cc544c63 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java @@ -77,7 +77,6 @@ import android.view.View; import android.view.ViewTreeObserver; import android.view.WindowManager; -import androidx.test.filters.FlakyTest; import androidx.test.filters.SmallTest; import com.android.internal.colorextraction.ColorExtractor; @@ -142,6 +141,7 @@ import com.android.wm.shell.sysui.ShellCommandHandler; import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.sysui.ShellInit; +import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -152,13 +152,13 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.stubbing.Answer; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Optional; -@FlakyTest @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper(setAsMainLooper = true) @@ -411,6 +411,15 @@ public class BubblesTest extends SysuiTestCase { .addCallback(mKeyguardStateControllerCallbackCaptor.capture()); } + @After + public void tearDown() { + ArrayList<Bubble> bubbles = new ArrayList<>(mBubbleData.getBubbles()); + for (int i = 0; i < bubbles.size(); i++) { + mBubbleController.removeBubble(bubbles.get(i).getKey(), + Bubbles.DISMISS_NO_LONGER_BUBBLE); + } + } + @Test public void dreamingHidesBubbles() throws RemoteException { mBubbleController.updateBubble(mBubbleEntry); |