haptic: remove "ChangeHardkey" signal subscription 31/225431/1 accepted/tizen/5.5/unified/20200220.122559 submit/tizen_5.5/20200220.015705
authorYunmi Ha <yunmi.ha@samsung.com>
Thu, 20 Feb 2020 01:42:26 +0000 (10:42 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 20 Feb 2020 01:49:22 +0000 (01:49 +0000)
Change-Id: I8ea6d7b33cb7bc4b0314c90fad7fc8746f8c4532
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
(cherry picked from commit 5023c80e09539d854365a6b67f563f8b9ed8db48)

src/haptic/haptic.c

index f34e3f3..fa2e33c 100644 (file)
@@ -38,7 +38,6 @@
 #define VIBRATION_CONF_PATH        FEEDBACK_BASE_PATH"vibration.conf"
 
 #define HAPTIC_CONF_PATH                "/etc/feedbackd/haptic.conf"
-#define SIGNAL_CHANGE_HARDKEY           "ChangeHardkey"
 #define SIGNAL_POWEROFF_STATE           "ChangeState"
 #define SIGNAL_VIBRATOR_INITIATED       "InitiateVibrator"
 
@@ -1154,52 +1153,6 @@ static int haptic_internal_exit(void)
        return h_ops->close_device(g_handle);
 }
 
-static void haptic_hardkey_changed_cb(GDBusConnection  *conn,
-       const gchar      *sender,
-       const gchar      *path,
-       const gchar      *iface,
-       const gchar      *name,
-       GVariant         *param,
-       gpointer          data)
-{
-       int level, status, ret;
-
-       if (!CHECK_VALID_OPS(h_ops, ret)) {
-               ret = haptic_module_load();
-               if (ret < 0)
-                       return;
-       }
-
-       if (!g_handle)
-               haptic_internal_init();
-
-       /* if haptic is stopped, do not play vibration */
-       if (haptic_disabled)
-               return;
-
-       if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &status) < 0) {
-               _E("Failed to get VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL.");
-               status = 1;
-       }
-
-       /* when turn off haptic feedback option */
-       if (!status)
-               return;
-
-       ret = vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &level);
-       if (ret < 0) {
-               _E("Failed to get VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT.");
-               level = HARDKEY_VIB_FEEDBACK;
-       }
-
-       ret = h_ops->vibrate_monotone(g_handle, HARDKEY_VIB_DURATION,
-                       level*HAPTIC_FEEDBACK_STEP, PRIORITY_HIGH);
-       if (ret < 0)
-               _E("Failed to vibrate buffer: %d", ret);
-
-       return;
-}
-
 static void haptic_poweroff_cb(GDBusConnection  *conn,
        const gchar      *sender,
        const gchar      *path,
@@ -1357,7 +1310,6 @@ int haptic_probe(void)
        return haptic_module_load();
 }
 
-guint id_sig_change_hardkey;
 guint id_sig_pwr_off_state;
 
 void haptic_init(void)
@@ -1376,13 +1328,6 @@ void haptic_init(void)
        if (r < 0)
                _E("Failed to init hdbus interface and method: %d", r);
 
-       /* register notifier for below each event */
-       id_sig_change_hardkey = subscribe_dbus_signal(NULL, DEVICED_PATH_KEY, DEVICED_INTERFACE_KEY, SIGNAL_CHANGE_HARDKEY, haptic_hardkey_changed_cb, NULL, NULL);
-       if (id_sig_change_hardkey <= 0) {
-               _E("Failed to register signal handler: %d", r);
-               return;
-       }
-
        id_sig_pwr_off_state = subscribe_dbus_signal(NULL, DEVICED_PATH_POWEROFF, DEVICED_INTERFACE_POWEROFF, SIGNAL_POWEROFF_STATE, haptic_poweroff_cb, NULL, NULL);
        if (id_sig_pwr_off_state <= 0) {
                _E("Failed to register signal handler: %d", r);
@@ -1421,7 +1366,6 @@ void haptic_exit(void)
        }
 
        /* unregister notifier for below each event */
-       unsubscribe_dbus_signal(NULL, id_sig_change_hardkey);
        unsubscribe_dbus_signal(NULL, id_sig_pwr_off_state);
 
        /* release haptic data memory */