Build framework-connectivity-tiramisu library
- Move nsd APIs and build framework-connectivity-tiramisu library
- Add nsd associated hidden apis
- Build service-connectivity-tiramisu-pre-jarjar library for
T+ services.
- Move ConnectivityServiceInitialiizer to service-t directory
to create S+ service instances which can avoid dependency on
lower sdk library.
Bug: 206893064
Test: atest FrameworksNetTests CtsNetTestCases
Ignore-AOSP-First: Other commits has merged conflict.
CTS-Coverage-Bug: 207804007
Change-Id: I9628716f5c38047ff4ea2346b27589077259c436
diff --git a/service/Android.bp b/service/Android.bp
index b595ef2..1f87848 100644
--- a/service/Android.bp
+++ b/service/Android.bp
@@ -80,6 +80,10 @@
"com.android.tethering",
],
lint: { strict_updatability_linting: true },
+ visibility: [
+ "//packages/modules/Connectivity/service-t",
+ "//packages/modules/Connectivity/tests:__subpackages__",
+ ],
}
java_library {
@@ -104,8 +108,13 @@
sdk_version: "system_server_current",
min_sdk_version: "30",
installable: true,
+ // This library combines system server jars that have access to different bootclasspath jars.
+ // Lower SDK service jars must not depend on higher SDK jars as that would let them
+ // transitively depend on the wrong bootclasspath jars. Sources also cannot be added here as
+ // they would transitively depend on bootclasspath jars that may not be available.
static_libs: [
"service-connectivity-pre-jarjar",
+ "service-connectivity-tiramisu-pre-jarjar",
],
jarjar_rules: "jarjar-rules.txt",
apex_available: [
diff --git a/service/src/com/android/server/ConnectivityServiceInitializer.java b/service/src/com/android/server/ConnectivityServiceInitializer.java
deleted file mode 100644
index b1a56ae..0000000
--- a/service/src/com/android/server/ConnectivityServiceInitializer.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.server;
-
-import android.content.Context;
-import android.util.Log;
-
-/**
- * Connectivity service initializer for core networking. This is called by system server to create
- * a new instance of ConnectivityService.
- */
-public final class ConnectivityServiceInitializer extends SystemService {
- private static final String TAG = ConnectivityServiceInitializer.class.getSimpleName();
- private final ConnectivityService mConnectivity;
-
- public ConnectivityServiceInitializer(Context context) {
- super(context);
- // Load JNI libraries used by ConnectivityService and its dependencies
- System.loadLibrary("service-connectivity");
- mConnectivity = new ConnectivityService(context);
- }
-
- @Override
- public void onStart() {
- Log.i(TAG, "Registering " + Context.CONNECTIVITY_SERVICE);
- publishBinderService(Context.CONNECTIVITY_SERVICE, mConnectivity,
- /* allowIsolated= */ false);
- }
-}