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/BackgroundWorker.cpp",
63        "aidl/GpuCalculationHelpers.cpp",
64        "aidl/GpuCapacityNode.cpp",
65        "aidl/PowerHintSession.cpp",
66        "aidl/PowerSessionManager.cpp",
67        "aidl/SessionRecords.cpp",
68        "aidl/SessionTaskMap.cpp",
69        "aidl/SessionValueEntry.cpp",
70        "aidl/UClampVoter.cpp",
71    ],
72    cpp_std: "gnu++20",
73    static_libs: [
74        "libgmock",
75        "libgtest",
76        "android.hardware.common-V2-ndk",
77        "android.hardware.common.fmq-V1-ndk",
78    ],
79    shared_libs: [
80        "liblog",
81        "libbase",
82        "libcutils",
83        "libfmq",
84        "libutils",
85        "libperfmgr",
86        "libbinder_ndk",
87        "libprocessgroup",
88        "pixel-power-ext-V1-ndk",
89        "libfmq",
90    ],
91    test_suites: ["device-tests"],
92}
93
94cc_binary {
95    name: "android.hardware.power-service.pixel-libperfmgr",
96    defaults: ["android.hardware.power-ndk_shared"],
97    relative_install_path: "hw",
98    init_rc: ["aidl/android.hardware.power-service.pixel-libperfmgr.rc"],
99    vintf_fragments: ["aidl/android.hardware.power-service.pixel.xml"],
100    vendor: true,
101    cflags: [
102        "-Wthread-safety",
103    ],
104    shared_libs: [
105        "libbase",
106        "libcutils",
107        "liblog",
108        "libutils",
109        "libbinder_ndk",
110        "libdisppower-pixel",
111        "libperfmgr",
112        "libprocessgroup",
113        "pixel-power-ext-V1-ndk",
114        "android.hardware.common.fmq-V1-ndk",
115        "libfmq",
116    ],
117    static_libs: [
118        "libgmock",
119        "libgtest",
120    ],
121    srcs: [
122        "aidl/BackgroundWorker.cpp",
123        "aidl/GpuCalculationHelpers.cpp",
124        "aidl/GpuCapacityNode.cpp",
125        "aidl/service.cpp",
126        "aidl/Power.cpp",
127        "aidl/PowerExt.cpp",
128        "aidl/PowerHintSession.cpp",
129        "aidl/PowerSessionManager.cpp",
130        "aidl/UClampVoter.cpp",
131        "aidl/SessionRecords.cpp",
132        "aidl/SessionTaskMap.cpp",
133        "aidl/SessionValueEntry.cpp",
134    ],
135    cpp_std: "gnu++20",
136}
137
138cc_binary {
139    name: "sendhint",
140    defaults: ["android.hardware.power-ndk_shared"],
141    vendor: true,
142    shared_libs: [
143        "libbase",
144        "libcutils",
145        "liblog",
146        "libutils",
147        "libbinder_ndk",
148        "pixel-power-ext-V1-ndk",
149    ],
150    srcs: [
151        "utilities/sendhint.cc",
152    ],
153}
154