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 15package { 16 default_visibility: [":__subpackages__"], 17 default_applicable_licenses: ["Android-Apache-2.0"], 18} 19 20// Defaults common to all mainline module java_sdk_library instances. 21java_defaults { 22 name: "framework-module-common-defaults", 23 24 // Use the source of annotations that affect metalava doc generation, since 25 // the relevant generation instructions are themselves in javadoc, which is 26 // not present in class files. 27 api_srcs: [":framework-metalava-annotations"], 28 29 // Make the source retention annotations available on the classpath when compiling 30 // the implementation library. (This should be in impl_only_libs but some modules 31 // use these defaults for java_library, sigh.) 32 libs: ["framework-annotations-lib"], 33 34 // Framework modules are not generally shared libraries, i.e. they are not 35 // intended, and must not be allowed, to be used in a <uses-library> manifest 36 // entry. 37 shared_library: false, 38 39 // Prevent dependencies that do not specify an sdk_version from accessing the 40 // implementation library by default and force them to use stubs instead. 41 default_to_stubs: true, 42 43 // Enable api lint. This will eventually become the default for java_sdk_library 44 // but it cannot yet be turned on because some usages have not been cleaned up. 45 // TODO(b/156126315) - Remove when no longer needed. 46 api_lint: { 47 enabled: true, 48 legacy_errors_allowed: false, 49 }, 50 51 // The API scope specific properties. 52 public: { 53 enabled: true, 54 sdk_version: "module_current", 55 }, 56 57 // installable implies we'll create a non-apex (platform) variant, which 58 // we shouldn't ordinarily need (and it can create issues), so disable that. 59 installable: false, 60 61 // Configure framework module specific metalava options. 62 droiddoc_options: [ 63 "--error UnhiddenSystemApi", 64 "--error UnflaggedApi", 65 "--hide CallbackInterface", 66 "--enhance-documentation", 67 ], 68 69 annotations_enabled: true, 70 71 // Allow access to the stubs from anywhere 72 visibility: ["//visibility:public"], 73 stubs_library_visibility: ["//visibility:public"], 74 75 // Hide impl library and stub sources 76 impl_library_visibility: [ 77 ":__pkg__", 78 "//frameworks/base/api", // For framework-all 79 ], 80 stubs_source_visibility: ["//visibility:private"], 81 82 defaults_visibility: ["//visibility:private"], 83 84 dist_group: "android", 85} 86 87// Defaults for the java_sdk_libraries of non-updatable modules. 88// java_sdk_libraries using these defaults should also add themselves to the 89// non_updatable_modules list in frameworks/base/api/api.go 90java_defaults { 91 name: "non-updatable-framework-module-defaults", 92 defaults: ["framework-module-common-defaults"], 93 94 system: { 95 enabled: true, 96 sdk_version: "module_current", 97 }, 98 module_lib: { 99 enabled: true, 100 sdk_version: "module_current", 101 }, 102 // Non-updatable modules are allowed to provide @TestApi 103 test: { 104 enabled: true, 105 sdk_version: "module_current", 106 }, 107 108 defaults_visibility: [ 109 "//frameworks/base", 110 "//frameworks/base/api", 111 "//packages/modules/Virtualization:__subpackages__", 112 ], 113} 114 115// Defaults for mainline module provided java_sdk_library instances. 116java_defaults { 117 name: "framework-module-defaults", 118 defaults: ["framework-module-common-defaults"], 119 sdk_version: "module_current", 120 121 system: { 122 enabled: true, 123 sdk_version: "module_current", 124 }, 125 module_lib: { 126 enabled: true, 127 sdk_version: "module_current", 128 }, 129 130 defaults_visibility: [ 131 ":__subpackages__", 132 // TODO(b/237461653): Move this to packages/modules/Nfc 133 "//frameworks/base/nfc", 134 "//frameworks/base/apex:__subpackages__", 135 "//frameworks/base/libs/hwui", 136 "//frameworks/base/wifi", 137 "//packages/modules:__subpackages__", 138 "//packages/providers/MediaProvider:__subpackages__", 139 "//system/apex/apexd:__subpackages__", 140 ], 141} 142 143// Defaults for mainline module system server provided java_sdk_library instances. 144java_defaults { 145 name: "framework-system-server-module-defaults", 146 defaults: ["framework-module-common-defaults"], 147 sdk_version: "system_server_current", 148 149 system_server: { 150 enabled: true, 151 sdk_version: "system_server_current", 152 }, 153 154 defaults_visibility: [ 155 ":__subpackages__", 156 "//art/libartservice:__subpackages__", 157 "//frameworks/base/apex:__subpackages__", 158 "//packages/modules:__subpackages__", 159 "//system/apex/apexd:__subpackages__", 160 ], 161} 162 163filegroup_defaults { 164 name: "framework-sources-module-defaults", 165 visibility: [ 166 "//frameworks/base", 167 "//frameworks/base/api", 168 ], 169 defaults_visibility: ["//visibility:public"], 170} 171 172// These apex_defaults serve as a common place to add properties which should 173// affect all mainline modules. 174 175APEX_LOWEST_MIN_SDK_VERSION = "30" 176DCLA_MIN_SDK_VERSION = "31" 177 178apex_defaults { 179 name: "any-launched-apex-modules", 180 updatable: true, 181 defaults_visibility: ["//visibility:public"], 182} 183 184apex_defaults { 185 name: "q-launched-apex-module", 186 defaults: ["any-launched-apex-modules"], 187 min_sdk_version: APEX_LOWEST_MIN_SDK_VERSION, 188 defaults_visibility: ["//visibility:public"], 189} 190 191soong_config_module_type_import { 192 from: "system/apex/Android.bp", 193 module_types: [ 194 "library_linking_strategy_apex_defaults", 195 "library_linking_strategy_cc_defaults", 196 ], 197} 198 199library_linking_strategy_apex_defaults { 200 name: "q-launched-dcla-enabled-apex-module", 201 defaults_visibility: [ 202 "//external/conscrypt/apex", 203 "//packages/modules/DnsResolver/apex", 204 "//frameworks/av/apex" 205 ], 206 defaults: ["q-launched-apex-module"], 207 soong_config_variables: { 208 library_linking_strategy: { 209 // Use the Q min_sdk_version 210 prefer_static: {}, 211 // Override the Q min_sdk_version to min_sdk_version that supports dcla 212 conditions_default: { 213 min_sdk_version: DCLA_MIN_SDK_VERSION, 214 }, 215 }, 216 }, 217} 218 219apex_defaults { 220 name: "r-launched-apex-module", 221 defaults: ["any-launched-apex-modules"], 222 min_sdk_version: "30", 223 defaults_visibility: ["//visibility:public"], 224} 225 226library_linking_strategy_apex_defaults { 227 name: "r-launched-dcla-enabled-apex-module", 228 defaults_visibility: [ 229 "//packages/modules/adb:__subpackages__", 230 "//packages/modules/Connectivity/Tethering/apex", 231 ], 232 defaults: ["r-launched-apex-module"], 233 soong_config_variables: { 234 library_linking_strategy: { 235 // Use the R min_sdk_version 236 prefer_static: {}, 237 // Override the R min_sdk_version to min_sdk_version that supports dcla 238 conditions_default: { 239 min_sdk_version: DCLA_MIN_SDK_VERSION, 240 }, 241 }, 242 }, 243} 244 245apex_defaults { 246 name: "s-launched-apex-module", 247 defaults: ["any-launched-apex-modules"], 248 min_sdk_version: "31", 249 // Indicates that pre-installed version of this apex can be compressed. 250 // Whether it actually will be compressed is controlled on per-device basis. 251 compressible:true, 252 defaults_visibility: [ 253 "//art:__subpackages__", 254 "//packages/modules:__subpackages__", 255 ], 256} 257 258apex_defaults { 259 name: "t-launched-apex-module", 260 defaults: ["any-launched-apex-modules"], 261 min_sdk_version: "Tiramisu", 262 // Indicates that pre-installed version of this apex can be compressed. 263 // Whether it actually will be compressed is controlled on per-device basis. 264 compressible: true, 265 defaults_visibility: ["//packages/modules:__subpackages__"], 266} 267 268apex_defaults { 269 name: "u-launched-apex-module", 270 defaults: ["any-launched-apex-modules"], 271 min_sdk_version: "UpsideDownCake", 272 // Indicates that pre-installed version of this apex can be compressed. 273 // Whether it actually will be compressed is controlled on per-device basis. 274 compressible: true, 275 defaults_visibility: ["//packages/modules:__subpackages__"], 276} 277 278apex_defaults { 279 name: "v-launched-apex-module", 280 defaults: ["any-launched-apex-modules"], 281 min_sdk_version: "VanillaIceCream", 282 // Indicates that pre-installed version of this apex can be compressed. 283 // Whether it actually will be compressed is controlled on per-device basis. 284 compressible: true, 285 defaults_visibility: ["//packages/modules:__subpackages__"], 286} 287 288library_linking_strategy_cc_defaults { 289 name: "apex-lowest-min-sdk-version", 290 defaults_visibility: [ 291 "//system/core/libutils:__subpackages__", 292 ], 293 min_sdk_version: APEX_LOWEST_MIN_SDK_VERSION, 294 soong_config_variables: { 295 library_linking_strategy: { 296 prefer_static: { 297 min_sdk_version: "apex_inherit", 298 }, 299 }, 300 }, 301} 302