1// Copyright (C) 2021 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
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19android_app {
20    name: "CarUiPortraitSystemUI",
21
22    srcs: ["src/**/*.java"],
23
24    resource_dirs: ["res"],
25
26    static_libs: [
27        "CarSystemUI-core",
28        "car-portrait-ui-common",
29        "androidx.car.app_app",
30    ],
31
32    libs: [
33        "android.car",
34    ],
35
36    manifest: "AndroidManifest.xml",
37
38    overrides: [
39        "CarSystemUI",
40    ],
41
42    platform_apis: true,
43    system_ext_specific: true,
44    certificate: "platform",
45    privileged: true,
46
47    // TODO(b/301283770): Compiling CarSystemUI should not require -J-Xmx8192M
48    javacflags: [
49        "-J-Xmx8192M",
50    ],
51    optimize: {
52        proguard_flags_files: [
53            "proguard.flags",
54        ],
55    },
56    dxflags: ["--multi-dex"],
57
58    plugins: ["dagger2-compiler"],
59
60    required: [
61        "privapp_whitelist_com.android.systemui",
62        "allowed_privapp_com.android.carsystemui",
63    ],
64}
65
66//####################################################################################
67// Build a static library to help mocking in testing. This is meant to be used
68// for internal unit tests.
69//####################################################################################
70android_library {
71    name: "CarUiPortraitSystemUI-tests",
72
73    srcs: ["src/**/*.java"],
74
75    resource_dirs: ["res"],
76
77    libs: [
78        "android.car",
79    ],
80
81    static_libs: [
82        "CarSystemUI-tests",
83        "car-portrait-ui-common",
84        "androidx.car.app_app",
85    ],
86
87    plugins: ["dagger2-compiler"],
88    // TODO(b/319708040): re-enable use_resource_processor
89    use_resource_processor: false,
90
91    // TODO(b/301283770): Compiling CarSystemUI should not require -J-Xmx8192M
92    javacflags: [
93        "-J-Xmx8192M",
94    ],
95}
96