blob: 8491ee7db7ea254fac9b2b7ed28de4374a60bcc1 [file] [log] [blame]
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -08001//
2// Copyright (C) 2021 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17
Bob Badoure9c20682021-03-19 03:30:57 -070018package {
19 default_applicable_licenses: ["Android-Apache-2.0"],
20}
21
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080022filegroup {
23 name: "ThemePicker_srcs",
24 srcs: [
25 "src/**/*.java",
26 "src/**/*.kt",
27 ],
28}
29
30filegroup {
Chris Poultneyf5109062022-12-20 19:57:42 +000031 name: "ThemePicker_src_overrides",
32 srcs: [
33 "src_override/**/*.java",
34 "src_override/**/*.kt",
35 ],
36}
37
38filegroup {
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080039 name: "ThemePicker_Manifest",
40 srcs: [
41 "AndroidManifest.xml",
42 ],
43}
44
45genrule {
46 name: "ThemePicker_res",
47 tools: ["soong_zip"],
48 srcs: [
George Lin621fb8f2022-07-29 21:13:41 +000049 "res/**/*",
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080050 ],
51 out: ["ThemePicker_res.zip"],
52 cmd: "INPUTS=($(in)) && "
53 + "RES_DIR=$$(dirname $$(dirname $${INPUTS[0]})) && "
Colin Cross928f3132021-05-11 18:32:09 +000054 + "$(location soong_zip) -o $(out) -C $$RES_DIR -D $$RES_DIR"
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080055}
56
Chris Poultneyf5109062022-12-20 19:57:42 +000057genrule {
58 name: "ThemePicker_res_overrides",
59 tools: ["soong_zip"],
60 srcs: [
61 "res_override/**/*",
62 ],
63 out: ["ThemePicker_res_overrides.zip"],
64 cmd: "INPUTS=($(in)) && "
65 + "RES_DIR=$$(dirname $$(dirname $${INPUTS[0]})) && "
66 + "$(location soong_zip) -o $(out) -C $$RES_DIR -D $$RES_DIR"
67}
68
Alexander Martinz0eba31f2023-03-27 09:21:32 +020069genrule {
70 name: "ThemePicker_res_overrides_gms",
71 tools: ["soong_zip"],
72 srcs: [
73 "res_override_gms/**/*",
74 ],
75 out: ["ThemePicker_res_overrides_gms.zip"],
76 cmd: "INPUTS=($(in)) && "
77 + "RES_DIR=$$(dirname $$(dirname $${INPUTS[0]})) && "
78 + "$(location soong_zip) -o $(out) -C $$RES_DIR -D $$RES_DIR"
79}
80
Chris Poultneyf5109062022-12-20 19:57:42 +000081java_defaults {
82 name: "ThemePicker_defaults",
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080083
84 static_libs: [
Kunhung Li53fc4d52022-02-12 16:58:06 +080085 "guava",
86 "monet",
Alejandro Nijamkin0f02b082022-11-24 13:43:43 -080087 "renderscript_toolkit",
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080088 "wallpaper-common-deps",
Chihhang Chuangc21a3ff2021-06-08 12:53:24 +080089 "SettingsLibSettingsTheme",
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080090 "SystemUI-statsd",
Chihhang Chuangc21a3ff2021-06-08 12:53:24 +080091 "styleprotoslite",
Alejandro Nijamkin7a062282023-02-06 13:38:40 -080092 "androidx.lifecycle_lifecycle-livedata-ktx",
Alejandro Nijamkin0f02b082022-11-24 13:43:43 -080093 "androidx.lifecycle_lifecycle-runtime-ktx",
94 "androidx.lifecycle_lifecycle-viewmodel-ktx",
95 "androidx.recyclerview_recyclerview",
96 "SystemUICustomizationLib",
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080097 ],
98
Ching-Sung Libdf34222022-03-30 15:19:13 +080099 jni_libs: [
100 "librenderscript-toolkit",
101 ],
102
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -0800103 srcs: [
104 ":WallpaperPicker2_srcs",
105 ":ThemePicker_srcs",
Chris Poultneyf5109062022-12-20 19:57:42 +0000106 ":ThemePicker_src_overrides",
George Lin621fb8f2022-07-29 21:13:41 +0000107 ],
108
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -0800109 use_embedded_native_libs: true,
110
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -0800111 optimize: {
112 enabled: false,
113 },
Santiago Etchebehere260beaf2021-03-16 18:53:50 -0700114 kotlincflags: ["-Xjvm-default=enable"],
Tommy Webb3c2259a2023-06-20 12:58:20 -0400115 certificate: "",
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -0800116
117 privileged: true,
118 system_ext_specific: true,
Chris Poultneyf5109062022-12-20 19:57:42 +0000119}
120
121//
122// Build app code.
123//
124android_app {
125 name: "ThemePicker",
126 defaults: ["ThemePicker_defaults"],
127
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -0800128 platform_apis: true,
129 manifest: "AndroidManifest.xml",
Chihhang Chuangd2ece572021-06-17 22:40:26 +0800130 additional_manifests: [":WallpaperPicker2_Manifest"],
Alexander Martinz0eba31f2023-03-27 09:21:32 +0200131 resource_zips: [":WallpaperPicker2_res", ":ThemePicker_res", ":ThemePicker_res_overrides"],
Michael Wda9e2e82022-04-06 21:57:11 +0200132 overrides: [
133 "WallpaperCropper",
Danny Lin360f3802021-10-05 19:00:36 -0700134 "WallpaperPicker",
Michael Wda9e2e82022-04-06 21:57:11 +0200135 "WallpaperPicker2",
136 ],
LuK1337b5642112020-09-15 03:27:19 +0200137 required: [
LuK1337b5642112020-09-15 03:27:19 +0200138 "privapp_whitelist_com.android.wallpaper"
139 ],
140}
141
Alexander Martinz0eba31f2023-03-27 09:21:32 +0200142android_app {
143 name: "ThemePickerGms",
144 defaults: ["ThemePicker_defaults"],
145
146 platform_apis: true,
147 manifest: "AndroidManifest.xml",
148 additional_manifests: [":WallpaperPicker2_Manifest"],
149 resource_zips: [":WallpaperPicker2_res", ":ThemePicker_res", ":ThemePicker_res_overrides_gms"],
150 overrides: [
151 "ThemePicker",
152 "WallpaperCropper",
153 "WallpaperPicker",
154 "WallpaperPicker2",
155 ],
156 required: [
157 "privapp_whitelist_com.android.wallpaper"
158 ],
159}
160
LuK1337b5642112020-09-15 03:27:19 +0200161prebuilt_etc {
Luca Stefani3a29a8e2019-11-01 21:14:29 +0100162 name: "privapp_whitelist_com.android.wallpaper",
163 system_ext_specific: true,
164 src: "privapp_whitelist_com.android.wallpaper.xml",
165 sub_dir: "permissions",
166 filename_from_src: true,
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -0800167}