1// Copyright 2019 The Android Open Source Project
2package {
3    default_applicable_licenses: ["Android-Apache-2.0"],
4}
5
6java_defaults {
7    name: "CellBroadcastServiceCommon",
8    min_sdk_version: "30",
9    srcs: [
10      "src/**/*.java",
11      ":statslog-cellbroadcast-module-java-gen",
12    ],
13    libs: [
14        "framework-annotations-lib",
15        "framework-statsd",
16        "framework-location.stubs.module_lib",
17        "unsupportedappusage",
18    ],
19    sdk_version: "module_current",
20    static_libs: [
21        "modules-utils-build",
22        "modules-utils-handlerexecutor",
23        "modules-utils-locallog",
24        "modules-utils-preconditions",
25        "modules-utils-statemachine",
26    ],
27    certificate: "platform",
28    privileged: true,
29    resource_dirs: ["res"],
30    optimize: {
31        shrink_resources: true,
32        proguard_flags_files: ["proguard.flags"],
33    },
34    jarjar_rules: "cellbroadcast-jarjar-rules.txt",
35    lint: {
36        strict_updatability_linting: true,
37    },
38}
39
40android_app {
41    name: "CellBroadcastServiceModule",
42    defaults: ["CellBroadcastServiceCommon"],
43    certificate: "networkstack",
44    manifest: "AndroidManifest.xml",
45    apex_available: ["com.android.cellbroadcast"],
46    privapp_allowlist: ":privapp_allowlist_com.android.cellbroadcastservice.xml",
47}
48
49android_app {
50     name: "CellBroadcastServiceModulePlatform",
51     target_sdk_version: "33",
52     defaults: ["CellBroadcastServiceCommon"],
53     certificate: "platform",
54     // CellBroadcastServicePlatformModule is a replacement for com.android.cellbroadcast apex
55     // which consists of CellBroadcastServiceModule
56     overrides: ["com.android.cellbroadcast"],
57     manifest: "AndroidManifest_Platform.xml",
58     privapp_allowlist: ":platform_privapp_allowlist_com.android.cellbroadcastservice.xml",
59}
60
61genrule {
62  name: "statslog-cellbroadcast-java-gen",
63  tools: ["stats-log-api-gen"],
64  cmd: "$(location stats-log-api-gen) --java $(out) --module cellbroadcast" +
65       " --javaPackage com.android.cellbroadcastservice --javaClass CellBroadcastStatsLog" +
66       " --minApiLevel 30",
67  out: ["com/android/cellbroadcastservice/CellBroadcastStatsLog.java"],
68}
69
70genrule {
71  name: "statslog-cellbroadcast-module-java-gen",
72  tools: ["stats-log-api-gen"],
73  cmd: "$(location stats-log-api-gen) --java $(out) --module cellbroadcast" +
74       " --javaPackage com.android.cellbroadcastservice --javaClass CellBroadcastModuleStatsLog" +
75       " --minApiLevel 30",
76  out: ["com/android/cellbroadcastservice/CellBroadcastModuleStatsLog.java"],
77}
78
79// used to share common constants between cellbroadcastservice and cellbroadcastreceier
80filegroup {
81    name: "cellbroadcast-constants-shared-srcs",
82    srcs: [
83        "src/com/android/cellbroadcastservice/SmsCbConstants.java",
84        "src/com/android/cellbroadcastservice/CellBroadcastMetrics.java",
85        ":statslog-cellbroadcast-module-java-gen",
86    ],
87}
88
89// used to share src with cellbroadcastreceiver test app
90filegroup {
91    name: "cellbroadcast-util-shared-srcs",
92    srcs: [
93        "src/com/android/cellbroadcastservice/GsmAlphabet.java",
94        "src/com/android/cellbroadcastservice/CbGeoUtils.java",
95        "src/com/android/cellbroadcastservice/SmsCbHeader.java",
96        "src/com/android/cellbroadcastservice/CellBroadcastServiceMetrics.java",
97    ],
98}
99
100// used to share src with unit test app
101filegroup {
102    name: "cellbroadcast-shared-srcs",
103    srcs: [
104        "src/**/*.java",
105        ":statslog-cellbroadcast-module-java-gen",
106    ],
107}
108