diff options
-rwxr-xr-x | CMakeLists.txt | 1 | ||||
-rw-r--r-- | packaging/deviced.spec | 1 | ||||
-rw-r--r-- | src/extcon/earjack.c | 20 |
3 files changed, 22 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ee15efaa..75ffc642 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,7 @@ SET(PKG_MODULES capi-base-common dbus-1 gio-2.0 + eventsystem libtzplatform-config notification hwcommon diff --git a/packaging/deviced.spec b/packaging/deviced.spec index ef29bfbe..9be19c5a 100644 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -67,6 +67,7 @@ BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(gio-2.0) +BuildRequires: pkgconfig(eventsystem) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(notification) BuildRequires: pkgconfig(hwcommon) diff --git a/src/extcon/earjack.c b/src/extcon/earjack.c index 47513706..eb73b22d 100644 --- a/src/extcon/earjack.c +++ b/src/extcon/earjack.c @@ -19,12 +19,15 @@ #include <stdio.h> #include <vconf.h> +#include <bundle.h> +#include <eventsystem.h> #include "core/log.h" #include "display/poll.h" #include "extcon/extcon.h" #define SIGNAL_EARJACK_STATE "ChangedEarjack" +#define GET_EARJACK_STATE "Earjack" static void earjack_send_broadcast(int status) { @@ -44,11 +47,28 @@ static void earjack_send_broadcast(int status) SIGNAL_EARJACK_STATE, "i", arr); } +static void earjack_send_system_event(int status) +{ + bundle *b; + const char *str; + + if (status) + str = EVT_VAL_EARJACK_CONNECTED; + else + str = EVT_VAL_EARJACK_DISCONNECTED; + + b = bundle_create(); + bundle_add_str(b, EVT_KEY_EARJACK_STATUS, str); + eventsystem_send_system_event(SYS_EVENT_EARJACK_STATUS, b); + bundle_free(b); +} + static int earjack_update(int status) { _I("jack - earjack changed %d", status); vconf_set_int(VCONFKEY_SYSMAN_EARJACK, status); earjack_send_broadcast(status); + earjack_send_system_event(status); if (status != 0) pm_change_internal(getpid(), LCD_NORMAL); |