Wake up IME application before using it 49/108249/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 3 Jan 2017 11:38:54 +0000 (20:38 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Tue, 3 Jan 2017 13:32:13 +0000 (22:32 +0900)
Change-Id: Iccfabc06ac3b0df1f368d801836a1095f330c1f8

configure.ac
ism/extras/efl_panel/Makefile.am
ism/modules/panelagent/ecoresocket/Makefile.am
ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp
packaging/isf.spec

index 73df9bb..7cc2f38 100644 (file)
@@ -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])
 
index d3cb2f7..d881bf0 100644 (file)
@@ -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
index a19d5f1..3362103 100644 (file)
@@ -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
index 655c27b..6e14dc3 100644 (file)
 #include <string.h>
 #include <sys/types.h>
 #include <sys/times.h>
+#include <sys/socket.h>
 #include <dlog.h>
 #include <unistd.h>
 #include <Ecore.h>
+#include <aul.h>
 #include "scim_private.h"
 #include "scim.h"
 #include "scim_stl_map.h"
 #include "isf_debug.h"
+#include <errno.h>
 
 #ifdef LOG_TAG
 # undef LOG_TAG
@@ -70,6 +73,17 @@ struct IMControlStub {
     std::vector<int> 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);
index 37761c2..c96cd64 100644 (file)
@@ -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)