1// Copyright (C) 2020 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_team: "trendy_team_aaos_framework",
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20filegroup {
21    name: "SampleCustomInputService-srcs",
22    srcs: [
23        "src/**/*.java",
24    ],
25}
26
27android_app {
28    name: "SampleCustomInputService",
29    srcs: [":SampleCustomInputService-srcs"],
30    resource_dirs: ["res"],
31    sdk_version: "system_current",
32
33    // This app should be platform signed because it requires
34    // android.car.permission.CAR_MONITOR_INPUT permission, which is of type "signature".
35    certificate: "platform",
36
37    optimize: {
38        enabled: false,
39    },
40    libs: [
41        "android.car-system-stubs",
42        "androidx.annotation_annotation",
43    ],
44    static_libs: [
45        "androidx.annotation_annotation",
46    ],
47    enforce_uses_libs: false,
48    dex_preopt: {
49        enabled: false,
50    },
51}
52
53android_test {
54    name: "SampleCustomInputServiceTest",
55    srcs: [
56        "tests/src/**/*.java",
57        ":SampleCustomInputService-srcs",
58    ],
59    manifest: "tests/AndroidManifest.xml",
60    platform_apis: true,
61    static_libs: [
62        "mockito-target-extended",
63        "androidx.test.core",
64        "androidx.test.ext.junit",
65        "androidx.test.rules",
66        "truth",
67    ],
68    libs: [
69        "android.car-system-stubs",
70        "android.test.mock",
71        "android.test.base",
72        "android.test.runner",
73    ],
74
75    // Required by mockito-target-extended (lib used to mock final classes).
76    jni_libs: [
77        // For mockito extended
78        "libdexmakerjvmtiagent",
79    ],
80
81    optimize: {
82        enabled: false,
83    },
84    aaptflags: [
85        "--extra-packages com.android.car.custominput.sample",
86    ],
87    test_suites: [
88        "automotive-tests",
89        "automotive-general-tests",
90        "general-tests",
91    ],
92    // TODO(b/319708040): re-enable use_resource_processor
93    use_resource_processor: false,
94}
95