Issue #16941902: Charged % of battery is mismatching between phone status
area(top right corner) and battery screen

Need to make sure the stats are updated when we come back to
the foreground.

Issue #16901402: Crash in Settings observed after tap on Battery option

Don't allow us to have a null stats object.

Issue #16135174: Apps page "smoke" gradient footer must be removed

Finish tweaking layout to match mocks.

Change-Id: I29d56b506a9468ec548feef7c3f9502a9b16ef4d
This commit is contained in:
Dianne Hackborn
2014-08-27 14:04:32 -07:00
parent 29b5ef288a
commit be300225df
4 changed files with 134 additions and 106 deletions

View File

@@ -112,6 +112,12 @@ public class PowerUsageSummary extends PreferenceFragment {
setHasOptionsMenu(true);
}
@Override
public void onStart() {
super.onStart();
mStatsHelper.clearStats();
}
@Override
public void onResume() {
super.onResume();
@@ -250,7 +256,8 @@ public class PowerUsageSummary extends PreferenceFragment {
mAppListGroup.addPreference(mHistPref);
boolean addedSome = false;
PowerProfile powerProfile = mStatsHelper.getPowerProfile();
final PowerProfile powerProfile = mStatsHelper.getPowerProfile();
final BatteryStats stats = mStatsHelper.getStats();
final double averagePower = powerProfile.getAveragePower(PowerProfile.POWER_SCREEN_FULL);
if (averagePower >= MIN_AVERAGE_POWER_THRESHOLD_MILLI_AMP) {
final List<UserHandle> profiles = mUm.getUserProfiles();
@@ -259,7 +266,7 @@ public class PowerUsageSummary extends PreferenceFragment {
final List<BatterySipper> usageList = mStatsHelper.getUsageList();
final int dischargeAmount = mStatsHelper.getStats().getDischargeAmount(mStatsType);
final int dischargeAmount = stats != null ? stats.getDischargeAmount(mStatsType) : 0;
final int numSippers = usageList.size();
for (int i = 0; i < numSippers; i++) {
final BatterySipper sipper = usageList.get(i);