diff options
-rw-r--r-- | src/com/android/settings/fuelgauge/BatteryHistoryChart.java | 9 | ||||
-rw-r--r-- | src/com/android/settings/tts/TtsEngineSettingsFragment.java | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/settings/fuelgauge/BatteryHistoryChart.java b/src/com/android/settings/fuelgauge/BatteryHistoryChart.java index d88c516..9d3edd5 100644 --- a/src/com/android/settings/fuelgauge/BatteryHistoryChart.java +++ b/src/com/android/settings/fuelgauge/BatteryHistoryChart.java @@ -86,7 +86,7 @@ public class BatteryHistoryChart extends View { void addTick(int x, int bin) { if (bin != mLastBin && mNumTicks < mTicks.length) { - mTicks[mNumTicks] = x | bin << CHART_DATA_BIN_SHIFT; + mTicks[mNumTicks] = (x&CHART_DATA_X_MASK) | (bin<<CHART_DATA_BIN_SHIFT); mNumTicks++; mLastBin = bin; } @@ -540,6 +540,7 @@ public class BatteryHistoryChart extends View { } mDrainString = ""; mChargeDurationString = ""; + setContentDescription(mChargeLabelString); int pos = 0; int lastInteresting = 0; @@ -804,6 +805,9 @@ public class BatteryHistoryChart extends View { } if (curWalltime != 0 && rec.isDeltaData()) { x = mLevelLeft + (int)(((curWalltime-walltimeStart)*levelWidth)/walltimeChange); + if (x < 0) { + x = 0; + } if (false) { StringBuilder sb = new StringBuilder(128); sb.append("walloff="); @@ -984,6 +988,9 @@ public class BatteryHistoryChart extends View { } else { // Figure out where the actual data ends on the screen. x = mLevelLeft + (int)(((mEndDataWallTime-walltimeStart)*levelWidth)/walltimeChange); + if (x < 0) { + x = 0; + } } finishPaths(x, h, levelh, startX, lastY, curLevelPath, lastX, diff --git a/src/com/android/settings/tts/TtsEngineSettingsFragment.java b/src/com/android/settings/tts/TtsEngineSettingsFragment.java index c8531fa..2449353 100644 --- a/src/com/android/settings/tts/TtsEngineSettingsFragment.java +++ b/src/com/android/settings/tts/TtsEngineSettingsFragment.java @@ -140,7 +140,7 @@ public class TtsEngineSettingsFragment extends SettingsPreferenceFragment implem mLocalePreference.setEntries(entries); mLocalePreference.setEntryValues(entryValues); - mLocalePreference.setValue(value.toString()); + mLocalePreference.setValue(value != null ? value.toString() : null); mLocalePreference.setEnabled(entries.length > 0); } |