Remove usb keyboard detector logic 41/238241/3
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 10 Jul 2020 00:32:32 +0000 (09:32 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 10 Jul 2020 08:08:25 +0000 (17:08 +0900)
The duplicated code is existed in e-mod-tizen-wl-textinput
The usage of memory has been reduced about 67KB.

Change-Id: I49164a4525cb7901015263a72ec8c80124cfb5da
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
configure.ac
ism/extras/efl_panel/Makefile.am
ism/extras/efl_panel/isf_panel_efl.cpp
packaging/isf.spec

index 7b80085..bede0e9 100644 (file)
@@ -322,11 +322,6 @@ PKG_CHECK_MODULES(VCONF, [vconf],
                   [ISF_HAS_VCONF=yes],
                   [ISF_HAS_VCONF=no])
 
-# Check edbus library
-PKG_CHECK_MODULES(EDBUS, [edbus],
-                  [ISF_HAS_EDBUS=yes],
-                  [ISF_HAS_EDBUS=no])
-
 # Check bluetooth library
 PKG_CHECK_MODULES(BLUETOOTH, [capi-network-bluetooth],
                   [ISF_HAS_BLUETOOTH=yes],
@@ -395,10 +390,6 @@ if test "$ISF_HAS_FEEDBACK" = "yes"; then
   AC_DEFINE(HAVE_FEEDBACK,1,[Have Feedback functions.])
 fi
 
-if test "$ISF_HAS_EDBUS" = "yes"; then
-  AC_DEFINE(HAVE_EDBUS,1,[Have edbus functions.])
-fi
-
 if test "$ISF_HAS_NOTIFICATION" = "yes" && test "$enable_notification" = "yes"; then
   AC_DEFINE(HAVE_NOTIFICATION,1,[Have Notification functions.])
 fi
index 487f715..20e32ac 100644 (file)
@@ -49,7 +49,6 @@ isf_panel_efl_CXXFLAGS = @ECOREX_CFLAGS@ \
                          @DLOG_CFLAGS@ \
                          @NOTIFICATION_CFLAGS@ \
                          @TTS_CFLAGS@ \
-                         @EDBUS_CFLAGS@ \
                          @BLUETOOTH_CFLAGS@ \
                          @LIBWEBSOCKETS_CFLAGS@ \
                          @XKBCOMMON_CFLAGS@ \
@@ -71,7 +70,6 @@ isf_panel_efl_LDFLAGS  = @LTLIBINTL@ -rpath $(libdir) \
                          @DLOG_LIBS@ \
                          @NOTIFICATION_LIBS@ \
                          @TTS_LIBS@ \
-                         @EDBUS_LIBS@ \
                          @BLUETOOTH_LIBS@ \
                          @LIBWEBSOCKETS_LIBS@ \
                          @XKBCOMMON_LIBS@ \
index 0b084fa..cbb46fc 100644 (file)
@@ -73,9 +73,6 @@
 #include <notification.h>
 #include <notification_internal.h>
 #endif
-#ifdef HAVE_EDBUS
-#include <E_DBus.h>
-#endif
 #ifdef HAVE_BLUETOOTH
 #include <bluetooth.h>
 #endif
@@ -121,13 +118,6 @@ using namespace scim;
 #define ISF_KEYBOARD_ICON_FILE                          (SCIM_ICONDIR "/noti_keyboard_connected.png")
 #define ISF_ISE_SELECTOR_ICON_FILE                      "/noti_keyboard.png"
 
-#define HOST_BUS_NAME        "org.tizen.usb.host"
-#define HOST_OBJECT_PATH     "/Org/Tizen/Usb/Host"
-#define HOST_INTERFACE_NAME  "org.tizen.usb.host"
-#define HOST_KEYBOARD_SIGNAL "usbkeyboard"
-#define HOST_ADDED           "added"
-#define HOST_REMOVED         "removed"
-
 #define E_PROP_DEVICEMGR_INPUTWIN                       "DeviceMgr Input Window"
 
 
@@ -503,11 +493,6 @@ static bool               feedback_initialized              = false;
 #endif
 #endif /* CANDIDATE */
 
-#ifdef HAVE_EDBUS
-static E_DBus_Connection     *edbus_conn;
-static E_DBus_Signal_Handler *edbus_handler;
-#endif
-
 #if ENABLE_REMOTE_INPUT
 static Remote_Input*      remote_input_impl                 = NULL;
 static bool               launch_remote_input               = false;
@@ -589,91 +574,6 @@ static int pkgmgr_get_appinfo (const char *appid, pkgmgrinfo_appinfo_h *handle)
     return ret;
 }
 
-#ifdef HAVE_EDBUS
-static void usb_keyboard_signal_cb (void *data, DBusMessage *msg)
-{
-    DBusError err;
-    char *str = NULL;
-
-    if (!msg) {
-        LOGW ("No Message");
-        return;
-    }
-
-    if (dbus_message_is_signal (msg, HOST_INTERFACE_NAME, HOST_KEYBOARD_SIGNAL) == 0) {
-        LOGW ("HOST_KEYBOARD_SIGNAL");
-        return;
-    }
-
-    dbus_error_init (&err);
-
-    if (dbus_message_get_args (msg, &err, DBUS_TYPE_STRING, &str, DBUS_TYPE_INVALID) == 0) {
-        LOGW ("DBUS_TYPE_INVALID");
-        return;
-    }
-
-    if (!str) return;
-
-    if (!strncmp (str, HOST_ADDED, strlen (HOST_ADDED))) {
-        LOGD ("HOST_ADDED");
-        return;
-    }
-
-    if (!strncmp (str, HOST_REMOVED, strlen (HOST_REMOVED))) {
-        LOGD ("HOST_REMOVED");
-        if (_info_manager->get_current_toolbar_mode () == TOOLBAR_KEYBOARD_MODE) {
-            change_keyboard_mode (TOOLBAR_HELPER_MODE);
-        }
-        return;
-    }
-
-    LOGW ("ERROR: msg (%s) is improper", str);
-}
-
-static void unregister_edbus_signal_handler (void)
-{
-    if (edbus_conn) {
-        LOGD ("unregister signal handler for keyboard");
-        if (edbus_handler) {
-            e_dbus_signal_handler_del (edbus_conn, edbus_handler);
-            edbus_handler = NULL;
-        }
-        e_dbus_connection_close (edbus_conn);
-        edbus_conn = NULL;
-    }
-    e_dbus_shutdown ();
-}
-
-static int register_edbus_signal_handler (void)
-{
-    int retry;
-
-    retry = 0;
-    while (e_dbus_init () == 0) {
-        retry++;
-        if (retry >= 10) {
-            return -1;
-        }
-    }
-
-    edbus_conn = e_dbus_bus_get (DBUS_BUS_SYSTEM);
-    if (!edbus_conn) {
-        LOGW ("edbus connection fail");
-        return -1;
-    }
-
-    edbus_handler = e_dbus_signal_handler_add (edbus_conn, NULL, HOST_OBJECT_PATH, HOST_INTERFACE_NAME, HOST_KEYBOARD_SIGNAL, usb_keyboard_signal_cb, NULL);
-    if (!edbus_handler) {
-        LOGW ("cannot register signal");
-        return -1;
-    }
-
-    LOGD ("Success edbus register");
-
-    return 0;
-}
-#endif
-
 #ifdef HAVE_NOTIFICATION
 static void delete_notification (NotificationData *noti_data)
 {
@@ -7941,11 +7841,6 @@ int main (int argc, char *argv [])
     vconf_notify_key_changed (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, keyboard_mode_changed_cb, NULL);
 #endif
 
-#ifdef HAVE_EDBUS
-    if (0 != register_edbus_signal_handler ())
-        LOGW ("register edbus signal fail");
-#endif
-
     try {
         /* Update ISE list */
         std::vector<String> list;
@@ -8111,10 +8006,6 @@ cleanup:
 #endif
 #endif
 
-#ifdef HAVE_EDBUS
-    unregister_edbus_signal_handler ();
-#endif
-
     if (_info_manager) {
         try {
             _info_manager->stop ();
index 1a5ab94..ed62c30 100644 (file)
@@ -28,7 +28,6 @@ BuildRequires:  pkgconfig(ecore)
 BuildRequires:  pkgconfig(evas)
 BuildRequires:  pkgconfig(edje)
 BuildRequires:  pkgconfig(dlog)
-BuildRequires:  pkgconfig(edbus)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(capi-network-bluetooth)
 BuildRequires:  pkgconfig(efl-extension)