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