1// Copyright 2011 The Android Open Source Project
2package {
3    // See: http://go/android-license-faq
4    default_applicable_licenses: ["Android-Apache-2.0"],
5}
6
7java_defaults {
8    name: "CellBroadcastDefaults",
9    min_sdk_version: "30",
10    sdk_version: "module_current",
11    privileged: true,
12    optimize: {
13        shrink_resources: true,
14        proguard_flags_files: ["proguard.flags"],
15    },
16}
17
18android_library {
19    name: "CellBroadcastCommon",
20    defaults: ["CellBroadcastDefaults"],
21    srcs: [
22      "src/**/*.java",
23      ":cellbroadcast-constants-shared-srcs",
24      ":statslog-cellbroadcast-module-java-gen",
25    ],
26    libs: [
27        "framework-annotations-lib",
28        "framework-statsd",
29        "framework-bluetooth",
30    ],
31    static_libs: [
32        "androidx.legacy_legacy-support-v4",
33        "androidx.legacy_legacy-support-v13",
34        "androidx.recyclerview_recyclerview",
35        "androidx.preference_preference",
36        "androidx.appcompat_appcompat",
37        "androidx.legacy_legacy-preference-v14",
38        "SettingsLibSettingsTheme",
39        "SettingsLibCollapsingToolbarBaseActivity",
40        "SettingsLibMainSwitchPreference",
41        "SettingsLibTopIntroPreference",
42        "modules-utils-build_system",
43        "cellbroadcast-java-proto-lite",
44    ],
45    resource_dirs: ["res"],
46    manifest: "AndroidManifest_Lib.xml",
47    apex_available : [
48        "com.android.cellbroadcast",
49        "//apex_available:platform",
50    ],
51}
52
53android_app {
54    name: "CellBroadcastApp",
55    defaults: ["CellBroadcastDefaults"],
56    static_libs: ["CellBroadcastCommon"],
57    certificate: "networkstack",
58    aaptflags: ["--custom-package com.android.cellbroadcastreceiver"],
59    manifest: "AndroidManifest.xml",
60    apex_available: ["com.android.cellbroadcast"],
61    privapp_allowlist: ":privapp_allowlist_com.android.cellbroadcastreceiver.module.xml",
62    resource_dirs: [],
63}
64
65android_app {
66    name: "CellBroadcastAppPlatform",
67    defaults: ["CellBroadcastDefaults"],
68    static_libs: ["CellBroadcastCommon"],
69    target_sdk_version: "33",
70    certificate: "platform",
71    // CellBroadcastAppPlatform is a replacement for com.android.cellbroadcast apex which consists
72    // of CellBroadcastApp
73    overrides: ["com.android.cellbroadcast", "CellBroadcastLegacyApp"],
74    manifest: "AndroidManifest_Platform.xml",
75    system_ext_specific: true,
76    privileged: true,
77    privapp_allowlist: ":platform_privapp_allowlist_com.android.cellbroadcastreceiver.xml",
78    resource_dirs: [],
79}
80
81// source file shared with legacy cellbroadcast app
82filegroup {
83    name: "cellbroadcast-database-sources",
84    srcs: [
85        "src/com/android/cellbroadcastreceiver/CellBroadcastDatabaseHelper.java",
86    ],
87}
88
89java_library {
90    name: "cellbroadcast-java-proto-lite",
91    proto: {
92        type: "lite",
93        include_dirs: ["external/protobuf/src"],
94        canonical_path_from_root: false,
95    },
96    srcs: ["proto/*.proto"],
97    sdk_version: "core_current",
98    apex_available : ["com.android.cellbroadcast",
99                      "//apex_available:platform",
100    ],
101}
102