diff options
| -rw-r--r-- | core/java/com/android/server/NetworkManagementSocketTagger.java | 46 | ||||
| -rw-r--r-- | services/core/java/com/android/server/NetworkManagementService.java | 6 |
2 files changed, 15 insertions, 37 deletions
diff --git a/core/java/com/android/server/NetworkManagementSocketTagger.java b/core/java/com/android/server/NetworkManagementSocketTagger.java index 2959667e046f..26ff192521da 100644 --- a/core/java/com/android/server/NetworkManagementSocketTagger.java +++ b/core/java/com/android/server/NetworkManagementSocketTagger.java @@ -17,7 +17,6 @@ package com.android.server; import android.os.StrictMode; -import android.os.SystemProperties; import android.util.Log; import android.util.Slog; @@ -33,13 +32,6 @@ public final class NetworkManagementSocketTagger extends SocketTagger { private static final String TAG = "NetworkManagementSocketTagger"; private static final boolean LOGD = false; - /** - * {@link SystemProperties} key that indicates if {@code qtaguid} bandwidth - * controls have been enabled. - */ - // TODO: remove when always enabled, or once socket tagging silently fails. - public static final String PROP_QTAGUID_ENABLED = "net.qtaguid_enabled"; - private static ThreadLocal<SocketTags> threadSocketTags = new ThreadLocal<SocketTags>() { @Override protected SocketTags initialValue() { @@ -88,13 +80,11 @@ public final class NetworkManagementSocketTagger extends SocketTagger { private void tagSocketFd(FileDescriptor fd, int tag, int uid) { if (tag == -1 && uid == -1) return; - if (SystemProperties.getBoolean(PROP_QTAGUID_ENABLED, false)) { - final int errno = native_tagSocketFd(fd, tag, uid); - if (errno < 0) { - Log.i(TAG, "tagSocketFd(" + fd.getInt$() + ", " - + tag + ", " + - + uid + ") failed with errno" + errno); - } + final int errno = native_tagSocketFd(fd, tag, uid); + if (errno < 0) { + Log.i(TAG, "tagSocketFd(" + fd.getInt$() + ", " + + tag + ", " + + uid + ") failed with errno" + errno); } } @@ -110,11 +100,9 @@ public final class NetworkManagementSocketTagger extends SocketTagger { final SocketTags options = threadSocketTags.get(); if (options.statsTag == -1 && options.statsUid == -1) return; - if (SystemProperties.getBoolean(PROP_QTAGUID_ENABLED, false)) { - final int errno = native_untagSocketFd(fd); - if (errno < 0) { - Log.w(TAG, "untagSocket(" + fd.getInt$() + ") failed with errno " + errno); - } + final int errno = native_untagSocketFd(fd); + if (errno < 0) { + Log.w(TAG, "untagSocket(" + fd.getInt$() + ") failed with errno " + errno); } } @@ -124,21 +112,17 @@ public final class NetworkManagementSocketTagger extends SocketTagger { } public static void setKernelCounterSet(int uid, int counterSet) { - if (SystemProperties.getBoolean(PROP_QTAGUID_ENABLED, false)) { - final int errno = native_setCounterSet(counterSet, uid); - if (errno < 0) { - Log.w(TAG, "setKernelCountSet(" + uid + ", " + counterSet + ") failed with errno " - + errno); - } + final int errno = native_setCounterSet(counterSet, uid); + if (errno < 0) { + Log.w(TAG, "setKernelCountSet(" + uid + ", " + counterSet + ") failed with errno " + + errno); } } public static void resetKernelUidStats(int uid) { - if (SystemProperties.getBoolean(PROP_QTAGUID_ENABLED, false)) { - int errno = native_deleteTagData(0, uid); - if (errno < 0) { - Slog.w(TAG, "problem clearing counters for uid " + uid + " : errno " + errno); - } + int errno = native_deleteTagData(0, uid); + if (errno < 0) { + Slog.w(TAG, "problem clearing counters for uid " + uid + " : errno " + errno); } } diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java index c7e906876526..a2c2dbd407a5 100644 --- a/services/core/java/com/android/server/NetworkManagementService.java +++ b/services/core/java/com/android/server/NetworkManagementService.java @@ -39,8 +39,6 @@ import static android.net.NetworkStats.STATS_PER_UID; import static android.net.NetworkStats.TAG_NONE; import static android.net.TrafficStats.UID_TETHERING; -import static com.android.server.NetworkManagementSocketTagger.PROP_QTAGUID_ENABLED; - import android.annotation.NonNull; import android.app.ActivityManager; import android.content.Context; @@ -72,7 +70,6 @@ import android.os.ServiceManager; import android.os.ServiceSpecificException; import android.os.StrictMode; import android.os.SystemClock; -import android.os.SystemProperties; import android.os.Trace; import android.text.TextUtils; import android.util.Log; @@ -446,9 +443,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub { // push any existing quota or UID rules synchronized (mQuotaLock) { - // Netd unconditionally enable bandwidth control - SystemProperties.set(PROP_QTAGUID_ENABLED, "1"); - mStrictEnabled = true; setDataSaverModeEnabled(mDataSaverMode); |