summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Jung <jh8801.jung@samsung.com>2018-08-20 16:53:53 +0900
committerJihoon Jung <jh8801.jung@samsung.com>2018-08-20 17:01:30 +0900
commitbd4b190e780dc78d6ab99ff9f661ec0a3ae1cad6 (patch)
treec275784cee9df496195ce73e7c59b4b0bb5067cf
parentb1c3e40ab7c21c4a1eeb0ee8f034b06470f70fdc (diff)
downloadmtp-responder-bd4b190e780dc78d6ab99ff9f661ec0a3ae1cad6.tar.gz
mtp-responder-bd4b190e780dc78d6ab99ff9f661ec0a3ae1cad6.tar.bz2
mtp-responder-bd4b190e780dc78d6ab99ff9f661ec0a3ae1cad6.zip
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com> Change-Id: I2d9d14add6d0de7d9a906aa337facca77f493620
-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 849f491..606535f 100755
--- a/packaging/mtp-responder.spec
+++ b/packaging/mtp-responder.spec
@@ -5,7 +5,7 @@ ExcludeArch: %arm aarch64
Name: mtp-responder
Summary: Media Transfer Protocol daemon (responder)
-Version: 0.0.31
+Version: 0.0.32
Release: 1
Group: Network & Connectivity/Other
License: Apache-2.0
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: