1// 2// Copyright (C) 2021 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 // See: http://go/android-license-faq 19 default_applicable_licenses: ["Android-Apache-2.0"], 20} 21 22// Include build rules from Sources.bp 23build = ["Sources.bp"] 24 25filegroup { 26 name: "service-connectivity-tiramisu-sources", 27 srcs: [ 28 "src/**/*.java", 29 ], 30 visibility: ["//visibility:private"], 31} 32// The above filegroup can be used to specify different sources depending 33// on the branch, while minimizing merge conflicts in the rest of the 34// build rules. 35 36// This builds T+ services depending on framework-connectivity-t 37// hidden symbols separately from the S+ services, to ensure that S+ 38// services cannot accidentally depend on T+ hidden symbols from 39// framework-connectivity-t. 40java_library { 41 name: "service-connectivity-tiramisu-pre-jarjar", 42 sdk_version: "system_server_current", 43 // TODO(b/210962470): Bump this to at least S, and then T. 44 min_sdk_version: "30", 45 srcs: [ 46 ":service-connectivity-tiramisu-sources", 47 ], 48 libs: [ 49 "framework-annotations-lib", 50 "framework-configinfrastructure", 51 "framework-connectivity-pre-jarjar", 52 "framework-connectivity-t-pre-jarjar", 53 // TODO: use framework-tethering-pre-jarjar when it is separated from framework-tethering 54 "framework-tethering.impl", 55 "framework-wifi", 56 "service-connectivity-pre-jarjar", 57 "service-nearby-pre-jarjar", 58 "ServiceConnectivityResources", 59 "unsupportedappusage", 60 ], 61 static_libs: [ 62 // Do not add static_libs here if they are already included in framework-connectivity 63 // or in service-connectivity. They are not necessary (included via 64 // service-connectivity-pre-jarjar), and in the case of code that is already in 65 // framework-connectivity, the classes would be included in the apex twice. 66 "modules-utils-statemachine", 67 ], 68 apex_available: [ 69 "com.android.tethering", 70 ], 71 visibility: [ 72 "//frameworks/base/tests/vcn", 73 "//packages/modules/Connectivity/service", 74 "//packages/modules/Connectivity/tests:__subpackages__", 75 "//packages/modules/IPsec/tests/iketests", 76 ], 77} 78 79// Test building mDNS as a standalone, so that it can be imported into other repositories as-is. 80// The mDNS code is platform code so it should use framework-annotations-lib, contrary to apps that 81// should use sdk_version: "system_current" and only androidx.annotation_annotation. But this build 82// rule verifies that the mDNS code can be built into apps, if code transformations are applied to 83// the annotations. 84// When using "system_current", framework annotations are not available; they would appear as 85// package-private as they are marked as such in the system_current stubs. So build against 86// core_platform and add the stubs manually in "libs". See http://b/147773144#comment7. 87java_library { 88 name: "service-connectivity-mdns-standalone-build-test", 89 sdk_version: "core_platform", 90 srcs: [ 91 ":service-mdns-droidstubs", 92 "src/com/android/server/connectivity/mdns/**/*.java", 93 ], 94 exclude_srcs: [ 95 "src/com/android/server/connectivity/mdns/internal/SocketNetlinkMonitor.java", 96 "src/com/android/server/connectivity/mdns/SocketNetLinkMonitorFactory.java" 97 ], 98 static_libs: [ 99 "net-utils-device-common-mdns-standalone-build-test", 100 ], 101 libs: [ 102 "framework-annotations-lib", 103 "android_system_stubs_current", 104 "androidx.annotation_annotation", 105 ], 106 visibility: [ 107 "//visibility:private", 108 ], 109} 110 111droidstubs { 112 name: "service-mdns-droidstubs", 113 srcs: ["src/com/android/server/connectivity/mdns/SocketNetLinkMonitorFactory.java"], 114 libs: [ 115 "net-utils-device-common-mdns-standalone-build-test", 116 "service-connectivity-tiramisu-pre-jarjar" 117 ], 118 visibility: [ 119 "//visibility:private", 120 ], 121}