diff options
Diffstat (limited to 'src/common')
-rwxr-xr-x | src/common/include/media-common-external-storage.h | 2 | ||||
-rwxr-xr-x | src/common/include/media-common-system.h | 1 | ||||
-rwxr-xr-x | src/common/include/media-common-types.h | 1 | ||||
-rwxr-xr-x | src/common/media-common-external-storage.c | 10 | ||||
-rwxr-xr-x | src/common/media-common-system.c | 13 |
5 files changed, 20 insertions, 7 deletions
diff --git a/src/common/include/media-common-external-storage.h b/src/common/include/media-common-external-storage.h index c74fc10..dfd4fcd 100755 --- a/src/common/include/media-common-external-storage.h +++ b/src/common/include/media-common-external-storage.h @@ -26,7 +26,7 @@ void ms_make_default_path_mmc(void); #ifndef DISABLE_NOTIFICATION -int ms_present_mmc_status(ms_sdcard_status_type_t status); +int ms_present_mmc_status(ms_sdcard_status_type_t status, int flags); #endif int ms_get_mmc_id(char **cid); diff --git a/src/common/include/media-common-system.h b/src/common/include/media-common-system.h index 6f74794..ee24c16 100755 --- a/src/common/include/media-common-system.h +++ b/src/common/include/media-common-system.h @@ -40,6 +40,7 @@ typedef struct ms_block_info_s{ char *mount_path; int state; int block_type; + int flags; } ms_block_info_s; typedef void (*block_changed_cb)(ms_block_info_s *block_info, void *user_data); diff --git a/src/common/include/media-common-types.h b/src/common/include/media-common-types.h index 9912233..36267b5 100755 --- a/src/common/include/media-common-types.h +++ b/src/common/include/media-common-types.h @@ -69,6 +69,7 @@ typedef enum { MS_SDCARD_INSERTED, /**< Stored only in phone */ MS_SDCARD_REMOVED, /**< Stored only in MMC */ } ms_sdcard_status_type_t; +#define MS_SDCARD_REMOVED_UNSAFE 0x0001 /* Removed without unmount */ typedef enum { MS_SCAN_INVALID, diff --git a/src/common/media-common-external-storage.c b/src/common/media-common-external-storage.c index 031af01..bbbee85 100755 --- a/src/common/media-common-external-storage.c +++ b/src/common/media-common-external-storage.c @@ -68,7 +68,7 @@ char default_path[][MS_FILE_NAME_LEN_MAX + 1] = { #define BLOCK_OBJECT_ADDED "ObjectAdded" #define BLOCK_OBJECT_REMOVED "ObjectRemoved" -#define BLOCK_DEVICE_CHANGED "DeviceChanged" +#define BLOCK_DEVICE_CHANGED "DeviceChanged2" GDBusConnection *g_stg_bus; int g_stg_added_handler; @@ -157,7 +157,7 @@ void update_lang(void) } } -int ms_present_mmc_status(ms_sdcard_status_type_t status) +int ms_present_mmc_status(ms_sdcard_status_type_t status, int flags) { int ret = NOTIFICATION_ERROR_NONE; @@ -165,8 +165,10 @@ int ms_present_mmc_status(ms_sdcard_status_type_t status) if (status == MS_SDCARD_INSERTED) ret = notification_status_message_post(_GETSYSTEMSTR("IDS_COM_BODY_PREPARING_SD_CARD")); - else if (status == MS_SDCARD_REMOVED) - ret = notification_status_message_post(_GETSYSTEMSTR("IDS_COM_BODY_SD_CARD_UNEXPECTEDLY_REMOVED")); + else if (status == MS_SDCARD_REMOVED) { + if (flags & MS_SDCARD_REMOVED_UNSAFE) + ret = notification_status_message_post(_GETSYSTEMSTR("IDS_COM_BODY_SD_CARD_UNEXPECTEDLY_REMOVED")); + } if(ret != NOTIFICATION_ERROR_NONE) return MS_MEDIA_ERR_INTERNAL; diff --git a/src/common/media-common-system.c b/src/common/media-common-system.c index d784af4..66234ab 100755 --- a/src/common/media-common-system.c +++ b/src/common/media-common-system.c @@ -50,9 +50,9 @@ #define BLOCK_OBJECT_ADDED "ObjectAdded" #define BLOCK_OBJECT_REMOVED "ObjectRemoved" -#define BLOCK_DEVICE_CHANGED "DeviceChanged" +#define BLOCK_DEVICE_CHANGED "DeviceChanged2" -#define BLOCK_DEVICE_METHOD "GetDeviceList" +#define BLOCK_DEVICE_METHOD "GetDeviceList2" #define BLOCK_DEVICE_USB "scsi" #define BLOCK_DEVICE_MMC "mmc" #define BLOCK_DEVICE_ALL "all" @@ -110,6 +110,10 @@ static void __ms_block_changed(GDBusConnection* connection, block_info->state = g_variant_get_int32 (tmp); MS_DBG_ERR("state : %d", block_info->state); + tmp = g_variant_get_child_value(parameters, 11); + block_info->flags = g_variant_get_int32 (tmp); + MS_DBG_ERR("flags : %d", block_info->flags); + ((block_changed_cb)usr_cb)(block_info, usr_data); MS_SAFE_FREE(block_info->mount_path); MS_SAFE_FREE(block_info); @@ -303,6 +307,11 @@ static int __ms_dbus_method_sync(const char *dest, const char *path, dbus_message_iter_get_basic(&piter, &val_bool); MS_DBG("\tprimary(%d)", val_bool ? "true" : "false"); + dbus_message_iter_next(&piter); + dbus_message_iter_get_basic(&piter, &val_int); + MS_DBG("\tflags(%d)", val_int); + data->flags = val_int; + dbus_message_iter_next(&aiter); if (*dev_list == NULL) { |