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
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user