Add MMC status chage event handler
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 17 Apr 2013 06:43:37 +0000 (15:43 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 17 Apr 2013 06:43:37 +0000 (15:43 +0900)
Change-Id: I876611034bf8f2d6cee33ed3d3237c5aaf9d0424

packaging/com.samsung.data-provider-slave.spec
src/main.c

index 919073d..beec888 100644 (file)
@@ -2,7 +2,7 @@
 
 Name: com.samsung.data-provider-slave
 Summary: Plugin type livebox service provider.
-Version: 0.10.3
+Version: 0.10.4
 Release: 1
 Group: HomeTF/Livebox
 License: Flora License
index c10014d..506eb47 100644 (file)
@@ -119,6 +119,12 @@ static Eina_Bool property_cb(void *data, int type, void *event)
        return ECORE_CALLBACK_PASS_ON;
 }
 
+static void mmc_changed_cb(keynode_t *node, void *user_data)
+{
+       DbgPrint("MMC status is changed\n");
+       lb_system_event_all(LB_SYS_EVENT_MMC_STATUS_CHANGED);
+}
+
 static void time_changed_cb(keynode_t *node, void *user_data)
 {
        if (vconf_keynode_get_int(node) != VCONFKEY_SYSMAN_STIME_CHANGED)
@@ -161,7 +167,10 @@ static bool app_create(void *data)
        DbgPrint("Content update monitor is initiated: %d\n", ret);
 
        ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_STIME, time_changed_cb, NULL);
-       DbgPrint("System time event callback added: %d\n", ret);
+       DbgPrint("System time changed event callback added: %d\n", ret);
+
+       ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, mmc_changed_cb, NULL);
+       DbgPrint("MMC status changed event callback added: %d\n", ret);
 
        return TRUE;
 }
@@ -170,6 +179,12 @@ static void app_terminate(void *data)
 {
        int ret;
 
+       ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_STIME, time_changed_cb);
+       DbgPrint("Remove time changed callback: %d\n", ret);
+
+       ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, mmc_changed_cb);
+       DbgPrint("Remove MMC status changed callback: %d\n", ret);
+
        ret = update_monitor_fini();
        DbgPrint("Content update monitor is finalized: %d\n", ret);
        ret = fault_fini();