summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java8
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImplTest.kt24
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerTest.java28
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java4
5 files changed, 2 insertions, 73 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
index d5cb6b6606c0..4878d45cec84 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
@@ -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);
/**
@@ -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";
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
index 553cbc5f0803..0f4d68c68d00 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
@@ -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) {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImplTest.kt
index 08e89fbef486..6f04f369d52f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImplTest.kt
@@ -220,30 +220,6 @@ class StatusBarIconControllerImplTest : SysuiTestCase() {
/** 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() {
val slotName = "mute"
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerTest.java
index 085ec27a4e6b..0ff6f200d402 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarIconControllerTest.java
@@ -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);
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java b/packages/SystemUI/tests/utils/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java
index 03e3423a3dd5..3774d1d16e4e 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/utils/leaks/FakeStatusBarIconController.java
@@ -84,10 +84,6 @@ public class FakeStatusBarIconController extends BaseLeakChecker<IconManager>
}
@Override
- public void removeAllIconsForSlot(String slot) {
- }
-
- @Override
public void setIconAccessibilityLiveRegion(String slot, int mode) {
}