blob: 81675e01a949df3423964dedff6293c2b039ac86 [file] [log] [blame]
Polina Bondarenko1c408b02015-11-13 17:04:00 +01001/*
2 * Copyright (C) 2015 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 */
16
Polina Bondarenko81b83b32016-01-26 14:26:37 +010017#include <errno.h>
18
Polina Bondarenko1c408b02015-11-13 17:04:00 +010019#include <hardware/hardware.h>
20#include <hardware/hardware_properties.h>
21
22static ssize_t get_device_temperatures(
23 struct hardware_properties_module *module, float **temps) {
24 *temps = NULL;
25 errno = ENOSYS;
26 ALOGE("getDeviceTemperatures: %s", strerror(errno));
27 return -1;
28}
29
30static ssize_t get_cpu_usages(struct hardware_properties_module *module,
31 int64_t **active_times, int64_t **total_times) {
32 *active_times = NULL;
33 *total_times = NULL;
34 errno = ENOSYS;
35 ALOGE("getCpuUsages: %s", strerror(errno));
36 return -1;
37}
38
39static ssize_t get_fan_speeds(struct hardware_properties_module *module,
40 float **fan_speeds) {
41 *fan_speeds = NULL;
42 errno = ENOSYS;
43 ALOGE("getFanSpeeds: %s", strerror(errno));
44 return -1;
45}
46
47static struct hw_module_methods_t hardware_properties_module_methods = {
48 .open = NULL,
49};
50
51struct hardware_properties_module HAL_MODULE_INFO_SYM = {
52 .common = {
53 .tag = HARDWARE_MODULE_TAG,
54 .module_api_version = HARDWARE_PROPERTIES_HARDWARE_MODULE_API_VERSION_0_1,
55 .hal_api_version = HARDWARE_HAL_API_VERSION,
56 .id = HARDWARE_PROPERTIES_HARDWARE_MODULE_ID,
57 .name = "Default Hardware Properties HAL",
58 .author = "The Android Open Source Project",
59 .methods = &hardware_properties_module_methods,
60 },
61
62 .getCpuTemperatures = get_device_temperatures,
63 .getGpuTemperatures = get_device_temperatures,
64 .getBatteryTemperatures = get_device_temperatures,
65 .getCpuUsages = get_cpu_usages,
66 .getFanSpeeds = get_fan_speeds,
67};