Missing tethering stats isn't an error.
When a device first boots, there won't be any tethering stats, which
isn't an error. Continue checking for partial results.
Bug: 5868832
Change-Id: Ic432f5f159320da9886d85c2525fa2cde8c67750
diff --git a/BandwidthController.cpp b/BandwidthController.cpp
index e31a515..664211d 100644
--- a/BandwidthController.cpp
+++ b/BandwidthController.cpp
@@ -1098,7 +1098,6 @@
TetherStats stats;
char *buffPtr;
int64_t packets, bytes;
- int statsFound = 0;
bool filterPair = filter.intIface[0] && filter.extIface[0];
@@ -1174,11 +1173,10 @@
stats = filter;
}
free(msg);
- statsFound++;
}
}
- /* We found some stats, and the last one isn't a partial stats. */
- if (statsFound && (stats.rxBytes == -1 || stats.txBytes == -1)) {
+ /* Successful if the last stats entry wasn't partial. */
+ if ((stats.rxBytes == -1) == (stats.txBytes == -1)) {
cli->sendMsg(ResponseCode::CommandOkay, "Tethering stats list completed", false);
return 0;
}