Update settings main page battery string

UX requested that the percentage be moved to the front.

Test: robotests pass
Bug: 77874406
Change-Id: I7008c81fa42487bb71ecd84b6a66203d89fe50a8
This commit is contained in:
Salvador Martinez
2018-04-18 15:56:28 -07:00
parent 8a3bcaa3e3
commit 950d94f689
2 changed files with 29 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ import com.android.internal.os.BatteryStatsHelper;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.applications.LayoutPreference;
import com.android.settings.dashboard.SummaryLoader;
import com.android.settings.fuelgauge.anomaly.Anomaly;
import com.android.settings.fuelgauge.batterytip.BatteryTipPreferenceController;
import com.android.settings.testutils.FakeFeatureFactory;
@@ -375,6 +376,18 @@ public class PowerUsageSummaryTest {
verify(mFragment).restartBatteryTipLoader();
}
@Test
public void getDashboardLabel_returnsCorrectLabel() {
BatteryInfo info = new BatteryInfo();
info.batteryPercentString = "3%";
assertThat(PowerUsageSummary.getDashboardLabel(mRealContext, info))
.isEqualTo(info.batteryPercentString);
info.remainingLabel = "Phone will shut down soon";
assertThat(PowerUsageSummary.getDashboardLabel(mRealContext, info))
.isEqualTo("3% - Phone will shut down soon");
}
public static class TestFragment extends PowerUsageSummary {
private Context mContext;