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

This commit is contained in:
YK Hung
2022-08-26 16:07:40 +00:00
committed by Android (Google) Code Review

View File

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