Merge "NetworkStats: Avoid Division By 0" into sc-qpr1-dev am: c98d5a9d97
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15782831 Change-Id: I541f8edc99296f396dbf4c482a2687fb13424629
This commit is contained in:
@@ -290,7 +290,8 @@ public class NetworkStatsCollection implements FileRotator.Reader, FileRotator.W
|
|||||||
combined.getValues(augmentStart, augmentEnd, entry);
|
combined.getValues(augmentStart, augmentEnd, entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
final long rawBytes = entry.rxBytes + entry.txBytes;
|
final long rawBytes = (entry.rxBytes + entry.txBytes) == 0 ? 1 :
|
||||||
|
(entry.rxBytes + entry.txBytes);
|
||||||
final long rawRxBytes = entry.rxBytes == 0 ? 1 : entry.rxBytes;
|
final long rawRxBytes = entry.rxBytes == 0 ? 1 : entry.rxBytes;
|
||||||
final long rawTxBytes = entry.txBytes == 0 ? 1 : entry.txBytes;
|
final long rawTxBytes = entry.txBytes == 0 ? 1 : entry.txBytes;
|
||||||
final long targetBytes = augmentPlan.getDataUsageBytes();
|
final long targetBytes = augmentPlan.getDataUsageBytes();
|
||||||
|
|||||||
Reference in New Issue
Block a user