Use connectivity APIs from framework-connectivity

Instead of compiling framework-connectivity source into
frameworks-minus-apex, have the APIs loaded separately from
framework-connectivity.

Bug: 171540887
Test: device boots, has connectivity
Change-Id: I8f07ff2082c3de80821e121807e66a43a870de7b
This commit is contained in:
Remi NGUYEN VAN
2021-03-19 10:15:06 +00:00
parent 143600af4e
commit 7b6b006f5d
6 changed files with 12 additions and 10 deletions

View File

@@ -465,6 +465,7 @@ java_library {
static_libs: [
"android.net.ipsec.ike.stubs.module_lib",
"framework-appsearch.stubs.module_lib",
"framework-connectivity.stubs.module_lib",
"framework-graphics.stubs.module_lib",
"framework-media.stubs.module_lib",
"framework-mediaprovider.stubs.module_lib",
@@ -487,6 +488,7 @@ java_library {
"android.net.ipsec.ike.impl",
"framework-minus-apex",
"framework-appsearch.impl",
"framework-connectivity.impl",
"framework-graphics.impl",
"framework-mediaprovider.impl",
"framework-permission.impl",
@@ -643,14 +645,17 @@ java_defaults {
defaults: ["framework-aidl-export-defaults"],
srcs: [
":framework-non-updatable-sources",
":framework-connectivity-sources",
"core/java/**/*.logtags",
],
// See comment on framework-atb-backward-compatibility module below
exclude_srcs: ["core/java/android/content/pm/AndroidTestBaseUpdater.java"],
aidl: {
generate_get_transaction_name: true,
local_include_dirs: ["media/aidl"],
local_include_dirs: [
"media/aidl",
// TODO: move to include_dirs when migrated to packages/modules
"packages/Connectivity/framework/aidl-export",
],
include_dirs: ["frameworks/av/aidl"],
},
dxflags: [
@@ -703,8 +708,6 @@ java_library {
apex_available: ["//apex_available:platform"],
visibility: [
"//frameworks/base",
// TODO: remove when framework-connectivity can build against API
"//frameworks/base/packages/Connectivity/framework",
// TODO(b/147128803) remove the below lines
"//frameworks/base/apex/appsearch/framework",
"//frameworks/base/apex/blobstore/framework",
@@ -743,6 +746,7 @@ java_library {
static_libs: [
"app-compat-annotations",
"framework-minus-apex",
"framework-connectivity.impl", // TODO(b/182859030): should be removed
"framework-appsearch.impl", // TODO(b/146218515): should be removed
"framework-updatable-stubs-module_libs_api",
],

View File

@@ -32,6 +32,7 @@ java_library {
},
libs: [
"app-compat-annotations",
"framework-connectivity.stubs.module_lib",
"framework-minus-apex",
"unsupportedappusage",
],

View File

@@ -221,7 +221,6 @@ cc_library_shared {
static_libs: [
"libasync_safe",
"libconnectivityframeworkutils",
"libbinderthreadstateutils",
"libdmabufinfo",
"libgif",
@@ -238,7 +237,6 @@ cc_library_shared {
"android.hardware.camera.device@3.2",
"media_permission-aidl-cpp",
"libandroidicu",
"libandroid_net",
"libbpf_android",
"libnetdbpf",
"libnetdutils",

View File

@@ -156,7 +156,6 @@ extern int register_android_os_SharedMemory(JNIEnv* env);
extern int register_android_service_DataLoaderService(JNIEnv* env);
extern int register_android_os_incremental_IncrementalManager(JNIEnv* env);
extern int register_android_net_LocalSocketImpl(JNIEnv* env);
extern int register_android_net_NetworkUtils(JNIEnv* env);
extern int register_android_text_AndroidCharacter(JNIEnv *env);
extern int register_android_text_Hyphenator(JNIEnv *env);
extern int register_android_opengl_classes(JNIEnv *env);
@@ -1548,7 +1547,6 @@ static const RegJNIRec gRegJNI[] = {
REG_JNI(register_android_os_Trace),
REG_JNI(register_android_os_UEventObserver),
REG_JNI(register_android_net_LocalSocketImpl),
REG_JNI(register_android_net_NetworkUtils),
REG_JNI(register_android_os_MemoryFile),
REG_JNI(register_android_os_SharedMemory),
REG_JNI(register_android_os_incremental_IncrementalManager),

View File

@@ -35,7 +35,6 @@ java_library {
":framework-javastream-protos",
],
apex_available: [
"//apex_available:platform",
"com.android.tethering",
],
jarjar_rules: "jarjar-rules-proto.txt",
@@ -125,7 +124,6 @@ java_sdk_library {
"//packages/modules/Connectivity/Tethering/tests/unit",
],
apex_available: [
"//apex_available:platform",
"com.android.tethering",
],
}

View File

@@ -42,6 +42,9 @@ import java.util.TreeSet;
* {@hide}
*/
public class NetworkUtils {
static {
System.loadLibrary("framework-connectivity-jni");
}
private static final String TAG = "NetworkUtils";