Merge "Revert^2 "Move service-connectivity to the tethering APEX""
This commit is contained in:
@@ -14,8 +14,8 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
cc_defaults {
|
cc_library_shared {
|
||||||
name: "libservice-connectivity-defaults",
|
name: "libservice-connectivity",
|
||||||
// TODO: build against the NDK (sdk_version: "30" for example)
|
// TODO: build against the NDK (sdk_version: "30" for example)
|
||||||
cflags: [
|
cflags: [
|
||||||
"-Wall",
|
"-Wall",
|
||||||
@@ -26,6 +26,7 @@ cc_defaults {
|
|||||||
srcs: [
|
srcs: [
|
||||||
"jni/com_android_server_TestNetworkService.cpp",
|
"jni/com_android_server_TestNetworkService.cpp",
|
||||||
"jni/com_android_server_connectivity_Vpn.cpp",
|
"jni/com_android_server_connectivity_Vpn.cpp",
|
||||||
|
"jni/onload.cpp",
|
||||||
],
|
],
|
||||||
shared_libs: [
|
shared_libs: [
|
||||||
"libbase",
|
"libbase",
|
||||||
@@ -35,27 +36,11 @@ cc_defaults {
|
|||||||
// addresses, and remove dependency on libnetutils.
|
// addresses, and remove dependency on libnetutils.
|
||||||
"libnetutils",
|
"libnetutils",
|
||||||
],
|
],
|
||||||
}
|
|
||||||
|
|
||||||
cc_library_shared {
|
|
||||||
name: "libservice-connectivity",
|
|
||||||
defaults: ["libservice-connectivity-defaults"],
|
|
||||||
srcs: [
|
|
||||||
"jni/onload.cpp",
|
|
||||||
],
|
|
||||||
apex_available: [
|
apex_available: [
|
||||||
// TODO: move this library to the tethering APEX and remove libservice-connectivity-static
|
"com.android.tethering",
|
||||||
// "com.android.tethering",
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static library linked into libservices.core until libservice-connectivity can be loaded from
|
|
||||||
// the tethering APEX instead.
|
|
||||||
cc_library_static {
|
|
||||||
name: "libservice-connectivity-static",
|
|
||||||
defaults: ["libservice-connectivity-defaults"],
|
|
||||||
}
|
|
||||||
|
|
||||||
java_library {
|
java_library {
|
||||||
name: "service-connectivity",
|
name: "service-connectivity",
|
||||||
srcs: [
|
srcs: [
|
||||||
@@ -75,5 +60,6 @@ java_library {
|
|||||||
],
|
],
|
||||||
apex_available: [
|
apex_available: [
|
||||||
"//apex_available:platform",
|
"//apex_available:platform",
|
||||||
|
"com.android.tethering",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ java_library {
|
|||||||
"services.voiceinteraction",
|
"services.voiceinteraction",
|
||||||
"services.wifi",
|
"services.wifi",
|
||||||
"service-blobstore",
|
"service-blobstore",
|
||||||
"service-connectivity",
|
|
||||||
"service-jobscheduler",
|
"service-jobscheduler",
|
||||||
"android.hidl.base-V1.0-java",
|
"android.hidl.base-V1.0-java",
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ public final class ConnectivityServiceInitializer extends SystemService {
|
|||||||
|
|
||||||
public ConnectivityServiceInitializer(Context context) {
|
public ConnectivityServiceInitializer(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
|
// Load JNI libraries used by ConnectivityService and its dependencies
|
||||||
|
System.loadLibrary("service-connectivity");
|
||||||
// TODO: Define formal APIs to get the needed services.
|
// TODO: Define formal APIs to get the needed services.
|
||||||
mConnectivity = new ConnectivityService(context, getNetworkManagementService(),
|
mConnectivity = new ConnectivityService(context, getNetworkManagementService(),
|
||||||
getNetworkStatsService());
|
getNetworkStatsService());
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ final public class IpConnectivityMetrics extends SystemService {
|
|||||||
|
|
||||||
public IpConnectivityMetrics(Context ctx, ToIntFunction<Context> capacityGetter) {
|
public IpConnectivityMetrics(Context ctx, ToIntFunction<Context> capacityGetter) {
|
||||||
super(ctx);
|
super(ctx);
|
||||||
|
// Load JNI libraries used by the IpConnectivityMetrics service and its dependencies
|
||||||
|
System.loadLibrary("service-connectivity");
|
||||||
mCapacityGetter = capacityGetter;
|
mCapacityGetter = capacityGetter;
|
||||||
initBuffer();
|
initBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,6 @@ cc_defaults {
|
|||||||
|
|
||||||
static_libs: [
|
static_libs: [
|
||||||
"android.hardware.broadcastradio@common-utils-1x-lib",
|
"android.hardware.broadcastradio@common-utils-1x-lib",
|
||||||
"libservice-connectivity-static",
|
|
||||||
],
|
],
|
||||||
|
|
||||||
product_variables: {
|
product_variables: {
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ int register_android_server_UsbHostManager(JNIEnv* env);
|
|||||||
int register_android_server_vr_VrManagerService(JNIEnv* env);
|
int register_android_server_vr_VrManagerService(JNIEnv* env);
|
||||||
int register_android_server_VibratorService(JNIEnv* env);
|
int register_android_server_VibratorService(JNIEnv* env);
|
||||||
int register_android_server_location_GnssLocationProvider(JNIEnv* env);
|
int register_android_server_location_GnssLocationProvider(JNIEnv* env);
|
||||||
int register_android_server_connectivity_Vpn(JNIEnv* env);
|
|
||||||
int register_android_server_TestNetworkService(JNIEnv* env);
|
|
||||||
int register_android_server_devicepolicy_CryptoTestHelper(JNIEnv*);
|
int register_android_server_devicepolicy_CryptoTestHelper(JNIEnv*);
|
||||||
int register_android_server_tv_TvUinputBridge(JNIEnv* env);
|
int register_android_server_tv_TvUinputBridge(JNIEnv* env);
|
||||||
int register_android_server_tv_TvInputHal(JNIEnv* env);
|
int register_android_server_tv_TvInputHal(JNIEnv* env);
|
||||||
@@ -93,8 +91,6 @@ extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
|
|||||||
register_android_server_VibratorService(env);
|
register_android_server_VibratorService(env);
|
||||||
register_android_server_SystemServer(env);
|
register_android_server_SystemServer(env);
|
||||||
register_android_server_location_GnssLocationProvider(env);
|
register_android_server_location_GnssLocationProvider(env);
|
||||||
register_android_server_connectivity_Vpn(env);
|
|
||||||
register_android_server_TestNetworkService(env);
|
|
||||||
register_android_server_devicepolicy_CryptoTestHelper(env);
|
register_android_server_devicepolicy_CryptoTestHelper(env);
|
||||||
register_android_server_ConsumerIrService(env);
|
register_android_server_ConsumerIrService(env);
|
||||||
register_android_server_BatteryStatsService(env);
|
register_android_server_BatteryStatsService(env);
|
||||||
|
|||||||
@@ -221,6 +221,8 @@ public final class SystemServer {
|
|||||||
"com.android.server.companion.CompanionDeviceManagerService";
|
"com.android.server.companion.CompanionDeviceManagerService";
|
||||||
private static final String STATS_COMPANION_APEX_PATH =
|
private static final String STATS_COMPANION_APEX_PATH =
|
||||||
"/apex/com.android.os.statsd/javalib/service-statsd.jar";
|
"/apex/com.android.os.statsd/javalib/service-statsd.jar";
|
||||||
|
private static final String CONNECTIVITY_SERVICE_APEX_PATH =
|
||||||
|
"/apex/com.android.tethering/javalib/service-connectivity.jar";
|
||||||
private static final String STATS_COMPANION_LIFECYCLE_CLASS =
|
private static final String STATS_COMPANION_LIFECYCLE_CLASS =
|
||||||
"com.android.server.stats.StatsCompanion$Lifecycle";
|
"com.android.server.stats.StatsCompanion$Lifecycle";
|
||||||
private static final String STATS_PULL_ATOM_SERVICE_CLASS =
|
private static final String STATS_PULL_ATOM_SERVICE_CLASS =
|
||||||
@@ -1220,7 +1222,8 @@ public final class SystemServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
t.traceBegin("IpConnectivityMetrics");
|
t.traceBegin("IpConnectivityMetrics");
|
||||||
mSystemServiceManager.startService(IP_CONNECTIVITY_METRICS_CLASS);
|
mSystemServiceManager.startServiceFromJar(IP_CONNECTIVITY_METRICS_CLASS,
|
||||||
|
CONNECTIVITY_SERVICE_APEX_PATH);
|
||||||
t.traceEnd();
|
t.traceEnd();
|
||||||
|
|
||||||
t.traceBegin("NetworkWatchlistService");
|
t.traceBegin("NetworkWatchlistService");
|
||||||
@@ -1561,8 +1564,8 @@ public final class SystemServer {
|
|||||||
// This has to be called after NetworkManagementService, NetworkStatsService
|
// This has to be called after NetworkManagementService, NetworkStatsService
|
||||||
// and NetworkPolicyManager because ConnectivityService needs to take these
|
// and NetworkPolicyManager because ConnectivityService needs to take these
|
||||||
// services to initialize.
|
// services to initialize.
|
||||||
// TODO: Dynamically load service-connectivity.jar by using startServiceFromJar.
|
mSystemServiceManager.startServiceFromJar(CONNECTIVITY_SERVICE_INITIALIZER_CLASS,
|
||||||
mSystemServiceManager.startService(CONNECTIVITY_SERVICE_INITIALIZER_CLASS);
|
CONNECTIVITY_SERVICE_APEX_PATH);
|
||||||
connectivity = IConnectivityManager.Stub.asInterface(
|
connectivity = IConnectivityManager.Stub.asInterface(
|
||||||
ServiceManager.getService(Context.CONNECTIVITY_SERVICE));
|
ServiceManager.getService(Context.CONNECTIVITY_SERVICE));
|
||||||
// TODO: Use ConnectivityManager instead of ConnectivityService.
|
// TODO: Use ConnectivityManager instead of ConnectivityService.
|
||||||
|
|||||||
@@ -70,4 +70,7 @@ android_test {
|
|||||||
"android.test.base",
|
"android.test.base",
|
||||||
"android.test.mock",
|
"android.test.mock",
|
||||||
],
|
],
|
||||||
|
jni_libs: [
|
||||||
|
"libservice-connectivity",
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user