summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/fuelgauge/BatteryStatsHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/fuelgauge/BatteryStatsHelper.java')
-rw-r--r--src/com/android/settings/fuelgauge/BatteryStatsHelper.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/com/android/settings/fuelgauge/BatteryStatsHelper.java b/src/com/android/settings/fuelgauge/BatteryStatsHelper.java
index 3b1ea935c..953ff3df4 100644
--- a/src/com/android/settings/fuelgauge/BatteryStatsHelper.java
+++ b/src/com/android/settings/fuelgauge/BatteryStatsHelper.java
@@ -320,7 +320,12 @@ public class BatteryStatsHelper {
R.string.details_title, null, null, 0);
}
- public void refreshStats() {
+ /**
+ * Refreshes the power usage list.
+ * @param includeZeroConsumption whether includes those applications which have consumed very
+ * little power up till now.
+ */
+ public void refreshStats(boolean includeZeroConsumption) {
// Initialize mStats if necessary.
getStats();
@@ -336,7 +341,7 @@ public class BatteryStatsHelper {
mUserSippers.clear();
mUserPower.clear();
- processAppUsage();
+ processAppUsage(includeZeroConsumption);
processMiscUsage();
Collections.sort(mUsageList);
@@ -356,7 +361,7 @@ public class BatteryStatsHelper {
}
}
- private void processAppUsage() {
+ private void processAppUsage(boolean includeZeroConsumption) {
SensorManager sensorManager = (SensorManager) mActivity.getSystemService(
Context.SENSOR_SERVICE);
final int which = mStatsType;
@@ -522,7 +527,7 @@ public class BatteryStatsHelper {
// Add the app to the list if it is consuming power
boolean isOtherUser = false;
final int userId = UserHandle.getUserId(u.getUid());
- if (power != 0 || u.getUid() == 0) {
+ if (power != 0 || includeZeroConsumption || u.getUid() == 0) {
BatterySipper app = new BatterySipper(mActivity, mRequestQueue, mHandler,
packageWithHighestDrain, DrainType.APP, 0, u,
new double[] {power});