Aaron Huang | f73ff8c | 2019-12-06 18:12:24 +0800 | [diff] [blame] | 1 | // 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 Huang | 57a9496 | 2020-01-03 20:35:55 +0800 | [diff] [blame] | 15 | // 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 Colitti | e14bd34 | 2020-01-14 14:47:16 +0900 | [diff] [blame] | 20 | // 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 Huang | f73ff8c | 2019-12-06 18:12:24 +0800 | [diff] [blame] | 25 | |
| 26 | filegroup { |
| 27 | name: "net-utils-framework-common-srcs", |
| 28 | srcs: ["src_frameworkcommon/**/*.java"], |
| 29 | visibility: ["//frameworks/base"], |
| 30 | } |
| 31 | |
| 32 | java_library { |
| 33 | name: "net-utils-framework-common", |
Remi NGUYEN VAN | ce241a3 | 2020-01-14 21:42:09 +0900 | [diff] [blame] | 34 | srcs: [ |
| 35 | ":net-utils-framework-common-srcs", |
| 36 | // TODO: avoid including all framework annotations as they end up in library users jars |
| 37 | // and need jarjaring |
| 38 | ":framework-annotations", |
| 39 | ], |
| 40 | sdk_version: "system_current", |
Aaron Huang | f73ff8c | 2019-12-06 18:12:24 +0800 | [diff] [blame] | 41 | jarjar_rules: "jarjar-rules-shared.txt", |
| 42 | visibility: [ |
| 43 | "//frameworks/base/packages/Tethering", |
Aaron Huang | f73ff8c | 2019-12-06 18:12:24 +0800 | [diff] [blame] | 44 | "//frameworks/opt/net/ike", |
| 45 | "//frameworks/opt/telephony", |
| 46 | "//packages/modules/NetworkStack", |
| 47 | "//packages/modules/CaptivePortalLogin", |
| 48 | ] |
| 49 | } |
Aaron Huang | 57a9496 | 2020-01-03 20:35:55 +0800 | [diff] [blame] | 50 | |
| 51 | java_library { |
| 52 | name: "net-utils-services-common", |
Remi NGUYEN VAN | ce241a3 | 2020-01-14 21:42:09 +0900 | [diff] [blame] | 53 | srcs: [ |
| 54 | "src_servicescommon/**/*.java", |
| 55 | ":framework-annotations", |
| 56 | ], |
| 57 | sdk_version: "system_current", |
Aaron Huang | 57a9496 | 2020-01-03 20:35:55 +0800 | [diff] [blame] | 58 | visibility: [ |
Remi NGUYEN VAN | 376f8d4 | 2020-01-15 18:26:29 +0900 | [diff] [blame] | 59 | "//frameworks/base/services/net", |
Aaron Huang | 57a9496 | 2020-01-03 20:35:55 +0800 | [diff] [blame] | 60 | "//frameworks/base/packages/Tethering", |
Aaron Huang | 57a9496 | 2020-01-03 20:35:55 +0800 | [diff] [blame] | 61 | "//frameworks/opt/net/ike", |
| 62 | "//packages/modules/NetworkStack", |
| 63 | "//packages/modules/CaptivePortalLogin", |
| 64 | ], |
| 65 | } |
Lorenzo Colitti | e14bd34 | 2020-01-14 14:47:16 +0900 | [diff] [blame] | 66 | |
| 67 | // Use a filegroup and not a library for telephony sources, as framework-annotations cannot be |
| 68 | // included either (some annotations would be duplicated on the bootclasspath). |
| 69 | filegroup { |
| 70 | name: "net-utils-telephony-common-srcs", |
| 71 | srcs: [ |
| 72 | // Any class here *must* have a corresponding jarjar rule in the telephony build rules. |
| 73 | "src_servicescommon/android/net/NetworkFactory.java", |
| 74 | ], |
| 75 | visibility: [ |
| 76 | "//frameworks/opt/telephony", |
| 77 | ], |
| 78 | } |
Roshan Pius | 864bdec | 2020-01-16 09:19:11 -0800 | [diff] [blame^] | 79 | |
| 80 | // Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar |
| 81 | // rules on the wifi side. |
| 82 | // Any class here *must* have a corresponding jarjar rule in the wifi build rules. |
| 83 | filegroup { |
| 84 | name: "net-utils-framework-wifi-common-srcs", |
| 85 | srcs: [ |
| 86 | "src_frameworkcommon/android/net/util/MacAddressUtils.java", |
| 87 | ], |
| 88 | visibility: [ |
| 89 | "//frameworks/base", |
| 90 | ], |
| 91 | } |
| 92 | |
| 93 | // Use a filegroup and not a library for wifi sources, as this needs corresponding jar-jar |
| 94 | // rules on the wifi side. |
| 95 | // Any class here *must* have a corresponding jarjar rule in the wifi build rules. |
| 96 | filegroup { |
| 97 | name: "net-utils-wifi-service-common-srcs", |
| 98 | srcs: [ |
| 99 | "src_frameworkcommon/android/net/util/NetUtils.java", |
| 100 | "src_servicescommon/android/net/NetworkFactory.java", |
| 101 | ], |
| 102 | visibility: [ |
| 103 | "//frameworks/opt/net/wifi/service", |
| 104 | ], |
| 105 | } |