Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 916adce0 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #3108683: GRH18: Battery usage chart FCs

Make array more bigger, and bounds check the thing.

Change-Id: Iaffebefd27c16c6ecf57566803859be1a5049b8a
parent d36d650a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public class BatteryHistoryChart extends View {

        void init(int width) {
            if (width > 0) {
                mTicks = new int[width+2];
                mTicks = new int[width*2];
            } else {
                mTicks = null;
            }
@@ -68,7 +68,7 @@ public class BatteryHistoryChart extends View {
        }

        void addTick(int x, int bin) {
            if (bin != mLastBin) {
            if (bin != mLastBin && mNumTicks < mTicks.length) {
                mTicks[mNumTicks] = x | bin << CHART_DATA_BIN_SHIFT;
                mNumTicks++;
                mLastBin = bin;