Add quickUpdate method to BatteryHeaderPrefCtrl

This cl adds a method called quickUpdateHeaderPreference, which will
update the following items immediately without waiting for the
BatteryInfo:
1. Battery level
2. Battery charging status(whether to show lighting bolt)
3. Clear the charging summary

Note: this cl doesn't optimize the BatteryInfo loading time.

This cl also rename "TimeText" to "BatteryPercentText" because in
new UI that textview is used to display battery percentage.

Bug: 63029231
Test: RunSettingsRoboTests
Change-Id: I8cc886b35e937d73b46e47e303ff0994ccdcb61c
This commit is contained in:
jackqdyulei
2017-06-26 17:54:09 -07:00
parent d793590678
commit 19648756cb
4 changed files with 47 additions and 12 deletions

View File

@@ -856,6 +856,12 @@ public class PowerUsageSummary extends PowerUsageBase implements
performBatteryHeaderClick();
}
@Override
protected void restartBatteryStatsLoader() {
super.restartBatteryStatsLoader();
mBatteryHeaderPreferenceController.quickUpdateHeaderPreference();
}
private static class SummaryProvider implements SummaryLoader.SummaryProvider {
private final Context mContext;
private final SummaryLoader mLoader;