Wei Wang | 6b7561d | 2021-06-03 17:33:14 -0700 | [diff] [blame] | 1 | // Copyright (C) 2021 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 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
| 19 | filegroup { |
| 20 | name: "nearby-service-srcs", |
| 21 | srcs: [ |
| 22 | "java/**/*.java", |
Daniel (Ying Wai) Fan | 79d7ddc | 2022-01-07 16:51:18 -0800 | [diff] [blame^] | 23 | ":statslog-nearby-java-gen", |
Wei Wang | 6b7561d | 2021-06-03 17:33:14 -0700 | [diff] [blame] | 24 | ], |
| 25 | } |
| 26 | |
Weice | 57d88f6 | 2021-12-06 06:24:56 +0000 | [diff] [blame] | 27 | filegroup { |
| 28 | name: "nearby-service-string-res", |
| 29 | srcs: [ |
| 30 | "java/**/Constant.java", |
Weice | fcd891b | 2021-12-28 23:31:08 +0000 | [diff] [blame] | 31 | "java/**/UserActionHandlerBase.java", |
| 32 | "java/**/UserActionHandler.java", |
| 33 | "java/**/FastPairConstants.java", |
Weice | 57d88f6 | 2021-12-06 06:24:56 +0000 | [diff] [blame] | 34 | ], |
| 35 | } |
| 36 | |
| 37 | java_library { |
| 38 | name: "nearby-service-string", |
| 39 | srcs: [":nearby-service-string-res"], |
Roopa Sattiraju | e8fabcc | 2022-01-11 20:40:07 -0800 | [diff] [blame] | 40 | libs: ["framework-bluetooth"], |
Weice | 57d88f6 | 2021-12-06 06:24:56 +0000 | [diff] [blame] | 41 | sdk_version: "module_current", |
| 42 | } |
| 43 | |
| 44 | |
Wei Wang | 6b7561d | 2021-06-03 17:33:14 -0700 | [diff] [blame] | 45 | // Main lib for nearby services. |
| 46 | java_library { |
| 47 | name: "service-nearby", |
| 48 | srcs: [":nearby-service-srcs"], |
| 49 | |
| 50 | defaults: [ |
Wei Wang | 6b7561d | 2021-06-03 17:33:14 -0700 | [diff] [blame] | 51 | "framework-system-server-module-defaults" |
| 52 | ], |
| 53 | libs: [ |
Roopa Sattiraju | e8fabcc | 2022-01-11 20:40:07 -0800 | [diff] [blame] | 54 | "framework-bluetooth.stubs.module_lib", // TODO(b/215722418): Change to framework-bluetooth once fixed |
Chun Zhang | bc34fdb | 2021-09-20 11:19:04 -0700 | [diff] [blame] | 55 | "error_prone_annotations", |
Remi NGUYEN VAN | 15ed7d2 | 2022-01-07 13:20:08 +0900 | [diff] [blame] | 56 | "framework-connectivity-tiramisu.impl", |
Daniel (Ying Wai) Fan | 79d7ddc | 2022-01-07 16:51:18 -0800 | [diff] [blame^] | 57 | "framework-statsd.stubs.module_lib", |
Chun Zhang | bc34fdb | 2021-09-20 11:19:04 -0700 | [diff] [blame] | 58 | ], |
| 59 | static_libs: [ |
Chun Zhang | bc34fdb | 2021-09-20 11:19:04 -0700 | [diff] [blame] | 60 | "androidx.annotation_annotation", |
Chun Zhang | 2866081 | 2021-09-22 20:48:39 -0700 | [diff] [blame] | 61 | "androidx.core_core", |
Weice | fcd891b | 2021-12-28 23:31:08 +0000 | [diff] [blame] | 62 | "androidx.localbroadcastmanager_localbroadcastmanager", |
Chun Zhang | bbe6025 | 2021-09-21 22:05:03 -0700 | [diff] [blame] | 63 | "guava", |
Chun Zhang | fe6d0c1 | 2021-09-22 15:19:43 -0700 | [diff] [blame] | 64 | "libprotobuf-java-lite", |
weicesun | b989a18 | 2021-11-04 14:14:54 -0700 | [diff] [blame] | 65 | "fast-pair-lite-protos", |
Chun Zhang | 0024066 | 2021-12-06 09:17:50 -0800 | [diff] [blame] | 66 | "modules-utils-build", |
| 67 | "modules-utils-handlerexecutor", |
| 68 | "modules-utils-preconditions", |
| 69 | "modules-utils-backgroundthread", |
Wei Wang | 6b7561d | 2021-06-03 17:33:14 -0700 | [diff] [blame] | 70 | ], |
| 71 | sdk_version: "system_server_current", |
Remi NGUYEN VAN | 15ed7d2 | 2022-01-07 13:20:08 +0900 | [diff] [blame] | 72 | // This is included in service-connectivity which is 30+ |
| 73 | // TODO: allow APEXes to have service jars with higher min_sdk than the APEX |
| 74 | // (service-connectivity is only used on 31+) and use 31 here |
| 75 | min_sdk_version: "30", |
Wei Wang | 6b7561d | 2021-06-03 17:33:14 -0700 | [diff] [blame] | 76 | |
| 77 | installable: true, |
Wei Wang | 6b7561d | 2021-06-03 17:33:14 -0700 | [diff] [blame] | 78 | dex_preopt: { |
| 79 | enabled: false, |
| 80 | app_image: false, |
| 81 | }, |
| 82 | visibility: [ |
| 83 | "//packages/modules/Nearby/apex", |
| 84 | ], |
| 85 | apex_available: [ |
Remi NGUYEN VAN | 15ed7d2 | 2022-01-07 13:20:08 +0900 | [diff] [blame] | 86 | "com.android.tethering", |
Wei Wang | 6b7561d | 2021-06-03 17:33:14 -0700 | [diff] [blame] | 87 | ], |
Chun Zhang | 2841703 | 2021-09-20 14:10:38 -0700 | [diff] [blame] | 88 | } |
Daniel (Ying Wai) Fan | 79d7ddc | 2022-01-07 16:51:18 -0800 | [diff] [blame^] | 89 | |
| 90 | genrule { |
| 91 | name: "statslog-nearby-java-gen", |
| 92 | tools: ["stats-log-api-gen"], |
| 93 | cmd: "$(location stats-log-api-gen) --java $(out) --module nearby " + |
| 94 | " --javaPackage com.android.server.nearby.proto --javaClass NearbyStatsLog" + |
| 95 | " --minApiLevel 33", |
| 96 | out: ["com/android/server/nearby/proto/NearbyStatsLog.java"], |
| 97 | } |