Loading packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -496,7 +496,7 @@ open class QSTileViewImpl @JvmOverloads constructor( } // Colors if (state.state != lastState || state.disabledByPolicy || lastDisabledByPolicy) { if (state.state != lastState || state.disabledByPolicy != lastDisabledByPolicy) { singleAnimator.cancel() mQsLogger?.logTileBackgroundColorUpdateIfInternetTile( state.spec, Loading packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSTileViewImplTest.kt +20 −0 Original line number Diff line number Diff line Loading @@ -316,6 +316,26 @@ class QSTileViewImplTest : SysuiTestCase() { assertThat(colorsDisabledByPolicy).containsExactlyElementsIn(colorsUnavailable) } @Test fun testDisableByPolicyThenRemoved_changesColor() { val stateActive = QSTile.State() stateActive.state = Tile.STATE_ACTIVE val stateDisabledByPolicy = stateActive.copy() stateDisabledByPolicy.disabledByPolicy = true tileView.changeState(stateActive) val activeColors = tileView.getCurrentColors() tileView.changeState(stateDisabledByPolicy) // It has unavailable colors assertThat(tileView.getCurrentColors()).isNotEqualTo(activeColors) // When we get back to not disabled by policy tile, it should go back to active colors tileView.changeState(stateActive) assertThat(tileView.getCurrentColors()).containsExactlyElementsIn(activeColors) } @Test fun testDisabledByPolicy_secondaryLabelText() { val testA11yLabel = "TEST_LABEL" Loading Loading
packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -496,7 +496,7 @@ open class QSTileViewImpl @JvmOverloads constructor( } // Colors if (state.state != lastState || state.disabledByPolicy || lastDisabledByPolicy) { if (state.state != lastState || state.disabledByPolicy != lastDisabledByPolicy) { singleAnimator.cancel() mQsLogger?.logTileBackgroundColorUpdateIfInternetTile( state.spec, Loading
packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSTileViewImplTest.kt +20 −0 Original line number Diff line number Diff line Loading @@ -316,6 +316,26 @@ class QSTileViewImplTest : SysuiTestCase() { assertThat(colorsDisabledByPolicy).containsExactlyElementsIn(colorsUnavailable) } @Test fun testDisableByPolicyThenRemoved_changesColor() { val stateActive = QSTile.State() stateActive.state = Tile.STATE_ACTIVE val stateDisabledByPolicy = stateActive.copy() stateDisabledByPolicy.disabledByPolicy = true tileView.changeState(stateActive) val activeColors = tileView.getCurrentColors() tileView.changeState(stateDisabledByPolicy) // It has unavailable colors assertThat(tileView.getCurrentColors()).isNotEqualTo(activeColors) // When we get back to not disabled by policy tile, it should go back to active colors tileView.changeState(stateActive) assertThat(tileView.getCurrentColors()).containsExactlyElementsIn(activeColors) } @Test fun testDisabledByPolicy_secondaryLabelText() { val testA11yLabel = "TEST_LABEL" Loading