Fix b/265364509 Update battery usage page footer string

Bug: 265364509
Fix: 265364509
Test: manual
Change-Id: I1deef3157ae7c5a8425e2ae438dacebcadd25fce
This commit is contained in:
Zaiyue Xue
2023-02-22 15:54:44 +08:00
parent da1f2578a0
commit cc9df56ed4
2 changed files with 8 additions and 19 deletions

View File

@@ -572,17 +572,11 @@
<!-- Summary for the smart battery toggle [CHAR LIMIT=NONE] --> <!-- Summary for the smart battery toggle [CHAR LIMIT=NONE] -->
<string name="smart_battery_summary" product="default">Limit battery for apps that you don\u2019t use often</string> <string name="smart_battery_summary" product="default">Limit battery for apps that you don\u2019t use often</string>
<!-- [CHAR_LIMIT=NONE] Battery usage main screen footer content --> <!-- [CHAR_LIMIT=NONE] Battery usage main screen footer content -->
<string name="battery_usage_screen_footer_since_last_full_charge" product="default">Usage numbers are proportional to battery usage since last full charge and usage data is not measured when phone is charging</string> <string name="battery_usage_screen_footer" product="default">Battery usage and screen time are not measured while the phone is charging</string>
<!-- [CHAR_LIMIT=NONE] Battery usage main screen footer content --> <!-- [CHAR_LIMIT=NONE] Battery usage main screen footer content -->
<string name="battery_usage_screen_footer_since_last_full_charge" product="tablet">Usage numbers are proportional to battery usage since last full charge and usage data is not measured when tablet is charging</string> <string name="battery_usage_screen_footer" product="tablet">Battery usage and screen time are not measured while the tablet is charging</string>
<!-- [CHAR_LIMIT=NONE] Battery usage main screen footer content --> <!-- [CHAR_LIMIT=NONE] Battery usage main screen footer content -->
<string name="battery_usage_screen_footer_since_last_full_charge" product="device">Usage numbers are proportional to battery usage since last full charge and usage data is not measured when device is charging</string> <string name="battery_usage_screen_footer" product="device">Battery usage and screen time are not measured while the device is charging</string>
<!-- [CHAR_LIMIT=NONE] Battery usage main screen footer content -->
<string name="battery_usage_screen_footer_of_timestamp" product="default">Usage numbers are proportional to battery usage of <xliff:g id="slot">%s</xliff:g> and usage data is not measured when phone is charging</string>
<!-- [CHAR_LIMIT=NONE] Battery usage main screen footer content -->
<string name="battery_usage_screen_footer_of_timestamp" product="tablet">Usage numbers are proportional to battery usage of <xliff:g id="slot">%s</xliff:g> and usage data is not measured when tablet is charging</string>
<!-- [CHAR_LIMIT=NONE] Battery usage main screen footer content -->
<string name="battery_usage_screen_footer_of_timestamp" product="device">Usage numbers are proportional to battery usage of <xliff:g id="slot">%s</xliff:g> and usage data is not measured when device is charging</string>
<!-- Summary of preference to install certificates from SD card [CHAR LIMIT=NONE] --> <!-- Summary of preference to install certificates from SD card [CHAR LIMIT=NONE] -->
<string name="credentials_install_summary" product="nosdcard">Install certificates from storage</string> <string name="credentials_install_summary" product="nosdcard">Install certificates from storage</string>
<!-- Summary of preference to install certificates from SD card [CHAR LIMIT=NONE] --> <!-- Summary of preference to install certificates from SD card [CHAR LIMIT=NONE] -->

View File

@@ -194,7 +194,7 @@ public class BatteryUsageBreakdownController extends BasePreferenceController
showCategoryTitle(slotTimestamp); showCategoryTitle(slotTimestamp);
showSpinnerAndAppList(); showSpinnerAndAppList();
showFooterPreference(isAllUsageDataEmpty, slotTimestamp); showFooterPreference(isAllUsageDataEmpty);
} }
private void showCategoryTitle(String slotTimestamp) { private void showCategoryTitle(String slotTimestamp) {
@@ -206,16 +206,11 @@ public class BatteryUsageBreakdownController extends BasePreferenceController
mRootPreference.setVisible(true); mRootPreference.setVisible(true);
} }
private void showFooterPreference(boolean isAllBatteryUsageEmpty, String slotTimestamp) { private void showFooterPreference(boolean isAllBatteryUsageEmpty) {
mFooterPreference.setTitle( mFooterPreference.setTitle(mPrefContext.getString(
isAllBatteryUsageEmpty isAllBatteryUsageEmpty
? mPrefContext.getString(R.string.battery_usage_screen_footer_empty) ? R.string.battery_usage_screen_footer_empty
: (slotTimestamp == null : R.string.battery_usage_screen_footer));
? mPrefContext.getString(
R.string.battery_usage_screen_footer_since_last_full_charge)
: mPrefContext.getString(
R.string.battery_usage_screen_footer_of_timestamp,
slotTimestamp)));
mFooterPreference.setVisible(true); mFooterPreference.setVisible(true);
} }