David Su | 754fcc2 | 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 | |
David Su | 27953f1 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 15 | java_defaults { |
| 16 | name: "wifi-module-sdk-version-defaults", |
| 17 | min_sdk_version: "30", |
| 18 | target_sdk_version: "30", |
| 19 | } |
| 20 | |
David Su | 6dcd768 | 2020-01-21 11:23:00 -0800 | [diff] [blame] | 21 | filegroup { |
| 22 | name: "framework-wifi-updatable-exported-aidl-sources", |
| 23 | srcs: ["aidl-export/**/*.aidl"], |
| 24 | path: "aidl-export", |
| 25 | visibility: ["//visibility:private"], |
| 26 | } |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 27 | |
| 28 | filegroup { |
David Su | 6dcd768 | 2020-01-21 11:23:00 -0800 | [diff] [blame] | 29 | name: "framework-wifi-updatable-java-sources", |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 30 | srcs: [ |
| 31 | "java/**/*.java", |
| 32 | "java/**/*.aidl", |
| 33 | ], |
| 34 | exclude_srcs: [ |
| 35 | ":framework-wifi-non-updatable-sources" |
| 36 | ], |
| 37 | path: "java", |
David Su | 6dcd768 | 2020-01-21 11:23:00 -0800 | [diff] [blame] | 38 | visibility: ["//visibility:private"], |
| 39 | } |
| 40 | |
| 41 | filegroup { |
| 42 | name: "framework-wifi-updatable-sources", |
| 43 | srcs: [ |
| 44 | ":framework-wifi-updatable-java-sources", |
| 45 | ":framework-wifi-updatable-exported-aidl-sources", |
| 46 | ], |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | filegroup { |
| 50 | name: "framework-wifi-non-updatable-sources", |
| 51 | srcs: [ |
| 52 | // TODO(b/146011398) package android.net.wifi is now split amongst 2 jars: framework.jar and |
| 53 | // framework-wifi.jar. This is not a good idea, should move WifiNetworkScoreCache |
| 54 | // to a separate package. |
Roshan Pius | aa6527c | 2020-03-18 08:19:35 -0700 | [diff] [blame] | 55 | "java/android/net/wifi/SoftApConfToXmlMigrationUtil.java", |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 56 | "java/android/net/wifi/WifiNetworkScoreCache.java", |
Roshan Pius | 807b34a | 2020-02-24 09:12:52 -0800 | [diff] [blame] | 57 | "java/android/net/wifi/WifiMigration.java", |
Etan Cohen | 804d94a | 2020-02-15 17:33:27 -0800 | [diff] [blame] | 58 | "java/android/net/wifi/nl80211/*.java", |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 59 | ":libwificond_ipc_aidl", |
| 60 | ], |
| 61 | } |
| 62 | |
David Su | 130441b | 2019-12-14 21:37:20 -0800 | [diff] [blame] | 63 | filegroup { |
| 64 | name: "framework-wifi-annotations", |
| 65 | srcs: ["java/android/net/wifi/WifiAnnotations.java"], |
| 66 | } |
| 67 | |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 68 | // list of tests that are allowed to access @hide APIs from framework-wifi |
| 69 | test_access_hidden_api_whitelist = [ |
| 70 | "//frameworks/base/wifi/tests", |
| 71 | "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__", |
David Su | 434fe60 | 2019-12-18 21:22:21 -0800 | [diff] [blame] | 72 | |
David Su | 4c5bab6 | 2020-01-07 13:01:30 -0800 | [diff] [blame] | 73 | "//external/robolectric-shadows:__subpackages__", |
David Su | 6c00e38 | 2020-01-06 15:24:42 -0800 | [diff] [blame] | 74 | "//frameworks/base/packages/SettingsLib/tests/integ", |
David Su | 812a8f1 | 2020-01-11 16:22:00 -0800 | [diff] [blame] | 75 | "//external/sl4a:__subpackages__", |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 76 | ] |
| 77 | |
David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 78 | // wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility |
| 79 | // classes before they are renamed. |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 80 | java_library { |
David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 81 | name: "framework-wifi-pre-jarjar", |
David Su | 27953f1 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 82 | defaults: ["wifi-module-sdk-version-defaults"], |
David Su | 3c0d197 | 2020-03-16 15:53:48 -0700 | [diff] [blame] | 83 | sdk_version: "module_current", |
David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 84 | static_libs: [ |
| 85 | "framework-wifi-util-lib", |
David Su | 369c920 | 2020-01-09 18:09:56 -0800 | [diff] [blame] | 86 | "android.hardware.wifi-V1.0-java-constants", |
David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 87 | ], |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 88 | libs: [ |
David Su | 369c920 | 2020-01-09 18:09:56 -0800 | [diff] [blame] | 89 | "framework-annotations-lib", |
| 90 | "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 91 | ], |
| 92 | srcs: [ |
| 93 | ":framework-wifi-updatable-sources", |
David Su | 72f9d63 | 2020-02-10 15:58:26 -0800 | [diff] [blame] | 94 | ":framework-wifi-util-lib-aidls", |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 95 | ], |
David Su | a6f0c86 | 2020-01-21 16:45:50 -0800 | [diff] [blame] | 96 | // java_api_finder must accompany `srcs` |
| 97 | plugins: ["java_api_finder"], |
David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 98 | installable: false, |
| 99 | visibility: [ |
| 100 | "//frameworks/opt/net/wifi/service", |
| 101 | "//frameworks/opt/net/wifi/tests/wifitests", |
| 102 | ], |
| 103 | } |
| 104 | |
| 105 | // post-jarjar version of framework-wifi |
Paul Duffin | 5207958 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 106 | java_sdk_library { |
David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 107 | name: "framework-wifi", |
David Su | 27953f1 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 108 | defaults: [ |
| 109 | "framework-module-defaults", |
| 110 | "wifi-module-sdk-version-defaults", |
| 111 | ], |
David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 112 | static_libs: [ |
Paul Duffin | 5207958 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 113 | "framework-wifi-util-lib", |
| 114 | "android.hardware.wifi-V1.0-java-constants", |
David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 115 | ], |
Paul Duffin | 5207958 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 116 | libs: [ |
| 117 | "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage |
| 118 | ], |
| 119 | srcs: [ |
| 120 | ":framework-wifi-updatable-sources", |
| 121 | ":framework-wifi-util-lib-aidls", |
| 122 | ], |
| 123 | |
David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 124 | jarjar_rules: ":wifi-jarjar-rules", |
| 125 | |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 126 | installable: true, |
| 127 | optimize: { |
| 128 | enabled: false |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 129 | }, |
Jiyong Park | c81df3f | 2020-01-06 13:30:59 +0900 | [diff] [blame] | 130 | hostdex: true, // for hiddenapi check |
Paul Duffin | dde2230 | 2020-05-31 11:32:06 +0100 | [diff] [blame] | 131 | |
| 132 | // Allow access to the stubs from anywhere. |
| 133 | visibility: ["//visibility:public"], |
| 134 | |
| 135 | // Restrict access to implementation library. |
| 136 | impl_library_visibility: [ |
| 137 | "//visibility:override", // Ignore the visibility property. |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 138 | "//frameworks/opt/net/wifi/service:__subpackages__", |
| 139 | ] + test_access_hidden_api_whitelist, |
Paul Duffin | dde2230 | 2020-05-31 11:32:06 +0100 | [diff] [blame] | 140 | |
Jiyong Park | c81df3f | 2020-01-06 13:30:59 +0900 | [diff] [blame] | 141 | apex_available: [ |
| 142 | "com.android.wifi", |
| 143 | "test_com.android.wifi", |
| 144 | ], |
Vladimir Marko | 8a71e9b | 2020-03-19 14:30:21 +0000 | [diff] [blame] | 145 | permitted_packages: [ |
| 146 | "android.hardware.wifi", |
| 147 | "android.net.wifi", |
Paul Duffin | 407ce9dc | 2020-05-28 14:55:44 +0100 | [diff] [blame] | 148 | // Created by jarjar rules. |
| 149 | "com.android.wifi.x", |
Vladimir Marko | 8a71e9b | 2020-03-19 14:30:21 +0000 | [diff] [blame] | 150 | ], |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 151 | } |
| 152 | |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 153 | // defaults for tests that need to build against framework-wifi's @hide APIs |
| 154 | java_defaults { |
| 155 | name: "framework-wifi-test-defaults", |
| 156 | sdk_version: "core_platform", // tests can use @CorePlatformApi's |
| 157 | libs: [ |
David Su | cc38e1f | 2020-01-07 19:47:28 -0800 | [diff] [blame] | 158 | // order matters: classes in framework-wifi are resolved before framework, meaning |
| 159 | // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework |
Paul Duffin | 5207958 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 160 | "framework-wifi.impl", |
David Su | cc38e1f | 2020-01-07 19:47:28 -0800 | [diff] [blame] | 161 | "framework", |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 162 | |
| 163 | // if sdk_version="" this gets automatically included, but here we need to add manually. |
| 164 | "framework-res", |
| 165 | ], |
| 166 | visibility: test_access_hidden_api_whitelist, |
| 167 | } |
David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 168 | |
| 169 | filegroup { |
| 170 | name: "wifi-jarjar-rules", |
| 171 | srcs: ["jarjar-rules.txt"], |
| 172 | } |