1//
2// Copyright (C) 2019 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    default_team: "trendy_team_fwk_core_networking",
19    default_applicable_licenses: ["Android-Apache-2.0"],
20}
21
22// Defaults to enable/disable java targets which uses development APIs. "enabled" may have a
23// different value depending on the branch.
24java_defaults {
25    name: "ConnectivityNextEnableDefaults",
26    enabled: true,
27}
28
29java_defaults {
30    name: "NetworkStackApiShimSettingsForCurrentBranch",
31    // API shims to include in the networking modules built from the branch. Branches that disable
32    // the "next" targets must use stable shims (latest stable API level) instead of current shims
33    // (X_current API level).
34    static_libs: ["NetworkStackApiCurrentShims"],
35}
36
37apex_defaults {
38    name: "ConnectivityApexDefaults",
39    // Tethering app to include in the AOSP apex. Branches that disable the "next" targets may use
40    // a stable tethering app instead, but will generally override the AOSP apex to use updatable
41    // package names and keys, so that apex will be unused anyway.
42    apps: ["TetheringNext"], // Replace to "Tethering" if ConnectivityNextEnableDefaults is false.
43}
44
45enable_tethering_next_apex = true
46// This is a placeholder comment to avoid merge conflicts
47// as the above target may have different "enabled" values
48// depending on the branch
49
50apex_defaults {
51    name: "CronetInTetheringApexDefaults",
52    jni_libs: [
53        "cronet_aml_components_cronet_android_cronet",
54        "//external/cronet/third_party/boringssl:libcrypto",
55        "//external/cronet/third_party/boringssl:libssl",
56    ],
57}
58
59apex {
60    name: "com.android.tethering",
61    defaults: [
62        "ConnectivityApexDefaults",
63        "CronetInTetheringApexDefaults",
64        "r-launched-apex-module",
65    ],
66    compile_multilib: "both",
67    bootclasspath_fragments: [
68        "com.android.tethering-bootclasspath-fragment",
69    ],
70    systemserverclasspath_fragments: [
71        "com.android.tethering-systemserverclasspath-fragment",
72    ],
73    multilib: {
74        first: {
75            jni_libs: [
76                "libservice-connectivity",
77                "libservice-thread-jni",
78                "libandroid_net_connectivity_com_android_net_module_util_jni",
79            ],
80            native_shared_libs: [
81                "libcom.android.tethering.dns_helper",
82                "libcom.android.tethering.connectivity_native",
83                "libnetd_updatable",
84            ],
85        },
86        both: {
87            jni_libs: [
88                "libframework-connectivity-jni",
89                "libframework-connectivity-tiramisu-jni",
90            ],
91        },
92    },
93    binaries: [
94        "clatd",
95        "ethtool",
96        "netbpfload",
97        "ot-daemon",
98    ],
99    canned_fs_config: "canned_fs_config",
100    bpfs: [
101        "block.o",
102        "clatd.o",
103        "dscpPolicy.o",
104        "gentle.o",
105        "netd.o",
106        "offload.o",
107        "offload@mainline.o",
108        "test.o",
109        "test@mainline.o",
110    ],
111    apps: [
112        "ServiceConnectivityResources",
113    ],
114    prebuilts: [
115        "current_sdkinfo",
116        "netbpfload.33rc",
117        "netbpfload.35rc",
118        "ot-daemon.init.34rc",
119    ],
120    manifest: "manifest.json",
121    key: "com.android.tethering.key",
122    // Indicates that pre-installed version of this apex can be compressed.
123    // Whether it actually will be compressed is controlled on per-device basis.
124    compressible: true,
125
126    androidManifest: "AndroidManifest.xml",
127
128    compat_configs: [
129        "connectivity-platform-compat-config",
130    ],
131}
132
133apex_key {
134    name: "com.android.tethering.key",
135    public_key: "com.android.tethering.avbpubkey",
136    private_key: "com.android.tethering.pem",
137}
138
139android_app_certificate {
140    name: "com.android.tethering.certificate",
141    certificate: "com.android.tethering",
142}
143
144filegroup {
145    name: "connectivity-hiddenapi-files",
146    srcs: [
147        ":connectivity-t-hiddenapi-files",
148        "hiddenapi/*.txt",
149    ],
150    visibility: ["//packages/modules/Connectivity:__subpackages__"],
151}
152
153// Encapsulate the contributions made by the com.android.tethering to the bootclasspath.
154bootclasspath_fragment {
155    name: "com.android.tethering-bootclasspath-fragment",
156    contents: [
157        "framework-connectivity",
158        "framework-connectivity-t",
159        "framework-tethering",
160    ],
161    apex_available: ["com.android.tethering"],
162
163    // The bootclasspath_fragments that provide APIs on which this depends.
164    fragments: [
165        {
166            apex: "com.android.art",
167            module: "art-bootclasspath-fragment",
168        },
169    ],
170
171    // Additional stubs libraries that this fragment's contents use which are
172    // not provided by another bootclasspath_fragment.
173    additional_stubs: [
174        "android-non-updatable",
175    ],
176
177    // Additional hidden API flag files to override the defaults. This must only be
178    // modified by the Soong or platform compat team.
179    hidden_api: {
180        max_target_o_low_priority: [
181            "hiddenapi/hiddenapi-max-target-o-low-priority.txt",
182        ],
183        unsupported: [
184            "hiddenapi/hiddenapi-unsupported.txt",
185        ],
186
187        // The following packages contain classes from other modules on the
188        // bootclasspath. That means that the hidden API flags for this module
189        // has to explicitly list every single class this module provides in
190        // that package to differentiate them from the classes provided by other
191        // modules. That can include private classes that are not part of the
192        // API.
193        split_packages: [
194            "android.app.usage",
195            "android.nearby",
196            "android.net",
197            "android.net.http",
198            "android.net.netstats",
199            "android.net.util",
200        ],
201
202        // The following packages and all their subpackages currently only
203        // contain classes from this bootclasspath_fragment. Listing a package
204        // here won't prevent other bootclasspath modules from adding classes in
205        // any of those packages but it will prevent them from adding those
206        // classes into an API surface, e.g. public, system, etc.. Doing so will
207        // result in a build failure due to inconsistent flags.
208        package_prefixes: [
209            "android.nearby.aidl",
210            "android.remoteauth.aidl",
211            "android.remoteauth",
212            "android.net.apf",
213            "android.net.connectivity",
214            "android.net.http.apihelpers",
215            "android.net.netstats.provider",
216            "android.net.nsd",
217            "android.net.thread",
218            "android.net.wear",
219        ],
220    },
221}
222
223systemserverclasspath_fragment {
224    name: "com.android.tethering-systemserverclasspath-fragment",
225    standalone_contents: ["service-connectivity"],
226    apex_available: ["com.android.tethering"],
227}
228