IF(DISPLAY_MODULE STREQUAL on)
INSTALL_CONF(conf display)
- INSTALL_CONF(conf display-profile-wearable)
INSTALL_CONF(conf display-enable-timer)
+ INSTALL_CONF(conf profile-wearable)
ENDIF()
IF(POWER_MODULE STREQUAL on)
ADD_SUBDIRECTORY(src/usb-host-ffs-test-daemon)
ENDIF()
ADD_SUBDIRECTORY(src/auto-test)
-ADD_SUBDIRECTORY(plugins/display)
+ADD_SUBDIRECTORY(plugins/mobile/display)
+#ADD_SUBDIRECTORY(plugins/display/tv)
Deviced helper programs.
This package can be installed optional for auto dbus test.
-%package config-profile-wearable
-Summary: Configuration files for wearable profile
-Group: System/Management
-BuildArch: noarch
-
-%description config-profile-wearable
-This package is used for wearable profile
-
%package config-enable-display-timer
Summary: Configuration files for display
Group: System/Management
%description config-enable-display-timer
This package is used for enabling a display timer.
-%package plugin-profile-tv
-Summary: Plugin libraries for TV profile
+%package plugin-profile-mobile
+Summary: Plugin libraries for mobile devices
Group: System/Management
Requires: %{name} = %{version}-%{release}
-%description plugin-profile-tv
-Plugin libraries for TV profile
+%description plugin-profile-mobile
+Plugin libraries for mobile devices
+
+%package plugin-profile-wearable
+Summary: Plugin libraries for wearable devices
+Group: System/Management
+Requires: %{name} = %{version}-%{release}
+
+%description plugin-profile-wearable
+Plugin libraries for wearable devices
+
+#%package plugin-display-tv
+#Summary: Plugin libraries for TV display devices
+#Group: System/Management
+#Requires: %{name} = %{version}-%{release}
+
+#%description plugin-display-tv
+#Plugin libraries for TV display devices
%prep
%setup -q
%postun -n libdeviced -p /sbin/ldconfig
-%post config-profile-wearable
-cat %{_sysconfdir}/deviced/display-profile-wearable.conf >> %{_sysconfdir}/deviced/display.conf
-rm -rf %{_sysconfdir}/deviced/display-profile-wearable.conf
-
%post config-enable-display-timer
cat %{_sysconfdir}/deviced/display-enable-timer.conf >> %{_sysconfdir}/deviced/display.conf
rm -rf %{_sysconfdir}/deviced/display-enable-timer.conf
-%post plugin-profile-tv
+%post plugin-profile-mobile
mkdir -p %{_libdir}/deviced
-mv %{_libdir}/display-tv.so %{_libdir}/deviced/display.so
+mv %{_libdir}/mobile-display.so %{_libdir}/deviced/display.so
+
+%post plugin-profile-wearable
+cat %{_sysconfdir}/deviced/profile-wearable.conf >> %{_sysconfdir}/deviced/wearable.conf
+rm -rf %{_sysconfdir}/deviced/profile-wearable.conf
+#mv %{_libdir}/mobile-wearable.so %{_libdir}/deviced/display.so
-%postun plugin-profile-tv
+#%post plugin-display-tv
+#mkdir -p %{_libdir}/deviced
+#mv %{_libdir}/display-tv.so %{_libdir}/deviced/display.so
%files
%manifest %{name}.manifest
%{_bindir}/deviced-auto-test
%config %{_sysconfdir}/deviced/auto-test.conf
-%files config-profile-wearable
-%manifest deviced.manifest
-%license LICENSE.Apache-2.0
-%config %{_sysconfdir}/deviced/display-profile-wearable.conf
-
%files config-enable-display-timer
%manifest deviced.manifest
%license LICENSE.Apache-2.0
%config %{_sysconfdir}/deviced/display-enable-timer.conf
-%files plugin-profile-tv
+%files plugin-profile-mobile
%manifest deviced.manifest
%license LICENSE.Apache-2.0
%defattr(-,root,root,-)
-%{_libdir}/display-tv.so
+%{_libdir}/mobile-display.so
+
+%files plugin-profile-wearable
+%manifest deviced.manifest
+%license LICENSE.Apache-2.0
+%config %{_sysconfdir}/deviced/profile-wearable.conf
+#%{_libdir}/mobile-wearable.so
+
+#%files plugin-profile-tv
+#%manifest deviced.manifest
+#%license LICENSE.Apache-2.0
+#%defattr(-,root,root,-)
+#%{_libdir}/display-tv.so
+
+#%files plugin-profile-iot
+#%manifest deviced.manifest
+#%license LICENSE.Apache-2.0
+#%defattr(-,root,root,-)
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(mobile-display C)
+
+FILE(GLOB ALL_SRCS "*.c")
+SET(SRCS ${ALL_SRCS})
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/display)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(libpkgs REQUIRED
+ dlog
+ glib-2.0
+ gio-2.0
+ gio-unix-2.0
+ libinput
+ capi-system-sensor)
+
+FOREACH(flag ${libpkgs_CFLAGS})
+ SET(EXTRA_LIB_CFLAGS "${EXTRA_LIB_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_LIB_CFLAGS}")
+
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${libpkgs_LDFLAGS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES OUTPUT_NAME mobile-display)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
#define TIMEOUT_NONE (-1)
#define AMBIENT_CLOCK_WAITING_TIME 5000 /* ms */
+extern struct display_plugin disp_plgn;
static int ambient_state;
static pid_t ambient_pid; /* Ambient Clock pid */
static int ambient_condition;
ambient_state == false)
return;
- pm_lock_internal(INTERNAL_LOCK_AMBIENT,
- LCD_OFF, STAY_CUR_STATE, AMBIENT_CLOCK_WAITING_TIME);
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_AMBIENT, LCD_OFF, STAY_CUR_STATE,
+ AMBIENT_CLOCK_WAITING_TIME);
}
static void end_clock(pid_t pid)
if (update_count == 0)
broadcast_lcd_off_late(LCD_OFF_LATE_MODE);
- pm_unlock_internal(INTERNAL_LOCK_AMBIENT,
- LCD_OFF, PM_SLEEP_MARGIN);
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_AMBIENT, LCD_OFF, PM_SLEEP_MARGIN);
update_count++;
if (update_count == UINT_MAX)
#include "core/udev.h"
#include "core/list.h"
#include "core/common.h"
+#include "battery/battery.h"
#include "shared/plugin.h"
#include "core/config-parser.h"
#include "core/launch.h"
#define TIMEOUT_STR "timeout"
#define UNKNOWN_STR "unknown"
+extern void init_pm_internal();
+extern struct display_plugin disp_plgn;
unsigned int pm_status_flag;
static int trans_condition;
int pm_cur_state;
int pm_old_state;
guint timeout_src_id;
-int system_wakeup_flag = false;
static unsigned int custom_normal_timeout = 0;
static unsigned int custom_dim_timeout = 0;
static int custom_holdkey_block = false;
static dd_list *lcdon_ops;
static bool lcdon_broadcast = true;
static bool touch_blocked = false;
-static void *plugin_handle;
/* default transition, action fuctions */
static int default_trans(int evt);
}
/* third priority : lock state */
- if ((get_lock_screen_state() == VCONFKEY_IDLE_LOCK) &&
+ if ((__get_lock_screen_state() == VCONFKEY_IDLE_LOCK) &&
!get_lock_screen_bg_state()) {
/* timeout is different according to key or event. */
states[S_NORMAL].timeout = lock_screen_timeout;
#else
ret = vconf_get_int(VCONFKEY_CALL_STATE, &call_state);
if ((ret >= 0 && call_state != VCONFKEY_CALL_OFF) ||
- (get_lock_screen_state() == VCONFKEY_IDLE_LOCK)) {
+ (__get_lock_screen_state() == VCONFKEY_IDLE_LOCK)) {
_D("LOCK state, lcd is on directly");
lcd_on_procedure(LCD_NORMAL, flags);
}
_E("write() failed (%d)", errno);
snprintf(buf, sizeof(buf), "screen lock status : %d\n",
- get_lock_screen_state());
+ __get_lock_screen_state());
ret = write(fd, buf, strlen(buf));
if (ret < 0)
_E("write() failed (%d)", errno);
if (pm_cur_state != S_LCDDIM)
return false;
- lock = get_lock_screen_state();
+ lock = __get_lock_screen_state();
if (lock != VCONFKEY_IDLE_LOCK && hallic_open)
return false;
return true;
}
-int check_lcdoff_lock_state(void)
+static int __check_lcdoff_lock_state(void)
{
if (cond_head[S_LCDOFF] != NULL)
return true;
}
_I("system wakeup!!");
- system_wakeup_flag = true;
+ disp_plgn.system_wakeup_flag = true;
/* Resume !! */
if (power_ops.check_wakeup_src() == EVENT_DEVICE)
/* system waked up by devices */
return 0;
}
+extern int get_charging_status(int *val);
+//static int get_charging_status(int *val)
+//{
+ //return vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, val);
+//}
+
static void check_seed_status(void)
{
int ret = -1;
return done;
_I("booting done. Release display and power lock");
- pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF, PM_SLEEP_MARGIN);
- pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL, PM_SLEEP_MARGIN);
+ if (disp_plgn.pm_unlock_internal) {
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF, PM_SLEEP_MARGIN);
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL, PM_SLEEP_MARGIN);
+ }
return done;
}
_E("Failed to add wm_ready timeout");
}
-static int display_plugin_load()
-{
- return load_plugin("display", &plugin_handle);
-}
-
-static int display_plugin_unload()
-{
- return unload_plugin(plugin_handle);
-}
-
/**
* Power manager Main
*
if (ret)
return ret;
- display_plugin_load();
+ /* display_plugin instance initialization */
+ init_pm_internal();
+ disp_plgn.check_lcdoff_lock_state = __check_lcdoff_lock_state;
return 0;
}
register_notifier(DEVICE_NOTIFIER_PROCESS_FOREGROUND, process_foreground);
register_notifier(DEVICE_NOTIFIER_POWEROFF, device_poweroff);
-
for (i = INIT_SETTING; i < INIT_END; i++) {
switch (i) {
case INIT_SETTING:
* deviced guarantees all booting script is executing.
* Last script of booting unlocks this suspend blocking state.
*/
- pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF,
- STAY_CUR_STATE, BOOTING_DONE_WATING_TIME);
- pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL,
- STAY_CUR_STATE, BOOTING_DONE_WATING_TIME);
+ if (disp_plgn.pm_lock_internal) {
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF,
+ STAY_CUR_STATE, BOOTING_DONE_WATING_TIME);
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL,
+ STAY_CUR_STATE, BOOTING_DONE_WATING_TIME);
+ }
if (display_conf.input_support)
if (CHECK_OPS(keyfilter_ops, init))
{
int i = INIT_END;
- display_plugin_unload();
-
status = DEVICE_OPS_STATUS_STOP;
/* Set current state to S_NORMAL */
} \
} while (0)
+extern struct display_plugin disp_plgn;
+
GVariant *dbus_start(GDBusConnection *conn,
const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
flag |= STAY_CUR_STATE;
}
- ret = pm_lock_internal(pid, state, flag, timeout);
+ if (disp_plgn.pm_lock_internal)
+ ret = disp_plgn.pm_lock_internal(pid, state, flag, timeout);
out:
g_free(state_str);
g_free(option1_str);
flag = PM_RESET_TIMER;
}
- ret = pm_unlock_internal(pid, state, flag);
+ if (disp_plgn.pm_unlock_internal)
+ ret = disp_plgn.pm_unlock_internal(pid, state, flag);
out:
g_free(state_str);
g_free(option_str);
goto out;
}
- ret = pm_change_internal(pid, state);
+ if (disp_plgn.pm_change_internal)
+ ret = disp_plgn.pm_change_internal(pid, state);
if (!ret && state == LCD_OFF)
update_lcdoff_source(VCONFKEY_PM_LCDOFF_BY_TIMEOUT);
g_variant_get(param, "(s)", &on);
- if (!strcmp(on, "true"))
- update_pm_setting(SETTING_LOCK_SCREEN_BG, true);
- else if (!strcmp(on, "false"))
- update_pm_setting(SETTING_LOCK_SCREEN_BG, false);
- else
+ if (!strcmp(on, "true")) {
+ if (disp_plgn.update_pm_setting)
+ disp_plgn.update_pm_setting(SETTING_LOCK_SCREEN_BG, true);
+ } else if (!strcmp(on, "false")) {
+ if (disp_plgn.update_pm_setting)
+ disp_plgn.update_pm_setting(SETTING_LOCK_SCREEN_BG, false);
+ } else {
ret = -EINVAL;
+ }
g_free(on);
return g_variant_new("(i)", ret);
g_variant_get(param, "(s)", &on);
- if (!strcmp(on, "on"))
- pm_lock_internal(INTERNAL_LOCK_DUMPMODE, LCD_OFF,
- STAY_CUR_STATE, DUMP_MODE_WATING_TIME);
- else if (!strcmp(on, "off"))
- pm_unlock_internal(INTERNAL_LOCK_DUMPMODE, LCD_OFF,
- PM_SLEEP_MARGIN);
- else
+ if (!strcmp(on, "on")) {
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_DUMPMODE, LCD_OFF,
+ STAY_CUR_STATE, DUMP_MODE_WATING_TIME);
+ } else if (!strcmp(on, "off")) {
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_DUMPMODE, LCD_OFF, PM_SLEEP_MARGIN);
+ } else {
ret = -EINVAL;
+ }
g_free(on);
return g_variant_new("(i)", ret);
#include "poll.h"
#include "device-node.h"
#include "display-actor.h"
+#include "display-ops.h"
#include "core/common.h"
#include "core/devices.h"
#include "core/device-notifier.h"
#define GLOVE_MODE 1
+extern struct display_plugin disp_plgn;
+
enum key_combination_flags {
KEY_COMBINATION_STOP = 0,
KEY_COMBINATION_POWERKEY = BIT(0),
if (display_has_caps(caps, DISPLAY_CAPA_LCDON)) {
/* change state - LCD on */
- pm_change_internal(INTERNAL_LOCK_POWERKEY, LCD_NORMAL);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_POWERKEY, LCD_NORMAL);
(*pm_callback)(INPUT_POLL_EVENT, NULL);
}
delete_condition(S_NORMAL);
delete_condition(S_LCDDIM);
update_lcdoff_source(VCONFKEY_PM_LCDOFF_BY_POWERKEY);
- pm_change_internal(INTERNAL_LOCK_POWERKEY, LCD_OFF);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_POWERKEY, LCD_OFF);
}
} else {
ignore = false;
update_lcdoff_source(VCONFKEY_PM_LCDOFF_BY_POWERKEY);
/* LCD off forcly */
- pm_change_internal(-1, LCD_OFF);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(-1, LCD_OFF);
}
return true;
return;
}
/* Sound & Vibrate only in unlock state */
- if (get_lock_screen_state() == VCONFKEY_IDLE_UNLOCK
+ if (__get_lock_screen_state() == VCONFKEY_IDLE_UNLOCK
|| get_lock_screen_bg_state())
sound_vibrate_hardkey();
}
} else if (pinput->value == KEY_RELEASED) {
/* if lockscreen is idle lock */
- if (get_lock_screen_state() == VCONFKEY_IDLE_LOCK) {
+ if (__get_lock_screen_state() == VCONFKEY_IDLE_LOCK) {
_D("Lock state, key backlight is off when phone is unlocked!");
return;
}
#include "util.h"
#include "core.h"
#include "poll.h"
+#include "display/display-ops.h"
#define SHIFT_UNLOCK 4
#define SHIFT_UNLOCK_PARAMETER 12
#define HOLDKEY_BLOCK_BIT (__HOLDKEY_BLOCK_BIT << LOCK_FLAG_SHIFT)
static PMMsg recv_data;
+extern struct display_plugin disp_plgn;
int check_dimstay(int next_state, int flag)
{
return false;
}
-int pm_lock_internal(pid_t pid, int s_bits, int flag, int timeout)
+static int __pm_lock_internal(pid_t pid, int s_bits, int flag, int timeout)
{
int cond;
return 0;
}
-int pm_unlock_internal(pid_t pid, int s_bits, int flag)
+static int __pm_unlock_internal(pid_t pid, int s_bits, int flag)
{
int cond;
return 0;
}
-int pm_change_internal(pid_t pid, int s_bits)
+static int __pm_change_internal(pid_t pid, int s_bits)
{
int cond;
return 0;
}
+
+void init_pm_internal()
+{
+ disp_plgn.pm_lock_internal = __pm_lock_internal;
+ disp_plgn.pm_unlock_internal = __pm_unlock_internal;
+ disp_plgn.pm_change_internal = __pm_change_internal;
+}
#include "core.h"
#include "util.h"
#include "setting.h"
+#include "display-ops.h"
#define LCD_DIM_RATIO 0.3
#define LCD_MAX_DIM_TIMEOUT 7000
#define LCD_MIN_DIM_TIMEOUT 500
+extern struct display_plugin disp_plgn;
static const char *setting_keys[SETTING_GET_END] = {
[SETTING_TO_NORMAL] = VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL,
[SETTING_BRT_LEVEL] = VCONFKEY_SETAPPL_LCD_BRIGHTNESS,
static int custom_normal_timeout = 0;
static int custom_dim_timeout = 0;
-int (*update_pm_setting) (int key_idx, int val);
-
static void display_state_send_system_event(int state)
{
bundle *b;
return 0;
}
-int get_lock_screen_state(void)
+int __get_lock_screen_state(void)
{
return lock_screen_state;
}
lock_screen_bg_state = state;
}
-int get_charging_status(int *val)
-{
- return vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, val);
-}
-
-int get_lowbatt_status(int *val)
-{
- return vconf_get_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, val);
-}
-
-int get_usb_status(int *val)
-{
- return vconf_get_int(VCONFKEY_SYSMAN_USB_STATUS, val);
-}
-
int set_setting_pmstate(int val)
{
static int old = -1;
vconf_keynode_get_name(tmp), index);
return -1;
}
- if (update_pm_setting != NULL)
- update_pm_setting(index, vconf_keynode_get_int(tmp));
+ if (disp_plgn.update_pm_setting)
+ disp_plgn.update_pm_setting(index, vconf_keynode_get_int(tmp));
return 0;
}
{
int i;
- if (func != NULL)
- update_pm_setting = func;
+ if (func != NULL) {
+ disp_plgn.update_pm_setting = func;
+ }
for (i = SETTING_BEGIN; i < SETTING_GET_END; i++) {
/*
(void *)((intptr_t)i));
}
+ disp_plgn.get_lock_screen_state = __get_lock_screen_state;
+
return 0;
}
standby_timer = 0;
}
- ret = pm_change_internal(INTERNAL_LOCK_SUSPEND, SUSPEND);
+ if (disp_ops.pm_change_internal)
+ ret = disp_ops.pm_change_internal(INTERNAL_LOCK_SUSPEND, SUSPEND);
if (ret < 0) {
_E("Failed to change state to S_SUSPEND. Now Power off !!");
poweroff_trans(0);
#include <stdarg.h>
#include "core/log.h"
#include "core/common.h"
+#include "display/display-ops.h"
#include "apps.h"
#define POPUP_METHOD "PopupLaunch"
#define BUFF_MAX 255
+extern struct display_plugin disp_plgn;
+
static const struct app_dbus_match {
const char *type;
const char *bus;
NULL);
va_end(args);
- pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
return ret;
}
POPUP_INTERFACE_NOTI,
"MessagePostOn",
g_variant_new("(s)", type));
- pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
+
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
return ret;
}
#include "core/log.h"
#include "core/udev.h"
#include "display/setting.h"
+#include "display/display-ops.h"
#include "power-supply.h"
#define CHARGING_STATE(x) ((x) & CHRGR_FLAG)
#define SIGNAL_TIMETOFULL "TimeToFull"
#define SIGNAL_TIMETOEMPTY "TimeToEmpty"
+extern struct display_plugin disp_plgn;
+
enum state_b {
B_UNCHARGING = 0,
B_CHARGING = 1,
static double avg_factor[B_END] = {-1.0, -1.0};
static int old_capacity;
static int charging_state;
-extern int system_wakeup_flag;
static int time_to_full = -1;
static int time_to_empty = -1;
+int get_charging_status(int *val)
+{
+ return vconf_get_int(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, val);
+}
+
static int add_batt_node(enum state_b b_index, time_t clock, int capacity)
{
struct Batt_node *node = NULL;
update_time(A_TIMETOFULL, estimated_time);
} else {
del_all_batt_node(B_CHARGING);
- if (system_wakeup_flag == true) {
+ if (disp_plgn.system_wakeup_flag == true) {
del_all_batt_node(B_UNCHARGING);
- system_wakeup_flag = false;
+ disp_plgn.system_wakeup_flag = false;
}
if (batt_head[B_UNCHARGING] == NULL) {
add_batt_node(B_UNCHARGING, clock, capacity);
int battery_charge_err_low_act(void *data);
int battery_charge_err_high_act(void *data);
+
#endif /* __BATTERY_H__ */
#include "device-node.h"
#include "display/setting.h"
#include "display/poll.h"
+#include "display/display-ops.h"
#include "power/power-handler.h"
#include "apps/apps.h"
#include "power-supply.h"
#define VCONF_KEY_BATTERY_WARNING_LEVEL "db/sysman/battery_warning_level"
+extern struct display_plugin disp_plgn;
+
enum low_battery_type {
LOW_BATTERY,
CRITICAL_BATTERY,
static void power_off_pm_lock(void)
{
if (power_off_lock == POWER_OFF_UNLOCK) {
- pm_lock_internal(INTERNAL_LOCK_LOWBAT, LCD_OFF, STAY_CUR_STATE, 0);
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_LOWBAT, LCD_OFF, STAY_CUR_STATE, 0);
power_off_lock = POWER_OFF_LOCK;
}
}
static void power_off_pm_unlock(void)
{
if (power_off_lock == POWER_OFF_LOCK) {
- pm_unlock_internal(INTERNAL_LOCK_LOWBAT, LCD_OFF, PM_SLEEP_MARGIN);
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_LOWBAT, LCD_OFF, PM_SLEEP_MARGIN);
power_off_lock = POWER_OFF_UNLOCK;
}
}
r_block = vconf_get_bool("db/setting/blockmode_wearable", &s_block);
if ((r_disturb != 0 && r_block != 0) ||
(s_disturb == 0 && s_block == 0) ||
- lowbat_popup_option == LOWBAT_OPT_CHARGEERR)
- pm_change_internal(INTERNAL_LOCK_LOWBAT, LCD_NORMAL);
- else
+ lowbat_popup_option == LOWBAT_OPT_CHARGEERR) {
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_LOWBAT, LCD_NORMAL);
+ } else {
_I("block LCD");
+ }
if (lowbat_popup_option == LOWBAT_OPT_CHECK ||
lowbat_popup_option == LOWBAT_OPT_WARNING) {
}
if (status != -1) {
- lock = pm_lock_internal(INTERNAL_LOCK_BATTERY, LCD_OFF, STAY_CUR_STATE, 0);
+ if (disp_plgn.pm_lock_internal)
+ lock = disp_plgn.pm_lock_internal(INTERNAL_LOCK_BATTERY, LCD_OFF, STAY_CUR_STATE, 0);
ret = vconf_set_int(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW, status);
power_supply_broadcast(CHARGE_LEVEL_SIGNAL, status);
- if (update_pm_setting)
- update_pm_setting(SETTING_LOW_BATT, status);
+ if (disp_plgn.update_pm_setting)
+ disp_plgn.update_pm_setting(SETTING_LOW_BATT, status);
}
if (ret < 0) {
if (result == 1)
cur_bat_state = new_bat_state;
exit:
- if (lock == 0)
- pm_unlock_internal(INTERNAL_LOCK_BATTERY, LCD_OFF, PM_SLEEP_MARGIN);
+ if (lock == 0) {
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_BATTERY, LCD_OFF, PM_SLEEP_MARGIN);
+ }
return result;
}
#include "core/config-parser.h"
#include "display/poll.h"
#include "display/setting.h"
+#include "display/display-ops.h"
#include "apps/apps.h"
#include "power-supply.h"
#include "battery.h"
#define RETRY_MAX 5
#define BATTERY_CHECK_TIMER_INTERVAL (0.5)
+extern struct display_plugin disp_plgn;
+
enum power_supply_init_type {
POWER_SUPPLY_NOT_READY = 0,
POWER_SUPPLY_INITIALIZED = 1,
if (old == bInserted)
return;
old = bInserted;
- pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
}
static int changed_battery_cf(enum present_type status)
_I("popup - Battery health status is not good");
device_notify(DEVICE_NOTIFIER_BATTERY_HEALTH, (void *)&value);
- pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
- pm_lock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, STAY_CUR_STATE, 0);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, STAY_CUR_STATE, 0);
if (battery.temp == TEMP_LOW)
battery_charge_err_low_act(NULL);
else if (battery.temp == TEMP_HIGH)
bat_full_noti = 1;
/* turn on LCD, if battery is full charged */
noti = check_power_supply_noti();
- if (noti)
- pm_change_internal(INTERNAL_LOCK_BATTERY_FULL,
- LCD_NORMAL);
- else
+ if (noti) {
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_BATTERY_FULL, LCD_NORMAL);
+ } else {
_I("block LCD");
+ }
/* on the full charge state */
device_notify(DEVICE_NOTIFIER_FULLBAT, (void *)&bat_full_noti);
}
static void check_power_supply(int state)
{
pm_check_and_change(state);
- if (update_pm_setting)
- update_pm_setting(SETTING_CHARGING, state);
+ if (disp_plgn.update_pm_setting)
+ disp_plgn.update_pm_setting(SETTING_CHARGING, state);
}
static void charger_state_send_system_event(int state)
return;
_I("charge %d present %d", battery.charge_now, battery.present);
old = status;
- pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
if (status == DEVICE_NOTI_ON) {
present = PRESENT_ABNORMAL;
device_notify(DEVICE_NOTIFIER_BATTERY_PRESENT, (void *)&present);
- pm_lock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, STAY_CUR_STATE, 0);
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, STAY_CUR_STATE, 0);
} else {
present = PRESENT_NORMAL;
device_notify(DEVICE_NOTIFIER_BATTERY_PRESENT, (void *)&present);
- pm_unlock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, PM_SLEEP_MARGIN);
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, PM_SLEEP_MARGIN);
}
changed_battery_cf(present);
}
_I("charge %d health %d", battery.charge_now, battery.health);
old = status;
- pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
+
if (status == DEVICE_NOTI_ON) {
_I("popup - Battery health status is not good");
- pm_lock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, STAY_CUR_STATE, 0);
+
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, STAY_CUR_STATE, 0);
if (battery.temp == TEMP_LOW)
battery_charge_err_low_act(NULL);
else if (battery.temp == TEMP_HIGH)
battery_charge_err_high_act(NULL);
} else {
- pm_unlock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, PM_SLEEP_MARGIN);
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, PM_SLEEP_MARGIN);
abnormal_popup_timer_init();
launch_system_app(APP_DEFAULT, 2, APP_KEY_TYPE, REMOVE_POPUP);
}
return;
_I("charge %d ovp %d", battery.charge_now, battery.ovp);
old = status;
- pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_POPUP, LCD_NORMAL);
if (status == DEVICE_NOTI_ON)
value = OVP_ABNORMAL;
else
return 0;
if (battery.health != HEALTH_BAD && battery.present != PRESENT_ABNORMAL)
return 0;
- pm_lock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, STAY_CUR_STATE, 0);
+
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_POPUP, LCD_DIM, STAY_CUR_STATE, 0);
return 0;
}
#include "devices.h"
#include "power/boot.h"
#include "power/power-handler.h"
+#include "shared/plugin.h"
#include "device-notifier.h"
#define PIDFILE_PATH "/var/run/.deviced.pid"
if (!handle)
_E("Fail to get dbus connection");
+ load_plugins();
+
devices_init(NULL);
ret = dbus_handle_request_bus_name(handle, DEVICED_BUS_NAME, deviced_dbus_name_acquired, NULL);
const gchar *unique_name,
gpointer data);
-int check_lcdoff_lock_state(void);
-
/* setting.c */
int get_lock_screen_bg_state(void);
int set_custom_lcdon_timeout(int timeout);
void remove_display(const struct display_ops *disp);
const struct display_ops *find_display_feature(const char *name);
+struct display_plugin {
+ int (*pm_lock_internal) (pid_t pid, int s_bits, int flag, int timeout);
+ int (*pm_unlock_internal) (pid_t pid, int s_bits, int flag);
+ int (*pm_change_internal) (pid_t pid, int s_bits);
+ int (*check_lcdoff_lock_state) ();
+ int (*update_pm_setting) (int key_idx, int val);
+ int (*get_lock_screen_state) ();
+ bool system_wakeup_flag;
+};
#endif
int init_input(void);
int exit_input(void);
-extern int pm_lock_internal(pid_t pid, int s_bits, int flag, int timeout);
-extern int pm_unlock_internal(pid_t pid, int s_bits, int flag);
-extern int pm_change_internal(pid_t pid, int s_bits);
-
/**
* @}
*/
SETTING_END
};
-extern int (*update_pm_setting) (int key_idx, int val);
-
int get_setting_brightness(int *level);
/*
*/
extern int set_setting_pmstate(int val);
-/*
- * get charging status at SLP-setting "memory/Battery/Charger"
- *
- * @internal
- * @param[in] val charging or not (1 or 0 respectively).
- * @return 0 : success, -1 : error
- */
-extern int get_charging_status(int *val);
-
-/*
- * get current battery low status at SLP-setting "memory/Battery/Status/Low"
- *
- * @internal
- * @param[in] val current low battery status
- * @return 0 : success, -1 : error
- */
-extern int get_lowbatt_status(int *val);
-
-int get_lock_screen_state(void);
+//FIXME
+int __get_lock_screen_state(void);
/*
* @}
#include "core/device-notifier.h"
#include "core/udev.h"
#include "display/core.h"
+#include "display/display-ops.h"
#include "extcon/extcon.h"
#define METHOD_GET_CRADLE "GetCradle"
#define SIGNAL_CRADLE_STATE "ChangedCradle"
+extern struct display_plugin disp_plgn;
static struct extcon_ops cradle_extcon_ops;
static void cradle_send_broadcast(int status)
static int cradle_update(int status)
{
_I("jack - cradle changed %d", status);
- pm_change_internal(INTERNAL_LOCK_CRADLE, LCD_NORMAL);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_CRADLE, LCD_NORMAL);
cradle_send_broadcast(status);
if (vconf_set_int(VCONFKEY_SYSMAN_CRADLE_STATUS, status) != 0) {
_E("failed to set vconf status");
return -EIO;
}
- if (status == DOCK_SOUND)
- pm_lock_internal(INTERNAL_LOCK_CRADLE, LCD_DIM, STAY_CUR_STATE, 0);
- else if (status == DOCK_NONE)
- pm_unlock_internal(INTERNAL_LOCK_CRADLE, LCD_DIM, PM_SLEEP_MARGIN);
+ if (status == DOCK_SOUND) {
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_CRADLE, LCD_DIM, STAY_CUR_STATE, 0);
+ } else if (status == DOCK_NONE) {
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_CRADLE, LCD_DIM, PM_SLEEP_MARGIN);
+ }
return 0;
}
cradle = cradle_extcon_ops.status;
if (cradle == DOCK_SOUND) {
- pm_lock_internal(INTERNAL_LOCK_CRADLE, LCD_DIM, STAY_CUR_STATE, 0);
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_CRADLE, LCD_DIM, STAY_CUR_STATE, 0);
_I("sound dock is connected! dim lock is on.");
}
#include "core/log.h"
#include "display/poll.h"
+#include "display/display-ops.h"
#include "extcon/extcon.h"
#include "extcon/extcon_count.h"
#define SIGNAL_EARJACK_STATE "ChangedEarjack"
#define GET_EARJACK_STATE "Earjack"
+extern struct display_plugin disp_plgn;
+
static void earjack_send_broadcast(int status)
{
static int old = 0;
vconf_set_int(VCONFKEY_SYSMAN_EARJACK, status);
earjack_send_broadcast(status);
earjack_send_system_event(status);
- if (status != 0)
- pm_change_internal(INTERNAL_LOCK_EARJACK, LCD_NORMAL);
+ if (status != 0) {
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_EARJACK, LCD_NORMAL);
+ }
if (CONNECTED(status)) {
extcon_get_count(EXTCON_EARJACK);
#include "core/log.h"
#include "core/device-notifier.h"
#include "display/core.h"
+#include "display/display-ops.h"
#include "extcon.h"
#define METHOD_GET_HDMI "GetHDMI"
#define SIGNAL_HDMI_STATE "ChangedHDMI"
+extern struct display_plugin disp_plgn;
static struct extcon_ops hdmi_extcon_ops;
static void hdmi_send_broadcast(int status)
static int hdmi_update(int status)
{
_I("jack - hdmi changed %d", status);
- pm_change_internal(INTERNAL_LOCK_HDMI, LCD_NORMAL);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_HDMI, LCD_NORMAL);
vconf_set_int(VCONFKEY_SYSMAN_HDMI, status);
hdmi_send_broadcast(status);
- if (status == 1)
- pm_lock_internal(INTERNAL_LOCK_HDMI, LCD_DIM, STAY_CUR_STATE, 0);
- else
- pm_unlock_internal(INTERNAL_LOCK_HDMI, LCD_DIM, PM_SLEEP_MARGIN);
+ if (status == 1) {
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_HDMI, LCD_DIM, STAY_CUR_STATE, 0);
+ } else {
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_HDMI, LCD_DIM, PM_SLEEP_MARGIN);
+ }
return 0;
}
hdmi = hdmi_extcon_ops.status;
if (hdmi == 0) {
- pm_lock_internal(INTERNAL_LOCK_HDMI, LCD_DIM, STAY_CUR_STATE, 0);
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_HDMI, LCD_DIM, STAY_CUR_STATE, 0);
_I("hdmi is connected! dim lock is on.");
}
return 0;
#include "core/device-notifier.h"
#include "display/core.h"
#include "display/setting.h"
+#include "display/display-ops.h"
#include "touch-key.h"
#define KEYBACKLIGHT_TIME_90 90 /* 1.5 second */
#define GET_BRIGHTNESS(val) (((val) >> 24) & 0xFF)
#define SET_BRIGHTNESS(val) (((val) & 0xFF) << 24)
+extern struct display_plugin disp_plgn;
struct led_device *touchled_dev;
static guint hardkey_timeout_id;
static int hardkey_duration;
touchled_set_state(true);
/* do not create turnoff timer in case of idle lock state */
- if (get_lock_screen_state() == VCONFKEY_IDLE_LOCK)
+ if (disp_plgn.get_lock_screen_state && disp_plgn.get_lock_screen_state() == VCONFKEY_IDLE_LOCK)
return;
/* start timer */
#include "core/device-notifier.h"
#include "core/common.h"
#include "display/poll.h"
+#include "display/display-ops.h"
#include "shared/deviced-systemd.h"
#define SIGNAL_BOOTING_DONE "BootingDone"
#define SYSTEMD_STATE_RUNNING "running"
#define SYSTEMD_STATE_DEGRADED "degraded"
+extern struct display_plugin disp_plgn;
+
int booting_finished(void)
{
char *state = NULL;
remove_booting_done_handler(NULL);
_I("real booting done, unlock LCD_OFF");
- pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF, PM_SLEEP_MARGIN);
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF, PM_SLEEP_MARGIN);
_I("signal booting done");
#include "display/poll.h"
#include "display/setting.h"
#include "display/core.h"
+#include "display/display-ops.h"
#include "power-handler.h"
#include "apps/apps.h"
#include "shared/deviced-systemd.h"
#define POWER_CONF_FILE "/etc/deviced/power.conf"
+extern struct display_plugin disp_plgn;
+
struct power_flag {
enum poweroff_type type;
const char *path;
{
const struct device_ops *display_device_ops = NULL;
FIND_DEVICE_VOID(display_device_ops, "display");
- pm_change_internal(INTERNAL_LOCK_POWEROFF, LCD_NORMAL);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_POWEROFF, LCD_NORMAL);
display_device_ops->exit(NULL);
}
make_power_flag(poweroff_opt.type, poweroff_opt.option);
- pm_lock_internal(INTERNAL_LOCK_POWEROFF, LCD_OFF, STAY_CUR_STATE, 0);
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_POWEROFF, LCD_OFF, STAY_CUR_STATE, 0);
poweroff_fixed_flow(poweroff_opt.type);
_E("Failed to %s (%d)", poweroff_opt.name, ret);
out:
- if (update_pm_setting)
- update_pm_setting(SETTING_POWEROFF, poweroff_opt.type);
+ if (disp_plgn.update_pm_setting)
+ disp_plgn.update_pm_setting(SETTING_POWEROFF, poweroff_opt.type);
during_poweroff = false;
return G_SOURCE_REMOVE;
}
#define _GNU_SOURCE
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
+#include <fcntl.h>
#include <gio/gio.h>
#include <dlfcn.h>
+#include <sys/types.h>
+#include <stdbool.h>
+#include "display/display-ops.h"
#include "common.h"
#include "core/log.h"
#endif
#define MODULE_PATH LIBPATH"/deviced"
+struct display_plugin disp_plgn;
+
int load_plugin(const char *id, void **h)
{
char path[PATH_MAX];
void *handle;
- if (!id || !h)
+ if (!id)
return -EINVAL;
/* Find matched module path */
}
/* Load module */
- handle = dlopen(path, RTLD_LAZY|RTLD_GLOBAL);
- //handle = dlopen(path, RTLD_NOW|RTLD_GLOBAL);
+ handle = dlopen(path, RTLD_NOW|RTLD_GLOBAL);
if (!handle) {
_E("fail to open module : %s", dlerror());
return -ENOENT;
}
- *h = handle;
+ if (h)
+ *h = handle;
return 0;
}
-
int unload_plugin(void *h)
{
if (!h)
else
return dlclose(h);
}
+
+void load_plugins()
+{
+ load_plugin("display", NULL);
+
+ return;
+}
int load_plugin(const char *id, void **h);
int unload_plugin(void *h);
+void load_plugins();
#endif /* __DD_PLUGIN_H__ */
#include "core/devices.h"
#include "display/poll.h"
#include "display/core.h"
+#include "display/display-ops.h"
#include "core/common.h"
#include "core/device-notifier.h"
#define TIME_CHANGE_SIGNAL "STimeChanged"
+extern struct display_plugin disp_plgn;
static const time_t default_time = 2147483645; /* max(32bit) -3sec */
static guint tfdh; /* tfd change noti */
int tfd = -1;
else
pm_state = 0x4;
- pm_lock_internal(INTERNAL_LOCK_TIME, pm_state, STAY_CUR_STATE, 0);
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_TIME, pm_state, STAY_CUR_STATE, 0);
+
ret = handle_date(argv[0]);
- pm_unlock_internal(INTERNAL_LOCK_TIME, pm_state, STAY_CUR_STATE);
+
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_TIME, pm_state, STAY_CUR_STATE);
+
return ret;
}
else
pm_state = 0x4;
- pm_lock_internal(INTERNAL_LOCK_TIME, pm_state, STAY_CUR_STATE, 0);
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_TIME, pm_state, STAY_CUR_STATE, 0);
+
ret = handle_timezone(argv[0]);
- pm_unlock_internal(INTERNAL_LOCK_TIME, pm_state, STAY_CUR_STATE);
+
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_TIME, pm_state, STAY_CUR_STATE);
+
return ret;
}
if (lcd_state < S_LCDOFF)
goto restart;
- lcd_state = check_lcdoff_lock_state();
+ if (disp_plgn.check_lcdoff_lock_state)
+ lcd_state = disp_plgn.check_lcdoff_lock_state();
+
if (lcd_state || !tfdh || tfd == -1)
goto out;
#include "core/common.h"
#include "core/device-notifier.h"
#include "display/poll.h"
+#include "display/display-ops.h"
#include "extcon/extcon.h"
#include "apps/apps.h"
#include "usb.h"
#include "usb-tethering.h"
#include "usb-debug.h"
+extern struct display_plugin disp_plgn;
static struct usb_gadget_translator *gadget_translator;
static struct usb_client *usb_client;
}
usb_state_update_state(USB_CONNECTED, mode);
- pm_lock_internal(INTERNAL_LOCK_USB,
- LCD_OFF, STAY_CUR_STATE, 0);
+
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_USB, LCD_OFF, STAY_CUR_STATE, 0);
return 0;
}
_E("Failed to disable usb config (%d)", ret);
}
- pm_unlock_internal(INTERNAL_LOCK_USB,
- LCD_OFF, STAY_CUR_STATE);
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_USB, LCD_OFF, STAY_CUR_STATE);
return 0;
}
#include "core/device-idler.h"
#include "apps/apps.h"
#include "extcon/extcon.h"
+#include "display/display-ops.h"
#define USB_INTERFACE_CLASS "bInterfaceClass"
#define USB_INTERFACE_SUBCLASS "bInterfaceSubClass"
#define ROOTPATH tzplatform_getenv(TZ_SYS_VAR)
#define POLICY_FILENAME "usbhost-policy"
+extern struct display_plugin disp_plgn;
char *POLICY_FILEPATH;
/**
broadcast_usbhost_signal(USB_HOST_ADDED, usbhost);
- pm_change_internal(INTERNAL_LOCK_USB, LCD_NORMAL);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_USB, LCD_NORMAL);
/* for debugging */
_I("USB HOST Added");
broadcast_usbhost_signal(USB_HOST_REMOVED, usbhost);
- pm_change_internal(INTERNAL_LOCK_USB, LCD_NORMAL);
+ if (disp_plgn.pm_change_internal)
+ disp_plgn.pm_change_internal(INTERNAL_LOCK_USB, LCD_NORMAL);
/* for debugging */
_I("USB HOST Removed");
{
if (status == 0) {
_I("USB host connector disconnected");
- pm_unlock_internal(INTERNAL_LOCK_USB, LCD_OFF, STAY_CUR_STATE);
+ if (disp_plgn.pm_unlock_internal)
+ disp_plgn.pm_unlock_internal(INTERNAL_LOCK_USB, LCD_OFF, STAY_CUR_STATE);
} else {
_I("USB host connector connected");
- pm_lock_internal(INTERNAL_LOCK_USB, LCD_OFF, STAY_CUR_STATE, 0);
+ if (disp_plgn.pm_lock_internal)
+ disp_plgn.pm_lock_internal(INTERNAL_LOCK_USB, LCD_OFF, STAY_CUR_STATE, 0);
}
return 0;
}