Move networkstats JNI to connectivity module
Reorganize networkstats JNI so it can be included in the connectivity module. Bug: 197717846 Test: m Change-Id: I815ea379f3d9915041c80ac5e743ce62e05f4cf8 Merged-In: I815ea379f3d9915041c80ac5e743ce62e05f4cf8
This commit is contained in:
committed by
junyulai
parent
6b708138c1
commit
f7c0b1fd9e
@@ -194,10 +194,9 @@ cc_library_shared {
|
|||||||
"jni/onload.cpp",
|
"jni/onload.cpp",
|
||||||
],
|
],
|
||||||
shared_libs: [
|
shared_libs: [
|
||||||
|
"libandroid",
|
||||||
"liblog",
|
"liblog",
|
||||||
],
|
"libnativehelper",
|
||||||
static_libs: [
|
|
||||||
"libnativehelper_compat_libc++",
|
|
||||||
],
|
],
|
||||||
stl: "none",
|
stl: "none",
|
||||||
apex_available: [
|
apex_available: [
|
||||||
|
|||||||
@@ -40,6 +40,30 @@ filegroup {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For test code only.
|
||||||
|
filegroup {
|
||||||
|
name: "lib_networkStatsFactory_native",
|
||||||
|
srcs: [
|
||||||
|
"jni/com_android_server_net_NetworkStatsFactory.cpp",
|
||||||
|
],
|
||||||
|
path: "jni",
|
||||||
|
visibility: [
|
||||||
|
"//packages/modules/Connectivity:__subpackages__",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
filegroup {
|
||||||
|
name: "services.connectivity-netstats-jni-sources",
|
||||||
|
srcs: [
|
||||||
|
"jni/com_android_server_net_NetworkStatsFactory.cpp",
|
||||||
|
"jni/com_android_server_net_NetworkStatsService.cpp",
|
||||||
|
],
|
||||||
|
path: "jni",
|
||||||
|
visibility: [
|
||||||
|
"//packages/modules/Connectivity:__subpackages__",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
// Nsd related libraries.
|
// Nsd related libraries.
|
||||||
|
|
||||||
filegroup {
|
filegroup {
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public class NetworkStatsFactory {
|
public class NetworkStatsFactory {
|
||||||
|
static {
|
||||||
|
System.loadLibrary("service-connectivity");
|
||||||
|
}
|
||||||
|
|
||||||
private static final String TAG = "NetworkStatsFactory";
|
private static final String TAG = "NetworkStatsFactory";
|
||||||
|
|
||||||
private static final boolean USE_NATIVE_PARSING = true;
|
private static final boolean USE_NATIVE_PARSING = true;
|
||||||
|
|||||||
@@ -173,6 +173,10 @@ import java.util.concurrent.TimeUnit;
|
|||||||
*/
|
*/
|
||||||
@TargetApi(Build.VERSION_CODES.TIRAMISU)
|
@TargetApi(Build.VERSION_CODES.TIRAMISU)
|
||||||
public class NetworkStatsService extends INetworkStatsService.Stub {
|
public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||||
|
static {
|
||||||
|
System.loadLibrary("service-connectivity");
|
||||||
|
}
|
||||||
|
|
||||||
static final String TAG = "NetworkStats";
|
static final String TAG = "NetworkStats";
|
||||||
static final boolean LOGD = Log.isLoggable(TAG, Log.DEBUG);
|
static final boolean LOGD = Log.isLoggable(TAG, Log.DEBUG);
|
||||||
static final boolean LOGV = Log.isLoggable(TAG, Log.VERBOSE);
|
static final boolean LOGV = Log.isLoggable(TAG, Log.VERBOSE);
|
||||||
|
|||||||
@@ -178,10 +178,6 @@ cc_library_shared {
|
|||||||
name: "libandroid_servers",
|
name: "libandroid_servers",
|
||||||
defaults: ["libservices.core-libs"],
|
defaults: ["libservices.core-libs"],
|
||||||
whole_static_libs: ["libservices.core"],
|
whole_static_libs: ["libservices.core"],
|
||||||
required: [
|
|
||||||
// TODO: remove after NetworkStatsService is moved to the mainline module.
|
|
||||||
"libcom_android_net_module_util_jni",
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
platform_compat_config {
|
platform_compat_config {
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ cc_library_static {
|
|||||||
"com_android_server_lights_LightsService.cpp",
|
"com_android_server_lights_LightsService.cpp",
|
||||||
"com_android_server_location_GnssLocationProvider.cpp",
|
"com_android_server_location_GnssLocationProvider.cpp",
|
||||||
"com_android_server_locksettings_SyntheticPasswordManager.cpp",
|
"com_android_server_locksettings_SyntheticPasswordManager.cpp",
|
||||||
"com_android_server_net_NetworkStatsService.cpp",
|
|
||||||
"com_android_server_power_PowerManagerService.cpp",
|
"com_android_server_power_PowerManagerService.cpp",
|
||||||
"com_android_server_powerstats_PowerStatsService.cpp",
|
"com_android_server_powerstats_PowerStatsService.cpp",
|
||||||
"com_android_server_hint_HintManagerService.cpp",
|
"com_android_server_hint_HintManagerService.cpp",
|
||||||
@@ -73,7 +72,6 @@ cc_library_static {
|
|||||||
"com_android_server_sensor_SensorService.cpp",
|
"com_android_server_sensor_SensorService.cpp",
|
||||||
"onload.cpp",
|
"onload.cpp",
|
||||||
":lib_cachedAppOptimizer_native",
|
":lib_cachedAppOptimizer_native",
|
||||||
":lib_networkStatsFactory_native",
|
|
||||||
],
|
],
|
||||||
|
|
||||||
include_dirs: [
|
include_dirs: [
|
||||||
@@ -85,7 +83,6 @@ cc_library_static {
|
|||||||
|
|
||||||
header_libs: [
|
header_libs: [
|
||||||
"bionic_libc_platform_headers",
|
"bionic_libc_platform_headers",
|
||||||
"bpf_connectivity_headers",
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,9 +137,6 @@ cc_defaults {
|
|||||||
"libhidlbase",
|
"libhidlbase",
|
||||||
"libutils",
|
"libutils",
|
||||||
"libhwui",
|
"libhwui",
|
||||||
"libbpf_android",
|
|
||||||
"libnetdutils",
|
|
||||||
"libnetworkstats",
|
|
||||||
"libpsi",
|
"libpsi",
|
||||||
"libdataloader",
|
"libdataloader",
|
||||||
"libincfs",
|
"libincfs",
|
||||||
@@ -204,13 +198,6 @@ cc_defaults {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
filegroup {
|
|
||||||
name: "lib_networkStatsFactory_native",
|
|
||||||
srcs: [
|
|
||||||
"com_android_server_net_NetworkStatsFactory.cpp",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
filegroup {
|
filegroup {
|
||||||
name: "lib_cachedAppOptimizer_native",
|
name: "lib_cachedAppOptimizer_native",
|
||||||
srcs: [
|
srcs: [
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ int register_android_server_Watchdog(JNIEnv* env);
|
|||||||
int register_android_server_HardwarePropertiesManagerService(JNIEnv* env);
|
int register_android_server_HardwarePropertiesManagerService(JNIEnv* env);
|
||||||
int register_android_server_SyntheticPasswordManager(JNIEnv* env);
|
int register_android_server_SyntheticPasswordManager(JNIEnv* env);
|
||||||
int register_android_hardware_display_DisplayViewport(JNIEnv* env);
|
int register_android_hardware_display_DisplayViewport(JNIEnv* env);
|
||||||
int register_android_server_net_NetworkStatsFactory(JNIEnv* env);
|
|
||||||
int register_android_server_net_NetworkStatsService(JNIEnv* env);
|
|
||||||
int register_android_server_am_CachedAppOptimizer(JNIEnv* env);
|
int register_android_server_am_CachedAppOptimizer(JNIEnv* env);
|
||||||
int register_android_server_am_LowMemDetector(JNIEnv* env);
|
int register_android_server_am_LowMemDetector(JNIEnv* env);
|
||||||
int register_com_android_server_soundtrigger_middleware_AudioSessionProviderImpl(JNIEnv* env);
|
int register_com_android_server_soundtrigger_middleware_AudioSessionProviderImpl(JNIEnv* env);
|
||||||
@@ -107,8 +105,6 @@ extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
|
|||||||
register_android_server_SyntheticPasswordManager(env);
|
register_android_server_SyntheticPasswordManager(env);
|
||||||
register_android_graphics_GraphicsStatsService(env);
|
register_android_graphics_GraphicsStatsService(env);
|
||||||
register_android_hardware_display_DisplayViewport(env);
|
register_android_hardware_display_DisplayViewport(env);
|
||||||
register_android_server_net_NetworkStatsFactory(env);
|
|
||||||
register_android_server_net_NetworkStatsService(env);
|
|
||||||
register_android_server_am_CachedAppOptimizer(env);
|
register_android_server_am_CachedAppOptimizer(env);
|
||||||
register_android_server_am_LowMemDetector(env);
|
register_android_server_am_LowMemDetector(env);
|
||||||
register_com_android_server_soundtrigger_middleware_AudioSessionProviderImpl(env);
|
register_com_android_server_soundtrigger_middleware_AudioSessionProviderImpl(env);
|
||||||
|
|||||||
Reference in New Issue
Block a user