Change the master code the same as tm-qpr-dev to avoid future merge conflicts.

Bug: 243746796
Test: manual
Change-Id: I9c693a65ebbbe33c9d132131f832c26505a23a4e
This commit is contained in:
Zaiyue Xue
2022-08-26 13:36:36 +08:00
parent 855dc04b31
commit 4bb92296b5

View File

@@ -595,13 +595,14 @@ 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
&& x <= slot.mRight + mTrapezoidHOffset) {
return index;
}
if (mTrapezoidSlots == null) {
return BatteryChartViewModel.SELECTED_INDEX_INVALID;
}
for (int index = 0; index < mTrapezoidSlots.length; index++) {
final TrapezoidSlot slot = mTrapezoidSlots[index];
if (x >= slot.mLeft - mTrapezoidHOffset
&& x <= slot.mRight + mTrapezoidHOffset) {
return index;
}
}
return BatteryChartViewModel.SELECTED_INDEX_INVALID;