* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact: DongGi Jang <dg0402.jang@samsung.com>
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* See the License for the specific language governing permissions and
* limitations under the License.
*
-*/
+*/
#include <stdio.h>
fprintf(stderr, "[DISPLAY_WD] display_wd will be exit for signal %d\n", signo);
if(fifo_pollfd.fd >= 0)
close(fifo_pollfd.fd);
- if (access(fifo_path, F_OK) == 0)
+ if (access(fifo_path, F_OK) == 0)
unlink(fifo_path);
}
int main(void)
{
- int fd, ret, val = -1;
+ int fd = -1;
+ int ret = -1;
+ int val = -1;
+ int auto_brightness_state = -1;
fifo_pollfd.fd = -1;
setsid();
fifo_pollfd.fd = open(fifo_path, O_WRONLY);
if (fifo_pollfd.fd < 0) {
fprintf(stderr, "[DISPLAY_WD] Cannot open the fifo file - %s.\n",
- fifo_path);
+ fifo_path);
return -1;
}
fifo_pollfd.fd = open(fifo_path, O_RDONLY);
if (fifo_pollfd.fd < 0) {
fprintf(stderr, "[DISPLAY_WD] Cannot open the fifo file - %s.\n",
- fifo_path);
+ fifo_path);
return -1;
}
while (ret != DISPLAY_WD_CANCEL) {
if (poll(&fifo_pollfd, 1, -1) < 0) {
fprintf(stderr,
- "[DISPLAY_WD] Cannot poll the fifo file - %s\n",
- fifo_path);
+ "[DISPLAY_WD] Cannot poll the fifo file - %s\n",
+ fifo_path);
close(fifo_pollfd.fd);
return -1;
}
read(fifo_pollfd.fd, &ret, sizeof(int));
if (ret == DISPLAY_WD_CANCEL) {
fprintf(stderr,
- "[DISPLAY_WD] Canceled. - %s, %d\n",
- fifo_path, ret);
+ "[DISPLAY_WD] Canceled. - %s, %d\n",
+ fifo_path, ret);
close(fifo_pollfd.fd);
return -1;
}
device_set_property(DEVTYPE_LED, LED_PROP_BRIGHTNESS, 0);
}
+ if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &auto_brightness_state) == 0) {
+ if (auto_brightness_state == SETTING_BRIGHTNESS_AUTOMATIC_PAUSE) {
+ vconf_set_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, SETTING_BRIGHTNESS_AUTOMATIC_ON);
+ }
+ }
+
return 0;
}