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

Commit 1169af15 authored by Chenbo Feng's avatar Chenbo Feng Committed by android-build-merger
Browse files

Merge "Always enable bandwidth control in Q" am: 4be14198 am: e3621c5e

am: 827fa6e1

Change-Id: I92ac5efec3380dd98ebab82b763c78771a102fc3
parents 2e71381c 827fa6e1
Loading
Loading
Loading
Loading
+8 −13
Original line number Original line Diff line number Diff line
@@ -626,13 +626,11 @@ public class NetworkManagementService extends INetworkManagementService.Stub


        mBandwidthControlEnabled = false;
        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
        // push any existing quota or UID rules
        synchronized (mQuotaLock) {
        synchronized (mQuotaLock) {


            if (hasKernelSupport) {
            // TODO: Delete this code and have netd unconditionally enable bandwidth control at
            // startup time
            Slog.d(TAG, "enabling bandwidth control");
            Slog.d(TAG, "enabling bandwidth control");
            try {
            try {
                mConnector.execute("bandwidth", "enable");
                mConnector.execute("bandwidth", "enable");
@@ -640,9 +638,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub
            } catch (NativeDaemonConnectorException e) {
            } catch (NativeDaemonConnectorException e) {
                Log.wtf(TAG, "problem enabling bandwidth controls", 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");
            SystemProperties.set(PROP_QTAGUID_ENABLED, mBandwidthControlEnabled ? "1" : "0");