Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f46dc156 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Let's not divide by zero.

Test: sure
Bug: 73060623
Change-Id: Ic9d60bb99e43a05c4131f642563d792de665e592
parent 9447b83c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1722,7 +1722,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
                final long totalBytes = getTotalBytes(
                        NetworkTemplate.buildTemplateMobileAll(state.subscriberId), start, end);
                final long remainingBytes = limitBytes - totalBytes;
                final long remainingDays = Math.min(1, (end - currentTimeMillis())
                final long remainingDays = Math.max(1, (end - currentTimeMillis())
                        / TimeUnit.DAYS.toMillis(1));
                if (remainingBytes > 0) {
                    quotaBytes = (remainingBytes / remainingDays) / 10;