1// Copyright (C) 2018 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: "system_suspend_defaults", 21 shared_libs: [ 22 "libbase", 23 "libbinder", 24 "libcutils", 25 "libhidlbase", 26 "liblog", 27 "libutils", 28 ], 29 cflags: [ 30 "-Wall", 31 "-Werror", 32 ], 33 cpp_std: "c++17", 34} 35 36cc_defaults { 37 name: "system_suspend_stats_defaults", 38 cflags: [ 39 "-Wall", 40 "-Werror", 41 ], 42} 43 44cc_binary { 45 name: "android.system.suspend@1.0-service", 46 relative_install_path: "hw", 47 defaults: [ 48 "system_suspend_defaults", 49 "system_suspend_stats_defaults", 50 ], 51 init_rc: ["android.system.suspend@1.0-service.rc"], 52 vintf_fragments: ["android.system.suspend@1.0-service.xml"], 53 shared_libs: [ 54 "android.system.suspend.control-V1-cpp", 55 "android.system.suspend.control.internal-cpp", 56 "android.system.suspend@1.0", 57 "SuspendProperties", 58 ], 59 srcs: [ 60 "main.cpp", 61 "SuspendControlService.cpp", 62 "SystemSuspend.cpp", 63 "WakeLockEntryList.cpp", 64 "WakeupList.cpp", 65 ], 66} 67 68// Unit tests for ISystemSuspend implementation. 69// Do *NOT* use for compliance with *TS. 70cc_test { 71 name: "SystemSuspendV1_0UnitTest", 72 defaults: [ 73 "system_suspend_defaults", 74 "system_suspend_stats_defaults", 75 ], 76 static_libs: [ 77 "android.system.suspend.control-V1-cpp", 78 "android.system.suspend.control.internal-cpp", 79 "android.system.suspend@1.0", 80 "libgmock", 81 "SuspendProperties", 82 ], 83 srcs: [ 84 "SuspendControlService.cpp", 85 "SystemSuspend.cpp", 86 "SystemSuspendUnitTest.cpp", 87 "WakeLockEntryList.cpp", 88 "WakeupList.cpp", 89 ], 90 test_suites: ["device-tests"], 91 require_root: true, 92} 93 94cc_test { 95 name:"SystemSuspendV1_0AidlTest", 96 srcs: [ 97 "SystemSuspendAidlTest.cpp", 98 ], 99 shared_libs: [ 100 "libbinder", 101 "libutils", 102 ], 103 static_libs: [ 104 "android.system.suspend.control-V1-cpp", 105 ], 106 test_suites: ["device-tests", "vts"], 107 require_root: true, 108} 109 110cc_benchmark { 111 name: "SystemSuspendBenchmark", 112 defaults: [ 113 "system_suspend_defaults", 114 ], 115 shared_libs: [ 116 "android.system.suspend.control-V1-cpp", 117 "android.system.suspend.control.internal-cpp", 118 "android.system.suspend@1.0", 119 ], 120 srcs: [ 121 "SystemSuspendBenchmark.cpp", 122 ], 123} 124 125sysprop_library { 126 name: "SuspendProperties", 127 srcs: ["SuspendProperties.sysprop"], 128 property_owner: "Platform", 129} 130