• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15cc_defaults {
16    name: "system_suspend_defaults",
17    shared_libs: [
18        "libbase",
19        "libbinder",
20        "libcutils",
21        "libhidlbase",
22        "libhidltransport",
23        "libhwbinder",
24        "liblog",
25        "libutils",
26    ],
27    cflags: [
28        "-Wall",
29        "-Werror",
30    ],
31    cpp_std: "c++17",
32}
33
34cc_defaults {
35    name: "system_suspend_stats_defaults",
36    shared_libs: [
37        "libprotobuf-cpp-full",
38    ],
39    static_libs: ["SystemSuspendStatsProto"],
40    cflags: [
41        "-Wall",
42        "-Werror",
43        "-Wno-unused-parameter",
44    ],
45}
46
47cc_library {
48    name: "SystemSuspendStatsProto",
49    srcs: [
50        "SystemSuspendStats.proto",
51    ],
52    proto: {
53        export_proto_headers: true,
54        type: "full",
55    },
56    cflags: [
57        "-Wall",
58        "-Werror",
59        "-Wno-unused-parameter",
60    ],
61}
62
63cc_binary {
64    name: "android.system.suspend@1.0-service",
65    relative_install_path: "hw",
66    defaults: [
67        "system_suspend_defaults",
68        "system_suspend_stats_defaults",
69    ],
70    init_rc: ["android.system.suspend@1.0-service.rc"],
71    vintf_fragments: ["android.system.suspend@1.0-service.xml"],
72    shared_libs: [
73        "android.system.suspend@1.0",
74        "suspend_control_aidl_interface-cpp",
75    ],
76    static_libs: ["SystemSuspendStatsProto"],
77    srcs: [
78        "main.cpp",
79        "SuspendControlService.cpp",
80        "SystemSuspend.cpp",
81    ],
82}
83
84// Unit tests for ISystemSuspend implementation.
85// Do *NOT* use for compliance with *TS.
86cc_test {
87    name: "SystemSuspendV1_0UnitTest",
88    defaults: [
89        "system_suspend_defaults",
90        "system_suspend_stats_defaults",
91    ],
92    static_libs: [
93        "android.system.suspend@1.0",
94        "suspend_control_aidl_interface-cpp",
95        "libgmock",
96    ],
97    srcs: [
98        "SuspendControlService.cpp",
99        "SystemSuspend.cpp",
100        "SystemSuspendUnitTest.cpp"
101    ],
102    test_suites: ["device-tests"],
103}
104
105