// Copyright (C) 2019 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package { default_team: "trendy_team_fwk_wifi_hal", default_applicable_licenses: ["Android-Apache-2.0"], } java_defaults { name: "wifi-module-sdk-version-defaults", min_sdk_version: "30", } filegroup { name: "framework-wifi-updatable-exported-aidl-sources", srcs: ["aidl-export/**/*.aidl"], path: "aidl-export", visibility: ["//visibility:private"], } filegroup { name: "framework-wifi-updatable-java-sources", srcs: [ "java/**/*.java", "java/**/*.aidl", ], path: "java", visibility: ["//visibility:private"], } filegroup { name: "framework-wifi-updatable-sources", srcs: [ ":framework-wifi-updatable-java-sources", ":framework-wifi-updatable-exported-aidl-sources", ":module-utils-os-aidls", ":wifi_framework_aconfig_flags_lib{.generated_srcjars}", ], } filegroup { name: "framework-wifi-annotations", srcs: ["java/android/net/wifi/WifiAnnotations.java"], } filegroup { name: "wifi_javadoc_only_files", srcs: [ "java/android/net/wifi/package.html", "java/android/net/wifi/rtt/package.html", "java/android/net/wifi/p2p/package.html", "java/android/net/wifi/aware/package.html", ], path: "java/android/net/wifi", } // list of tests that are allowed to access @hide APIs from framework-wifi test_access_hidden_api_whitelist = [ "//frameworks/base/wifi/tests", "//frameworks/base/wifi/non-updatable/tests", "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__", "//packages/modules/Wifi/framework/tests", "//packages/modules/Wifi/service/tests/wifitests:__subpackages__", "//external/robolectric-shadows:__subpackages__", "//frameworks/base/packages/SettingsLib/tests/integ", "//external/sl4a:__subpackages__", ] java_library { name: "wifi-modules-utils", sdk_version: "module_current", min_sdk_version: "30", static_libs: [ "modules-utils-build", "modules-utils-handlerexecutor", "modules-utils-list-slice", "modules-utils-preconditions", "modules-utils-shell-command-handler", "modules-utils-statemachine", ], apex_available: [ "com.android.wifi", "test_com.android.wifi", ], } // defaults shared between `framework-wifi` & `framework-wifi-pre-jarjar` // java_sdk_library `framework-wifi` needs sources to generate stubs, so it cannot reuse // `framework-wifi-pre-jarjar` java_defaults { name: "framework-wifi-defaults", defaults: ["wifi-module-sdk-version-defaults"], static_libs: [ "framework-wifi-util-lib", "android.hardware.wifi-V1.0-java-constants", "wifi-modules-utils", "PlatformProperties", ], libs: [ "androidx.annotation_annotation", "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage "app-compat-annotations", // Add aconfig-annotations-lib as a dependency for the optimization "aconfig-annotations-lib", "framework-configinfrastructure", ], aidl: { generate_get_transaction_name: true, include_dirs: [ "packages/modules/Connectivity/framework/aidl-export", ], }, srcs: [ ":framework-wifi-updatable-sources", ":module-utils-os-aidls", ], } // wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility // classes before they are renamed. java_library { name: "framework-wifi-pre-jarjar", defaults: ["framework-wifi-defaults"], sdk_version: "module_current", libs: [ "framework-annotations-lib", "framework-connectivity.stubs.module_lib", "framework-location.stubs.module_lib", "framework-tethering.stubs.module_lib", ], installable: false, visibility: [ "//frameworks/opt/net/wifi/service", "//frameworks/opt/net/wifi/tests/wifitests", "//packages/modules/Wifi/service", "//packages/modules/Wifi/service/tests/wifitests", ], } // post-jarjar version of framework-wifi java_sdk_library { name: "framework-wifi", defaults: [ "framework-module-defaults", "framework-wifi-defaults", ], impl_only_libs: [ "framework-connectivity.stubs.module_lib", "framework-location.stubs.module_lib", "framework-tethering.stubs.module_lib", ], public: { libs: [ "framework-connectivity.stubs", "framework-location.stubs", "framework-tethering.stubs", ], }, system: { libs: [ "framework-connectivity.stubs.system", "framework-location.stubs.system", "framework-tethering.stubs.system", ], }, module_lib: { libs: [ "framework-connectivity.stubs.module_lib", "framework-location.stubs.module_lib", "framework-tethering.stubs.module_lib", ], }, api_srcs: [ ":wifi_javadoc_only_files", ], jarjar_rules: ":wifi-jarjar-rules", installable: true, optimize: { enabled: false, }, hostdex: true, // for hiddenapi check // Restrict access to implementation library. impl_library_visibility: [ "//frameworks/opt/net/wifi/service:__subpackages__", "//packages/modules/Wifi/service:__subpackages__", "//packages/modules/Wifi/WifiDialog:__subpackages__", ] + test_access_hidden_api_whitelist, apex_available: [ "com.android.wifi", "test_com.android.wifi", ], permitted_packages: [ "android.hardware.wifi", "android.net.wifi", // Created by jarjar rules. "com.android.wifi.x", ], lint: { strict_updatability_linting: true, }, } // defaults for tests that need to build against framework-wifi's @hide APIs java_defaults { name: "framework-wifi-test-defaults", sdk_version: "core_current", libs: [ // order matters: classes in framework-wifi are resolved before framework, meaning // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework "framework-wifi.impl", "framework", // if sdk_version="" this gets automatically included, but here we need to add manually. "framework-res", ], visibility: test_access_hidden_api_whitelist, } filegroup { name: "wifi-jarjar-rules", srcs: ["jarjar-rules.txt"], } platform_compat_config { name: "wifi-compat-config", src: ":framework-wifi-pre-jarjar", }