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