diff options
| author | 2018-02-09 10:06:59 -0700 | |
|---|---|---|
| committer | 2018-02-09 10:06:59 -0700 | |
| commit | a7be8da9adefaf6d55f7c90b95d0c6f9e66fca63 (patch) | |
| tree | 03f58d523b68f5ecb3ae6ef2162fdf480b2f7576 | |
| parent | f46dc156cfcb31da8714f29338614c2cd4fc61e7 (diff) | |
Shore up dividing by zero protections.
We're already trying to protect against zero elsewhere in this file,
but we've seen evidence of it still happening, so add last-ditch
protections.
Test: builds, boots
Bug: 73060623
Change-Id: I0549ed08f906521a8dbd9ff6162f80fa9b388434
| -rw-r--r-- | services/core/java/com/android/server/net/NetworkStatsCollection.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/net/NetworkStatsCollection.java b/services/core/java/com/android/server/net/NetworkStatsCollection.java index 961a45177897..3cc4d83267cf 100644 --- a/services/core/java/com/android/server/net/NetworkStatsCollection.java +++ b/services/core/java/com/android/server/net/NetworkStatsCollection.java @@ -187,6 +187,7 @@ public class NetworkStatsCollection implements FileRotator.Reader { */ @VisibleForTesting public static long multiplySafe(long value, long num, long den) { + if (den == 0) den = 1; long x = value; long y = num; |