In BatteryChartViewV2, use levels.length-1 to replace mTrapezoidCount. So the chartview could show any number of slots as the given levels length-1.

Test: manual
Bug: 236101166, 239491373
Change-Id: I9625ed80e8eba6632cc864ada0ba3e9cf11de82a
This commit is contained in:
Zaiyue Xue
2022-07-18 19:32:46 +08:00
parent a3a90a744f
commit 837a8f0063
2 changed files with 19 additions and 25 deletions

View File

@@ -183,7 +183,6 @@ public final class BatteryChartViewV2Test {
for (int index = 0; index < levels.length; index++) {
levels[index] = index + 1;
}
mBatteryChartView.setTrapezoidCount(12);
mBatteryChartView.setLevels(levels);
mBatteryChartView.setClickableForce(true);
when(mPowerUsageFeatureProvider.isChartGraphSlotsEnabled(mContext))