diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/shade/QsBatteryModeController.kt | 13 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/shade/QsBatteryModeControllerTest.kt | 14 |
2 files changed, 12 insertions, 15 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/QsBatteryModeController.kt b/packages/SystemUI/src/com/android/systemui/shade/QsBatteryModeController.kt index 3eec7fa0e84a..ff57a73a8d6d 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/QsBatteryModeController.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/QsBatteryModeController.kt @@ -39,19 +39,12 @@ constructor( * [cutout]. We don't show battery estimation in qqs header on the devices with center cutout. * The result might be null when the battery icon is invisible during the qs-qqs transition * animation. + * + * Note: short-circuiting this value until a comprehensive fix for b/282044659 is finished. */ @BatteryMeterView.BatteryPercentMode fun getBatteryMode(cutout: DisplayCutout?, qsExpandedFraction: Float): Int? = - when { - qsExpandedFraction > fadeInStartFraction -> BatteryMeterView.MODE_ESTIMATE - qsExpandedFraction < fadeOutCompleteFraction -> - if (hasCenterCutout(cutout)) { - BatteryMeterView.MODE_ON - } else { - BatteryMeterView.MODE_ESTIMATE - } - else -> null - } + BatteryMeterView.MODE_ON fun updateResources() { fadeInStartFraction = diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/QsBatteryModeControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/QsBatteryModeControllerTest.kt index d421acac2daa..b028f1fd3664 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/QsBatteryModeControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/QsBatteryModeControllerTest.kt @@ -63,36 +63,40 @@ class QsBatteryModeControllerTest : SysuiTestCase() { @Test fun returnsMODE_ESTIMATEforQsWithCenterCutout() { + // TODO (b/282044659): revert this test to previous behavior assertThat(controller.getBatteryMode(CENTER_TOP_CUTOUT, QS_END_FRAME.nextFrameToFraction())) - .isEqualTo(BatteryMeterView.MODE_ESTIMATE) + .isEqualTo(BatteryMeterView.MODE_ON) } @Test fun returnsMODE_ONforQqsWithCornerCutout() { whenever(insetsProvider.currentRotationHasCornerCutout()).thenReturn(true) + // TODO (b/282044659): revert this test to previous behavior assertThat( controller.getBatteryMode(CENTER_TOP_CUTOUT, QQS_START_FRAME.prevFrameToFraction()) ) - .isEqualTo(BatteryMeterView.MODE_ESTIMATE) + .isEqualTo(BatteryMeterView.MODE_ON) } @Test fun returnsMODE_ESTIMATEforQsWithCornerCutout() { whenever(insetsProvider.currentRotationHasCornerCutout()).thenReturn(true) + // TODO (b/282044659): revert this test to previous behavior assertThat(controller.getBatteryMode(CENTER_TOP_CUTOUT, QS_END_FRAME.nextFrameToFraction())) - .isEqualTo(BatteryMeterView.MODE_ESTIMATE) + .isEqualTo(BatteryMeterView.MODE_ON) } @Test fun returnsNullInBetween() { + // TODO (b/282044659): revert this test to previous behavior assertThat( controller.getBatteryMode(CENTER_TOP_CUTOUT, QQS_START_FRAME.nextFrameToFraction()) ) - .isNull() + .isEqualTo(BatteryMeterView.MODE_ON) assertThat(controller.getBatteryMode(CENTER_TOP_CUTOUT, QS_END_FRAME.prevFrameToFraction())) - .isNull() + .isEqualTo(BatteryMeterView.MODE_ON) } private fun Int.prevFrameToFraction(): Float = (this - 1) / MOTION_LAYOUT_MAX_FRAME.toFloat() |