NetworkStats: Avoid Division By 0

RawBytes should always be at least 1 to avoid division by 0 and
ArithmeticException resulting in Settings crash.

Bug: 197292638
Change-Id: I4e5ac9da7adf707d7f991483555ab5c6d0cc3245
Merged-In: I4e5ac9da7adf707d7f991483555ab5c6d0cc3245
(cherry picked from commit 93581a034784f7473798e836f52c890a265dfc8b)
diff --git a/services/core/java/com/android/server/net/NetworkStatsCollection.java b/services/core/java/com/android/server/net/NetworkStatsCollection.java
index 557fa89..df372b1 100644
--- a/services/core/java/com/android/server/net/NetworkStatsCollection.java
+++ b/services/core/java/com/android/server/net/NetworkStatsCollection.java
@@ -290,7 +290,8 @@
                 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 rawTxBytes = entry.txBytes == 0 ? 1 : entry.txBytes;
             final long targetBytes = augmentPlan.getDataUsageBytes();