Remove Battery Settings page battery saver tips

- Not present Battery saver tips when it's enabled
 - Not redirect Low battery tips to saver tips when saver is enabled
 Screenshots:
   https://screenshot.googleplex.com/4ehKSRs8gM64wfm.png
   https://screenshot.googleplex.com/92pd3q9jnTEXd8o.png
   https://screenshot.googleplex.com/BzLYwTjdi3kH4RF.png
   https://screenshot.googleplex.com/4w9ubmHaajNxB9b.png

Bug: 183079415
Test: make RunSettingsRoboTests -j40
Change-Id: Ib9783a95df88753342ff217b1a402f2dbb99079d
This commit is contained in:
Wesley.CW Wang
2021-03-22 18:48:44 +08:00
committed by Wesley Wang
parent 59aa4f9cb1
commit 3da3bf7a21
8 changed files with 24 additions and 52 deletions

View File

@@ -86,11 +86,11 @@ public class EarlyWarningDetectorTest {
}
@Test
public void testDetect_batterySaverOn_tipHandled() {
public void testDetect_batterySaverOn_tipInvisible() {
doReturn(true).when(mPowerManager).isPowerSaveMode();
assertThat(mEarlyWarningDetector.detect().getState())
.isEqualTo(BatteryTip.StateType.HANDLED);
.isEqualTo(BatteryTip.StateType.INVISIBLE);
}
@Test

View File

@@ -91,10 +91,11 @@ public class LowBatteryDetectorTest {
}
@Test
public void testDetect_batterySaverOn_tipHandled() {
public void testDetect_batterySaverOn_tipInvisible() {
mShadowPowerManager.setIsPowerSaveMode(true);
assertThat(mLowBatteryDetector.detect().getState()).isEqualTo(BatteryTip.StateType.HANDLED);
assertThat(mLowBatteryDetector.detect().getState())
.isEqualTo(BatteryTip.StateType.INVISIBLE);
}
@Test

View File

@@ -74,24 +74,13 @@ public class EarlyWarningTipTest {
}
@Test
public void testInfo_stateHandled_displayPowerModeHandledInfo() {
final EarlyWarningTip tip =
new EarlyWarningTip(BatteryTip.StateType.HANDLED, false /* powerModeOn */);
assertThat(tip.getTitle(mContext)).isEqualTo("Battery Saver is on");
assertThat(tip.getSummary(mContext)).isEqualTo("Some features may be limited");
assertThat(tip.getIconId()).isEqualTo(R.drawable.ic_battery_status_maybe_24dp);
assertThat(tip.getIconTintColorId()).isEqualTo(R.color.battery_maybe_color_light);
}
@Test
public void testUpdate_powerModeTurnedOn_typeBecomeHandled() {
public void testUpdate_powerModeTurnedOn_typeBecomeInvisible() {
final EarlyWarningTip nextTip =
new EarlyWarningTip(BatteryTip.StateType.INVISIBLE, true /* powerModeOn */);
mEarlyWarningTip.updateState(nextTip);
assertThat(mEarlyWarningTip.getState()).isEqualTo(BatteryTip.StateType.HANDLED);
assertThat(mEarlyWarningTip.getState()).isEqualTo(BatteryTip.StateType.INVISIBLE);
}
@Test

View File

@@ -64,13 +64,6 @@ public class LowBatteryTipTest {
assertThat(parcelTip.getSummary(mContext)).isEqualTo(SUMMARY);
}
@Test
public void getSummary_tipHandled_showSummary() {
mLowBatteryTip.mState = BatteryTip.StateType.HANDLED;
assertThat(mLowBatteryTip.getSummary(mContext)).isEqualTo("Some features may be limited");
}
@Test
public void getSummary_tipNew_showSummary() {
mLowBatteryTip.mState = BatteryTip.StateType.NEW;