From 3d8b419dbf086c2e61c12fc5cd5c52180b30e855 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Tue, 3 Jan 2017 20:38:54 +0900 Subject: [PATCH] Wake up IME application before using it Change-Id: Iccfabc06ac3b0df1f368d801836a1095f330c1f8 --- configure.ac | 3 +++ ism/extras/efl_panel/Makefile.am | 2 +- ism/modules/panelagent/ecoresocket/Makefile.am | 3 ++- .../ecore_socket_panel_agent_module.cpp | 23 ++++++++++++++++++++++ packaging/isf.spec | 1 + 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 73df9bb..7cc2f38 100644 --- a/configure.ac +++ b/configure.ac @@ -330,6 +330,9 @@ PKG_CHECK_MODULES(FEEDBACK, [feedback], # Check package manager PKG_CHECK_MODULES(PACKAGE_MANAGER, [capi-appfw-package-manager]) +# Check AUL +PKG_CHECK_MODULES(AUL, [aul]) + # Check App Control PKG_CHECK_MODULES(APP_CONTROL, [capi-appfw-app-control]) diff --git a/ism/extras/efl_panel/Makefile.am b/ism/extras/efl_panel/Makefile.am index d3cb2f7..d881bf0 100644 --- a/ism/extras/efl_panel/Makefile.am +++ b/ism/extras/efl_panel/Makefile.am @@ -75,4 +75,4 @@ isf_panel_efl_LDFLAGS = @LTLIBINTL@ -rpath $(libdir) \ isf_panel_efl_LDADD = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la \ $(top_builddir)/ism/src/libisf_pkg.la \ - $(top_builddir)/ism/src/libprivilege_checker.la \ No newline at end of file + $(top_builddir)/ism/src/libprivilege_checker.la diff --git a/ism/modules/panelagent/ecoresocket/Makefile.am b/ism/modules/panelagent/ecoresocket/Makefile.am index a19d5f1..3362103 100644 --- a/ism/modules/panelagent/ecoresocket/Makefile.am +++ b/ism/modules/panelagent/ecoresocket/Makefile.am @@ -33,7 +33,7 @@ module_LTLIBRARIES = $(CONFIG_ECORESOCKET_PANELAGENT_MODULE) ecoresocket_la_SOURCES = ecore_socket_panel_agent_module.cpp -ecoresocket_la_CXXFLAGS = @DLOG_CFLAGS@ @ECORE_CFLAGS@ +ecoresocket_la_CXXFLAGS = @DLOG_CFLAGS@ @ECORE_CFLAGS@ @AUL_CFLAGS@ ecoresocket_la_LDFLAGS = -avoid-version \ -rpath $(moduledir) \ @@ -42,6 +42,7 @@ ecoresocket_la_LDFLAGS = -avoid-version \ @LIBTOOL_EXPORT_OPTIONS@ \ @LTLIBINTL@ \ @DLOG_LIBS@ \ + @AUL_LIBS@ \ @ECORE_LIBS@ ecoresocket_la_LIBADD = $(top_builddir)/ism/src/libscim@SCIM_EPOCH@.la diff --git a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp index 655c27b..6e14dc3 100644 --- a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp +++ b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp @@ -36,13 +36,16 @@ #include #include #include +#include #include #include #include +#include #include "scim_private.h" #include "scim.h" #include "scim_stl_map.h" #include "isf_debug.h" +#include #ifdef LOG_TAG # undef LOG_TAG @@ -70,6 +73,17 @@ struct IMControlStub { std::vector count; }; +void aul_wakeup_ime_application(int sockfd) +{ + struct ucred ucred; + socklen_t len = sizeof(struct ucred); + if (getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED, &ucred, &len) == 0) { + int ret = aul_update_freezer_status((long)ucred.pid, "wakeup"); + LOGD("aul_update_freezer_status : %d %d\n", ucred.pid, ret); + } else { + LOGD("getsockopt failed : %d\n", errno); + } +} #define DEFAULT_CONTEXT_VALUE 0xfff #define scim_module_init ecoresocket_LTX_scim_module_init @@ -543,6 +557,9 @@ private: LOGD ("client id:%d\n", client); Socket client_socket(client); + + aul_wakeup_ime_application(client_socket.get_id()); + m_send_trans.clear(); m_send_trans.put_command(SCIM_TRANS_CMD_REPLY); m_send_trans.put_data(context); @@ -748,6 +765,9 @@ private: LOGD ("client id:%d\n", client); Socket client_socket(client); + + aul_wakeup_ime_application(client_socket.get_id()); + m_send_trans.clear(); m_send_trans.put_command(SCIM_TRANS_CMD_REPLY); m_send_trans.put_data(context); @@ -760,6 +780,9 @@ private: LOGD ("client id:%d\n", client); Socket client_socket(client); + + aul_wakeup_ime_application(client_socket.get_id()); + m_send_trans.clear(); m_send_trans.put_command(SCIM_TRANS_CMD_REPLY); m_send_trans.put_data(context); diff --git a/packaging/isf.spec b/packaging/isf.spec index 37761c2..c96cd64 100644 --- a/packaging/isf.spec +++ b/packaging/isf.spec @@ -33,6 +33,7 @@ BuildRequires: efl-extension-devel BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(pkgmgr-info) BuildRequires: pkgconfig(db-util) +BuildRequires: pkgconfig(aul) BuildRequires: pkgconfig(capi-appfw-app-control) BuildRequires: pkgconfig(capi-appfw-application) BuildRequires: pkgconfig(cynara-client) -- 2.7.4