summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-04-06 18:21:43 -0700
committerAdam Lesinski <adamlesinski@google.com>2015-04-06 18:21:43 -0700
commita74ddc29b831d788ecedffef3233ae7c8d3241a1 (patch)
treea9c7e12d91a3b3dfa771761917cb4ce71a6e4fbb /src
parentbec3e0114371dc2cfc36e7b1ae0f7bcfe57ae310 (diff)
downloadpackages_apps_Settings-a74ddc29b831d788ecedffef3233ae7c8d3241a1.zip
packages_apps_Settings-a74ddc29b831d788ecedffef3233ae7c8d3241a1.tar.gz
packages_apps_Settings-a74ddc29b831d788ecedffef3233ae7c8d3241a1.tar.bz2
Update name of field used from BatterySipper
This relies on change Ia3d97e0a1c3352127185c18626d8ba8221c9ab40 Change-Id: Ibfb31da3938bf2ff4cf20444e680addabcca9eb3
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/fuelgauge/PowerUsageDetail.java35
-rw-r--r--src/com/android/settings/fuelgauge/PowerUsageSummary.java11
2 files changed, 22 insertions, 24 deletions
diff --git a/src/com/android/settings/fuelgauge/PowerUsageDetail.java b/src/com/android/settings/fuelgauge/PowerUsageDetail.java
index d796570..3bc1a23 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageDetail.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageDetail.java
@@ -21,7 +21,6 @@ import static com.android.settings.Utils.prepareCustomPreferencesList;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ApplicationErrorReport;
-import android.app.Fragment;
import android.app.admin.DevicePolicyManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -93,9 +92,9 @@ public class PowerUsageDetail extends InstrumentedFragment implements Button.OnC
Bundle args = new Bundle();
args.putString(PowerUsageDetail.EXTRA_TITLE, entry.name);
args.putInt(PowerUsageDetail.EXTRA_PERCENT, (int)
- ((entry.sipper.value * dischargeAmount / helper.getTotalPower()) + .5));
+ ((entry.sipper.totalPowerMah * dischargeAmount / helper.getTotalPower()) + .5));
args.putInt(PowerUsageDetail.EXTRA_GAUGE, (int)
- Math.ceil(entry.sipper.value * 100 / helper.getMaxPower()));
+ Math.ceil(entry.sipper.totalPowerMah * 100 / helper.getMaxPower()));
args.putLong(PowerUsageDetail.EXTRA_USAGE_DURATION, helper.getStatsPeriod());
args.putString(PowerUsageDetail.EXTRA_ICON_PACKAGE, entry.defaultPackageName);
args.putInt(PowerUsageDetail.EXTRA_ICON_ID, entry.iconId);
@@ -129,11 +128,11 @@ public class PowerUsageDetail extends InstrumentedFragment implements Button.OnC
R.string.usage_type_video,
};
values = new double[] {
- entry.sipper.cpuTime,
- entry.sipper.cpuFgTime,
- entry.sipper.wakeLockTime,
- entry.sipper.gpsTime,
- entry.sipper.wifiRunningTime,
+ entry.sipper.cpuTimeMs,
+ entry.sipper.cpuFgTimeMs,
+ entry.sipper.wakeLockTimeMs,
+ entry.sipper.gpsTimeMs,
+ entry.sipper.wifiRunningTimeMs,
entry.sipper.mobileRxPackets,
entry.sipper.mobileTxPackets,
entry.sipper.mobileActive,
@@ -170,7 +169,7 @@ public class PowerUsageDetail extends InstrumentedFragment implements Button.OnC
R.string.usage_type_radio_active,
};
values = new double[] {
- entry.sipper.usageTime,
+ entry.sipper.usageTimeMs,
entry.sipper.noCoveragePercent,
entry.sipper.mobileActive
};
@@ -189,10 +188,10 @@ public class PowerUsageDetail extends InstrumentedFragment implements Button.OnC
R.string.usage_type_data_wifi_send,
};
values = new double[] {
- entry.sipper.usageTime,
- entry.sipper.cpuTime,
- entry.sipper.cpuFgTime,
- entry.sipper.wakeLockTime,
+ entry.sipper.usageTimeMs,
+ entry.sipper.cpuTimeMs,
+ entry.sipper.cpuFgTimeMs,
+ entry.sipper.wakeLockTimeMs,
entry.sipper.mobileRxPackets,
entry.sipper.mobileTxPackets,
entry.sipper.wifiRxPackets,
@@ -212,10 +211,10 @@ public class PowerUsageDetail extends InstrumentedFragment implements Button.OnC
R.string.usage_type_data_wifi_send,
};
values = new double[] {
- entry.sipper.usageTime,
- entry.sipper.cpuTime,
- entry.sipper.cpuFgTime,
- entry.sipper.wakeLockTime,
+ entry.sipper.usageTimeMs,
+ entry.sipper.cpuTimeMs,
+ entry.sipper.cpuFgTimeMs,
+ entry.sipper.wakeLockTimeMs,
entry.sipper.mobileRxPackets,
entry.sipper.mobileTxPackets,
entry.sipper.wifiRxPackets,
@@ -254,7 +253,7 @@ public class PowerUsageDetail extends InstrumentedFragment implements Button.OnC
R.string.usage_type_on_time
};
values = new double[] {
- entry.sipper.usageTime
+ entry.sipper.usageTimeMs
};
}
}
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index dbc78c2..297fe1a 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -30,7 +30,6 @@ import android.os.Message;
import android.os.UserHandle;
import android.os.UserManager;
import android.preference.Preference;
-import android.preference.PreferenceFragment;
import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.text.TextUtils;
@@ -278,18 +277,18 @@ public class PowerUsageSummary extends InstrumentedPreferenceFragment {
final int numSippers = usageList.size();
for (int i = 0; i < numSippers; i++) {
final BatterySipper sipper = usageList.get(i);
- if ((sipper.value * SECONDS_IN_HOUR) < MIN_POWER_THRESHOLD_MILLI_AMP) {
+ if ((sipper.totalPowerMah * SECONDS_IN_HOUR) < MIN_POWER_THRESHOLD_MILLI_AMP) {
continue;
}
final double percentOfTotal =
- ((sipper.value / mStatsHelper.getTotalPower()) * dischargeAmount);
+ ((sipper.totalPowerMah / mStatsHelper.getTotalPower()) * dischargeAmount);
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
// the largest real entry, and its percent of total is more significant
- if (sipper.value < ((mStatsHelper.getMaxRealPower()*2)/3)) {
+ if (sipper.totalPowerMah < ((mStatsHelper.getMaxRealPower()*2)/3)) {
continue;
}
if (percentOfTotal < 10) {
@@ -302,7 +301,7 @@ public class PowerUsageSummary extends InstrumentedPreferenceFragment {
if (sipper.drainType == BatterySipper.DrainType.UNACCOUNTED) {
// Don't show over-counted unless it is at least 1/2 the size of
// the largest real entry, and its percent of total is more significant
- if (sipper.value < (mStatsHelper.getMaxRealPower()/2)) {
+ if (sipper.totalPowerMah < (mStatsHelper.getMaxRealPower()/2)) {
continue;
}
if (percentOfTotal < 5) {
@@ -321,7 +320,7 @@ public class PowerUsageSummary extends InstrumentedPreferenceFragment {
final PowerGaugePreference pref = new PowerGaugePreference(getActivity(),
badgedIcon, contentDescription, entry);
- final double percentOfMax = (sipper.value * 100) / mStatsHelper.getMaxPower();
+ final double percentOfMax = (sipper.totalPowerMah * 100) / mStatsHelper.getMaxPower();
sipper.percent = percentOfTotal;
pref.setTitle(entry.getLabel());
pref.setOrder(i + 1);