Loading packages/SystemUI/src/com/android/systemui/controls/controller/ControlsControllerImpl.kt +4 −2 Original line number Diff line number Diff line Loading @@ -493,10 +493,12 @@ private object Favorites { updatedStructure } else { s } if (!newStructure.controls.isEmpty()) { structures.add(newStructure) } } if (!replaced) { if (!replaced && !updatedStructure.controls.isEmpty()) { structures.add(updatedStructure) } Loading packages/SystemUI/tests/src/com/android/systemui/controls/controller/ControlsControllerImplTest.kt +11 −1 Original line number Diff line number Diff line Loading @@ -521,7 +521,7 @@ class ControlsControllerImplTest : SysuiTestCase() { } @Test fun testReplaceFavoritesForStructure_noFavorites() { fun testReplaceFavoritesForStructure_noExistingFavorites() { controller.replaceFavoritesForStructure(TEST_STRUCTURE_INFO) delayableExecutor.runAllReady() Loading @@ -530,6 +530,16 @@ class ControlsControllerImplTest : SysuiTestCase() { controller.getFavoritesForComponent(TEST_COMPONENT)) } @Test fun testReplaceFavoritesForStructure_doNotStoreEmptyStructure() { controller.replaceFavoritesForStructure( StructureInfo(TEST_COMPONENT, "Home", emptyList<ControlInfo>())) delayableExecutor.runAllReady() assertEquals(0, controller.countFavoritesForComponent(TEST_COMPONENT)) assertEquals(emptyList<ControlInfo>(), controller.getFavoritesForComponent(TEST_COMPONENT)) } @Test fun testReplaceFavoritesForStructure_differentComponentsAreFilteredOut() { controller.replaceFavoritesForStructure(TEST_STRUCTURE_INFO) Loading Loading
packages/SystemUI/src/com/android/systemui/controls/controller/ControlsControllerImpl.kt +4 −2 Original line number Diff line number Diff line Loading @@ -493,10 +493,12 @@ private object Favorites { updatedStructure } else { s } if (!newStructure.controls.isEmpty()) { structures.add(newStructure) } } if (!replaced) { if (!replaced && !updatedStructure.controls.isEmpty()) { structures.add(updatedStructure) } Loading
packages/SystemUI/tests/src/com/android/systemui/controls/controller/ControlsControllerImplTest.kt +11 −1 Original line number Diff line number Diff line Loading @@ -521,7 +521,7 @@ class ControlsControllerImplTest : SysuiTestCase() { } @Test fun testReplaceFavoritesForStructure_noFavorites() { fun testReplaceFavoritesForStructure_noExistingFavorites() { controller.replaceFavoritesForStructure(TEST_STRUCTURE_INFO) delayableExecutor.runAllReady() Loading @@ -530,6 +530,16 @@ class ControlsControllerImplTest : SysuiTestCase() { controller.getFavoritesForComponent(TEST_COMPONENT)) } @Test fun testReplaceFavoritesForStructure_doNotStoreEmptyStructure() { controller.replaceFavoritesForStructure( StructureInfo(TEST_COMPONENT, "Home", emptyList<ControlInfo>())) delayableExecutor.runAllReady() assertEquals(0, controller.countFavoritesForComponent(TEST_COMPONENT)) assertEquals(emptyList<ControlInfo>(), controller.getFavoritesForComponent(TEST_COMPONENT)) } @Test fun testReplaceFavoritesForStructure_differentComponentsAreFilteredOut() { controller.replaceFavoritesForStructure(TEST_STRUCTURE_INFO) Loading