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 | |
| 15 | |
| 16 | filegroup { |
| 17 | name: "framework-wifi-updatable-sources", |
| 18 | srcs: [ |
| 19 | "java/**/*.java", |
| 20 | "java/**/*.aidl", |
| 21 | ], |
| 22 | exclude_srcs: [ |
| 23 | ":framework-wifi-non-updatable-sources" |
| 24 | ], |
| 25 | path: "java", |
| 26 | } |
| 27 | |
| 28 | filegroup { |
| 29 | name: "framework-wifi-non-updatable-sources", |
| 30 | srcs: [ |
| 31 | // TODO(b/146011398) package android.net.wifi is now split amongst 2 jars: framework.jar and |
| 32 | // framework-wifi.jar. This is not a good idea, should move WifiNetworkScoreCache |
| 33 | // to a separate package. |
| 34 | "java/android/net/wifi/WifiNetworkScoreCache.java", |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 35 | "java/android/net/wifi/wificond/*.java", |
| 36 | ":libwificond_ipc_aidl", |
| 37 | ], |
| 38 | } |
| 39 | |
David Su | 130441b | 2019-12-14 21:37:20 -0800 | [diff] [blame] | 40 | filegroup { |
| 41 | name: "framework-wifi-annotations", |
| 42 | srcs: ["java/android/net/wifi/WifiAnnotations.java"], |
| 43 | } |
| 44 | |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 45 | // list of tests that are allowed to access @hide APIs from framework-wifi |
| 46 | test_access_hidden_api_whitelist = [ |
| 47 | "//frameworks/base/wifi/tests", |
| 48 | "//frameworks/opt/net/wifi/tests/wifitests:__subpackages__", |
David Su | 434fe60 | 2019-12-18 21:22:21 -0800 | [diff] [blame] | 49 | |
David Su | fd0886a | 2019-12-18 21:56:46 -0800 | [diff] [blame] | 50 | "//frameworks/opt/net/wifi/libs/WifiTrackerLib/tests", |
David Su | 4c5bab6 | 2020-01-07 13:01:30 -0800 | [diff] [blame] | 51 | "//external/robolectric-shadows:__subpackages__", |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 52 | ] |
| 53 | |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 54 | java_library { |
| 55 | name: "framework-wifi", |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 56 | // TODO(b/140299412) should be core_current once we build against framework-system-stubs |
| 57 | sdk_version: "core_platform", |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 58 | libs: [ |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 59 | // TODO(b/140299412) should be framework-system-stubs once we fix all @hide dependencies |
| 60 | "framework-minus-apex", |
Artur Satayev | 74cb719 | 2019-12-10 17:47:56 +0000 | [diff] [blame] | 61 | "unsupportedappusage", |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 62 | ], |
| 63 | srcs: [ |
| 64 | ":framework-wifi-updatable-sources", |
| 65 | ], |
| 66 | installable: true, |
| 67 | optimize: { |
| 68 | enabled: false |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 69 | }, |
| 70 | visibility: [ |
| 71 | "//frameworks/base", // TODO(b/140299412) remove once all dependencies are fixed |
| 72 | "//frameworks/opt/net/wifi/service:__subpackages__", |
| 73 | ] + test_access_hidden_api_whitelist, |
David Su | ae86a37 | 2020-01-03 14:26:11 -0800 | [diff] [blame] | 74 | plugins: ["java_api_finder"], |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 75 | } |
| 76 | |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 77 | droidstubs { |
| 78 | name: "framework-wifi-stubs-srcs", |
| 79 | srcs: [ |
| 80 | ":framework-annotations", |
| 81 | ":framework-wifi-updatable-sources", |
| 82 | ], |
| 83 | aidl: { |
| 84 | include_dirs: ["frameworks/base/core/java"], |
| 85 | }, |
Anton Hansson | 0c2ebe2 | 2019-12-17 10:03:52 +0000 | [diff] [blame] | 86 | defaults: [ "framework-module-stubs-defaults-systemapi" ], |
David Su | 754fcc2 | 2019-09-04 14:31:58 -0700 | [diff] [blame] | 87 | sdk_version: "core_current", |
| 88 | libs: ["android_system_stubs_current"], |
| 89 | } |
| 90 | |
| 91 | java_library { |
| 92 | name: "framework-wifi-stubs", |
| 93 | srcs: [":framework-wifi-stubs-srcs"], |
| 94 | aidl: { |
| 95 | export_include_dirs: [ |
| 96 | "java", |
| 97 | ], |
| 98 | }, |
| 99 | sdk_version: "core_current", |
| 100 | libs: ["android_system_stubs_current"], |
| 101 | installable: false, |
| 102 | } |
| 103 | |
David Su | 90ed105 | 2019-12-18 18:20:28 -0800 | [diff] [blame] | 104 | // defaults for tests that need to build against framework-wifi's @hide APIs |
| 105 | java_defaults { |
| 106 | name: "framework-wifi-test-defaults", |
| 107 | sdk_version: "core_platform", // tests can use @CorePlatformApi's |
| 108 | libs: [ |
| 109 | "framework-wifi", |
| 110 | "framework-minus-apex", |
| 111 | |
| 112 | // if sdk_version="" this gets automatically included, but here we need to add manually. |
| 113 | "framework-res", |
| 114 | ], |
| 115 | visibility: test_access_hidden_api_whitelist, |
| 116 | } |