Merge "[MS61] Remove NetworkManagementSocketTagger#install dependency" am: 513d8dd2ac am: c756efe7bd am: 211ee3e066
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952099 Change-Id: Ia76d1cf3d75f1189be719a9ded3d107ce1fd8221
This commit is contained in:
@@ -368,6 +368,7 @@ package android.net {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class TrafficStats {
|
public class TrafficStats {
|
||||||
|
method public static void attachSocketTagger();
|
||||||
method public static void init(@NonNull android.content.Context);
|
method public static void init(@NonNull android.content.Context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.app.ApplicationErrorReport;
|
|||||||
import android.app.IActivityManager;
|
import android.app.IActivityManager;
|
||||||
import android.compat.annotation.UnsupportedAppUsage;
|
import android.compat.annotation.UnsupportedAppUsage;
|
||||||
import android.content.type.DefaultMimeMapFactory;
|
import android.content.type.DefaultMimeMapFactory;
|
||||||
|
import android.net.TrafficStats;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.DeadObjectException;
|
import android.os.DeadObjectException;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
@@ -32,7 +33,6 @@ import android.util.Log;
|
|||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
|
|
||||||
import com.android.internal.logging.AndroidConfig;
|
import com.android.internal.logging.AndroidConfig;
|
||||||
import com.android.server.NetworkManagementSocketTagger;
|
|
||||||
|
|
||||||
import dalvik.system.RuntimeHooks;
|
import dalvik.system.RuntimeHooks;
|
||||||
import dalvik.system.VMRuntime;
|
import dalvik.system.VMRuntime;
|
||||||
@@ -254,7 +254,7 @@ public class RuntimeInit {
|
|||||||
/*
|
/*
|
||||||
* Wire socket tagging to traffic stats.
|
* Wire socket tagging to traffic stats.
|
||||||
*/
|
*/
|
||||||
NetworkManagementSocketTagger.install();
|
TrafficStats.attachSocketTagger();
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
|
import static android.annotation.SystemApi.Client.MODULE_LIBRARIES;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
@@ -213,6 +215,18 @@ public class TrafficStats {
|
|||||||
sStatsService = statsManager.getBinder();
|
sStatsService = statsManager.getBinder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attach the socket tagger implementation to the current process, to
|
||||||
|
* get notified when a socket's {@link FileDescriptor} is assigned to
|
||||||
|
* a thread. See {@link SocketTagger#set(SocketTagger)}.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi(client = MODULE_LIBRARIES)
|
||||||
|
public static void attachSocketTagger() {
|
||||||
|
NetworkManagementSocketTagger.install();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set active tag to use when accounting {@link Socket} traffic originating
|
* Set active tag to use when accounting {@link Socket} traffic originating
|
||||||
* from the current thread. Only one active tag per thread is supported.
|
* from the current thread. Only one active tag per thread is supported.
|
||||||
|
|||||||
Reference in New Issue
Block a user