Data usage: precise editing, restrict help, D-pad.
Introduce dialogs for precise editing of network policy warning/limit values, triggered by click on sweep labels. Show up to 999MB before rounding to GB, and round to nearest 5MB value when dragging. Partial D-pad navigation around chart controls. Fix jumping when relayout during drag, and fix sweep overlap bug. When restricting data without limited networks, show dialog help to guide user towards network limit. When reloading chart data, try restoring to nearest cycle. Bug: 5289641, 5111701, 5226078 Change-Id: Ic59dee6496c480a64dc56f8534acf4d81b50bca7
This commit is contained in:
@@ -149,6 +149,10 @@ public class NetworkPolicyEditor {
|
||||
template, cycleDay, WARNING_DISABLED, LIMIT_DISABLED, SNOOZE_NEVER);
|
||||
}
|
||||
|
||||
public int getPolicyCycleDay(NetworkTemplate template) {
|
||||
return getPolicy(template).cycleDay;
|
||||
}
|
||||
|
||||
public void setPolicyCycleDay(NetworkTemplate template, int cycleDay) {
|
||||
final NetworkPolicy policy = getOrCreatePolicy(template);
|
||||
policy.cycleDay = cycleDay;
|
||||
@@ -156,6 +160,10 @@ public class NetworkPolicyEditor {
|
||||
writeAsync();
|
||||
}
|
||||
|
||||
public long getPolicyWarningBytes(NetworkTemplate template) {
|
||||
return getPolicy(template).warningBytes;
|
||||
}
|
||||
|
||||
public void setPolicyWarningBytes(NetworkTemplate template, long warningBytes) {
|
||||
final NetworkPolicy policy = getOrCreatePolicy(template);
|
||||
policy.warningBytes = warningBytes;
|
||||
@@ -163,6 +171,10 @@ public class NetworkPolicyEditor {
|
||||
writeAsync();
|
||||
}
|
||||
|
||||
public long getPolicyLimitBytes(NetworkTemplate template) {
|
||||
return getPolicy(template).limitBytes;
|
||||
}
|
||||
|
||||
public void setPolicyLimitBytes(NetworkTemplate template, long limitBytes) {
|
||||
final NetworkPolicy policy = getOrCreatePolicy(template);
|
||||
policy.limitBytes = limitBytes;
|
||||
|
Reference in New Issue
Block a user