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-cpp", 30 "android.frameworks.automotive.powerpolicy.internal-cpp", 31 "android.hardware.automotive.vehicle@2.0", 32 "libbase", 33 "libbinder", 34 "libhidlbase", 35 "liblog", 36 "libtinyxml2", 37 "libutils", 38 ], 39} 40 41cc_library { 42 name: "lib_carpowerpolicyserver", 43 srcs: [ 44 "src/CarPowerPolicyServer.cpp", 45 "src/PolicyManager.cpp", 46 "src/PowerComponentHandler.cpp", 47 "src/SilentModeHandler.cpp", 48 ], 49 defaults: [ 50 "carpowerpolicyserver_defaults", 51 ], 52 export_include_dirs: [ 53 "src", 54 ], 55} 56 57filegroup { 58 name: "powerpolicyxmlfiles", 59 srcs: [ 60 "tests/data/*.xml", 61 ], 62} 63 64cc_test { 65 name: "carpowerpolicyserver_test", 66 defaults: [ 67 "carpowerpolicyserver_defaults", 68 ], 69 test_suites: ["general-tests"], 70 srcs: [ 71 "tests/CarPowerPolicyServerTest.cpp", 72 "tests/PolicyManagerTest.cpp", 73 "tests/PowerComponentHandlerTest.cpp", 74 "tests/SilentModeHandlerTest.cpp", 75 ], 76 static_libs: [ 77 "libgmock", 78 "libgtest", 79 "lib_carpowerpolicyserver", 80 ], 81 data: [":powerpolicyxmlfiles"], 82} 83 84cc_binary { 85 name: "carpowerpolicyd", 86 defaults: [ 87 "carpowerpolicyserver_defaults", 88 ], 89 srcs: [ 90 "src/main.cpp", 91 ], 92 static_libs: [ 93 "lib_carpowerpolicyserver", 94 ], 95 init_rc: ["carpowerpolicyd.rc"], 96 vintf_fragments: ["carpowerpolicyd.xml"], 97} 98