Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java +1 −10 Original line number Diff line number Diff line Loading @@ -81,11 +81,7 @@ public interface StatusBarIconController { /** Removes an icon that had come from an active tile service. */ void removeIconForTile(String slot); /** * Adds or updates an icon for the given slot for **internal system icons**. * * TODO(b/265307726): Re-name this to `setInternalIcon`. */ /** Adds or updates an icon for the given slot for **internal system icons**. */ void setIcon(String slot, int resourceId, CharSequence contentDescription); /** Loading Loading @@ -127,11 +123,6 @@ public interface StatusBarIconController { */ void removeIcon(String slot, int tag); /** * TODO(b/265307726): Re-name this to `removeAllIconsForInternalSlot`. */ void removeAllIconsForSlot(String slot); // TODO: See if we can rename this tunable name. String ICON_HIDE_LIST = "icon_blacklist"; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java +1 −7 Original line number Diff line number Diff line Loading @@ -385,13 +385,7 @@ public class StatusBarIconControllerImpl implements Tunable, } private void removeAllIconsForExternalSlot(String slotName) { removeAllIconsForSlot(createExternalSlotName(slotName)); } /** */ @Override public void removeAllIconsForSlot(String slotName) { removeAllIconsForSlot(slotName, /* fromNewPipeline */ false); removeAllIconsForSlot(createExternalSlotName(slotName), /* fromNewPipeline= */ false); } private void removeAllIconsForSlot(String slotName, boolean fromNewPipeline) { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImplTest.kt +0 −24 Original line number Diff line number Diff line Loading @@ -218,30 +218,6 @@ class StatusBarIconControllerImplTest : SysuiTestCase() { verify(iconGroup).onRemoveIcon(1) } /** Regression test for b/255428281. */ @Test fun internalAndExternalIconWithSameName_internalRemoved_viaRemoveAll_externalStays() { val slotName = "mute" // Internal underTest.setIcon(slotName, /* resourceId= */ 10, "contentDescription") // External underTest.setIconFromTile(slotName, createExternalIcon()) // WHEN the internal icon is removed via #removeAllIconsForSlot underTest.removeAllIconsForSlot(slotName) // THEN the internal icon is removed but the external icon remains assertThat(iconList.slots).hasSize(2) assertThat(iconList.slots[0].name).isEqualTo(slotName + EXTERNAL_SLOT_SUFFIX) assertThat(iconList.slots[1].name).isEqualTo(slotName) assertThat(iconList.slots[0].hasIconsInSlot()).isTrue() assertThat(iconList.slots[1].hasIconsInSlot()).isFalse() // Indicates removal verify(iconGroup).onRemoveIcon(1) } /** Regression test for b/255428281. */ @Test fun internalAndExternalIconWithSameName_internalUpdatedIndependently() { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerTest.java +0 −28 Original line number Diff line number Diff line Loading @@ -120,34 +120,6 @@ public class StatusBarIconControllerTest extends LeakCheckedTest { verify(manager, never()).onRemoveIcon(anyInt()); } @Test public void testRemoveAllIconsForSlot_ignoredForNewPipeline() { IconManager manager = mock(IconManager.class); // GIVEN the new pipeline is on StatusBarPipelineFlags flags = mock(StatusBarPipelineFlags.class); when(flags.isIconControlledByFlags("test_icon")).thenReturn(true); StatusBarIconController iconController = new StatusBarIconControllerImpl( mContext, mock(CommandQueue.class), mock(DemoModeController.class), mock(ConfigurationController.class), mock(TunerService.class), mock(DumpManager.class), mock(StatusBarIconList.class), flags ); iconController.addIconGroup(manager); // WHEN a request to remove a new icon is sent iconController.removeAllIconsForSlot("test_icon"); // THEN it is not removed for those icons verify(manager, never()).onRemoveIcon(anyInt()); } private <T extends IconManager & TestableIconManager> void testCallOnAdd_forManager(T manager) { StatusBarIconHolder holder = holderForType(TYPE_ICON); manager.onIconAdded(0, "test_slot", false, holder); Loading packages/SystemUI/tests/utils/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java +0 −4 Original line number Diff line number Diff line Loading @@ -83,10 +83,6 @@ public class FakeStatusBarIconController extends BaseLeakChecker<IconManager> public void removeIcon(String slot, int tag) { } @Override public void removeAllIconsForSlot(String slot) { } @Override public void setIconAccessibilityLiveRegion(String slot, int mode) { } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java +1 −10 Original line number Diff line number Diff line Loading @@ -81,11 +81,7 @@ public interface StatusBarIconController { /** Removes an icon that had come from an active tile service. */ void removeIconForTile(String slot); /** * Adds or updates an icon for the given slot for **internal system icons**. * * TODO(b/265307726): Re-name this to `setInternalIcon`. */ /** Adds or updates an icon for the given slot for **internal system icons**. */ void setIcon(String slot, int resourceId, CharSequence contentDescription); /** Loading Loading @@ -127,11 +123,6 @@ public interface StatusBarIconController { */ void removeIcon(String slot, int tag); /** * TODO(b/265307726): Re-name this to `removeAllIconsForInternalSlot`. */ void removeAllIconsForSlot(String slot); // TODO: See if we can rename this tunable name. String ICON_HIDE_LIST = "icon_blacklist"; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java +1 −7 Original line number Diff line number Diff line Loading @@ -385,13 +385,7 @@ public class StatusBarIconControllerImpl implements Tunable, } private void removeAllIconsForExternalSlot(String slotName) { removeAllIconsForSlot(createExternalSlotName(slotName)); } /** */ @Override public void removeAllIconsForSlot(String slotName) { removeAllIconsForSlot(slotName, /* fromNewPipeline */ false); removeAllIconsForSlot(createExternalSlotName(slotName), /* fromNewPipeline= */ false); } private void removeAllIconsForSlot(String slotName, boolean fromNewPipeline) { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImplTest.kt +0 −24 Original line number Diff line number Diff line Loading @@ -218,30 +218,6 @@ class StatusBarIconControllerImplTest : SysuiTestCase() { verify(iconGroup).onRemoveIcon(1) } /** Regression test for b/255428281. */ @Test fun internalAndExternalIconWithSameName_internalRemoved_viaRemoveAll_externalStays() { val slotName = "mute" // Internal underTest.setIcon(slotName, /* resourceId= */ 10, "contentDescription") // External underTest.setIconFromTile(slotName, createExternalIcon()) // WHEN the internal icon is removed via #removeAllIconsForSlot underTest.removeAllIconsForSlot(slotName) // THEN the internal icon is removed but the external icon remains assertThat(iconList.slots).hasSize(2) assertThat(iconList.slots[0].name).isEqualTo(slotName + EXTERNAL_SLOT_SUFFIX) assertThat(iconList.slots[1].name).isEqualTo(slotName) assertThat(iconList.slots[0].hasIconsInSlot()).isTrue() assertThat(iconList.slots[1].hasIconsInSlot()).isFalse() // Indicates removal verify(iconGroup).onRemoveIcon(1) } /** Regression test for b/255428281. */ @Test fun internalAndExternalIconWithSameName_internalUpdatedIndependently() { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerTest.java +0 −28 Original line number Diff line number Diff line Loading @@ -120,34 +120,6 @@ public class StatusBarIconControllerTest extends LeakCheckedTest { verify(manager, never()).onRemoveIcon(anyInt()); } @Test public void testRemoveAllIconsForSlot_ignoredForNewPipeline() { IconManager manager = mock(IconManager.class); // GIVEN the new pipeline is on StatusBarPipelineFlags flags = mock(StatusBarPipelineFlags.class); when(flags.isIconControlledByFlags("test_icon")).thenReturn(true); StatusBarIconController iconController = new StatusBarIconControllerImpl( mContext, mock(CommandQueue.class), mock(DemoModeController.class), mock(ConfigurationController.class), mock(TunerService.class), mock(DumpManager.class), mock(StatusBarIconList.class), flags ); iconController.addIconGroup(manager); // WHEN a request to remove a new icon is sent iconController.removeAllIconsForSlot("test_icon"); // THEN it is not removed for those icons verify(manager, never()).onRemoveIcon(anyInt()); } private <T extends IconManager & TestableIconManager> void testCallOnAdd_forManager(T manager) { StatusBarIconHolder holder = holderForType(TYPE_ICON); manager.onIconAdded(0, "test_slot", false, holder); Loading
packages/SystemUI/tests/utils/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java +0 −4 Original line number Diff line number Diff line Loading @@ -83,10 +83,6 @@ public class FakeStatusBarIconController extends BaseLeakChecker<IconManager> public void removeIcon(String slot, int tag) { } @Override public void removeAllIconsForSlot(String slot) { } @Override public void setIconAccessibilityLiveRegion(String slot, int mode) { } Loading