am 73a8f26a: Merge "NetworkManagementService: Combine setInterfaceRx/Tx throttle and add max speed" into froyo
Merge commit '73a8f26aef40184d9d5dfe9dabcfbd345deb6386' into froyo-plus-aosp * commit '73a8f26aef40184d9d5dfe9dabcfbd345deb6386': NetworkManagementService: Combine setInterfaceRx/Tx throttle and add max speed
This commit is contained in:
@@ -191,14 +191,9 @@ interface INetworkManagementService
|
|||||||
long getInterfaceRxCounter(String iface);
|
long getInterfaceRxCounter(String iface);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures RX bandwidth throttling on an interface
|
* Configures bandwidth throttling on an interface
|
||||||
*/
|
*/
|
||||||
void setInterfaceRxThrottle(String iface, int kbps);
|
void setInterfaceThrottle(String iface, int maxKbits, int rxKbps, int txKbps);
|
||||||
|
|
||||||
/**
|
|
||||||
* Configures TX bandwidth throttling on an interface
|
|
||||||
*/
|
|
||||||
void setInterfaceTxThrottle(String iface, int kbps);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the currently configured RX throttle values
|
* Returns the currently configured RX throttle values
|
||||||
@@ -211,4 +206,5 @@ interface INetworkManagementService
|
|||||||
* for the specified interface
|
* for the specified interface
|
||||||
*/
|
*/
|
||||||
int getInterfaceTxThrottle(String iface);
|
int getInterfaceTxThrottle(String iface);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -564,19 +564,11 @@ class NetworkManagementService extends INetworkManagementService.Stub {
|
|||||||
return getInterfaceCounter(iface, false);
|
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(
|
mContext.enforceCallingOrSelfPermission(
|
||||||
android.Manifest.permission.CHANGE_NETWORK_STATE, "NetworkManagementService");
|
android.Manifest.permission.CHANGE_NETWORK_STATE, "NetworkManagementService");
|
||||||
mConnector.doCommand(String.format(
|
mConnector.doCommand(String.format(
|
||||||
"interface setthrottle %s %s %d", iface, (rx ? "rx" : "tx"), kbps));
|
"interface setthrottle %s %d %d %d", iface, maxKbps, rxKbps, txKbps));
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterfaceRxThrottle(String iface, int kbps) {
|
|
||||||
setInterfaceThrottle(iface, true, kbps);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterfaceTxThrottle(String iface, int kbps) {
|
|
||||||
setInterfaceThrottle(iface, false, kbps);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getInterfaceThrottle(String iface, boolean rx) {
|
private int getInterfaceThrottle(String iface, boolean rx) {
|
||||||
|
|||||||
Reference in New Issue
Block a user