not change an existing format api and add new format api. 24/15124/1
authorjy910.yun <jy910.yun@samsung.com>
Tue, 14 May 2013 12:55:37 +0000 (21:55 +0900)
committerKrzysztof Sasiak <k.sasiak@samsung.com>
Thu, 16 Jan 2014 11:01:26 +0000 (12:01 +0100)
Change-Id: Id46880c069022302c8cb9f9258be435739b67f89
Signed-off-by: jy910.yun <jy910.yun@samsung.com>
src/deviced/dd-deviced-managed.h
src/shared/deviced-noti.c

index bd1ddca..1dd48a1 100755 (executable)
@@ -111,7 +111,18 @@ int deviced_request_mount_mmc(struct mmc_contents *mmc_data);
 int deviced_request_unmount_mmc(struct mmc_contents *mmc_data, int option);
 
 /**
- * @fn int deviced_request_format_mmc(struct deviced_mmc_contents *mmc_data, int option)
+ * @fn int deviced_request_format_mmc(struct deviced_mmc_contents *mmc_data)
+ * @brief This API is used to format mmc.\n
+ *             Internally, this API call predefined action API. That is send a notify message. \n
+ *             and when format opeation is finished, cb of deviced_mmc_content struct is called with cb's param1(result). \n
+ *             means of param1 - 0(format success) , -1(format fail)
+ * @param[in] mmc_data for receive result of format operation
+ * @return  non-zero on success message sending, -1 if message sending is failed.
+ */
+int deviced_request_format_mmc(struct mmc_contents *mmc_data);
+
+/**
+ * @fn int deviced_format_mmc(struct deviced_mmc_contents *mmc_data, int option)
  * @brief This API is used to format mmc.\n
  *             Internally, this API call predefined action API. That is send a notify message. \n
  *             and when format opeation is finished, cb of deviced_mmc_content struct is called with cb's param1(result). \n
@@ -122,7 +133,7 @@ int deviced_request_unmount_mmc(struct mmc_contents *mmc_data, int option);
  * @param[in] FMT_NORMAL is 0, FMT_FORCE is 1
  * @return  non-zero on success message sending, -1 if message sending is failed.
  */
-int deviced_request_format_mmc(struct mmc_contents *mmc_data, int option);
+int deviced_format_mmc(struct mmc_contents *mmc_data, int option);
 
 #ifdef __cplusplus
 }
index 5e079c9..f12b68c 100644 (file)
@@ -330,7 +330,17 @@ static int deviced_noti_format_mmc_cb(keynode_t *key_nodes, void *data)
        return 0;
 }
 
-API int deviced_request_format_mmc(struct mmc_contents *mmc_data, int option)
+API int deviced_request_format_mmc(struct mmc_contents *mmc_data)
+{
+       char *buf = "1";
+       if (mmc_data != NULL && mmc_data->mmc_cb != NULL)
+               vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_FORMAT,
+                                        (void *)deviced_noti_format_mmc_cb,
+                                        (void *)mmc_data);
+       return deviced_call_predef_action(PREDEF_FORMAT_MMC, 1, buf);
+}
+
+API int deviced_format_mmc(struct mmc_contents *mmc_data, int option)
 {
        char buf[32];