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

Commit da71ca08 authored by Fan Zhang's avatar Fan Zhang
Browse files

Parse -1 as WARNING_DISABLED in NetworkPolicyManager.

Bug: 26934313
Bug: 31437693
Test: Flashed phone with new config (-1) and verified data warning is
disabled out of box.
Change-Id: Iabdfb9d0625698d525d7537a93b936df505bd0ab
parent 3304f950
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1442,8 +1442,14 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
                + "; generating default policy");

        // Build default mobile policy, and assume usage cycle starts today
        final long warningBytes = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_networkPolicyDefaultWarning) * MB_IN_BYTES;
        final int dataWarningConfig = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_networkPolicyDefaultWarning);
        final long warningBytes;
        if (dataWarningConfig == WARNING_DISABLED) {
            warningBytes = WARNING_DISABLED;
        } else {
            warningBytes = dataWarningConfig * MB_IN_BYTES;
        }

        final Time time = new Time();
        time.setToNow();