blob: be6353d7f19ab3bd40079c3bb5353e3e2491ef55 [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
69java_defaults {
70 name: "ThemePicker_defaults",
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080071
72 static_libs: [
Kunhung Li53fc4d52022-02-12 16:58:06 +080073 "guava",
74 "monet",
Alejandro Nijamkin0f02b082022-11-24 13:43:43 -080075 "renderscript_toolkit",
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080076 "wallpaper-common-deps",
Chihhang Chuangc21a3ff2021-06-08 12:53:24 +080077 "SettingsLibSettingsTheme",
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080078 "SystemUI-statsd",
Chihhang Chuangc21a3ff2021-06-08 12:53:24 +080079 "styleprotoslite",
Alejandro Nijamkin7a062282023-02-06 13:38:40 -080080 "androidx.lifecycle_lifecycle-livedata-ktx",
Alejandro Nijamkin0f02b082022-11-24 13:43:43 -080081 "androidx.lifecycle_lifecycle-runtime-ktx",
82 "androidx.lifecycle_lifecycle-viewmodel-ktx",
83 "androidx.recyclerview_recyclerview",
84 "SystemUICustomizationLib",
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080085 ],
86
Ching-Sung Libdf34222022-03-30 15:19:13 +080087 jni_libs: [
88 "librenderscript-toolkit",
89 ],
90
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080091 srcs: [
92 ":WallpaperPicker2_srcs",
93 ":ThemePicker_srcs",
Chris Poultneyf5109062022-12-20 19:57:42 +000094 ":ThemePicker_src_overrides",
George Lin621fb8f2022-07-29 21:13:41 +000095 ],
96
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -080097 use_embedded_native_libs: true,
98
Chris Poultneyf5109062022-12-20 19:57:42 +000099 resource_zips: [":WallpaperPicker2_res", ":ThemePicker_res", ":ThemePicker_res_overrides"],
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -0800100
101 optimize: {
102 enabled: false,
103 },
Santiago Etchebehere260beaf2021-03-16 18:53:50 -0700104 kotlincflags: ["-Xjvm-default=enable"],
Tommy Webb3c2259a2023-06-20 12:58:20 -0400105 certificate: "",
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -0800106
107 privileged: true,
108 system_ext_specific: true,
Chris Poultneyf5109062022-12-20 19:57:42 +0000109}
110
111//
112// Build app code.
113//
114android_app {
115 name: "ThemePicker",
116 defaults: ["ThemePicker_defaults"],
117
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -0800118 platform_apis: true,
119 manifest: "AndroidManifest.xml",
Chihhang Chuangd2ece572021-06-17 22:40:26 +0800120 additional_manifests: [":WallpaperPicker2_Manifest"],
Michael Wda9e2e82022-04-06 21:57:11 +0200121 overrides: [
122 "WallpaperCropper",
Danny Lin360f3802021-10-05 19:00:36 -0700123 "WallpaperPicker",
Michael Wda9e2e82022-04-06 21:57:11 +0200124 "WallpaperPicker2",
125 ],
LuK1337b5642112020-09-15 03:27:19 +0200126 required: [
LuK1337b5642112020-09-15 03:27:19 +0200127 "privapp_whitelist_com.android.wallpaper"
128 ],
129}
130
131prebuilt_etc {
Luca Stefani3a29a8e2019-11-01 21:14:29 +0100132 name: "privapp_whitelist_com.android.wallpaper",
133 system_ext_specific: true,
134 src: "privapp_whitelist_com.android.wallpaper.xml",
135 sub_dir: "permissions",
136 filename_from_src: true,
Santiago Etchebehere0b1d66e2021-03-04 18:25:05 -0800137}