Merge changes from topic "revert-1532910-connectivity_jar_in_apex-LKXFLQGLIU" am: 1ef739b3fa

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1541542

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I70cdc5ba92d03d76620db5fb2e78a65c9976539c
This commit is contained in:
Treehugger Robot
2021-01-07 18:06:23 +00:00
committed by Automerger Merge Worker
9 changed files with 30 additions and 20 deletions

View File

@@ -14,8 +14,8 @@
// limitations under the License.
//
cc_library_shared {
name: "libservice-connectivity",
cc_defaults {
name: "libservice-connectivity-defaults",
// TODO: build against the NDK (sdk_version: "30" for example)
cflags: [
"-Wall",
@@ -26,7 +26,6 @@ cc_library_shared {
srcs: [
"jni/com_android_server_TestNetworkService.cpp",
"jni/com_android_server_connectivity_Vpn.cpp",
"jni/onload.cpp",
],
shared_libs: [
"libbase",
@@ -36,9 +35,25 @@ cc_library_shared {
// addresses, and remove dependency on libnetutils.
"libnetutils",
],
apex_available: [
"com.android.tethering",
}
cc_library_shared {
name: "libservice-connectivity",
defaults: ["libservice-connectivity-defaults"],
srcs: [
"jni/onload.cpp",
],
apex_available: [
// TODO: move this library to the tethering APEX and remove libservice-connectivity-static
// "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 {
@@ -60,6 +75,5 @@ java_library {
],
apex_available: [
"//apex_available:platform",
"com.android.tethering",
],
}

View File

@@ -83,6 +83,7 @@ java_library {
"services.voiceinteraction",
"services.wifi",
"service-blobstore",
"service-connectivity",
"service-jobscheduler",
"android.hidl.base-V1.0-java",
],

View File

@@ -35,8 +35,6 @@ public final class ConnectivityServiceInitializer extends SystemService {
public ConnectivityServiceInitializer(Context 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.
mConnectivity = new ConnectivityService(context, getNetworkManagementService(),
getNetworkStatsService());

View File

@@ -122,8 +122,6 @@ final public class IpConnectivityMetrics extends SystemService {
public IpConnectivityMetrics(Context ctx, ToIntFunction<Context> capacityGetter) {
super(ctx);
// Load JNI libraries used by the IpConnectivityMetrics service and its dependencies
System.loadLibrary("service-connectivity");
mCapacityGetter = capacityGetter;
initBuffer();
}

View File

@@ -177,7 +177,7 @@ public class PacManager {
* @param proxy Proxy information that is about to be broadcast.
* @return Returns whether the broadcast should be sent : either DO_ or DONT_SEND_BROADCAST
*/
public synchronized boolean setCurrentProxyScriptUrl(ProxyInfo proxy) {
synchronized boolean setCurrentProxyScriptUrl(ProxyInfo proxy) {
if (!Uri.EMPTY.equals(proxy.getPacFileUrl())) {
if (proxy.getPacFileUrl().equals(mPacUrl) && (proxy.getPort() > 0)) {
// Allow to send broadcast, nothing to do.

View File

@@ -168,6 +168,7 @@ cc_defaults {
static_libs: [
"android.hardware.broadcastradio@common-utils-1x-lib",
"libservice-connectivity-static",
],
product_variables: {

View File

@@ -40,6 +40,8 @@ int register_android_server_UsbHostManager(JNIEnv* env);
int register_android_server_vr_VrManagerService(JNIEnv* env);
int register_android_server_VibratorService(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_tv_TvUinputBridge(JNIEnv* env);
int register_android_server_tv_TvInputHal(JNIEnv* env);
@@ -91,6 +93,8 @@ extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
register_android_server_VibratorService(env);
register_android_server_SystemServer(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_ConsumerIrService(env);
register_android_server_BatteryStatsService(env);

View File

@@ -221,8 +221,6 @@ public final class SystemServer {
"com.android.server.companion.CompanionDeviceManagerService";
private static final String STATS_COMPANION_APEX_PATH =
"/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 =
"com.android.server.stats.StatsCompanion$Lifecycle";
private static final String STATS_PULL_ATOM_SERVICE_CLASS =
@@ -1222,8 +1220,7 @@ public final class SystemServer {
}
t.traceBegin("IpConnectivityMetrics");
mSystemServiceManager.startServiceFromJar(IP_CONNECTIVITY_METRICS_CLASS,
CONNECTIVITY_SERVICE_APEX_PATH);
mSystemServiceManager.startService(IP_CONNECTIVITY_METRICS_CLASS);
t.traceEnd();
t.traceBegin("NetworkWatchlistService");
@@ -1564,8 +1561,8 @@ public final class SystemServer {
// This has to be called after NetworkManagementService, NetworkStatsService
// and NetworkPolicyManager because ConnectivityService needs to take these
// services to initialize.
mSystemServiceManager.startServiceFromJar(CONNECTIVITY_SERVICE_INITIALIZER_CLASS,
CONNECTIVITY_SERVICE_APEX_PATH);
// TODO: Dynamically load service-connectivity.jar by using startServiceFromJar.
mSystemServiceManager.startService(CONNECTIVITY_SERVICE_INITIALIZER_CLASS);
connectivity = IConnectivityManager.Stub.asInterface(
ServiceManager.getService(Context.CONNECTIVITY_SERVICE));
// TODO: Use ConnectivityManager instead of ConnectivityService.

View File

@@ -70,7 +70,4 @@ android_test {
"android.test.base",
"android.test.mock",
],
jni_libs: [
"libservice-connectivity",
],
}