1// Copyright (C) 2022 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
15package {
16    default_visibility: [":__subpackages__"],
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20genrule {
21    name: "statslog-federatedcompute-java-gen",
22    tools: ["stats-log-api-gen"],
23    cmd: "$(location stats-log-api-gen) --java $(out) --module ondevicepersonalization" +
24        " --javaPackage com.android.federatedcompute.services.stats" +
25        " --javaClass FederatedComputeStatsLog",
26    out: ["com/android/federatedcompute/services/stats/FederatedComputeStatsLog.java"],
27    visibility: [
28        "//packages/modules/OnDevicePersonalization:__subpackages__",
29    ],
30}
31
32filegroup {
33    name: "fcp-apk-jarjar",
34    srcs: ["jarjar_rules.txt"],
35}
36
37android_app_certificate {
38    name: "com.android.federatedcompute.certificate",
39    certificate: "com.android.federatedcompute",
40}
41
42android_app {
43    name: "FederatedCompute",
44    srcs: [
45        ":common-ondevicepersonalization-sources",
46        ":federatedcompute-sources",
47        ":federatedcompute-fbs",
48        ":statslog-federatedcompute-java-gen",
49        ":fcp_native_wrapper",
50    ],
51    libs: [
52        "auto_value_annotations",
53        "framework-ondevicepersonalization.impl",
54        "framework-annotations-lib",
55        "framework-configinfrastructure", // For PH flags
56        "framework-statsd.stubs.module_lib", // For WW logging
57    ],
58    plugins: ["auto_value_plugin"],
59    static_libs: [
60        "flatbuffers-java",
61        "androidx.concurrent_concurrent-futures",
62        "federated-compute-java-proto-lite",
63        "guava",
64        "libprotobuf-java-lite",
65        "modules-utils-preconditions",
66        // Used for client error logging and background job logging.
67        "adservices-shared-spe",
68    ],
69    sdk_version: "module_current",
70    min_sdk_version: "Tiramisu",
71    jarjar_rules: ":fcp-apk-jarjar",
72    updatable: true,
73    certificate: ":com.android.federatedcompute.certificate",
74    apex_available: ["com.android.ondevicepersonalization"],
75    defaults: [
76        "federatedcompute-java-defaults",
77    ],
78    optimize: {
79        proguard_flags_files: ["proguard.flags"],
80    },
81}