From 5a1bf547615a68070c34543882693bd6af9804af Mon Sep 17 00:00:00 2001 From: Chris Göllner Date: Fri, 2 Aug 2024 15:07:30 +0100 Subject: Clean up launched bug fix flag "truncated_status_bar_icons_fix" Flag: EXEMPT removing com.android.systemui.truncated_status_bar_icons_fix Test: N/A Bug: 323299264 Change-Id: I221313ed902d31d4992e06da71cde474798a54e3 --- packages/SystemUI/aconfig/systemui.aconfig | 11 ----- .../statusbar/phone/CentralSurfacesImpl.java | 6 --- .../statusbar/phone/PhoneStatusBarView.java | 9 +--- .../statusbar/phone/CentralSurfacesImplTest.java | 11 +---- .../statusbar/phone/PhoneStatusBarViewTest.kt | 56 ++++------------------ 5 files changed, 12 insertions(+), 81 deletions(-) diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig index eb9d0ab9d42c..f88db99ea417 100644 --- a/packages/SystemUI/aconfig/systemui.aconfig +++ b/packages/SystemUI/aconfig/systemui.aconfig @@ -362,17 +362,6 @@ flag { bug: "308676488" } -flag { - name: "truncated_status_bar_icons_fix" - namespace: "systemui" - description: "Fixes the status bar icons being trunacted due to the status bar window height " - "not being updated after certain rotations" - bug: "323299264" - metadata { - purpose: PURPOSE_BUGFIX - } -} - flag { name: "status_bar_monochrome_icons_fix" namespace: "systemui" diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index 462ae7ab39cb..05641c32f74f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -30,7 +30,6 @@ import static com.android.systemui.Dependency.TIME_TICK_HANDLER_NAME; import static com.android.systemui.Flags.keyboardShortcutHelperRewrite; import static com.android.systemui.Flags.lightRevealMigration; import static com.android.systemui.Flags.newAodTransition; -import static com.android.systemui.Flags.truncatedStatusBarIconsFix; import static com.android.systemui.charging.WirelessChargingAnimation.UNKNOWN_BATTERY_LEVEL; import static com.android.systemui.flags.Flags.SHORTCUT_LIST_SEARCH_LAYOUT; import static com.android.systemui.statusbar.NotificationLockscreenUserManager.PERMISSION_SELF; @@ -1936,11 +1935,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mQSPanelController.updateResources(); } - if (!truncatedStatusBarIconsFix()) { - if (mStatusBarWindowController != null) { - mStatusBarWindowController.refreshStatusBarHeight(); - } - } if (mShadeSurface != null) { mShadeSurface.updateResources(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index 6b47ac113928..8115c36c31e2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -17,7 +17,6 @@ package com.android.systemui.statusbar.phone; -import static com.android.systemui.Flags.truncatedStatusBarIconsFix; import android.annotation.Nullable; import android.content.Context; @@ -108,9 +107,7 @@ public class PhoneStatusBarView extends FrameLayout { Dependency.get(DarkIconDispatcher.class).addDarkReceiver(mClock); if (updateDisplayParameters()) { updateLayoutForCutout(); - if (truncatedStatusBarIconsFix()) { - updateWindowHeight(); - } + updateWindowHeight(); } } @@ -135,9 +132,7 @@ public class PhoneStatusBarView extends FrameLayout { updateLayoutForCutout(); requestLayout(); } - if (truncatedStatusBarIconsFix()) { - updateWindowHeight(); - } + updateWindowHeight(); } void onDensityOrFontScaleChanged() { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java index d2540a64bd79..7cd446d96fc8 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java @@ -1155,21 +1155,12 @@ public class CentralSurfacesImplTest extends SysuiTestCase { } @Test - @EnableFlags(com.android.systemui.Flags.FLAG_TRUNCATED_STATUS_BAR_ICONS_FIX) - public void updateResources_flagEnabled_doesNotUpdateStatusBarWindowHeight() { + public void updateResources_doesNotUpdateStatusBarWindowHeight() { mCentralSurfaces.updateResources(); verify(mStatusBarWindowController, never()).refreshStatusBarHeight(); } - @Test - @DisableFlags(com.android.systemui.Flags.FLAG_TRUNCATED_STATUS_BAR_ICONS_FIX) - public void updateResources_flagDisabled_updatesStatusBarWindowHeight() { - mCentralSurfaces.updateResources(); - - verify(mStatusBarWindowController).refreshStatusBarHeight(); - } - @Test @EnableSceneContainer public void brightnesShowingChanged_flagEnabled_ScrimControllerNotified() { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewTest.kt index fd2dead02c6c..ab81598a4317 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewTest.kt @@ -30,7 +30,6 @@ import android.view.View import android.view.WindowInsets import android.widget.FrameLayout import androidx.test.filters.SmallTest -import com.android.systemui.Flags import com.android.systemui.Gefingerpoken import com.android.systemui.SysuiTestCase import com.android.systemui.plugins.DarkIconDispatcher @@ -41,7 +40,6 @@ import com.android.systemui.util.mockito.whenever import com.google.common.truth.Truth.assertThat import org.junit.Before import org.junit.Test -import org.mockito.Mockito.never import org.mockito.Mockito.spy import org.mockito.Mockito.times import org.mockito.Mockito.verify @@ -123,36 +121,21 @@ class PhoneStatusBarViewTest : SysuiTestCase() { } @Test - fun onAttachedToWindow_flagEnabled_updatesWindowHeight() { - mSetFlagsRule.enableFlags(Flags.FLAG_TRUNCATED_STATUS_BAR_ICONS_FIX) - + fun onAttachedToWindow_updatesWindowHeight() { view.onAttachedToWindow() verify(windowController).refreshStatusBarHeight() } @Test - fun onAttachedToWindow_flagDisabled_doesNotUpdateWindowHeight() { - mSetFlagsRule.disableFlags(Flags.FLAG_TRUNCATED_STATUS_BAR_ICONS_FIX) - - view.onAttachedToWindow() - - verify(windowController, never()).refreshStatusBarHeight() - } - - @Test - fun onConfigurationChanged_flagEnabled_updatesWindowHeight() { - mSetFlagsRule.enableFlags(Flags.FLAG_TRUNCATED_STATUS_BAR_ICONS_FIX) - + fun onConfigurationChanged_updatesWindowHeight() { view.onConfigurationChanged(Configuration()) verify(windowController).refreshStatusBarHeight() } @Test - fun onConfigurationChanged_multipleCalls_flagEnabled_updatesWindowHeightMultipleTimes() { - mSetFlagsRule.enableFlags(Flags.FLAG_TRUNCATED_STATUS_BAR_ICONS_FIX) - + fun onConfigurationChanged_multipleCalls_updatesWindowHeightMultipleTimes() { view.onConfigurationChanged(Configuration()) view.onConfigurationChanged(Configuration()) view.onConfigurationChanged(Configuration()) @@ -161,30 +144,9 @@ class PhoneStatusBarViewTest : SysuiTestCase() { verify(windowController, times(4)).refreshStatusBarHeight() } - @Test - fun onConfigurationChanged_flagDisabled_doesNotUpdateWindowHeight() { - mSetFlagsRule.disableFlags(Flags.FLAG_TRUNCATED_STATUS_BAR_ICONS_FIX) - - view.onConfigurationChanged(Configuration()) - - verify(windowController, never()).refreshStatusBarHeight() - } - - @Test - fun onConfigurationChanged_multipleCalls_flagDisabled_doesNotUpdateWindowHeight() { - mSetFlagsRule.disableFlags(Flags.FLAG_TRUNCATED_STATUS_BAR_ICONS_FIX) - - view.onConfigurationChanged(Configuration()) - view.onConfigurationChanged(Configuration()) - view.onConfigurationChanged(Configuration()) - view.onConfigurationChanged(Configuration()) - - verify(windowController, never()).refreshStatusBarHeight() - } - @Test fun onAttachedToWindow_updatesLeftTopRightPaddingsBasedOnInsets() { - val insets = Insets.of(/* left = */ 10, /* top = */ 20, /* right = */ 30, /* bottom = */ 40) + val insets = Insets.of(/* left= */ 10, /* top= */ 20, /* right= */ 30, /* bottom= */ 40) whenever(contentInsetsProvider.getStatusBarContentInsetsForCurrentRotation()) .thenReturn(insets) @@ -198,7 +160,7 @@ class PhoneStatusBarViewTest : SysuiTestCase() { @Test fun onConfigurationChanged_updatesLeftTopRightPaddingsBasedOnInsets() { - val insets = Insets.of(/* left = */ 40, /* top = */ 30, /* right = */ 20, /* bottom = */ 10) + val insets = Insets.of(/* left= */ 40, /* top= */ 30, /* right= */ 20, /* bottom= */ 10) whenever(contentInsetsProvider.getStatusBarContentInsetsForCurrentRotation()) .thenReturn(insets) @@ -213,7 +175,7 @@ class PhoneStatusBarViewTest : SysuiTestCase() { @Test fun onConfigurationChanged_noRelevantChange_doesNotUpdateInsets() { val previousInsets = - Insets.of(/* left = */ 40, /* top = */ 30, /* right = */ 20, /* bottom = */ 10) + Insets.of(/* left= */ 40, /* top= */ 30, /* right= */ 20, /* bottom= */ 10) whenever(contentInsetsProvider.getStatusBarContentInsetsForCurrentRotation()) .thenReturn(previousInsets) context.orCreateTestableResources.overrideConfiguration(Configuration()) @@ -233,7 +195,7 @@ class PhoneStatusBarViewTest : SysuiTestCase() { @Test fun onConfigurationChanged_densityChanged_updatesInsets() { val previousInsets = - Insets.of(/* left = */ 40, /* top = */ 30, /* right = */ 20, /* bottom = */ 10) + Insets.of(/* left= */ 40, /* top= */ 30, /* right= */ 20, /* bottom= */ 10) whenever(contentInsetsProvider.getStatusBarContentInsetsForCurrentRotation()) .thenReturn(previousInsets) val configuration = Configuration() @@ -256,7 +218,7 @@ class PhoneStatusBarViewTest : SysuiTestCase() { @Test fun onConfigurationChanged_fontScaleChanged_updatesInsets() { val previousInsets = - Insets.of(/* left = */ 40, /* top = */ 30, /* right = */ 20, /* bottom = */ 10) + Insets.of(/* left= */ 40, /* top= */ 30, /* right= */ 20, /* bottom= */ 10) whenever(contentInsetsProvider.getStatusBarContentInsetsForCurrentRotation()) .thenReturn(previousInsets) val configuration = Configuration() @@ -291,7 +253,7 @@ class PhoneStatusBarViewTest : SysuiTestCase() { @Test fun onApplyWindowInsets_updatesLeftTopRightPaddingsBasedOnInsets() { - val insets = Insets.of(/* left = */ 90, /* top = */ 10, /* right = */ 45, /* bottom = */ 50) + val insets = Insets.of(/* left= */ 90, /* top= */ 10, /* right= */ 45, /* bottom= */ 50) whenever(contentInsetsProvider.getStatusBarContentInsetsForCurrentRotation()) .thenReturn(insets) -- cgit v1.2.3-59-g8ed1b