Updates battery usage messages from last 24hr to last full charge. (Part1: V2 files)

Test: manual
Bug: 236101166
Change-Id: I0aa9a1a4c902764bb9937e422e5e7f60b6e86859
This commit is contained in:
Zaiyue Xue
2022-08-04 11:57:53 +08:00
parent 8d1c50b4dc
commit 49e67c9f33
3 changed files with 9 additions and 6 deletions

View File

@@ -6438,8 +6438,12 @@
<!-- [CHAR_LIMIT=NONE] Battery usage main screen chart graph hint -->
<string name="battery_usage_chart_graph_hint">Battery level for past 24 hr</string>
<!-- [CHAR_LIMIT=NONE] Battery app usage section header since last full charge -->
<string name="battery_app_usage">App usage since last full charge</string>
<!-- [CHAR_LIMIT=NONE] Battery app usage section header for past 24 hour -->
<string name="battery_app_usage_for_past_24">App usage for past 24 hr</string>
<!-- [CHAR_LIMIT=NONE] Battery system usage section header since last full charge -->
<string name="battery_system_usage">System usage since last full charge</string>
<!-- [CHAR_LIMIT=NONE] Battery system usage section header for past 24 hour -->
<string name="battery_system_usage_for_past_24">System usage for past 24 hr</string>
<!-- [CHAR_LIMIT=NONE] Battery system usage section header -->

View File

@@ -200,8 +200,7 @@ public class BatteryChartPreferenceControllerV2 extends AbstractPreferenceContro
mPrefContext = screen.getContext();
mAppListPrefGroup = screen.findPreference(mPreferenceKey);
mAppListPrefGroup.setOrderingAsAdded(false);
mAppListPrefGroup.setTitle(
mPrefContext.getString(R.string.battery_app_usage_for_past_24));
mAppListPrefGroup.setTitle(mPrefContext.getString(R.string.battery_app_usage));
mFooterPreference = screen.findPreference(KEY_FOOTER_PREF);
// Removes footer first until usage data is loaded to avoid flashing.
if (mFooterPreference != null) {
@@ -498,8 +497,8 @@ public class BatteryChartPreferenceControllerV2 extends AbstractPreferenceContro
// Null means we show all information without a specific time slot.
if (slotInformation == null) {
return isApp
? mPrefContext.getString(R.string.battery_app_usage_for_past_24)
: mPrefContext.getString(R.string.battery_system_usage_for_past_24);
? mPrefContext.getString(R.string.battery_app_usage)
: mPrefContext.getString(R.string.battery_system_usage);
} else {
return isApp
? mPrefContext.getString(R.string.battery_app_usage_for, slotInformation)

View File

@@ -533,13 +533,13 @@ public final class BatteryChartPreferenceControllerV2Test {
verify(mBatteryChartPreferenceController.mAppListPrefGroup)
.setTitle(captor.capture());
assertThat(captor.getValue())
.isEqualTo("App usage for past 24 hr");
.isEqualTo("App usage since last full charge");
// Verifies the title in the expandable divider.
captor = ArgumentCaptor.forClass(String.class);
verify(mBatteryChartPreferenceController.mExpandDividerPreference)
.setTitle(captor.capture());
assertThat(captor.getValue())
.isEqualTo("System usage for past 24 hr");
.isEqualTo("System usage since last full charge");
}
@Test