Merge "Add adaptive charging to the top level settings menu" into rvc-qpr-dev am: 4046f5c134

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/13287641

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie23c4efbf1923e89c4f077decb397251f6c70f28
This commit is contained in:
TreeHugger Robot
2021-01-09 00:02:13 +00:00
committed by Automerger Merge Worker
6 changed files with 96 additions and 25 deletions

View File

@@ -18,7 +18,6 @@ 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;
@@ -59,14 +58,16 @@ public class TopLevelBatteryPreferenceControllerTest {
public void getDashboardLabel_returnsCorrectLabel() {
BatteryInfo info = new BatteryInfo();
info.batteryPercentString = "3%";
assertThat(getDashboardLabel(mContext, info)).isEqualTo(info.batteryPercentString);
assertThat(mController.getDashboardLabel(mContext, info, true))
.isEqualTo(info.batteryPercentString);
info.remainingLabel = "Phone will shut down soon";
assertThat(getDashboardLabel(mContext, info)).isEqualTo("3% - Phone will shut down soon");
assertThat(mController.getDashboardLabel(mContext, info, true))
.isEqualTo("3% - Phone will shut down soon");
info.discharging = false;
info.chargeLabel = "5% - charging";
assertThat(getDashboardLabel(mContext, info)).isEqualTo("5% - charging");
assertThat(mController.getDashboardLabel(mContext, info, true)).isEqualTo("5% - charging");
}
@Test