Merge "Revert "Add adaptive charging to the top level settings menu""

This commit is contained in:
TreeHugger Robot
2020-12-29 20:08:25 +00:00
committed by Android (Google) Code Review
6 changed files with 23 additions and 87 deletions

View File

@@ -18,6 +18,7 @@ package com.android.settings.fuelgauge;
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
import static com.android.settings.fuelgauge.TopLevelBatteryPreferenceController.getDashboardLabel;
import static com.google.common.truth.Truth.assertThat;
@@ -68,16 +69,14 @@ public class TopLevelBatteryPreferenceControllerTest {
public void getDashboardLabel_returnsCorrectLabel() {
BatteryInfo info = new BatteryInfo();
info.batteryPercentString = "3%";
assertThat(mController.getDashboardLabel(mContext, info))
.isEqualTo(info.batteryPercentString);
assertThat(getDashboardLabel(mContext, info)).isEqualTo(info.batteryPercentString);
info.remainingLabel = "Phone will shut down soon";
assertThat(mController.getDashboardLabel(mContext, info))
.isEqualTo("3% - Phone will shut down soon");
assertThat(getDashboardLabel(mContext, info)).isEqualTo("3% - Phone will shut down soon");
info.discharging = false;
info.chargeLabel = "5% - charging";
assertThat(mController.getDashboardLabel(mContext, info)).isEqualTo("5% - charging");
assertThat(getDashboardLabel(mContext, info)).isEqualTo("5% - charging");
}
@Test