Make BatteryStatsHistoryIterator API compatible with Iterator
Bug: 261622968 Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.google.android.settings.fuelgauge.BatteryInfoTest RELAX_USES_LIBRARY_CHECK=true Change-Id: I4b3cf18e4714017b412485120557eb22d7039118
This commit is contained in:
@@ -375,8 +375,8 @@ public class BatteryInfo {
|
||||
boolean first = true;
|
||||
final BatteryStatsHistoryIterator iterator1 =
|
||||
mBatteryUsageStats.iterateBatteryStatsHistory();
|
||||
final HistoryItem rec = new HistoryItem();
|
||||
while (iterator1.next(rec)) {
|
||||
HistoryItem rec;
|
||||
while ((rec = iterator1.next()) != null) {
|
||||
pos++;
|
||||
if (first) {
|
||||
first = false;
|
||||
@@ -420,7 +420,7 @@ public class BatteryInfo {
|
||||
if (endWalltime > startWalltime) {
|
||||
final BatteryStatsHistoryIterator iterator2 =
|
||||
mBatteryUsageStats.iterateBatteryStatsHistory();
|
||||
while (iterator2.next(rec) && i < N) {
|
||||
while ((rec = iterator2.next()) != null && i < N) {
|
||||
if (rec.isDeltaData()) {
|
||||
curWalltime += rec.time - lastRealtime;
|
||||
lastRealtime = rec.time;
|
||||
|
Reference in New Issue
Block a user