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

Commit fb2090e6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix b/243746796 Crash when mouse hangs over an empty battery chart"

parents 2802ec1c 079aaf12
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -595,6 +595,7 @@ public class BatteryChartView extends AppCompatImageView implements View.OnClick

    // Searches the corresponding trapezoid index from x location.
    private int getTrapezoidIndex(float x) {
        if (mTrapezoidSlots != null) {
            for (int index = 0; index < mTrapezoidSlots.length; index++) {
                final TrapezoidSlot slot = mTrapezoidSlots[index];
                if (x >= slot.mLeft - mTrapezoidHOffset
@@ -602,6 +603,7 @@ public class BatteryChartView extends AppCompatImageView implements View.OnClick
                    return index;
                }
            }
        }
        return BatteryChartViewModel.SELECTED_INDEX_INVALID;
    }