remove PROP_QTAGUID_ENABLED
Remaining hits: $ repo grep 'net.qtaguid_enabled|PROP_QTAGUID_ENABLED' | egrep -v '^external/cpuinfo/test/mock/' art/Binary file tools/ahat/etc/L.hprof matches cts/Binary file tools/release-parser/tests/resources/boot-framework.art matches external/cpuinfo/test/dmesg/oppo-r9.log:2212:<14>[ 12.785966] (6)[1:init]init: [PropSet]: pid:887 uid:1000 gid:1000 set net.qtaguid_enabled=1 prebuilts/runtime/appcompat/hiddenapi-flags.csv:412141:Lcom/android/server/NetworkManagementSocketTagger;->PROP_QTAGUID_ENABLED:Ljava/lang/String;,blocked Bug: 161325508 Test: atest, TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ifa30a7549396312a970fc07c37e8fa8ed85abec0
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user