| 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 | 80417683 | 2020-10-26 11:12:04 -0700 | [diff] [blame] | 78 | // defaults shared between `framework-wifi` & `framework-wifi-pre-jarjar` | 
|  | 79 | // java_sdk_library `framework-wifi` needs sources to generate stubs, so it cannot reuse | 
|  | 80 | // `framework-wifi-pre-jarjar` | 
|  | 81 | java_defaults { | 
|  | 82 | name: "framework-wifi-defaults", | 
| David Su | 27953f1 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 83 | defaults: ["wifi-module-sdk-version-defaults"], | 
| 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 | 80417683 | 2020-10-26 11:12:04 -0700 | [diff] [blame] | 87 | "modules-utils-build", | 
| David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 88 | ], | 
| David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 89 | libs: [ | 
| David Su | 369c920 | 2020-01-09 18:09:56 -0800 | [diff] [blame] | 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 | 80417683 | 2020-10-26 11:12:04 -0700 | [diff] [blame] | 96 | } | 
|  | 97 |  | 
|  | 98 | // wifi-service needs pre-jarjared version of framework-wifi so it can reference copied utility | 
|  | 99 | // classes before they are renamed. | 
|  | 100 | java_library { | 
|  | 101 | name: "framework-wifi-pre-jarjar", | 
|  | 102 | defaults: ["framework-wifi-defaults"], | 
|  | 103 | sdk_version: "module_current", | 
|  | 104 | libs: ["framework-annotations-lib"], | 
|  | 105 | // java_api_finder must accompany `srcs` (`srcs` defined in `framework-wifi-defaults`) | 
| David Su | a6f0c86 | 2020-01-21 16:45:50 -0800 | [diff] [blame] | 106 | plugins: ["java_api_finder"], | 
| David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 107 | installable: false, | 
|  | 108 | visibility: [ | 
|  | 109 | "//frameworks/opt/net/wifi/service", | 
|  | 110 | "//frameworks/opt/net/wifi/tests/wifitests", | 
|  | 111 | ], | 
|  | 112 | } | 
|  | 113 |  | 
|  | 114 | // post-jarjar version of framework-wifi | 
| Paul Duffin | 5207958 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 115 | java_sdk_library { | 
| David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 116 | name: "framework-wifi", | 
| David Su | 27953f1 | 2020-06-10 12:39:07 -0700 | [diff] [blame] | 117 | defaults: [ | 
|  | 118 | "framework-module-defaults", | 
| David Su | 80417683 | 2020-10-26 11:12:04 -0700 | [diff] [blame] | 119 | "framework-wifi-defaults", | 
| Paul Duffin | 5207958 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 120 | ], | 
|  | 121 |  | 
| David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 122 | jarjar_rules: ":wifi-jarjar-rules", | 
|  | 123 |  | 
| David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 124 | installable: true, | 
|  | 125 | optimize: { | 
|  | 126 | enabled: false | 
| David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 127 | }, | 
| Jiyong Park | c81df3f | 2020-01-06 13:30:59 +0900 | [diff] [blame] | 128 | hostdex: true, // for hiddenapi check | 
| Paul Duffin | dde2230 | 2020-05-31 11:32:06 +0100 | [diff] [blame] | 129 |  | 
| Paul Duffin | dde2230 | 2020-05-31 11:32:06 +0100 | [diff] [blame] | 130 | // Restrict access to implementation library. | 
|  | 131 | impl_library_visibility: [ | 
| David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 132 | "//frameworks/opt/net/wifi/service:__subpackages__", | 
|  | 133 | ] + test_access_hidden_api_whitelist, | 
| Paul Duffin | dde2230 | 2020-05-31 11:32:06 +0100 | [diff] [blame] | 134 |  | 
| Jiyong Park | c81df3f | 2020-01-06 13:30:59 +0900 | [diff] [blame] | 135 | apex_available: [ | 
|  | 136 | "com.android.wifi", | 
|  | 137 | "test_com.android.wifi", | 
|  | 138 | ], | 
| Vladimir Marko | 8a71e9b | 2020-03-19 14:30:21 +0000 | [diff] [blame] | 139 | permitted_packages: [ | 
|  | 140 | "android.hardware.wifi", | 
|  | 141 | "android.net.wifi", | 
| Paul Duffin | 407ce9dc | 2020-05-28 14:55:44 +0100 | [diff] [blame] | 142 | // Created by jarjar rules. | 
|  | 143 | "com.android.wifi.x", | 
| Vladimir Marko | 8a71e9b | 2020-03-19 14:30:21 +0000 | [diff] [blame] | 144 | ], | 
| David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 145 | } | 
|  | 146 |  | 
| David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 147 | // defaults for tests that need to build against framework-wifi's @hide APIs | 
|  | 148 | java_defaults { | 
|  | 149 | name: "framework-wifi-test-defaults", | 
|  | 150 | sdk_version: "core_platform", // tests can use @CorePlatformApi's | 
|  | 151 | libs: [ | 
| David Su | cc38e1f | 2020-01-07 19:47:28 -0800 | [diff] [blame] | 152 | // order matters: classes in framework-wifi are resolved before framework, meaning | 
|  | 153 | // @hide APIs in framework-wifi are resolved before @SystemApi stubs in framework | 
| Paul Duffin | 5207958 | 2020-05-13 20:33:29 +0100 | [diff] [blame] | 154 | "framework-wifi.impl", | 
| David Su | cc38e1f | 2020-01-07 19:47:28 -0800 | [diff] [blame] | 155 | "framework", | 
| David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 156 |  | 
|  | 157 | // if sdk_version="" this gets automatically included, but here we need to add manually. | 
|  | 158 | "framework-res", | 
|  | 159 | ], | 
|  | 160 | visibility: test_access_hidden_api_whitelist, | 
|  | 161 | } | 
| David Su | 511a814 | 2020-01-09 14:02:21 -0800 | [diff] [blame] | 162 |  | 
|  | 163 | filegroup { | 
|  | 164 | name: "wifi-jarjar-rules", | 
|  | 165 | srcs: ["jarjar-rules.txt"], | 
|  | 166 | } |