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

Commit 52f1e6f6 authored by Chenbo Feng's avatar Chenbo Feng
Browse files

Always enable bandwidth control in Q

The current bindwith control check the qtaguid module before start. But
since the bandwidth controlling feature is tested by CTS already, all
devices should have either xt_qtaguid or proper eBPF program to support
that by default. So just delete the checking code and always try to turn
it on when device start

Bug: 30950746
Test: The bindwith control start correctly on new devices.
Change-Id: I4cc5ebfbcf89181fcdba3a2711b637722e56ce73
parent c96760f4
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -621,13 +621,11 @@ public class NetworkManagementService extends INetworkManagementService.Stub

        mBandwidthControlEnabled = false;

        // only enable bandwidth control when support exists
        final boolean hasKernelSupport = new File("/proc/net/xt_qtaguid/ctrl").exists();

        // push any existing quota or UID rules
        synchronized (mQuotaLock) {

            if (hasKernelSupport) {
            // TODO: Delete this code and have netd unconditionally enable bandwidth control at
            // startup time
            Slog.d(TAG, "enabling bandwidth control");
            try {
                mConnector.execute("bandwidth", "enable");
@@ -635,9 +633,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub
            } catch (NativeDaemonConnectorException e) {
                Log.wtf(TAG, "problem enabling bandwidth controls", e);
            }
            } else {
                Slog.i(TAG, "not enabling bandwidth control");
            }

            SystemProperties.set(PROP_QTAGUID_ENABLED, mBandwidthControlEnabled ? "1" : "0");