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