From f303903a458d03a7f2528faebf450b59a36aa83b Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Wed, 22 Jun 2022 16:08:05 -0700 Subject: [PATCH] Do not filter MediaDreamComplication. This changelist removes the type filter for MediaDreamComplication, allowing it to show over any dream. Test: atest DreamOverlayStateControllerTest#testComplicationWithNoTypeNotFiltered Fixes: 236080038 Change-Id: Idbfbd59b1277705a1e67aeff900d860681ca53cb --- .../systemui/media/dream/MediaDreamComplication.java | 5 ----- .../dreams/DreamOverlayStateControllerTest.java | 11 +++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/media/dream/MediaDreamComplication.java b/packages/SystemUI/src/com/android/systemui/media/dream/MediaDreamComplication.java index 7c0481049098d..2c35db337cdac 100644 --- a/packages/SystemUI/src/com/android/systemui/media/dream/MediaDreamComplication.java +++ b/packages/SystemUI/src/com/android/systemui/media/dream/MediaDreamComplication.java @@ -36,11 +36,6 @@ public class MediaDreamComplication implements Complication { mComponentFactory = componentFactory; } - @Override - public int getRequiredTypeAvailability() { - return COMPLICATION_TYPE_CAST_INFO; - } - @Override public ViewHolder createView(ComplicationViewModel model) { return mComponentFactory.create().getViewHolder(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java index fb64c7b58aacd..2adf2857a3858 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java @@ -207,4 +207,15 @@ public class DreamOverlayStateControllerTest extends SysuiTestCase { assertThat(complications.contains(weatherComplication)).isFalse(); } } + + @Test + public void testComplicationWithNoTypeNotFiltered() { + final Complication complication = Mockito.mock(Complication.class); + final DreamOverlayStateController stateController = + new DreamOverlayStateController(mExecutor); + stateController.addComplication(complication); + mExecutor.runAllReady(); + assertThat(stateController.getComplications(true).contains(complication)) + .isTrue(); + } }