summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/fuelgauge/PowerUsageSummary.java
diff options
context:
space:
mode:
authorChristopher R. Palmer <crpalmer@gmail.com>2015-09-25 20:52:57 -0400
committerSteve Kondik <steve@cyngn.com>2015-11-03 18:52:03 -0800
commit8aead8b15627ad94a18a94b7ecbd8732b2bd5408 (patch)
tree23965d671f2b07065370e3897924c95a5c4983d1 /src/com/android/settings/fuelgauge/PowerUsageSummary.java
parentc014a667ccd32b8aa002cd4950e7c3c289f3b694 (diff)
downloadpackages_apps_Settings-8aead8b15627ad94a18a94b7ecbd8732b2bd5408.zip
packages_apps_Settings-8aead8b15627ad94a18a94b7ecbd8732b2bd5408.tar.gz
packages_apps_Settings-8aead8b15627ad94a18a94b7ecbd8732b2bd5408.tar.bz2
settings: fuelgauge: Always show screen on time
The screen on time is always meaningful, even if it doesn't account for 1% of the total battery drain. Always show it. Change-Id: Ie627959130fd84bbf7f337a14e322ca43b899526
Diffstat (limited to 'src/com/android/settings/fuelgauge/PowerUsageSummary.java')
-rw-r--r--src/com/android/settings/fuelgauge/PowerUsageSummary.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index d48a63d..0e71f51 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -466,9 +466,14 @@ public class PowerUsageSummary extends PowerUsageBase
updatePerformanceSummary();
}
+ private boolean sipperCanBePruned(BatterySipper sipper) {
+ return sipper.drainType != BatterySipper.DrainType.SCREEN;
+ }
+
protected void refreshStats() {
super.refreshStats();
updatePreference(mHistPref);
+
mAppListGroup.removeAll();
mAppListGroup.setOrderingAsAdded(false);
boolean addedSome = false;
@@ -490,14 +495,16 @@ public class PowerUsageSummary extends PowerUsageBase
final int numSippers = usageList.size();
for (int i = 0; i < numSippers; i++) {
final BatterySipper sipper = usageList.get(i);
- if ((sipper.totalPowerMah * SECONDS_IN_HOUR) < MIN_POWER_THRESHOLD_MILLI_AMP) {
- continue;
- }
double totalPower = USE_FAKE_DATA ? 4000 : mStatsHelper.getTotalPower();
final double percentOfTotal =
((sipper.totalPowerMah / totalPower) * dischargeAmount);
- if (((int) (percentOfTotal + .5)) < 1) {
- continue;
+ if (sipperCanBePruned(sipper)) {
+ if ((sipper.totalPowerMah * SECONDS_IN_HOUR) < MIN_POWER_THRESHOLD_MILLI_AMP) {
+ continue;
+ }
+ if (((int) (percentOfTotal + .5)) < 1) {
+ continue;
+ }
}
if (sipper.drainType == BatterySipper.DrainType.OVERCOUNTED) {
// Don't show over-counted unless it is at least 2/3 the size of