NetworkManagementService: Combine setInterfaceRx/Tx throttle and add max speed

Change-Id: I1d6816c9754801504a988802118a2167e0eb8690
Signed-off-by: San Mehat <san@google.com>
This commit is contained in:
San Mehat
2010-04-02 11:50:05 -07:00
parent c1548e3819
commit be23fba286
2 changed files with 5 additions and 17 deletions

View File

@@ -564,19 +564,11 @@ class NetworkManagementService extends INetworkManagementService.Stub {
return getInterfaceCounter(iface, false);
}
private void setInterfaceThrottle(String iface, boolean rx, int kbps) {
public void setInterfaceThrottle(String iface, int maxKbps, int rxKbps, int txKbps) {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.CHANGE_NETWORK_STATE, "NetworkManagementService");
mConnector.doCommand(String.format(
"interface setthrottle %s %s %d", iface, (rx ? "rx" : "tx"), kbps));
}
public void setInterfaceRxThrottle(String iface, int kbps) {
setInterfaceThrottle(iface, true, kbps);
}
public void setInterfaceTxThrottle(String iface, int kbps) {
setInterfaceThrottle(iface, false, kbps);
"interface setthrottle %s %d %d %d", iface, maxKbps, rxKbps, txKbps));
}
private int getInterfaceThrottle(String iface, boolean rx) {