summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinclude/mtp_config.h1
-rwxr-xr-xpackaging/mtp-responder.spec2
-rwxr-xr-xsrc/entity/mtp_store.c24
3 files changed, 24 insertions, 3 deletions
diff --git a/include/mtp_config.h b/include/mtp_config.h
index 5d37986..7b02960 100755
--- a/include/mtp_config.h
+++ b/include/mtp_config.h
@@ -115,7 +115,6 @@
/*To determine whether command is for Samsung mobile*/
#define MTP_SAMSUNG_MOBILE 0x1000
-#define MTP_STORAGE_DESC_INT "Phone"
#define MTP_STORAGE_DESC_EXT "Card"
/*Devices Property*/
diff --git a/packaging/mtp-responder.spec b/packaging/mtp-responder.spec
index 631f29f..f3eee73 100755
--- a/packaging/mtp-responder.spec
+++ b/packaging/mtp-responder.spec
@@ -6,7 +6,7 @@ ExcludeArch: %arm aarch64
Name: mtp-responder
Summary: Media Transfer Protocol daemon (responder)
Version: 0.0.27
-Release: 5
+Release: 6
Group: Network & Connectivity/Other
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
diff --git a/src/entity/mtp_store.c b/src/entity/mtp_store.c
index 882fac5..417ec67 100755
--- a/src/entity/mtp_store.c
+++ b/src/entity/mtp_store.c
@@ -18,6 +18,7 @@
#include <unistd.h>
#include <sys/types.h>
#include <dirent.h>
+#include <system_info.h>
#include "mtp_util.h"
#include "mtp_support.h"
#include "mtp_device.h"
@@ -206,6 +207,8 @@ mtp_bool _entity_init_mtp_store(mtp_store_t *store, mtp_uint32 store_id,
mtp_wchar wtemp[MTP_MAX_REG_STRING + 1] = { 0 };
mtp_char serial[MTP_MAX_REG_STRING + 1] = { 0 };
mtp_wchar wserial[MTP_MAX_REG_STRING + 1] = { 0 };
+ char *profile = NULL;
+ char *storage_desc = NULL;
retv_if(store == NULL, FALSE);
@@ -223,12 +226,31 @@ mtp_bool _entity_init_mtp_store(mtp_store_t *store, mtp_uint32 store_id,
switch (store_id) {
case MTP_INTERNAL_STORE_ID:
store->is_hidden = FALSE;
+
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profile);
+ if (profile != NULL) {
+ if (g_strcmp0(profile, "mobile") == 0) {
+ storage_desc = g_strdup("Phone");
+ } else if (g_strcmp0(profile, "wearable") == 0) {
+ storage_desc = g_strdup("Watch");
+ }
+ }
+
+ if (storage_desc == NULL)
+ storage_desc = g_strdup("Common");
+
_util_utf8_to_utf16(wtemp, sizeof(wtemp) / WCHAR_SIZ,
- MTP_STORAGE_DESC_INT);
+ storage_desc);
__init_store_info_params(&(store->store_info),
store->store_info.capacity, PTP_STORAGETYPE_FIXEDRAM,
PTP_FILESYSTEMTYPE_HIERARCHICAL, PTP_STORAGEACCESS_RWD,
wtemp, wserial);
+
+ if (storage_desc != NULL)
+ g_free(storage_desc);
+
+ if (profile != NULL)
+ g_free(profile);
break;
case MTP_EXTERNAL_STORE_ID: