#include "display-lock.h"
#include "display-backlight.h"
#include "display-panel.h"
+#include "display-config.h"
#include "shared/plugin.h"
-#define DISPLAY_CONF_FILE "/etc/deviced/display.conf"
-
/**
* @addtogroup POWER_MANAGER
* @{
power_saving_func = default_saving_mode;
/* load configutation */
- ret = config_parse(DISPLAY_CONF_FILE, display_load_config, &display_conf);
+ ret = display_load_config(&display_conf);
if (ret < 0)
_W("Failed to load '%s', use default value: %d",
DISPLAY_CONF_FILE, ret);
#include "display-actor.h"
#include "display-backlight.h"
#include "display-ops.h"
+#include "display-config.h"
#include "shared/common.h"
#include "shared/devices.h"
#include "shared/device-notifier.h"
#include "display-lock.h"
#include "display-backlight.h"
#include "display-panel.h"
+#include "display-config.h"
#include "shared/plugin.h"
-#define DISPLAY_CONF_FILE "/etc/deviced/display.conf"
-
/**
* @addtogroup POWER_MANAGER
* @{
power_saving_func = default_saving_mode;
/* load configutation */
- ret = config_parse(DISPLAY_CONF_FILE, display_load_config, &display_conf);
+ ret = display_load_config(&display_conf);
if (ret < 0)
_W("Failed to load '%s', use default value: %d",
DISPLAY_CONF_FILE, ret);
#include "display-actor.h"
#include "display-backlight.h"
#include "display-ops.h"
+#include "display-config.h"
#include "shared/common.h"
#include "shared/devices.h"
#include "shared/device-notifier.h"
#include "display-lock.h"
#include "display-backlight.h"
#include "display-panel.h"
+#include "display-config.h"
#include "shared/plugin.h"
-#define DISPLAY_CONF_FILE "/etc/deviced/display.conf"
-
/**
* @addtogroup POWER_MANAGER
* @{
power_saving_func = default_saving_mode;
/* load configutation */
- ret = config_parse(DISPLAY_CONF_FILE, display_load_config, &display_conf);
+ ret = display_load_config(&display_conf);
if (ret < 0)
_W("Failed to load '%s', use default value: %d",
DISPLAY_CONF_FILE, ret);
#include "display-actor.h"
#include "display-backlight.h"
#include "display-ops.h"
+#include "display-config.h"
#include "shared/common.h"
#include "shared/devices.h"
#include "shared/device-notifier.h"
#include "core.h"
#include "display-ops.h"
#include "display-backlight.h"
+#include "display-config.h"
#include "shared/device-notifier.h"
#include "battery/power-supply.h"
#include "shared/plugin.h"
#include "display-lock.h"
#include "display-backlight.h"
#include "display-panel.h"
+#include "display-config.h"
#include "shared/plugin.h"
-#define DISPLAY_CONF_FILE "/etc/deviced/display.conf"
#define POWERLOCK_CONF_FILE "/etc/deviced/powerlock.conf"
#ifndef VCONFKEY_HOMESCREEN_TUTORIAL_OOBE_ENABLED
power_saving_func = default_saving_mode;
/* load configutation */
- ret = config_parse(DISPLAY_CONF_FILE, display_load_config, &display_conf);
+ ret = display_load_config(&display_conf);
if (ret < 0)
_W("Failed to load '%s', use default value: %d",
DISPLAY_CONF_FILE, ret);
#include "display-lock.h"
#include "display-backlight.h"
#include "display-panel.h"
+#include "display-config.h"
#include "battery-monitor.h"
#include "battery/power-supply.h"
#include "power/power-suspend.h"
#include "display-actor.h"
#include "display-ops.h"
#include "display-backlight.h"
+#include "display-config.h"
#include "shared/common.h"
#include "shared/devices.h"
#include "shared/device-notifier.h"
#include "shared/common.h"
#include "shared/device-notifier.h"
-#define DISPLAY_CONF_FILE "/etc/deviced/display.conf"
-
#define SIGNAL_LBM_ON "LBMOn"
#define SIGNAL_LBM_OFF "LBMOff"
--- /dev/null
+/*
+ * deviced
+ *
+ * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdbool.h>
+#include <libsyscommon/ini-parser.h>
+
+#include "display-dpms.h"
+#include "display.h"
+#include "deviced/dd-display.h"
+
+#include <shared/log.h>
+#include "display-config.h"
+
+static int display_config_parse(struct parse_result *result, void *user_data)
+{
+ struct display_config *c = user_data;
+
+ _D("display_load_config: section=%s name=%s value=%s", result->section, result->name, result->value);
+
+ if (!c)
+ return -EINVAL;
+
+ if (!MATCH(result->section, "Display"))
+ return 0;
+
+ if (MATCH(result->name, "LockScreenWaitingTime")) {
+ SET_CONF(c->lock_wait_time, atof(result->value));
+ _D("lock wait time is %.3f", c->lock_wait_time);
+ } else if (MATCH(result->name, "LongPressInterval")) {
+ SET_CONF(c->longpress_interval, atof(result->value));
+ _D("long press interval is %.3f", c->longpress_interval);
+ } else if (MATCH(result->name, "LightSensorSamplingInterval")) {
+ SET_CONF(c->lightsensor_interval, atof(result->value));
+ _D("lightsensor interval is %.3f", c->lightsensor_interval);
+ } else if (MATCH(result->name, "LCDOffTimeout")) {
+ SET_CONF(c->lcdoff_timeout, atoi(result->value));
+ _D("lcdoff timeout is %d ms", c->lcdoff_timeout);
+ } else if (MATCH(result->name, "BrightnessChangeStep")) {
+ SET_CONF(c->brightness_change_step, atoi(result->value));
+ _D("brightness change step is %d", c->brightness_change_step);
+ } else if (MATCH(result->name, "LCDAlwaysOn")) {
+ c->lcd_always_on = (MATCH(result->value, "yes") ? 1 : 0);
+ _D("LCD always on is %d", c->lcd_always_on);
+ } else if (MATCH(result->name, "Dimming")) {
+ c->dimming = (MATCH(result->value, "yes") ? 1 : 0);
+ _D("Dimming is %d", c->dimming);
+ } else if (MATCH(result->name, "ChangedFrameRateAllowed")) {
+ if (strstr(result->value, "setting")) {
+ c->framerate_app[REFRESH_SETTING] = 1;
+ _D("framerate app is Setting");
+ }
+ if (strstr(result->value, "all")) {
+ memset(c->framerate_app, 1, sizeof(c->framerate_app));
+ _D("framerate app is All");
+ }
+ } else if (MATCH(result->name, "ControlDisplay")) {
+ c->control_display = (MATCH(result->value, "yes") ? 1 : 0);
+ _D("ControlDisplay is %d", c->control_display);
+ } else if (MATCH(result->name, "PowerKeyDoublePressSupport")) {
+ c->powerkey_doublepress = (MATCH(result->value, "yes") ? 1 : 0);
+ _D("PowerKeyDoublePressSupport is %d", c->powerkey_doublepress);
+ } else if (MATCH(result->name, "AccelSensorOn")) {
+ c->accel_sensor_on = (MATCH(result->value, "yes") ? 1 : 0);
+ _D("AccelSensorOn is %d", c->accel_sensor_on);
+ } else if (MATCH(result->name, "ContinuousSampling")) {
+ c->continuous_sampling = (MATCH(result->value, "yes") ? 1 : 0);
+ _D("ContinuousSampling is %d", c->continuous_sampling);
+ } else if (MATCH(result->name, "TimeoutEnable")) {
+ c->timeout_enable = (MATCH(result->value, "yes") ? true : false);
+ _D("Timeout is %s", c->timeout_enable ? "enalbed" : "disabled");
+ } else if (MATCH(result->name, "InputSupport")) {
+ c->input_support = (MATCH(result->value, "yes") ? true : false);
+ _D("Input is %s", c->input_support ? "supported" : "NOT supported");
+ } else if (MATCH(result->name, "LockCheckTimeout")) {
+ SET_CONF(c->lockcheck_timeout, atoi(result->value));
+ _D("LockCheckTimeout is %d", c->lockcheck_timeout);
+ } else if (MATCH(result->name, "AODTSP")) {
+ c->aod_tsp = (MATCH(result->value, "yes") ? true : false);
+ _D("TSP control at is %d at aod", c->aod_tsp);
+ } else if (MATCH(result->name, "DisplayOnUsbConnChanged")) {
+ c->display_on_usb_conn_changed = (MATCH(result->value, "yes") ? true : false);
+ } else if (MATCH(result->name, "DisplayInitDirection")) {
+ c->display_init_direction = (MATCH(result->value, "vertical") ? \
+ DISPLAY_INIT_DIRECTION_VERTICAL : DISPLAY_INIT_DIRECTION_HORIZONTAL);
+ } else if (MATCH(result->name, "DisplayDPMSType")) {
+ c->display_dpms_type = (MATCH(result->value, "none") ? \
+ DISPLAY_DPMS_TYPE_NONE : DISPLAY_DPMS_TYPE_WINDOW_MANAGER);
+ }
+
+ return 0;
+}
+
+int display_load_config(struct display_config *config)
+{
+ return config_parse(DISPLAY_CONF_FILE, display_config_parse, config);
+}
+
--- /dev/null
+/*
+ * deviced
+ *
+ * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __DISPLAY_CONFIG_H__
+#define __DISPLAY_CONFIG_H__
+
+#define DISPLAY_CONF_FILE "/etc/deviced/display.conf"
+/*
+ * @brief Configuration structure
+ */
+struct display_config {
+ double lock_wait_time;
+ double longpress_interval;
+ double lightsensor_interval;
+ int lcdoff_timeout;
+ const int pm_default_brightness;
+ int brightness_change_step;
+ int lcd_always_on;
+ int dimming;
+ int framerate_app[4];
+ int control_display;
+ int powerkey_doublepress;
+ int alpm_on;
+ int accel_sensor_on;
+ int continuous_sampling;
+ int lockcheck_timeout;
+ int display_init_direction;
+
+ /* Define pmlock checker.
+ * Return id of the lock checker.
+ *
+ * Returning 0 will use default lock checker */
+ int (*pmlock_check) (void *data);
+
+ int aod_enter_level;
+ bool aod_tsp;
+ bool timeout_enable;
+ bool input_support;
+ bool touch_wakeup;
+ bool display_on_usb_conn_changed;
+
+ /* FIXME: After extrancting display-dpms from plugin, restore its type to enum display_dpms_type */
+ int display_dpms_type;
+};
+
+int display_load_config(struct display_config *config);
+
+#endif //__DISPLAY_CONFIG_H__
#include "device-interface.h"
#include "setting.h"
#include "display-dpms.h"
+#include "display-config.h"
#define WITHOUT_STARTNOTI 0x1
#define MASK_BIT 0x7 /* 111 */
struct state *state_st(enum state_t state);
/*
- * @brief Configuration structure
- */
-struct display_config {
- double lock_wait_time;
- double longpress_interval;
- double lightsensor_interval;
- int lcdoff_timeout;
- const int pm_default_brightness;
- int brightness_change_step;
- int lcd_always_on;
- int dimming;
- int framerate_app[4];
- int control_display;
- int powerkey_doublepress;
- int alpm_on;
- int accel_sensor_on;
- int continuous_sampling;
- int lockcheck_timeout;
- int display_init_direction;
-
- /* Define pmlock checker.
- * Return id of the lock checker.
- *
- * Returning 0 will use default lock checker */
- int (*pmlock_check) (void *data);
-
- int aod_enter_level;
- bool aod_tsp;
- bool timeout_enable;
- bool input_support;
- bool touch_wakeup;
- bool display_on_usb_conn_changed;
- enum display_dpms_type display_dpms_type;
-};
-
-/*
* Global variables
* display_conf : configuration of display
*/
if (!backlight_ops)
_W("Failed to get backlight operator variable.");
-}
\ No newline at end of file
+}
#include "display-signal.h"
#include "lock-detector.h"
#include "display-lock.h"
+#include "display-config.h"
#include "shared/log-macro.h"
#include "shared/apps.h"
}
}
-int display_load_config(struct parse_result *result, void *user_data)
-{
- struct display_config *c = user_data;
-
- _D("display_load_config: section=%s name=%s value=%s", result->section, result->name, result->value);
-
- if (!c)
- return -EINVAL;
-
- if (!MATCH(result->section, "Display"))
- return 0;
-
- if (MATCH(result->name, "LockScreenWaitingTime")) {
- SET_CONF(c->lock_wait_time, atof(result->value));
- _D("lock wait time is %.3f", c->lock_wait_time);
- } else if (MATCH(result->name, "LongPressInterval")) {
- SET_CONF(c->longpress_interval, atof(result->value));
- _D("long press interval is %.3f", c->longpress_interval);
- } else if (MATCH(result->name, "LightSensorSamplingInterval")) {
- SET_CONF(c->lightsensor_interval, atof(result->value));
- _D("lightsensor interval is %.3f", c->lightsensor_interval);
- } else if (MATCH(result->name, "LCDOffTimeout")) {
- SET_CONF(c->lcdoff_timeout, atoi(result->value));
- _D("lcdoff timeout is %d ms", c->lcdoff_timeout);
- } else if (MATCH(result->name, "BrightnessChangeStep")) {
- SET_CONF(c->brightness_change_step, atoi(result->value));
- _D("brightness change step is %d", c->brightness_change_step);
- } else if (MATCH(result->name, "LCDAlwaysOn")) {
- c->lcd_always_on = (MATCH(result->value, "yes") ? 1 : 0);
- _D("LCD always on is %d", c->lcd_always_on);
- } else if (MATCH(result->name, "Dimming")) {
- c->dimming = (MATCH(result->value, "yes") ? 1 : 0);
- _D("Dimming is %d", c->dimming);
- } else if (MATCH(result->name, "ChangedFrameRateAllowed")) {
- if (strstr(result->value, "setting")) {
- c->framerate_app[REFRESH_SETTING] = 1;
- _D("framerate app is Setting");
- }
- if (strstr(result->value, "all")) {
- memset(c->framerate_app, 1, sizeof(c->framerate_app));
- _D("framerate app is All");
- }
- } else if (MATCH(result->name, "ControlDisplay")) {
- c->control_display = (MATCH(result->value, "yes") ? 1 : 0);
- _D("ControlDisplay is %d", c->control_display);
- } else if (MATCH(result->name, "PowerKeyDoublePressSupport")) {
- c->powerkey_doublepress = (MATCH(result->value, "yes") ? 1 : 0);
- _D("PowerKeyDoublePressSupport is %d", c->powerkey_doublepress);
- } else if (MATCH(result->name, "AccelSensorOn")) {
- c->accel_sensor_on = (MATCH(result->value, "yes") ? 1 : 0);
- _D("AccelSensorOn is %d", c->accel_sensor_on);
- } else if (MATCH(result->name, "ContinuousSampling")) {
- c->continuous_sampling = (MATCH(result->value, "yes") ? 1 : 0);
- _D("ContinuousSampling is %d", c->continuous_sampling);
- } else if (MATCH(result->name, "TimeoutEnable")) {
- c->timeout_enable = (MATCH(result->value, "yes") ? true : false);
- _D("Timeout is %s", c->timeout_enable ? "enalbed" : "disabled");
- } else if (MATCH(result->name, "InputSupport")) {
- c->input_support = (MATCH(result->value, "yes") ? true : false);
- _D("Input is %s", c->input_support ? "supported" : "NOT supported");
- } else if (MATCH(result->name, "LockCheckTimeout")) {
- SET_CONF(c->lockcheck_timeout, atoi(result->value));
- _D("LockCheckTimeout is %d", c->lockcheck_timeout);
- } else if (MATCH(result->name, "AODTSP")) {
- c->aod_tsp = (MATCH(result->value, "yes") ? true : false);
- _D("TSP control at is %d at aod", c->aod_tsp);
- } else if (MATCH(result->name, "DisplayOnUsbConnChanged")) {
- c->display_on_usb_conn_changed = (MATCH(result->value, "yes") ? true : false);
- } else if (MATCH(result->name, "DisplayInitDirection")) {
- c->display_init_direction = (MATCH(result->value, "vertical") ? \
- DISPLAY_INIT_DIRECTION_VERTICAL : DISPLAY_INIT_DIRECTION_HORIZONTAL);
- } else if (MATCH(result->name, "DisplayDPMSType")) {
- c->display_dpms_type = (MATCH(result->value, "none") ? \
- DISPLAY_DPMS_TYPE_NONE : DISPLAY_DPMS_TYPE_WINDOW_MANAGER);
- }
-
- return 0;
-}
-
/* FIXME: This function is for temporary use, should be fixed after plugin refactoring */
void display_set_hal_backend_available(bool display_hal_backend_available)
{
bool display_is_hal_backend_available(void)
{
return g_display_hal_backend_available;
-}
\ No newline at end of file
+}
void clear_pm_status_flag(unsigned int status_flag);
enum display_init_direction_e get_display_init_direction(void);
void set_display_init_direction(enum display_init_direction_e display_init_direction);
-int display_load_config(struct parse_result *result, void *user_data);
void display_set_hal_backend_available(bool display_hal_backend_available);
bool display_is_hal_backend_available(void);