1//
2// Copyright (C) 2018 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20cc_library {
21    name: "libdisppower-pixel",
22    proprietary: true,
23    srcs: [
24        "disp-power/DisplayLowPower.cpp",
25        "disp-power/InteractionHandler.cpp",
26    ],
27    cpp_std: "gnu++20",
28    shared_libs: [
29        "libbase",
30        "libcutils",
31        "liblog",
32        "libperfmgr",
33        "libutils",
34    ],
35}
36
37// Deprecated, do not use
38// Use pixel-power-ext for vendor extension
39cc_library_headers {
40    name: "pixel_power_headers",
41    vendor: true,
42    export_include_dirs: ["hidl"],
43}
44
45cc_test {
46    name: "libadpf_test",
47    defaults: ["android.hardware.power-ndk_static"],
48    proprietary: true,
49    vendor: true,
50    require_root: true,
51    srcs: [
52        "aidl/tests/BackgroundWorkerTest.cpp",
53        "aidl/tests/GpuCapacityCalculationTest.cpp",
54        "aidl/tests/GpuCapacityNodeTest.cpp",
55        "aidl/tests/PhysicalQuantityTypeTest.cpp",
56        "aidl/tests/PowerHintSessionTest.cpp",
57        "aidl/tests/PowerSessionManagerTest.cpp",
58        "aidl/tests/SessionRecordsTest.cpp",
59        "aidl/tests/SessionTaskMapTest.cpp",
60        "aidl/tests/TestHelper.cpp",
61        "aidl/tests/UClampVoterTest.cpp",
62        "aidl/tests/ChannelGroupTest.cpp",
63        "aidl/tests/ChannelManagerTest.cpp",
64        "aidl/BackgroundWorker.cpp",
65        "aidl/ChannelGroup.cpp",
66        "aidl/ChannelManager.cpp",
67        "aidl/GpuCalculationHelpers.cpp",
68        "aidl/GpuCapacityNode.cpp",
69        "aidl/PowerHintSession.cpp",
70        "aidl/PowerSessionManager.cpp",
71        "aidl/SessionRecords.cpp",
72        "aidl/SessionChannel.cpp",
73        "aidl/SessionTaskMap.cpp",
74        "aidl/SessionValueEntry.cpp",
75        "aidl/UClampVoter.cpp",
76    ],
77    cpp_std: "gnu++20",
78    static_libs: [
79        "libgmock",
80        "libgtest",
81        "android.hardware.common-V2-ndk",
82        "android.hardware.common.fmq-V1-ndk",
83    ],
84    shared_libs: [
85        "liblog",
86        "libbase",
87        "libcutils",
88        "libfmq",
89        "libutils",
90        "libperfmgr",
91        "libbinder_ndk",
92        "libprocessgroup",
93        "pixel-power-ext-V1-ndk",
94        "libfmq",
95    ],
96    test_suites: [
97        "device-tests",
98        "device-pixel-tests",
99    ],
100}
101
102cc_binary {
103    name: "android.hardware.power-service.pixel-libperfmgr",
104    defaults: ["android.hardware.power-ndk_shared"],
105    relative_install_path: "hw",
106    init_rc: ["aidl/android.hardware.power-service.pixel-libperfmgr.rc"],
107    vintf_fragments: ["aidl/android.hardware.power-service.pixel.xml"],
108    vendor: true,
109    cflags: [
110        "-Wthread-safety",
111    ],
112    shared_libs: [
113        "libbase",
114        "libcutils",
115        "liblog",
116        "libutils",
117        "libbinder_ndk",
118        "libdisppower-pixel",
119        "libperfmgr",
120        "libprocessgroup",
121        "pixel-power-ext-V1-ndk",
122        "android.hardware.common.fmq-V1-ndk",
123        "libfmq",
124    ],
125    static_libs: [
126        "libgmock",
127        "libgtest",
128    ],
129    srcs: [
130        "aidl/BackgroundWorker.cpp",
131        "aidl/ChannelGroup.cpp",
132        "aidl/ChannelManager.cpp",
133        "aidl/GpuCalculationHelpers.cpp",
134        "aidl/GpuCapacityNode.cpp",
135        "aidl/service.cpp",
136        "aidl/Power.cpp",
137        "aidl/PowerExt.cpp",
138        "aidl/PowerHintSession.cpp",
139        "aidl/PowerSessionManager.cpp",
140        "aidl/SupportManager.cpp",
141        "aidl/UClampVoter.cpp",
142        "aidl/SessionRecords.cpp",
143        "aidl/SessionChannel.cpp",
144        "aidl/SessionTaskMap.cpp",
145        "aidl/SessionValueEntry.cpp",
146    ],
147    cpp_std: "gnu++20",
148}
149
150cc_binary {
151    name: "sendhint",
152    defaults: ["android.hardware.power-ndk_shared"],
153    vendor: true,
154    shared_libs: [
155        "libbase",
156        "libcutils",
157        "liblog",
158        "libutils",
159        "libbinder_ndk",
160        "pixel-power-ext-V1-ndk",
161    ],
162    srcs: [
163        "utilities/sendhint.cc",
164    ],
165}
166