| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [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 | |
| Bob Badour | c446a52 | 2021-02-04 00:08:31 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
| David Su | 9ca5d40 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 19 | java_defaults { |
| 20 | name: "wifi-module-sdk-version-defaults", |
| 21 | min_sdk_version: "30", |
| Nate Jiang | f64ed82 | 2021-07-02 17:16:48 -0700 | [diff] [blame] | 22 | target_sdk_version: "31", |
| David Su | 9ca5d40 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 23 | } |
| 24 | |
| David Su | 005f890 | 2020-01-21 11:23:00 -0800 | [diff] [blame] | 25 | filegroup { |
| 26 | name: "framework-wifi-updatable-exported-aidl-sources", |
| 27 | srcs: ["aidl-export/**/*.aidl"], |
| 28 | path: "aidl-export", |
| 29 | visibility: ["//visibility:private"], |
| 30 | } |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 31 | |
| 32 | filegroup { |
| David Su | 005f890 | 2020-01-21 11:23:00 -0800 | [diff] [blame] | 33 | name: "framework-wifi-updatable-java-sources", |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 34 | srcs: [ |
| 35 | "java/**/*.java", |
| 36 | "java/**/*.aidl", |
| 37 | ], |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 38 | path: "java", |
| David Su | 005f890 | 2020-01-21 11:23:00 -0800 | [diff] [blame] | 39 | visibility: ["//visibility:private"], |
| 40 | } |
| 41 | |
| 42 | filegroup { |
| 43 | name: "framework-wifi-updatable-sources", |
| 44 | srcs: [ |
| 45 | ":framework-wifi-updatable-java-sources", |
| 46 | ":framework-wifi-updatable-exported-aidl-sources", |
| David Su | 08f810e | 2020-12-09 10:40:18 -0800 | [diff] [blame] | 47 | ":module-utils-os-aidls", |
| David Su | 005f890 | 2020-01-21 11:23:00 -0800 | [diff] [blame] | 48 | ], |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | filegroup { |
| David Su | 414e909 | 2019-12-14 21:37:20 -0800 | [diff] [blame] | 52 | name: "framework-wifi-annotations", |
| 53 | srcs: ["java/android/net/wifi/WifiAnnotations.java"], |
| 54 | } |
| 55 | |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 56 | // list of tests that are allowed to access @hide APIs from framework-wifi |
| 57 | test_access_hidden_api_whitelist = [ |
| 58 | "//frameworks/base/wifi/tests", |
| David Su | 00bb68f | 2020-12-03 14:28:24 -0800 | [diff] [blame] | 59 | "//frameworks/base/wifi/non-updatable/tests", |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 60 | "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__", |
| David Su | e36d77e | 2019-12-18 21:22:21 -0800 | [diff] [blame] | 61 | |
| Baligh Uddin | d5af8cf | 2020-12-23 04:04:00 +0000 | [diff] [blame] | 62 | "//packages/modules/Wifi/framework/tests", |
| 63 | "//packages/modules/Wifi/service/tests/wifitests:__subpackages__", |
| 64 | |
| David Su | cd246f7 | 2020-01-07 13:01:30 -0800 | [diff] [blame] | 65 | "//external/robolectric-shadows:__subpackages__", |
| David Su | d9ab8ff | 2020-01-06 15:24:42 -0800 | [diff] [blame] | 66 | "//frameworks/base/packages/SettingsLib/tests/integ", |
| David Su | 16cbcd1 | 2020-01-11 16:22:00 -0800 | [diff] [blame] | 67 | "//external/sl4a:__subpackages__", |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 68 | ] |
| 69 | |
| William Escande | 4367f1e | 2021-09-03 17:02:38 +0200 | [diff] [blame^] | 70 | java_library { |
| 71 | name: "wifi-modules-utils", |
| 72 | sdk_version: "module_current", |
| 73 | min_sdk_version: "30", |
| 74 | static_libs: [ |
| 75 | "modules-utils-build", |
| 76 | "modules-utils-shell-command-handler", |
| 77 | "modules-utils-list-slice", |
| 78 | "modules-utils-preconditions", |
| 79 | "modules-utils-handlerexecutor", |
| 80 | ], |
| 81 | apex_available: [ |
| 82 | "com.android.wifi", |
| 83 | "test_com.android.wifi", |
| 84 | ], |
| 85 | } |
| 86 | |
| David Su | 0c1d0c9 | 2020-10-26 11:12:04 -0700 | [diff] [blame] | 87 | // defaults shared between `framework-wifi` & `framework-wifi-pre-jarjar` |
| 88 | // java_sdk_library `framework-wifi` needs sources to generate stubs, so it cannot reuse |
| 89 | // `framework-wifi-pre-jarjar` |
| 90 | java_defaults { |
| 91 | name: "framework-wifi-defaults", |
| David Su | 9ca5d40 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 92 | defaults: ["wifi-module-sdk-version-defaults"], |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 93 | static_libs: [ |
| 94 | "framework-wifi-util-lib", |
| David Su | bcdd406 | 2020-01-09 18:09:56 -0800 | [diff] [blame] | 95 | "android.hardware.wifi-V1.0-java-constants", |
| Quang Luong | a9d92d9 | 2021-04-30 15:57:00 -0700 | [diff] [blame] | 96 | "androidx.annotation_annotation", |
| William Escande | 4367f1e | 2021-09-03 17:02:38 +0200 | [diff] [blame^] | 97 | "wifi-modules-utils", |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 98 | ], |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 99 | libs: [ |
| David Su | bcdd406 | 2020-01-09 18:09:56 -0800 | [diff] [blame] | 100 | "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage |
| Remi NGUYEN VAN | ae6f9b7 | 2021-03-24 23:04:02 +0900 | [diff] [blame] | 101 | "framework-connectivity.stubs.module_lib", |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 102 | ], |
| Remi NGUYEN VAN | 37237ba | 2021-01-14 16:44:22 +0900 | [diff] [blame] | 103 | aidl: { |
| 104 | include_dirs: [ |
| Baligh Uddin | f009d85 | 2021-05-22 13:20:05 +0000 | [diff] [blame] | 105 | "packages/modules/Connectivity/framework/aidl-export", |
| Remi NGUYEN VAN | 37237ba | 2021-01-14 16:44:22 +0900 | [diff] [blame] | 106 | ], |
| 107 | }, |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 108 | srcs: [ |
| 109 | ":framework-wifi-updatable-sources", |
| David Su | 08f810e | 2020-12-09 10:40:18 -0800 | [diff] [blame] | 110 | ":module-utils-os-aidls", |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 111 | ], |
| David Su | 0c1d0c9 | 2020-10-26 11:12:04 -0700 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | // wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility |
| 115 | // classes before they are renamed. |
| 116 | java_library { |
| 117 | name: "framework-wifi-pre-jarjar", |
| 118 | defaults: ["framework-wifi-defaults"], |
| 119 | sdk_version: "module_current", |
| 120 | libs: ["framework-annotations-lib"], |
| 121 | // java_api_finder must accompany `srcs` (`srcs` defined in `framework-wifi-defaults`) |
| David Su | 3baa067 | 2020-01-21 16:45:50 -0800 | [diff] [blame] | 122 | plugins: ["java_api_finder"], |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 123 | installable: false, |
| 124 | visibility: [ |
| 125 | "//frameworks/opt/net/wifi/service", |
| 126 | "//frameworks/opt/net/wifi/tests/wifitests", |
| Baligh Uddin | e65d766 | 2020-12-24 05:49:07 +0000 | [diff] [blame] | 127 | "//packages/modules/Wifi/service", |
| 128 | "//packages/modules/Wifi/service/tests/wifitests", |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 129 | ], |
| 130 | } |
| 131 | |
| 132 | // post-jarjar version of framework-wifi |
| Paul Duffin | d224b73 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 133 | java_sdk_library { |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 134 | name: "framework-wifi", |
| David Su | 9ca5d40 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 135 | defaults: [ |
| 136 | "framework-module-defaults", |
| David Su | 0c1d0c9 | 2020-10-26 11:12:04 -0700 | [diff] [blame] | 137 | "framework-wifi-defaults", |
| Paul Duffin | d224b73 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 138 | ], |
| 139 | |
| Remi NGUYEN VAN | ae6f9b7 | 2021-03-24 23:04:02 +0900 | [diff] [blame] | 140 | stub_only_libs: ["framework-connectivity.stubs.module_lib"], |
| Remi NGUYEN VAN | 37237ba | 2021-01-14 16:44:22 +0900 | [diff] [blame] | 141 | |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 142 | jarjar_rules: ":wifi-jarjar-rules", |
| 143 | |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 144 | installable: true, |
| 145 | optimize: { |
| 146 | enabled: false |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 147 | }, |
| Jiyong Park | e954a15 | 2020-01-06 13:30:59 +0900 | [diff] [blame] | 148 | hostdex: true, // for hiddenapi check |
| Paul Duffin | 4b3c643 | 2020-05-31 11:32:06 +0100 | [diff] [blame] | 149 | |
| Paul Duffin | 4b3c643 | 2020-05-31 11:32:06 +0100 | [diff] [blame] | 150 | // Restrict access to implementation library. |
| 151 | impl_library_visibility: [ |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 152 | "//frameworks/opt/net/wifi/service:__subpackages__", |
| Baligh Uddin | e65d766 | 2020-12-24 05:49:07 +0000 | [diff] [blame] | 153 | "//packages/modules/Wifi/service:__subpackages__", |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 154 | ] + test_access_hidden_api_whitelist, |
| Paul Duffin | 4b3c643 | 2020-05-31 11:32:06 +0100 | [diff] [blame] | 155 | |
| Jiyong Park | e954a15 | 2020-01-06 13:30:59 +0900 | [diff] [blame] | 156 | apex_available: [ |
| 157 | "com.android.wifi", |
| 158 | "test_com.android.wifi", |
| 159 | ], |
| Vladimir Marko | 58338c4 | 2020-03-19 14:30:21 +0000 | [diff] [blame] | 160 | permitted_packages: [ |
| 161 | "android.hardware.wifi", |
| 162 | "android.net.wifi", |
| Paul Duffin | bc41cb7 | 2020-05-28 14:55:44 +0100 | [diff] [blame] | 163 | // Created by jarjar rules. |
| 164 | "com.android.wifi.x", |
| Vladimir Marko | 58338c4 | 2020-03-19 14:30:21 +0000 | [diff] [blame] | 165 | ], |
| Nate Jiang | 71d7586 | 2021-05-26 13:09:09 -0700 | [diff] [blame] | 166 | lint: { |
| 167 | strict_updatability_linting: true, |
| 168 | }, |
| David Su | 4b3032f | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 169 | } |
| 170 | |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 171 | // defaults for tests that need to build against framework-wifi's @hide APIs |
| 172 | java_defaults { |
| 173 | name: "framework-wifi-test-defaults", |
| David Su | 85ef0ad | 2020-11-25 10:55:11 -0800 | [diff] [blame] | 174 | sdk_version: "core_current", |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 175 | libs: [ |
| David Su | 8843a2d | 2020-01-07 19:47:28 -0800 | [diff] [blame] | 176 | // order matters: classes in framework-wifi are resolved before framework, meaning |
| 177 | // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework |
| Paul Duffin | d224b73 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 178 | "framework-wifi.impl", |
| David Su | 8843a2d | 2020-01-07 19:47:28 -0800 | [diff] [blame] | 179 | "framework", |
| David Su | dc878b8 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 180 | |
| 181 | // if sdk_version="" this gets automatically included, but here we need to add manually. |
| 182 | "framework-res", |
| 183 | ], |
| 184 | visibility: test_access_hidden_api_whitelist, |
| 185 | } |
| David Su | 5d01d6d | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 186 | |
| 187 | filegroup { |
| 188 | name: "wifi-jarjar-rules", |
| 189 | srcs: ["jarjar-rules.txt"], |
| 190 | } |