• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
19cc_defaults {
20    name: "carpowerpolicyserver_defaults",
21    cflags: [
22        "-Wall",
23        "-Wno-missing-field-initializers",
24        "-Werror",
25        "-Wno-unused-variable",
26        "-Wunused-parameter",
27    ],
28    shared_libs: [
29        "android.frameworks.automotive.powerpolicy-V1-ndk",
30        "android.frameworks.automotive.powerpolicy.internal-V1-cpp",
31        "android.frameworks.automotive.powerpolicy.internal-V1-ndk",
32        "android.hardware.automotive.vehicle@2.0",
33        "libbase",
34        "libbinder",
35        "libbinder_ndk",
36        "libhidlbase",
37        "liblog",
38        "libtinyxml2",
39        "libutils",
40    ],
41    static_libs: [
42        "libc++fs",
43        "libsysfsmonitor",
44        "libvhalclient",
45    ],
46    defaults: [ "vhalclient_defaults" ],
47}
48
49cc_library {
50    name: "lib_carpowerpolicyserver",
51    srcs: [
52        "src/CarPowerPolicyServer.cpp",
53        "src/PolicyManager.cpp",
54        "src/PowerComponentHandler.cpp",
55        "src/SilentModeHandler.cpp",
56    ],
57    defaults: [
58        "carpowerpolicyserver_defaults",
59    ],
60    export_include_dirs: [
61        "src",
62    ],
63}
64
65filegroup {
66    name: "powerpolicyxmlfiles",
67    srcs: [
68        "tests/data/*.xml",
69    ],
70}
71
72cc_test {
73    name: "carpowerpolicyserver_test",
74    defaults: [
75        "carpowerpolicyserver_defaults",
76    ],
77    test_suites: ["general-tests"],
78    srcs: [
79        "tests/CarPowerPolicyServerTest.cpp",
80        "tests/PolicyManagerTest.cpp",
81        "tests/PowerComponentHandlerTest.cpp",
82        "tests/SilentModeHandlerTest.cpp",
83    ],
84    static_libs: [
85        "libgmock",
86        "libgtest",
87        "lib_carpowerpolicyserver",
88    ],
89    data: [":powerpolicyxmlfiles"],
90}
91
92cc_binary {
93    name: "carpowerpolicyd",
94    defaults: [
95        "carpowerpolicyserver_defaults",
96    ],
97    srcs: [
98        "src/main.cpp",
99    ],
100    static_libs: [
101        "lib_carpowerpolicyserver",
102    ],
103    init_rc: ["carpowerpolicyd.rc"],
104    vintf_fragments: ["carpowerpolicyd.xml"],
105}
106