blob: ef6d62d23edf26d91781382228d9b840c10f0a19 [file] [log] [blame]
Aaron Huangf73ff8c2019-12-06 18:12:24 +08001// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Aaron Huang57a94962020-01-03 20:35:55 +080015// 1. The "net-utils-framework-common" library is also compiled into the framework and placed on the
16// boot classpath. It uses jarjar rules so that anything outside the framework can use this
17// library directly.
18// 2. The "net-utils-services-common" library is for use by modules and frameworks/base/services.
19// It does not need to be jarjared because it is not placed on the bootclasspath.
Lorenzo Colittie14bd342020-01-14 14:47:16 +090020// 3. The "net-utils-telephony-common-srcs" filegroup is for use specifically by telephony, which
21// places many of its classes, even non-API service classes, on the boot classpath. Any file that
22// is added to this filegroup *must* have a corresponding jarjar rule in the telephony jarjar
23// rules file. Otherwise, it will end up on the boot classpath and other modules will not be able
24// to provide their own copy.
Aaron Huangf73ff8c2019-12-06 18:12:24 +080025
Adrian Roos0607dd92020-03-27 00:30:41 +010026// Note: all filegroups here must have the right path attribute because otherwise, if they are
27// included in the bootclasspath, they could incorrectly be included in the SDK documentation even
28// though they are not in the current.txt files.
29
Aaron Huangf73ff8c2019-12-06 18:12:24 +080030filegroup {
31 name: "net-utils-framework-common-srcs",
32 srcs: ["src_frameworkcommon/**/*.java"],
Adrian Roos0607dd92020-03-27 00:30:41 +010033 path: "src_frameworkcommon",
Aaron Huangf73ff8c2019-12-06 18:12:24 +080034 visibility: ["//frameworks/base"],
35}
36
37java_library {
38 name: "net-utils-framework-common",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +090039 srcs: [
40 ":net-utils-framework-common-srcs",
41 // TODO: avoid including all framework annotations as they end up in library users jars
42 // and need jarjaring
43 ":framework-annotations",
44 ],
45 sdk_version: "system_current",
Aaron Huangf73ff8c2019-12-06 18:12:24 +080046 jarjar_rules: "jarjar-rules-shared.txt",
47 visibility: [
Luke Huangfd5479e2020-06-20 11:38:17 +080048 "//cts/tests/tests/net",
Aaron Huangf73ff8c2019-12-06 18:12:24 +080049 "//frameworks/base/packages/Tethering",
Aaron Huangf73ff8c2019-12-06 18:12:24 +080050 "//frameworks/opt/net/ike",
51 "//frameworks/opt/telephony",
52 "//packages/modules/NetworkStack",
53 "//packages/modules/CaptivePortalLogin",
Lorenzo Colitti5d9f8ed2020-01-21 15:31:06 +090054 "//frameworks/libs/net/common/tests:__subpackages__",
Aaron Huangf73ff8c2019-12-06 18:12:24 +080055 ]
56}
Aaron Huang57a94962020-01-03 20:35:55 +080057
58java_library {
59 name: "net-utils-services-common",
Remi NGUYEN VANce241a32020-01-14 21:42:09 +090060 srcs: [
61 "src_servicescommon/**/*.java",
62 ":framework-annotations",
63 ],
64 sdk_version: "system_current",
Aaron Huang57a94962020-01-03 20:35:55 +080065 visibility: [
Remi NGUYEN VAN376f8d42020-01-15 18:26:29 +090066 "//frameworks/base/services/net",
Aaron Huang57a94962020-01-03 20:35:55 +080067 "//frameworks/base/packages/Tethering",
Aaron Huang57a94962020-01-03 20:35:55 +080068 "//frameworks/opt/net/ike",
69 "//packages/modules/NetworkStack",
70 "//packages/modules/CaptivePortalLogin",
Lorenzo Colitti5d9f8ed2020-01-21 15:31:06 +090071 "//frameworks/libs/net/common/tests:__subpackages__",
Aaron Huang57a94962020-01-03 20:35:55 +080072 ],
73}
Lorenzo Colittie14bd342020-01-14 14:47:16 +090074
75// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be
76// included either (some annotations would be duplicated on the bootclasspath).
77filegroup {
78 name: "net-utils-telephony-common-srcs",
79 srcs: [
80 // Any class here *must* have a corresponding jarjar rule in the telephony build rules.
81 "src_servicescommon/android/net/NetworkFactory.java",
82 ],
Adrian Roos0607dd92020-03-27 00:30:41 +010083 path: "src_servicescommon",
Lorenzo Colittie14bd342020-01-14 14:47:16 +090084 visibility: [
85 "//frameworks/opt/telephony",
86 ],
87}
Roshan Pius864bdec2020-01-16 09:19:11 -080088
89// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar
90// rules on the wifi side.
91// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
92filegroup {
93 name: "net-utils-framework-wifi-common-srcs",
94 srcs: [
David Su37535272020-01-16 20:56:39 -080095 "src_frameworkcommon/android/net/util/nsd/DnsSdTxtRecord.java",
Roshan Pius864bdec2020-01-16 09:19:11 -080096 "src_frameworkcommon/android/net/util/MacAddressUtils.java",
97 ],
Adrian Roos0607dd92020-03-27 00:30:41 +010098 path: "src_frameworkcommon",
Roshan Pius864bdec2020-01-16 09:19:11 -080099 visibility: [
100 "//frameworks/base",
101 ],
102}
103
104// Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar
105// rules on the wifi side.
106// Any class here *must* have a corresponding jarjar rule in the wifi build rules.
107filegroup {
108 name: "net-utils-wifi-service-common-srcs",
109 srcs: [
110 "src_frameworkcommon/android/net/util/NetUtils.java",
111 "src_servicescommon/android/net/NetworkFactory.java",
112 ],
113 visibility: [
114 "//frameworks/opt/net/wifi/service",
115 ],
116}