Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73a8f26a authored by San Mehat's avatar San Mehat Committed by Android (Google) Code Review
Browse files

Merge "NetworkManagementService: Combine setInterfaceRx/Tx throttle and add max speed" into froyo

parents 5923c971 be23fba2
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -191,14 +191,9 @@ interface INetworkManagementService
    long getInterfaceRxCounter(String iface);

    /**
     * Configures RX bandwidth throttling on an interface
     * Configures bandwidth throttling on an interface
     */
    void setInterfaceRxThrottle(String iface, int kbps);

    /**
     * Configures TX bandwidth throttling on an interface
     */
    void setInterfaceTxThrottle(String iface, int kbps);
    void setInterfaceThrottle(String iface, int maxKbits, int rxKbps, int txKbps);

    /**
     * Returns the currently configured RX throttle values
@@ -211,4 +206,5 @@ interface INetworkManagementService
     * for the specified interface
     */
    int getInterfaceTxThrottle(String iface);

}
+2 −10
Original line number Diff line number Diff line
@@ -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) {