1// Copyright (C) 2014 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
15// Classic TvSettings
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20filegroup {
21    name: "TvSettingsSrc",
22    srcs: [
23        "Settings/src/**/*.java",
24        "Settings/src/**/I*.aidl",
25        "Settings/src/**/*.kt",
26    ],
27}
28
29android_library {
30    name: "TvSettingsStaticLibs",
31    manifest: "Settings/AndroidManifest-lib.xml",
32    static_libs: [
33        "androidx-constraintlayout_constraintlayout",
34        "androidx.recyclerview_recyclerview",
35        "androidx.preference_preference",
36        "androidx.appcompat_appcompat",
37        "androidx.legacy_legacy-preference-v14",
38        "androidx.leanback_leanback-preference",
39        "androidx.leanback_leanback",
40        "androidx.lifecycle_lifecycle-extensions",
41        "androidx.lifecycle_lifecycle-common-java8",
42        "androidx.annotation_annotation",
43        "statslog-tvsettings",
44        "tvsettings-logtags",
45        "TwoPanelSettingsLib",
46        "zxing-core-1.7",
47        "TvSettingsAPI",
48        "androidx.lifecycle_lifecycle-runtime-ktx",
49        "androidx.core_core-ktx",
50    ],
51}
52
53android_library {
54    name: "TvSettingsLib",
55    manifest: "Settings/AndroidManifest.xml",
56    srcs: [
57        ":TvSettingsSrc",
58    ],
59    aidl: {
60        local_include_dirs: ["Settings/src"],
61    },
62    resource_dirs: [
63        "Settings/res",
64        "Settings/res-twopanel",
65    ],
66
67    static_libs: [
68        "TvSettingsStaticLibs",
69    ],
70    platform_apis: true,
71    // TODO(b/319716205): re-enable use_resource_processor
72    use_resource_processor: false,
73}
74
75android_app {
76    name: "TvSettings",
77    manifest: "Settings/AndroidManifest.xml",
78    srcs: [
79        ":TvSettingsSrc",
80    ],
81    aidl: {
82        local_include_dirs: ["Settings/src"],
83    },
84    resource_dirs: ["Settings/res"],
85    defaults: ["SettingsLibDefaults"],
86    platform_apis: true,
87    certificate: "platform",
88    system_ext_specific: true,
89    required: ["privapp_whitelist_com.android.tv.settings"],
90    optimize: {
91        proguard_flags_files: ["Settings/proguard.flags"],
92    },
93    privileged: true,
94    static_libs: [
95        "TvSettingsStaticLibs",
96    ],
97    // TODO(b/319716205): re-enable use_resource_processor
98    use_resource_processor: false,
99}
100
101android_app {
102    name: "TvSettingsDebug",
103    manifest: "Settings/AndroidManifest-debug.xml",
104    additional_manifests: [
105        "Settings/AndroidManifest.xml",
106    ],
107    srcs: [
108        ":TvSettingsSrc",
109    ],
110    aidl: {
111        local_include_dirs: ["Settings/src"],
112    },
113    resource_dirs: ["Settings/res"],
114    defaults: ["SettingsLibDefaults"],
115    platform_apis: true,
116    certificate: "platform",
117    system_ext_specific: true,
118    required: ["privapp_whitelist_com.android.tv.settings"],
119    optimize: {
120        proguard_flags_files: ["Settings/proguard.flags"],
121    },
122    privileged: true,
123    static_libs: [
124        "TvSettingsStaticLibs",
125    ],
126    // TODO(b/319716205): re-enable use_resource_processor
127    use_resource_processor: false,
128}
129
130// Two-panel TvSettings
131android_app {
132    name: "TvSettingsTwoPanel",
133    manifest: "Settings/AndroidManifest.xml",
134    dex_preopt: {
135        profile: "two-panel-baseline-profile.txt",
136    },
137    srcs: [
138        ":TvSettingsSrc",
139    ],
140    aidl: {
141        local_include_dirs: ["Settings/src"],
142    },
143    // Resources in res-twopanel should be applied last so they take precedence
144    resource_dirs: [
145        "Settings/res",
146        "Settings/res-twopanel",
147    ],
148    overrides: ["TvSettings"],
149    defaults: ["SettingsLibDefaults"],
150    platform_apis: true,
151    certificate: "platform",
152    system_ext_specific: true,
153    required: ["privapp_whitelist_com.android.tv.settings"],
154    optimize: {
155        proguard_flags_files: ["Settings/proguard.flags"],
156        enabled: true,
157    },
158    privileged: true,
159    static_libs: [
160        "TvSettingsStaticLibs",
161    ],
162    jacoco: {
163        include_filter: [
164            "com.android.tv.settings.*",
165            "com.android.settingslib.*",
166            "com.android.tv.twopanelsettingsoverlay.*",
167        ],
168    },
169    // TODO(b/319716205): re-enable use_resource_processor
170    use_resource_processor: false,
171}
172
173// Two-panel TvSettings 0 Debug
174android_app {
175    name: "TvSettingsTwoPanelDebug",
176    manifest: "Settings/AndroidManifest-debug.xml",
177    additional_manifests: [
178        "Settings/AndroidManifest.xml",
179    ],
180    srcs: [
181        ":TvSettingsSrc",
182    ],
183    aidl: {
184        local_include_dirs: ["Settings/src"],
185    },
186    // Resources in res-twopanel should be applied last so they take precedence
187    resource_dirs: [
188        "Settings/res",
189        "Settings/res-twopanel",
190    ],
191    overrides: ["TvSettings"],
192    defaults: ["SettingsLibDefaults"],
193    platform_apis: true,
194    certificate: "platform",
195    system_ext_specific: true,
196    required: ["privapp_whitelist_com.android.tv.settings"],
197    optimize: {
198        proguard_flags_files: ["Settings/proguard.flags"],
199    },
200    privileged: true,
201    static_libs: [
202        "TvSettingsStaticLibs",
203    ],
204    // TODO(b/319716205): re-enable use_resource_processor
205    use_resource_processor: false,
206}
207