summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/fuelgauge
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2013-03-15 18:21:12 -0700
committerTodd Poynor <toddpoynor@google.com>2013-03-18 12:30:44 -0700
commit56247a63fc621815ecff82a278ad8553174922a0 (patch)
treef5776df8766ae761f54bf3940d44fbb4a18703ac /src/com/android/settings/fuelgauge
parent474958fc670e18347b2135d0ffd118f921ad7ccb (diff)
downloadpackages_apps_Settings-56247a63fc621815ecff82a278ad8553174922a0.tar.gz
packages_apps_Settings-56247a63fc621815ecff82a278ad8553174922a0.tar.bz2
packages_apps_Settings-56247a63fc621815ecff82a278ad8553174922a0.zip
battery history details: update status bars on any change
Don't apply the "X axis (time) still within previous pixel" optimization to the status bars below the battery level graph. Keep the path cursor position and previous state variables up-to-date in this case. Bug: 8132455 Change-Id: I09390256e3e71d34813de655a1d01ec054ee778a
Diffstat (limited to 'src/com/android/settings/fuelgauge')
-rw-r--r--src/com/android/settings/fuelgauge/BatteryHistoryChart.java118
1 files changed, 59 insertions, 59 deletions
diff --git a/src/com/android/settings/fuelgauge/BatteryHistoryChart.java b/src/com/android/settings/fuelgauge/BatteryHistoryChart.java
index a22988882..514578912 100644
--- a/src/com/android/settings/fuelgauge/BatteryHistoryChart.java
+++ b/src/com/android/settings/fuelgauge/BatteryHistoryChart.java
@@ -557,77 +557,77 @@ public class BatteryHistoryChart extends View {
lastX = x;
lastY = y;
}
+ }
- final boolean charging =
- (rec.states&HistoryItem.STATE_BATTERY_PLUGGED_FLAG) != 0;
- if (charging != lastCharging) {
- if (charging) {
- mChargingPath.moveTo(x, h-mChargingOffset);
- } else {
- mChargingPath.lineTo(x, h-mChargingOffset);
- }
- lastCharging = charging;
+ final boolean charging =
+ (rec.states&HistoryItem.STATE_BATTERY_PLUGGED_FLAG) != 0;
+ if (charging != lastCharging) {
+ if (charging) {
+ mChargingPath.moveTo(x, h-mChargingOffset);
+ } else {
+ mChargingPath.lineTo(x, h-mChargingOffset);
}
+ lastCharging = charging;
+ }
- final boolean screenOn =
- (rec.states&HistoryItem.STATE_SCREEN_ON_FLAG) != 0;
- if (screenOn != lastScreenOn) {
- if (screenOn) {
- mScreenOnPath.moveTo(x, h-mScreenOnOffset);
- } else {
- mScreenOnPath.lineTo(x, h-mScreenOnOffset);
- }
- lastScreenOn = screenOn;
+ final boolean screenOn =
+ (rec.states&HistoryItem.STATE_SCREEN_ON_FLAG) != 0;
+ if (screenOn != lastScreenOn) {
+ if (screenOn) {
+ mScreenOnPath.moveTo(x, h-mScreenOnOffset);
+ } else {
+ mScreenOnPath.lineTo(x, h-mScreenOnOffset);
}
+ lastScreenOn = screenOn;
+ }
- final boolean gpsOn =
- (rec.states&HistoryItem.STATE_GPS_ON_FLAG) != 0;
- if (gpsOn != lastGpsOn) {
- if (gpsOn) {
- mGpsOnPath.moveTo(x, h-mGpsOnOffset);
- } else {
- mGpsOnPath.lineTo(x, h-mGpsOnOffset);
- }
- lastGpsOn = gpsOn;
+ final boolean gpsOn =
+ (rec.states&HistoryItem.STATE_GPS_ON_FLAG) != 0;
+ if (gpsOn != lastGpsOn) {
+ if (gpsOn) {
+ mGpsOnPath.moveTo(x, h-mGpsOnOffset);
+ } else {
+ mGpsOnPath.lineTo(x, h-mGpsOnOffset);
}
+ lastGpsOn = gpsOn;
+ }
- final boolean wifiRunning =
- (rec.states&HistoryItem.STATE_WIFI_RUNNING_FLAG) != 0;
- if (wifiRunning != lastWifiRunning) {
- if (wifiRunning) {
- mWifiRunningPath.moveTo(x, h-mWifiRunningOffset);
- } else {
- mWifiRunningPath.lineTo(x, h-mWifiRunningOffset);
- }
- lastWifiRunning = wifiRunning;
+ final boolean wifiRunning =
+ (rec.states&HistoryItem.STATE_WIFI_RUNNING_FLAG) != 0;
+ if (wifiRunning != lastWifiRunning) {
+ if (wifiRunning) {
+ mWifiRunningPath.moveTo(x, h-mWifiRunningOffset);
+ } else {
+ mWifiRunningPath.lineTo(x, h-mWifiRunningOffset);
}
+ lastWifiRunning = wifiRunning;
+ }
- final boolean wakeLock =
- (rec.states&HistoryItem.STATE_WAKE_LOCK_FLAG) != 0;
- if (wakeLock != lastWakeLock) {
- if (wakeLock) {
- mWakeLockPath.moveTo(x, h-mWakeLockOffset);
- } else {
- mWakeLockPath.lineTo(x, h-mWakeLockOffset);
- }
- lastWakeLock = wakeLock;
+ final boolean wakeLock =
+ (rec.states&HistoryItem.STATE_WAKE_LOCK_FLAG) != 0;
+ if (wakeLock != lastWakeLock) {
+ if (wakeLock) {
+ mWakeLockPath.moveTo(x, h-mWakeLockOffset);
+ } else {
+ mWakeLockPath.lineTo(x, h-mWakeLockOffset);
}
+ lastWakeLock = wakeLock;
+ }
- if (mLargeMode && mHavePhoneSignal) {
- int bin;
- if (((rec.states&HistoryItem.STATE_PHONE_STATE_MASK)
- >> HistoryItem.STATE_PHONE_STATE_SHIFT)
- == ServiceState.STATE_POWER_OFF) {
- bin = 0;
- } else if ((rec.states&HistoryItem.STATE_PHONE_SCANNING_FLAG) != 0) {
- bin = 1;
- } else {
- bin = (rec.states&HistoryItem.STATE_SIGNAL_STRENGTH_MASK)
- >> HistoryItem.STATE_SIGNAL_STRENGTH_SHIFT;
- bin += 2;
- }
- mPhoneSignalChart.addTick(x, bin);
+ if (mLargeMode && mHavePhoneSignal) {
+ int bin;
+ if (((rec.states&HistoryItem.STATE_PHONE_STATE_MASK)
+ >> HistoryItem.STATE_PHONE_STATE_SHIFT)
+ == ServiceState.STATE_POWER_OFF) {
+ bin = 0;
+ } else if ((rec.states&HistoryItem.STATE_PHONE_SCANNING_FLAG) != 0) {
+ bin = 1;
+ } else {
+ bin = (rec.states&HistoryItem.STATE_SIGNAL_STRENGTH_MASK)
+ >> HistoryItem.STATE_SIGNAL_STRENGTH_SHIFT;
+ bin += 2;
}
+ mPhoneSignalChart.addTick(x, bin);
}
} else if (rec.cmd != BatteryStats.HistoryItem.CMD_OVERFLOW) {