Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-liblights: Commit

hardware/liblights


Commit MetaInfo

Revision2d132222d7333b7fa1e89b6bf03f4a1d7a626a2f (tree)
Time2013-01-08 19:53:38
AuthorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

fix compatibility issues of jb-x86

* LOGx -> ALOGx
* Remove constness of struct hw_module_t

Change Summary

Incremental Difference

--- a/lights.c
+++ b/lights.c
@@ -61,7 +61,7 @@ static int write_int(char* path, int value)
6161 return amt == -1 ? -errno : 0;
6262 } else {
6363 if (already_warned == 0) {
64- LOGE("write_int failed to open %s\n", path);
64+ ALOGE("write_int failed to open %s\n", path);
6565 already_warned = 1;
6666 }
6767 return -errno;
@@ -95,7 +95,7 @@ static int set_light_backlight(struct light_device_t* dev, struct light_state_t
9595 {
9696 int err = 0;
9797 int brightness = rgb_to_brightness16(state) / (65536 / (max_brightness + 1));
98- LOGV("Setting display brightness to %d", brightness);
98+ ALOGV("Setting display brightness to %d", brightness);
9999
100100 pthread_mutex_lock(&g_lock);
101101 err = write_int(brightness_file, (brightness));
@@ -121,23 +121,23 @@ static int open_lights(const struct hw_module_t* module, char const* name, struc
121121 char max_b_file[PROPERTY_VALUE_MAX] = { '\0' };
122122 if (property_get(LLP_MAX_BRIGHTNESS, max_b_file, NULL)) {
123123 if (!sscanf(max_b_file, "%d", &max_brightness)) {
124- LOGE("%s system property is set to '%s', this could not be parsed as an integer!", LLP_MAX_BRIGHTNESS, max_b_file);
124+ ALOGE("%s system property is set to '%s', this could not be parsed as an integer!", LLP_MAX_BRIGHTNESS, max_b_file);
125125 return -EINVAL;
126126 }
127127 } else {
128128 if (property_get(LLP_MAX_BRIGHTNESS_FILE, max_b_file, DEF_LLP_MAX_BRIGHTNESS_FILE)) {
129129 max_brightness = read_int(max_b_file);
130130 } else {
131- LOGE("%s system property not set", LLP_MAX_BRIGHTNESS_FILE);
131+ ALOGE("%s system property not set", LLP_MAX_BRIGHTNESS_FILE);
132132 return -EINVAL;
133133 }
134134 }
135- LOGV("Read max display brightness of %d", max_brightness);
135+ ALOGV("Read max display brightness of %d", max_brightness);
136136 if (max_brightness < 1) {
137137 max_brightness = 255;
138138 }
139139 if (!property_get(LLP_BRIGHTNESS_FILE, brightness_file, DEF_LLP_BRIGHTNESS_FILE)) {
140- LOGE("%s system property not set", LLP_BRIGHTNESS_FILE);
140+ ALOGE("%s system property not set", LLP_BRIGHTNESS_FILE);
141141 return -EINVAL;
142142 }
143143 } else {
@@ -164,7 +164,7 @@ static struct hw_module_methods_t lights_module_methods = {
164164 .open = open_lights,
165165 };
166166
167-const struct hw_module_t HAL_MODULE_INFO_SYM = {
167+struct hw_module_t HAL_MODULE_INFO_SYM = {
168168 .tag = HARDWARE_MODULE_TAG,
169169 .version_major = 1,
170170 .version_minor = 0,
Show on old repository browser