2019-08-27 02:19:38 +00:00
|
|
|
//
|
|
|
|
// Copyright (C) 2019 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.
|
|
|
|
//
|
|
|
|
|
|
|
|
java_defaults {
|
|
|
|
name: "TetheringAndroidLibraryDefaults",
|
|
|
|
platform_apis: true,
|
|
|
|
srcs: [
|
|
|
|
"src/**/*.java",
|
2019-09-03 07:58:06 +00:00
|
|
|
":framework-tethering-shared-srcs",
|
2019-08-09 06:52:06 +00:00
|
|
|
":net-module-utils-srcs",
|
2019-09-03 07:58:06 +00:00
|
|
|
":services-tethering-shared-srcs",
|
2019-08-27 02:19:38 +00:00
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
"androidx.annotation_annotation",
|
2019-09-30 06:40:57 +00:00
|
|
|
"netd_aidl_interface-unstable-java",
|
2019-08-09 06:52:06 +00:00
|
|
|
"netlink-client",
|
2019-09-30 06:40:57 +00:00
|
|
|
"networkstack-aidl-interfaces-unstable-java",
|
2019-09-25 06:33:39 +00:00
|
|
|
"android.hardware.tetheroffload.control-V1.0-java",
|
2019-08-27 02:19:38 +00:00
|
|
|
],
|
2019-12-16 12:15:20 +00:00
|
|
|
libs: [
|
|
|
|
"framework-tethering",
|
|
|
|
],
|
|
|
|
|
2019-08-27 02:19:38 +00:00
|
|
|
manifest: "AndroidManifestBase.xml",
|
|
|
|
}
|
|
|
|
|
|
|
|
// Build tethering static library, used to compile both variants of the tethering.
|
|
|
|
android_library {
|
|
|
|
name: "TetheringApiCurrentLib",
|
|
|
|
defaults: ["TetheringAndroidLibraryDefaults"],
|
|
|
|
}
|
|
|
|
|
2019-10-23 08:27:52 +00:00
|
|
|
// Due to b/143733063, APK can't access a jni lib that is in APEX (but not in the APK).
|
|
|
|
cc_library {
|
2019-12-07 14:02:28 +00:00
|
|
|
name: "libtetherutilsjni",
|
2019-09-25 06:33:39 +00:00
|
|
|
srcs: [
|
2019-12-07 14:02:28 +00:00
|
|
|
"jni/android_net_util_TetheringUtils.cpp",
|
2019-09-25 06:33:39 +00:00
|
|
|
],
|
|
|
|
shared_libs: [
|
2019-10-23 08:27:52 +00:00
|
|
|
"libcgrouprc",
|
|
|
|
"libnativehelper_compat_libc++",
|
|
|
|
"libvndksupport",
|
2019-09-25 06:33:39 +00:00
|
|
|
],
|
|
|
|
static_libs: [
|
2019-10-23 08:27:52 +00:00
|
|
|
"android.hardware.tetheroffload.config@1.0",
|
2019-09-25 06:33:39 +00:00
|
|
|
"liblog",
|
|
|
|
"libbase",
|
2019-10-23 08:27:52 +00:00
|
|
|
"libbinderthreadstate",
|
|
|
|
"libcutils",
|
2019-09-25 06:33:39 +00:00
|
|
|
"libhidlbase",
|
2019-10-23 08:27:52 +00:00
|
|
|
"libjsoncpp",
|
|
|
|
"libprocessgroup",
|
2019-09-25 06:33:39 +00:00
|
|
|
"libutils",
|
|
|
|
],
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
"-Wthread-safety",
|
|
|
|
],
|
2019-10-23 08:27:52 +00:00
|
|
|
|
|
|
|
ldflags: ["-Wl,--exclude-libs=ALL,-error-limit=0"],
|
2019-09-25 06:33:39 +00:00
|
|
|
}
|
|
|
|
|
2019-08-27 02:19:38 +00:00
|
|
|
// Common defaults for compiling the actual APK.
|
|
|
|
java_defaults {
|
|
|
|
name: "TetheringAppDefaults",
|
|
|
|
platform_apis: true,
|
|
|
|
privileged: true,
|
2019-10-23 08:27:52 +00:00
|
|
|
// Build system doesn't track transitive dependeicies for jni_libs, list all the dependencies
|
|
|
|
// explicitly.
|
2019-09-25 06:33:39 +00:00
|
|
|
jni_libs: [
|
2019-10-23 08:27:52 +00:00
|
|
|
"libcgrouprc",
|
|
|
|
"libnativehelper_compat_libc++",
|
|
|
|
"libvndksupport",
|
2019-12-07 14:02:28 +00:00
|
|
|
"libtetherutilsjni",
|
2019-09-25 06:33:39 +00:00
|
|
|
],
|
2019-08-27 02:19:38 +00:00
|
|
|
resource_dirs: [
|
|
|
|
"res",
|
|
|
|
],
|
2019-12-16 12:15:20 +00:00
|
|
|
libs: [
|
|
|
|
"framework-tethering",
|
|
|
|
],
|
|
|
|
jarjar_rules: "jarjar-rules.txt",
|
2019-08-27 02:19:38 +00:00
|
|
|
optimize: {
|
|
|
|
proguard_flags_files: ["proguard.flags"],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
// Non-updatable tethering running in the system server process for devices not using the module
|
2019-09-30 06:40:57 +00:00
|
|
|
android_app {
|
|
|
|
name: "InProcessTethering",
|
|
|
|
defaults: ["TetheringAppDefaults"],
|
|
|
|
static_libs: ["TetheringApiCurrentLib"],
|
|
|
|
certificate: "platform",
|
|
|
|
manifest: "AndroidManifest_InProcess.xml",
|
|
|
|
// InProcessTethering is a replacement for Tethering
|
|
|
|
overrides: ["Tethering"],
|
|
|
|
}
|
2019-08-27 02:19:38 +00:00
|
|
|
|
|
|
|
// Updatable tethering packaged as an application
|
|
|
|
android_app {
|
|
|
|
name: "Tethering",
|
|
|
|
defaults: ["TetheringAppDefaults"],
|
|
|
|
static_libs: ["TetheringApiCurrentLib"],
|
|
|
|
certificate: "networkstack",
|
|
|
|
manifest: "AndroidManifest.xml",
|
|
|
|
use_embedded_native_libs: true,
|
|
|
|
// The permission configuration *must* be included to ensure security of the device
|
|
|
|
required: ["NetworkPermissionConfig"],
|
|
|
|
}
|