summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-11-08 13:04:22 -0800
committerJeff Sharkey <jsharkey@android.com>2011-11-08 13:04:22 -0800
commit38ddeaa67e52810da5db42895edb74b79111ec53 (patch)
tree25c07e6b9a1661f879210ceaf6bb8a7dd638bb47 /services
parent6dee1a9d046458134fb019669b5ffe7911dcdb29 (diff)
downloadframeworks_base-38ddeaa67e52810da5db42895edb74b79111ec53.zip
frameworks_base-38ddeaa67e52810da5db42895edb74b79111ec53.tar.gz
frameworks_base-38ddeaa67e52810da5db42895edb74b79111ec53.tar.bz2
Avoid inconsistent state when remove fails.
Bug: 5433432 Change-Id: Ia388fda006cbda09b5947fc61cec6353f75a3805
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/NetworkManagementService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/java/com/android/server/NetworkManagementService.java b/services/java/com/android/server/NetworkManagementService.java
index 6887de3..da960ae 100644
--- a/services/java/com/android/server/NetworkManagementService.java
+++ b/services/java/com/android/server/NetworkManagementService.java
@@ -1136,12 +1136,14 @@ public class NetworkManagementService extends INetworkManagementService.Stub
final StringBuilder command = new StringBuilder();
command.append("bandwidth removeiquota ").append(iface);
+ mActiveQuotaIfaces.remove(iface);
+ mActiveAlertIfaces.remove(iface);
+
try {
// TODO: support quota shared across interfaces
mConnector.doCommand(command.toString());
- mActiveQuotaIfaces.remove(iface);
- mActiveAlertIfaces.remove(iface);
} catch (NativeDaemonConnectorException e) {
+ // TODO: include current iptables state
throw new IllegalStateException("Error communicating to native daemon", e);
}
}