From 5c991c707d38067d6c405640dd98db64aa21bcb3 Mon Sep 17 00:00:00 2001 From: "jy910.yun" Date: Tue, 14 May 2013 21:55:37 +0900 Subject: [PATCH] not change an existing format api and add new format api. Change-Id: Id46880c069022302c8cb9f9258be435739b67f89 Signed-off-by: jy910.yun --- src/deviced/dd-deviced-managed.h | 15 +++++++++++++-- src/shared/deviced-noti.c | 12 +++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/deviced/dd-deviced-managed.h b/src/deviced/dd-deviced-managed.h index bd1ddca..1dd48a1 100755 --- a/src/deviced/dd-deviced-managed.h +++ b/src/deviced/dd-deviced-managed.h @@ -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 } diff --git a/src/shared/deviced-noti.c b/src/shared/deviced-noti.c index 5e079c9..f12b68c 100644 --- a/src/shared/deviced-noti.c +++ b/src/shared/deviced-noti.c @@ -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]; -- 2.7.4