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