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