Version up for 2018 MAIN branch 59/139059/1 accepted/tizen/4.0/unified/20170816.013318 accepted/tizen/unified/20170717.170820 submit/tizen/20170717.070032 submit/tizen_4.0/20170811.094300
authorjh8801.jung <jh8801.jung@samsung.com>
Mon, 17 Jul 2017 06:07:23 +0000 (15:07 +0900)
committerjh8801.jung <jh8801.jung@samsung.com>
Mon, 17 Jul 2017 06:08:36 +0000 (15:08 +0900)
- Reduction logs
- Apply for Gear 360 impelmentation

Signed-off-by: jh8801.jung <jh8801.jung@samsung.com>
Change-Id: I19233c20b69a9562022a3058186d3b3cf9a1e4d1

14 files changed:
packaging/mtp-initiator.spec
src/daemon/include/mtp_daemon.h
src/daemon/include/mtp_daemon_gdbus_deviceinfo.h
src/daemon/mtp_daemon.c
src/daemon/mtp_daemon_controller.c
src/daemon/mtp_daemon_db.c
src/daemon/mtp_daemon_event.c
src/daemon/mtp_daemon_gdbus.c
src/daemon/mtp_daemon_gdbus_deviceinfo.c
src/daemon/mtp_daemon_gdbus_manager.c
src/daemon/mtp_daemon_gdbus_objectinfo.c
src/daemon/mtp_daemon_gdbus_storageinfo.c
src/daemon/mtp_daemon_util.c
src/daemon/mtp_gdbuslib.xml

index 27ce624..f45a172 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       mtp-initiator
 Summary:    mtp(media transfer protocol) initiator
-Version:    1.4.21
+Version:    1.4.22
 Release:    1
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
index 98914cd..2020e59 100755 (executable)
@@ -54,7 +54,7 @@
 #define RETV_IF(expr, val) \
        do { \
                if (expr) { \
-                       MTP_LOGE("(%s) return", #expr); \
+                       MTP_LOGE("%s return", #expr); \
                        return (val); \
                } \
        } while (0)
@@ -127,7 +127,7 @@ struct _mtp_device_info {
        int bus_location;
        int device_number;
        char *model_name;
-       GMainLoop *event_loop;
+       char *stitching_engine_version;
 };
 
 struct _mtp_device_list {
@@ -138,7 +138,6 @@ struct _mtp_device_list {
 
 struct _mtp_context {
        /* daemon variable */
-       bool is_initialized;
        GMainLoop *main_loop;
 
        /* controller variable */
@@ -151,7 +150,6 @@ struct _mtp_context {
        mtp_device_list *device_list;
 
        /* gdbus variable */
-       gint bus_id;
        GDBusConnection *connection;
        mtpgdbuslibManager *manager;
 
index c4181e9..7fc927b 100755 (executable)
@@ -55,4 +55,10 @@ gboolean deviceinfo_get_device_number(
                gint handle,
                gpointer user_data);
 
+gboolean deviceinfo_get_stitching_engine_version(
+               mtpgdbuslibDeviceinfo *deviceinfo,
+               GDBusMethodInvocation *invocation,
+               gint handle,
+               gpointer user_data);
+
 #endif
index eaac549..bc08972 100755 (executable)
 
 static mtp_context *_mtp_ctx = NULL;
 
-mtp_context *get_mtp_ctx(void)
-{
-       MTP_LOGI("%s", __func__);
-       return _mtp_ctx;
-}
-
 static mtp_error_e __daemon_initalize(mtp_context *mtp_ctx)
 {
        mtp_error_e ret = MTP_ERROR_NONE;
@@ -36,23 +30,27 @@ static mtp_error_e __daemon_initalize(mtp_context *mtp_ctx)
 
        ret = mtp_daemon_controller_init(mtp_ctx);
        if (ret != MTP_ERROR_NONE) {
-               MTP_LOGE("mtp_daemon_controller_init is failed - ret[%d]", ret);
+               MTP_LOGE("mtp_daemon_controller_init is failed: %d", ret);
                return ret;
        }
 
        ret = mtp_daemon_db_init(mtp_ctx);
        if (ret != MTP_ERROR_NONE) {
-               MTP_LOGE("mtp_daemon_db_init is failed - ret[%d]", ret);
+               MTP_LOGE("mtp_daemon_db_init is failed: %d", ret);
                return ret;
        }
 
-       ret = mtp_daemon_gdbus_init(mtp_ctx);
+       ret = mtp_daemon_event_init(mtp_ctx);
        if (ret != MTP_ERROR_NONE) {
-               MTP_LOGE("mtp_daemon_gdbus_init is failed - ret[%d]", ret);
+               MTP_LOGE("mtp_daemon_event_init is failed: %d", ret);
                return ret;
        }
 
-       mtp_ctx->is_initialized = true;
+       ret = mtp_daemon_gdbus_init(mtp_ctx);
+       if (ret != MTP_ERROR_NONE) {
+               MTP_LOGE("mtp_daemon_gdbus_init is failed: %d", ret);
+               return ret;
+       }
 
        return ret;
 }
@@ -63,9 +61,6 @@ static mtp_error_e __daemon_deinitalize(mtp_context *mtp_ctx)
 
        RETV_IF(mtp_ctx == NULL, MTP_ERROR_INVALID_PARAMETER);
 
-       /* deinitialize daemon */
-       mtp_ctx->is_initialized = false;
-
        usb_host_unset_event_cb();
 
        ret = mtp_daemon_db_deinit(mtp_ctx);
@@ -92,11 +87,11 @@ static void __mtp_signal_handler(int signo)
        switch (signo) {
        case SIGTERM:
                ret = __daemon_deinitalize(_mtp_ctx);
-               MTP_LOGD("SIGTERM ret[%d]", ret);
+               MTP_LOGD("SIGTERM ret: %d", ret);
                break;
 
        default:
-               MTP_LOGD("unhandled signal[%d]", signo);
+               MTP_LOGD("unhandled signal: %d", signo);
                exit(EXIT_FAILURE);
                break;
        } /* end switch */
@@ -110,7 +105,7 @@ int main(int argc, char *argv[])
        mtp_error_e ret = MTP_ERROR_NONE;
        struct sigaction sigact;
 
-       MTP_LOGI("mtp_daemon - start");
+       MTP_LOGI("mtp initiator start");
 
        remove(MTP_DB_FILE);
 
@@ -119,7 +114,7 @@ int main(int argc, char *argv[])
        sigemptyset(&sigact.sa_mask);
        sigact.sa_flags = 0;
        if (sigaction(SIGTERM, &sigact, NULL) < 0)
-               MTP_LOGW("sigaction(SIGTERM) is failed");
+               MTP_LOGW("sigaction is failed");
 
        /* 2. create mtp daemon context */
        mtp_ctx = g_new0(mtp_context, 1);
@@ -130,7 +125,7 @@ int main(int argc, char *argv[])
 
        mtp_ctx->device_list = g_new0(mtp_device_list, 1);
        if (mtp_ctx->device_list == NULL) {
-               MTP_LOGE("create mtp_context is failed");
+               MTP_LOGE("create device_list is failed");
                goto EXIT;
        }
 
@@ -145,7 +140,7 @@ int main(int argc, char *argv[])
        /* 3. initialize daemon */
        ret = __daemon_initalize(mtp_ctx);
        if (ret != MTP_ERROR_NONE) {
-               MTP_LOGE("mtp_daemon_initalize is failed");
+               MTP_LOGE("daemon initalize is failed");
                goto EXIT;
        }
 
@@ -153,12 +148,10 @@ int main(int argc, char *argv[])
 
 EXIT:
        ret = __daemon_deinitalize(mtp_ctx);
-       if (ret != MTP_ERROR_NONE) {
-               MTP_LOGE("mtp_daemon_deinitalize is failed");
-               return -1;
-       }
+       if (ret != MTP_ERROR_NONE)
+               MTP_LOGE("daemon deinitalize is failed");
 
-       MTP_LOGD("mtp_daemon - exit");
+       MTP_LOGI("mtp initiator exit");
 
        return 0;
 }
index 78b5490..003093d 100755 (executable)
@@ -93,7 +93,7 @@ mtp_error_e mtp_daemon_controller_init(mtp_context *mtp_ctx)
        if (mtp_ctx->c_thread == NULL) {
                MTP_LOGE("Can not create controller thread");
                if (error != NULL) {
-                       MTP_LOGE("The error msg : %s", error->message);
+                       MTP_LOGE("The error msg: %s", error->message);
                        g_error_free(error);
                }
 
index 42e87aa..acabf81 100755 (executable)
@@ -54,7 +54,7 @@ mtp_error_e mtp_daemon_db_delete(int mtp_device, int mtp_storage,
        if (sql != NULL) {
                sql_ret = sqlite3_exec(mtp_ctx->db, sql, NULL, NULL, &error);
                if (sql_ret != SQLITE_OK) {
-                       MTP_LOGE("sqlite3_exec failed, sql_ret[%d] : %s", sql_ret, error);
+                       MTP_LOGE("sqlite3_exec failed, %d, %s", sql_ret, error);
                        ret = MTP_ERROR_DB;
                        sqlite3_free(error);
                }
@@ -102,7 +102,7 @@ mtp_error_e mtp_daemon_db_update(int mtp_device, int object_handle,
        if (sql != NULL) {
                sql_ret = sqlite3_exec(mtp_ctx->db, sql, NULL, NULL, &error);
                if (sql_ret != SQLITE_OK) {
-                       MTP_LOGE("sqlite3_exec failed, sql_ret[%d] : %s", sql_ret, error);
+                       MTP_LOGE("sqlite3_exec failed, %d, %s", sql_ret, error);
                        ret = MTP_ERROR_DB;
                        sqlite3_free(error);
                }
@@ -136,14 +136,14 @@ MTPObjectInfo* mtp_daemon_db_get_object_info(int mtp_device,
        if (sql != NULL && object_info != NULL) {
                sql_ret = sqlite3_prepare_v2(mtp_ctx->db, sql, strlen(sql), &stmt, NULL);
                if (stmt == NULL) {
-                       MTP_LOGE("sqlite3_prepare_v2 failed, sql_ret[%d], %s", sql_ret, sqlite3_errmsg(mtp_ctx->db));
+                       MTP_LOGE("sqlite3_prepare_v2 failed, %d, %s", sql_ret, sqlite3_errmsg(mtp_ctx->db));
                        g_free(object_info);
                        return NULL;
                }
 
                sql_ret = sqlite3_step(stmt);
                if (sql_ret != SQLITE_ROW) {
-                       MTP_LOGE("sqlite3_step failed, sql_ret[%d]", sql_ret);
+                       MTP_LOGE("sqlite3_step failed, %d", sql_ret);
                        g_free(object_info);
                        return NULL;
                }
@@ -168,9 +168,6 @@ MTPObjectInfo* mtp_daemon_db_get_object_info(int mtp_device,
                object_info->ModificationDate = sqlite3_column_int(stmt, 20);
                object_info->Keywords = g_strdup((const char *)sqlite3_column_text(stmt, 21));
 
-               /*MTP_LOGI("Filename: %s, CaptureDate: %ld, ModificationDate: %ld",
-                       object_info->Filename, (long)object_info->CaptureDate, (long)object_info->ModificationDate);*/
-
                sqlite3_finalize(stmt);
                sqlite3_free(sql);
        } else {
@@ -200,20 +197,18 @@ bool mtp_daemon_db_is_exist(int mtp_device, int mtp_storage, int object_handle,
        if (sql != NULL) {
                sql_ret = sqlite3_prepare_v2(mtp_ctx->db, sql, strlen(sql), &stmt, NULL);
                if (stmt == NULL) {
-                       MTP_LOGE("sqlite3_prepare_v2 failed, sql_ret[%d], %s", sql_ret, sqlite3_errmsg(mtp_ctx->db));
+                       MTP_LOGE("sqlite3_prepare_v2 failed, %d, %s", sql_ret, sqlite3_errmsg(mtp_ctx->db));
                        return false;
                }
 
                sql_ret = sqlite3_step(stmt);
                if (sql_ret != SQLITE_ROW) {
-                       MTP_LOGE("sqlite3_step failed, sql_ret[%d]", sql_ret);
+                       MTP_LOGE("sqlite3_step failed, %d", sql_ret);
                        return false;
                }
 
                count = sqlite3_column_int(stmt, 0);
 
-               /*MTP_LOGI("device: %d, object_id: %d, count: %d", device_handle, object_handle, count);*/
-
                sqlite3_finalize(stmt);
                sqlite3_free(sql);
        } else {
@@ -227,8 +222,6 @@ mtp_error_e mtp_daemon_db_begin(mtp_context *mtp_ctx)
 {
        int sql_ret;
 
-       MTP_LOGI("mtp_ctx %p", mtp_ctx);
-
        if (mtp_ctx->db == NULL) {
                MTP_LOGE("mtp_ctx->db is NULL");
                return MTP_ERROR_DB;
@@ -236,7 +229,7 @@ mtp_error_e mtp_daemon_db_begin(mtp_context *mtp_ctx)
 
        sql_ret = sqlite3_exec(mtp_ctx->db, "BEGIN;", NULL, NULL, NULL);
        if (sql_ret != SQLITE_OK) {
-               MTP_LOGE("sqlite3_exec BEGIN failed - sql_ret[%d]", sql_ret);
+               MTP_LOGE("sqlite3_exec BEGIN failed, %d", sql_ret);
                return MTP_ERROR_DB;
        }
 
@@ -247,8 +240,6 @@ mtp_error_e mtp_daemon_db_commit(mtp_context *mtp_ctx)
 {
        int sql_ret;
 
-       MTP_LOGI("mtp_ctx %p", mtp_ctx);
-
        if (mtp_ctx->db == NULL) {
                MTP_LOGE("mtp_ctx->db is NULL");
                return MTP_ERROR_DB;
@@ -256,7 +247,7 @@ mtp_error_e mtp_daemon_db_commit(mtp_context *mtp_ctx)
 
        sql_ret = sqlite3_exec(mtp_ctx->db, "COMMIT;", NULL, NULL, NULL);
        if (sql_ret != SQLITE_OK) {
-               MTP_LOGE("sqlite3_exec COMMIT failed - sql_ret[%d]", sql_ret);
+               MTP_LOGE("sqlite3_exec COMMIT failed, %d", sql_ret);
                return MTP_ERROR_DB;
        }
 
@@ -304,7 +295,7 @@ mtp_error_e mtp_daemon_db_insert(int mtp_device, int mtp_storage,
        if (sql != NULL) {
                sql_ret = sqlite3_exec(mtp_ctx->db, sql, NULL, NULL, &error);
                if (sql_ret != SQLITE_OK) {
-                       MTP_LOGE("sqlite3_exec failed, sql_ret[%d] : %s", sql_ret, error);
+                       MTP_LOGE("sqlite3_exec failed, %d, %s", sql_ret, error);
                        ret = MTP_ERROR_DB;
                        sqlite3_free(error);
                }
@@ -335,7 +326,7 @@ static mtp_error_e __create_table(mtp_context *mtp_ctx)
        if (sql != NULL) {
                sql_ret = sqlite3_exec(mtp_ctx->db, sql, NULL, NULL, &error);
                if (sql_ret != SQLITE_OK) {
-                       MTP_LOGE("sqlite3_exec failed, sql_ret[%d] : %s", sql_ret, error);
+                       MTP_LOGE("sqlite3_exec failed, %d, %s", sql_ret, error);
                        ret = MTP_ERROR_DB;
                        sqlite3_free(error);
                }
@@ -357,7 +348,7 @@ mtp_error_e mtp_daemon_db_init(mtp_context *mtp_ctx)
                sql_ret = sqlite3_open_v2(MTP_DB_FILE, &mtp_ctx->db,
                        SQLITE_OPEN_FULLMUTEX | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
                if (sql_ret != SQLITE_OK) {
-                       MTP_LOGE("sqlite3_open_v2 failed, sql_ret[%d]", sql_ret);
+                       MTP_LOGE("sqlite3_open_v2 failed, %d", sql_ret);
                        return MTP_ERROR_DB;
                }
 
@@ -375,7 +366,7 @@ mtp_error_e mtp_daemon_db_deinit(mtp_context *mtp_ctx)
        if (mtp_ctx->db != NULL) {
                sql_ret = sqlite3_close(mtp_ctx->db);
                if (sql_ret != SQLITE_OK) {
-                       MTP_LOGE("sqlite3_close failed, sql_ret[%d]", sql_ret);
+                       MTP_LOGE("sqlite3_close failed, %d", sql_ret);
                        return MTP_ERROR_DB;
                }
                mtp_ctx->db = NULL;
index e118fad..da909ea 100755 (executable)
@@ -37,7 +37,8 @@ typedef enum {
        USB_MAX,
 } usbhost_state;
 
-typedef void (*device_changed_cb)(const char *dev_path, int bus_no, int dev_no, usbhost_state host_status, void *user_data);
+typedef void (*device_changed_cb)(const char *dev_path, int bus_no, int dev_no,
+       usbhost_state host_status, void *user_data);
 
 typedef struct _device_cb_data device_cb_data;
 
@@ -52,22 +53,15 @@ static void __print_device_list(mtp_context *mtp_ctx)
 {
        int slot;
 
-       MTP_LOGI(" ");
-       MTP_LOGI("<------print list------->");
-
        for (slot = 1; slot < MTP_MAX_SLOT; slot++) {
                mtp_device_info *device_info;
                device_info = (mtp_device_info *)mtp_ctx->device_list->device_info_list[slot];
 
-               if (device_info != NULL)
-                       MTP_LOGI("%d. bus %d, dev %d, %s, %p", slot, device_info->bus_location,
-                               device_info->device_number, device_info->model_name, device_info->device);
-               else
-                       MTP_LOGI("empty slot %d", slot);
+               if (device_info != NULL) {
+                       MTP_LOGI("%s: %03d-%03d", device_info->model_name, device_info->bus_location,
+                               device_info->device_number);
+               }
        }
-
-       MTP_LOGI("<------print list end------->");
-       MTP_LOGI(" ");
 }
 
 static int __search_empty_slot(mtp_context *mtp_ctx)
@@ -76,7 +70,6 @@ static int __search_empty_slot(mtp_context *mtp_ctx)
 
        for (slot = 1; slot < MTP_MAX_SLOT; slot++) {
                if (mtp_ctx->device_list->device_info_list[slot] == NULL) {
-                       MTP_LOGI("empty slot: %d", slot);
                        return slot;
                }
        }
@@ -92,8 +85,6 @@ static void __wait_smack_labeling(char *usb_node)
                char label[256] = {0,};
                getxattr(usb_node, "security.SMACK64", label, 256);
 
-               MTP_LOGI("check_count: %d, label: %s", check_count, label);
-
                if (!strcmp(label, "*"))
                        break;
 
@@ -112,16 +103,12 @@ static bool __parsing_usb_devpath(const char *devpath, int *busno, int *devno)
        if (devpath_len < 8)
                return false;
 
-       MTP_LOGI("devpath_len: %d", devpath_len);
-
        strncpy(bus, &devpath[devpath_len - 7], 3);
        strncpy(dev, &devpath[devpath_len - 3], 3);
 
        *busno = atoi(bus);
        *devno = atoi(dev);
 
-       MTP_LOGI("busno: %d, devno: %d, devpath: %s", *busno, *devno, devpath);
-
        return true;
 }
 
@@ -135,19 +122,9 @@ static void __dbus_usb_host_event_cb(GDBusConnection* connection,
 {
        GVariant *tmp;
        const char *devpath = NULL;
-       int state;
-       int vendorid;
-       int productid;
+       int state = -1;
        int busno = 0;
        int devno = 0;
-
-       int baseclass;
-       int subclass;
-       int protocol;
-       const char *manufacturer = NULL;
-       const char *product = NULL;
-       const char *serial = NULL;
-
        gsize size = 0;
        device_cb_data *cb_data = (device_cb_data *)user_data;
        void *usr_cb = cb_data->usr_cb;
@@ -155,43 +132,9 @@ static void __dbus_usb_host_event_cb(GDBusConnection* connection,
 
        tmp = g_variant_get_child_value(parameters, 0);
        state = g_variant_get_int32(tmp);
-       MTP_LOGI("state: %d", state);
 
        tmp = g_variant_get_child_value(parameters, 1);
        devpath = g_variant_get_string(tmp, &size);
-       MTP_LOGI("devpath: %s", devpath);
-
-       tmp = g_variant_get_child_value(parameters, 2);
-       baseclass = g_variant_get_int32(tmp);
-       MTP_LOGI("baseclass: %d", baseclass);
-
-       tmp = g_variant_get_child_value(parameters, 3);
-       subclass = g_variant_get_int32(tmp);
-       MTP_LOGI("subclass: %d", subclass);
-
-       tmp = g_variant_get_child_value(parameters, 4);
-       protocol = g_variant_get_int32(tmp);
-       MTP_LOGI("protocol: %d", protocol);
-
-       tmp = g_variant_get_child_value(parameters, 5);
-       vendorid = g_variant_get_int32(tmp);
-       MTP_LOGI("vendorid: %d", vendorid);
-
-       tmp = g_variant_get_child_value(parameters, 6);
-       productid = g_variant_get_int32(tmp);
-       MTP_LOGI("productid: %d", productid);
-
-       tmp = g_variant_get_child_value(parameters, 7);
-       manufacturer = g_variant_get_string(tmp, &size);
-       MTP_LOGI("manufacturer: %s", manufacturer);
-
-       tmp = g_variant_get_child_value(parameters, 8);
-       product = g_variant_get_string(tmp, &size);
-       MTP_LOGI("product: %s", product);
-
-       tmp = g_variant_get_child_value(parameters, 9);
-       serial = g_variant_get_string(tmp, &size);
-       MTP_LOGI("serial: %s", serial);
 
        if (devpath == NULL) {
                MTP_LOGE("devpath is NULL");
@@ -199,14 +142,12 @@ static void __dbus_usb_host_event_cb(GDBusConnection* connection,
        }
 
        if (__parsing_usb_devpath(devpath, &busno, &devno) == false) {
-               MTP_LOGE("devpath parsing failed: %s", devpath);
+               MTP_LOGE("devpath parsing failed: %s", devpath);
                return;
        }
 
        if (busno > 0 && devno > 0)
                ((device_changed_cb)usr_cb)(devpath, busno, devno, state, usr_data);
-
-       MTP_LOGI("user callback done");
 }
 
 static int __dbus_subscribe_usb_host_event(device_changed_cb usr_callback, void *usr_data)
@@ -214,8 +155,6 @@ static int __dbus_subscribe_usb_host_event(device_changed_cb usr_callback, void
        int ret = MTP_ERROR_NONE;
        GError *error = NULL;
 
-       MTP_LOGI("BEGIN");
-
        g_usb_cb_data = malloc(sizeof(device_cb_data));
        if (g_usb_cb_data == NULL) {
                MTP_LOGE("malloc failed");
@@ -248,8 +187,6 @@ static int __dbus_subscribe_usb_host_event(device_changed_cb usr_callback, void
                                        g_usb_cb_data,
                                        NULL);
 
-       MTP_LOGI("END");
-
        return MTP_ERROR_NONE;
 
 ERROR:
@@ -274,10 +211,8 @@ void __usb_host_status_changed_cb(const char *dev_path, int bus_no, int dev_no,
        LIBMTP_raw_device_t *raw_devices;
        LIBMTP_mtpdevice_t *device;
        mtp_device_info *device_info;
-       int device_count = mtp_ctx->device_list->device_num;
 
-       MTP_LOGI("host_status: %d, bus_no: %d, dev_no: %d, dev_path: %s",
-               host_status, bus_no, dev_no, dev_path);
+       MTP_LOGI("usb status: %d, %03d-%03d", host_status, bus_no, dev_no);
 
        if (host_status == USB_HOST_ADDED) {
                LIBMTP_Detect_Raw_Devices(&raw_devices, &num_of_devices);
@@ -286,18 +221,14 @@ void __usb_host_status_changed_cb(const char *dev_path, int bus_no, int dev_no,
                                int empty_slot = 0;
                                char usb_node[256] = {0,};
 
-                               MTP_LOGI("connected bus_no: %d", bus_no);
-
                                snprintf(usb_node, sizeof(usb_node), "/dev/bus/usb/%03d/%03d",
                                        raw_devices[slot].bus_location, raw_devices[slot].devnum);
 
-                               MTP_LOGI("usb_node : %s", usb_node);
-
                                __wait_smack_labeling(usb_node);
 
                                device = LIBMTP_Open_Raw_Device_Uncached(&raw_devices[slot]);
                                if (device == NULL) {
-                                       MTP_LOGE("Unable to open raw device: %d", slot);
+                                       MTP_LOGE("Unable to open raw device: %s", usb_node);
                                        continue;
                                }
 
@@ -309,8 +240,10 @@ void __usb_host_status_changed_cb(const char *dev_path, int bus_no, int dev_no,
                                device_info->model_name = LIBMTP_Get_Modelname(device);
 
                                empty_slot = __search_empty_slot(mtp_ctx);
-                               if (empty_slot <= 0)
+                               if (empty_slot <= 0) {
+                                       MTP_LOGE("Not enough space in device_list");
                                        continue;
+                               }
 
                                mtp_ctx->device_list->device_info_list[empty_slot] = device_info;
                                mtp_ctx->device_list->device_num++;
@@ -318,25 +251,55 @@ void __usb_host_status_changed_cb(const char *dev_path, int bus_no, int dev_no,
                                g_thread_pool_push(mtp_ctx->device_list->threads, (gpointer)device, NULL);
 
                                mtp_daemon_gdbus_emit_event(MTP_INITIATOR_EVENT_DEVICE_ADDED, empty_slot, mtp_ctx);
+                               __print_device_list(mtp_ctx);
                        }
                }
                g_free(raw_devices);
-               __print_device_list(mtp_ctx);
        } else if (host_status == USB_HOST_REMOVED) {
-               MTP_LOGI("disconnected bus_no: %d, dev_no: %d", bus_no, dev_no);
+               while (1) {
+                       if (g_async_queue_length(mtp_ctx->c_queue) < 0 && mtp_ctx->is_processing == false)
+                               break;
+
+                       MTP_LOGW("queue length: %d, is processing: %d",
+                               g_async_queue_length(mtp_ctx->c_queue), mtp_ctx->is_processing);
+
+                       usleep(200000);
+               }
+
+               mtp_ctx->is_releasing = true;
 
                for (slot = 1; slot < MTP_MAX_SLOT; slot++) {
                        device_info = mtp_ctx->device_list->device_info_list[slot];
-                       if (device_info &&
-                               bus_no == device_info->bus_location &&
-                               dev_no == device_info->device_number &&
-                               device_info->event_loop != NULL) {
-                               MTP_LOGI("Event loop exists. Quit loop.");
-                               g_main_loop_quit(device_info->event_loop);
-                               g_main_loop_unref(device_info->event_loop);
-                               device_info->event_loop = NULL;
+                       if (device_info && bus_no == device_info->bus_location &&
+                               dev_no == device_info->device_number) {
+                               int device_id = -1;
+
+                               device_id = mtp_daemon_util_get_device_id(device_info->device, mtp_ctx);
+                               if (device_id < 0) {
+                                       MTP_LOGE("device_id: %d", device_id);
+                                       return;
+                               }
+
+                               LIBMTP_Release_Device(device_info->device);
+                               mtp_daemon_db_delete(device_id, 0, 0, mtp_ctx);
+
+                               mtp_ctx->device_list->device_num--;
+
+                               g_free(device_info->model_name);
+                               g_free(device_info);
+
+                               mtp_ctx->device_list->device_info_list[device_id] = NULL;
+                               mtp_daemon_gdbus_emit_event(MTP_INITIATOR_EVENT_DEVICE_REMOVED, device_id, mtp_ctx);
+                               __print_device_list(mtp_ctx);
                        }
                }
+
+               mtp_ctx->is_releasing = false;
+       }
+
+       if (mtp_ctx->device_list->device_num == 0) {
+               mtp_daemon_gdbus_emit_event(MTP_INITIATOR_EVENT_TURNED_OFF, 0, mtp_ctx);
+               g_main_loop_quit(mtp_ctx->main_loop);
        }
 }
 
@@ -349,8 +312,6 @@ static void* __event_thread(gpointer dev, gpointer data)
        int device_id = -1;
        mtp_device_info *device_info;
 
-       MTP_LOGI("Event loop is started");
-
        device_id = mtp_daemon_util_get_device_id(device, mtp_ctx);
        if (device_id < 0)
                return NULL;
@@ -359,84 +320,42 @@ static void* __event_thread(gpointer dev, gpointer data)
        if (device_info == NULL)
                return NULL;
 
-       mtp_daemon_gdbus_emit_event(MTP_INITIATOR_EVENT_DEVICE_ADDED, device_id, mtp_ctx);
-
-       if(!strcmp(device_info->model_name, "SM-C200")) {
-               device_info->event_loop = g_main_loop_new(NULL, FALSE);
-               g_main_loop_run(device_info->event_loop);
-       } else {
-               while (LIBMTP_Read_Event(device, &device_event, &param1) == 0) {
-                       MTP_LOGI("device %d device_event is occured %d", device, device_event);
-
-                       if (device_event == LIBMTP_EVENT_STORE_ADDED) {
-                               LIBMTP_Get_Storage(device, LIBMTP_STORAGE_SORTBY_NOTSORTED);
-                       } else if (device_event == LIBMTP_EVENT_STORE_REMOVED) {
-                               if (device_id >= 0)
-                                       mtp_daemon_db_delete(device_id, param1, 0, mtp_ctx);
-                               LIBMTP_Get_Storage(device, LIBMTP_STORAGE_SORTBY_NOTSORTED);
-                       } else if (device_event == LIBMTP_EVENT_OBJECT_REMOVED) {
-                               if (device_id >= 0)
-                                       mtp_daemon_db_delete(device_id, 0, param1, mtp_ctx);
-                       } else if (device_event == LIBMTP_EVENT_OBJECT_ADDED) {
-                               MTPObjectInfo *object_info;
-                               object_info = LIBMTP_Get_Object_Info(device, param1);
-
-                               /* scan db and if exist, then update db */
-                               if (object_info != NULL && device_id >= 0) {
-                                       if (mtp_daemon_db_is_exist(device_id, object_info->StorageID, param1, mtp_ctx) == true) {
-                                               MTP_LOGI("DB Update");
-                                               mtp_daemon_db_update(device_id, param1, object_info, mtp_ctx);
-                                       } else {
-                                               MTP_LOGI("DB Insert");
-                                               mtp_daemon_db_insert(device_id, object_info->StorageID, param1, object_info, mtp_ctx);
-                                       }
+       MTP_LOGI("%s, %03d-%03d event loop start", device_info->model_name,
+               device_info->bus_location, device_info->device_number);
+
+       while (LIBMTP_Read_Event(device, &device_event, &param1) == 0) {
+               MTP_LOGI("%s, %03d-%03d event occurs", device_info->model_name,
+                       device_info->bus_location, device_info->device_number);
+
+               if (device_event == LIBMTP_EVENT_STORE_ADDED) {
+                       LIBMTP_Get_Storage(device, LIBMTP_STORAGE_SORTBY_NOTSORTED);
+               } else if (device_event == LIBMTP_EVENT_STORE_REMOVED) {
+                       if (device_id >= 0)
+                               mtp_daemon_db_delete(device_id, param1, 0, mtp_ctx);
+                       LIBMTP_Get_Storage(device, LIBMTP_STORAGE_SORTBY_NOTSORTED);
+               } else if (device_event == LIBMTP_EVENT_OBJECT_REMOVED) {
+                       if (device_id >= 0)
+                               mtp_daemon_db_delete(device_id, 0, param1, mtp_ctx);
+               } else if (device_event == LIBMTP_EVENT_OBJECT_ADDED) {
+                       MTPObjectInfo *object_info;
+                       object_info = LIBMTP_Get_Object_Info(device, param1);
+
+                       /* scan db and if exist, then update db */
+                       if (object_info != NULL && device_id >= 0) {
+                               if (mtp_daemon_db_is_exist(device_id, object_info->StorageID, param1, mtp_ctx) == true) {
+                                       mtp_daemon_db_update(device_id, param1, object_info, mtp_ctx);
+                               } else {
+                                       mtp_daemon_db_insert(device_id, object_info->StorageID, param1, object_info, mtp_ctx);
                                }
-
-                               g_free(object_info);
                        }
-                       mtp_daemon_gdbus_emit_event(device_event, (int)param1, mtp_ctx);
-               }
-       }
-
-       while (1) {
-               MTP_LOGI("queue length = %d", g_async_queue_length(mtp_ctx->c_queue));
-               MTP_LOGI("is processing = %d", mtp_ctx->is_processing);
 
-               if (g_async_queue_length(mtp_ctx->c_queue) < 0 && mtp_ctx->is_processing == false) {
-                       break;
+                       g_free(object_info);
                }
-
-               usleep(200000);
+               mtp_daemon_gdbus_emit_event(device_event, (int)param1, mtp_ctx);
        }
 
-       mtp_ctx->is_releasing = true;
-
-       MTP_LOGI("device is closing down!! device_id : %d", device_id);
-
-       mtp_daemon_gdbus_emit_event(MTP_INITIATOR_EVENT_DEVICE_REMOVED, device_id, mtp_ctx);
-
-       /* remove the device into device list */
-       MTP_LOGI("remove device from the list!!");
-
-       mtp_ctx->device_list->device_num--;
-
-       LIBMTP_Release_Device(device_info->device);
-       mtp_daemon_db_delete(device_id, 0, 0, mtp_ctx);
-
-       g_free(device_info->model_name);
-       g_free(device_info);
-
-       mtp_ctx->device_list->device_info_list[device_id] = NULL;
-
-       /* TODO : deactivate signal to clients using g_idle_add */
-       __print_device_list(mtp_ctx);
-
-       mtp_ctx->is_releasing = false;
-
-       if (mtp_ctx->device_list->device_num == 0) {
-               mtp_daemon_gdbus_emit_event(MTP_INITIATOR_EVENT_TURNED_OFF, 0, mtp_ctx);
-               g_main_loop_quit(mtp_ctx->main_loop);
-       }
+       MTP_LOGI("%s, %03d-%03d event loop stop", device_info->model_name,
+               device_info->bus_location, device_info->device_number);
 
        return NULL;
 }
@@ -453,7 +372,6 @@ mtp_error_e __device_list_init(mtp_context *mtp_ctx)
 
        LIBMTP_Init();
        LIBMTP_Detect_Raw_Devices(&rawdevices, &numrawdevices);
-       MTP_LOGI("detected device num %d", numrawdevices);
 
        if (numrawdevices == 0) {
                MTP_LOGW("MTP Host have not any mtp device");
@@ -469,14 +387,12 @@ mtp_error_e __device_list_init(mtp_context *mtp_ctx)
 
                snprintf(usb_node, sizeof(usb_node), "/dev/bus/usb/%03d/%03d",
                        rawdevices[device_index].bus_location, rawdevices[device_index].devnum);
-
-               MTP_LOGI("usb_node : %s", usb_node);
-
+               
                __wait_smack_labeling(usb_node);
 
                device = LIBMTP_Open_Raw_Device_Uncached(&rawdevices[device_index]);
                if (device == NULL) {
-                       MTP_LOGE("Unable to open raw device[%d]", device_index);
+                       MTP_LOGE("Unable to open raw device : %s", usb_node);
                        continue;
                }
 
@@ -486,23 +402,25 @@ mtp_error_e __device_list_init(mtp_context *mtp_ctx)
                device_info->bus_location = rawdevices[device_index].bus_location;
                device_info->device_number = rawdevices[device_index].devnum;
                device_info->model_name = LIBMTP_Get_Modelname(device);
+               char *device_version = LIBMTP_Get_Deviceversion(device);
 
-               if (device_info->model_name == NULL) {
-                       MTP_LOGE("Device: (NULL)");
-                       device_info->model_name = strdup(tmp_name);
+               MTP_LOGI("Device version : %s", device_version);
+               if (!strncmp(device_version, "SM", 2) && strlen(device_version) > 25) {
+                       device_info->stitching_engine_version = g_strndup(&device_version[21], 4);
+                       MTP_LOGI("stitching engine version : %s", device_info->stitching_engine_version);
                }
-               MTP_LOGI("Device: %s, Bus: %d DevNo: %d", device_info->model_name, device_info->bus_location, device_info->device_number);
+
+               if (device_info->model_name == NULL)
+                       device_info->model_name = strdup(tmp_name);
 
                empty_slot = __search_empty_slot(mtp_ctx);
-               if (empty_slot < 0)
+               if (empty_slot < 0) {
+                       MTP_LOGE("Not enough space in device_list");
                        continue;
+               }
 
                mtp_ctx->device_list->device_info_list[empty_slot] = device_info;
                mtp_ctx->device_list->device_num++;
-
-               /*MTP_LOGI("mtp_ctx Device: %s, mtp_ctx Bus: %d",
-                       mtp_ctx->device_list->device_info_list[empty_slot]->model_name,
-                       mtp_ctx->device_list->device_info_list[empty_slot]->bus_location);*/
        }
        g_free(rawdevices);
 
@@ -536,7 +454,6 @@ int usb_host_unset_event_cb(void)
 mtp_error_e mtp_daemon_event_init(mtp_context *mtp_ctx)
 {
        int slot;
-       mtp_error_e ret = MTP_ERROR_NONE;
 
        RETV_IF(mtp_ctx == NULL, MTP_ERROR_INVALID_PARAMETER);
 
@@ -544,7 +461,8 @@ mtp_error_e mtp_daemon_event_init(mtp_context *mtp_ctx)
                mtp_ctx->device_list->device_info_list[slot] = NULL;
 
        /* mtp device list init */
-       __device_list_init(mtp_ctx);
+       if (__device_list_init(mtp_ctx) != MTP_ERROR_NONE)
+               return MTP_ERROR_NO_DEVICE;
 
        /* usb event setting */
        usb_host_set_event_cb(__usb_host_status_changed_cb, mtp_ctx);
@@ -559,20 +477,10 @@ mtp_error_e mtp_daemon_event_init(mtp_context *mtp_ctx)
                device_info = (mtp_device_info *)mtp_ctx->device_list->device_info_list[slot];
 
                if (device_info != NULL) {
-                       MTP_LOGI("%d. bus %d, dev %d, %p", slot, device_info->bus_location,
-                               device_info->device_number, device_info->device);
-
                        g_thread_pool_push(mtp_ctx->device_list->threads,
                                (gpointer) device_info->device, NULL);
                }
        }
 
-       MTP_LOGI("number of Devices and Thread is %d", mtp_ctx->device_list->device_num);
-
-       if (mtp_ctx->device_list->device_num == 0) {
-               MTP_LOGW("No Device !!");
-               return MTP_ERROR_NO_DEVICE;
-       }
-
-       return ret;
+       return MTP_ERROR_NONE;
 }
index 72f2135..4dbb07b 100755 (executable)
@@ -22,6 +22,7 @@
 #include "mtp_daemon_gdbus_deviceinfo.h"
 #include "mtp_daemon_gdbus_storageinfo.h"
 #include "mtp_daemon_gdbus_objectinfo.h"
+#include "mtp_daemon_util.h"
 
 static gboolean __manager_init(mtp_context *mtp_ctx)
 {
@@ -145,6 +146,12 @@ static gboolean __deviceinfo_init(mtp_context *mtp_ctx)
                        G_CALLBACK(deviceinfo_get_device_number),
                        mtp_ctx);
 
+       g_signal_connect(
+                       deviceinfo_skeleton,
+                       "handle-get-stitching-engine-version",
+                       G_CALLBACK(deviceinfo_get_stitching_engine_version),
+                       mtp_ctx);
+
        deviceinfo = g_dbus_object_manager_server_new(MTP_DBUS_DEVICEINFO_PATH);
 
        /* Set connection to 'deviceinfo' */
@@ -272,8 +279,6 @@ static void on_bus_acquired(GDBusConnection *connection,
 {
        mtp_context* mtp_ctx = (mtp_context*)user_data;
 
-       MTP_LOGI("path: %s", path);
-
        mtp_ctx->connection = connection;
 
        if (__manager_init(mtp_ctx) == FALSE) {
@@ -298,24 +303,33 @@ static void on_name_acquired(GDBusConnection *connection,
                        const gchar *name,
                        gpointer user_data)
 {
+       int slot;
+       int device_id = -1;
+       mtp_device_info *device_info;
        mtp_context* mtp_ctx = (mtp_context*)user_data;
 
-       MTP_LOGI("name: %s", name);
+       MTP_LOGI("mtp initiator is initialized : %d",  mtp_ctx->device_list->device_num);
+
+       /* event emit */
+       for (slot = 1; slot < MTP_MAX_SLOT; slot++) {
+               device_info = mtp_ctx->device_list->device_info_list[slot];
+               if (device_info == NULL)
+                       continue;
 
-       if (mtp_daemon_event_init(mtp_ctx) != MTP_ERROR_NONE)
-               g_main_loop_quit(mtp_ctx->main_loop);
+               mtp_daemon_gdbus_emit_event(MTP_INITIATOR_EVENT_DEVICE_ADDED, slot, mtp_ctx);
+       }
 }
 
 static void on_name_lost(GDBusConnection *connnection,
                        const gchar *name,
                        gpointer user_data)
 {
-       MTP_LOGI("name : %s", name);
+       MTP_LOGE("on_name_lost : %s", name);
 }
 
 mtp_error_e mtp_daemon_gdbus_init(mtp_context *mtp_ctx)
 {
-       mtp_ctx->bus_id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
+       g_bus_own_name(G_BUS_TYPE_SYSTEM,
                MTP_DBUS_SERVICE,
                G_BUS_NAME_OWNER_FLAGS_NONE,
                on_bus_acquired,
@@ -324,8 +338,6 @@ mtp_error_e mtp_daemon_gdbus_init(mtp_context *mtp_ctx)
                mtp_ctx,
                NULL);
 
-       MTP_LOGI("mtp_ctx->bus_id: %d", mtp_ctx->bus_id);
-
        return MTP_ERROR_NONE;
 }
 
index 6f35f12..73d700d 100755 (executable)
@@ -34,8 +34,6 @@ static void __deviceinfo_get_manufacturer_name_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -46,12 +44,12 @@ static void __deviceinfo_get_manufacturer_name_thread_func(gpointer user_data)
                /* do process */
                name = LIBMTP_Get_Manufacturername(device);
        } else {
-               MTP_LOGE("!!! no MTP device");
-               name = strdup("No Device");
+               name = strdup("N/A");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
-       MTP_LOGI("name: %s, device handle: %p", name, device);
+       MTP_LOGI("manufacturer name: %s", name);
 
        mtp_gdbuslib_deviceinfo_complete_get_manufacturer_name(param->object,
                param->invocation, name, result);
@@ -78,8 +76,6 @@ static void __deviceinfo_get_model_name_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -90,12 +86,12 @@ static void __deviceinfo_get_model_name_thread_func(gpointer user_data)
                /* do process */
                name = LIBMTP_Get_Modelname(device);
        } else {
-               MTP_LOGE("!!! no MTP device");
-               name = strdup("No Device");
+               name = strdup("N/A");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
-       MTP_LOGI("name: %s, device handle: %p", name, device);
+       MTP_LOGI("model name: %s", name);
 
        mtp_gdbuslib_deviceinfo_complete_get_model_name(param->object,
                param->invocation, name, result);
@@ -120,8 +116,6 @@ static void __deviceinfo_get_serial_number_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -132,12 +126,12 @@ static void __deviceinfo_get_serial_number_thread_func(gpointer user_data)
                /* do process */
                number = LIBMTP_Get_Serialnumber(device);
        } else {
-               MTP_LOGE("!!! no MTP device");
-               number = strdup("No Device");
+               number = strdup("N/A");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
-       MTP_LOGI("name: %s, device handle: %p", number, device);
+       MTP_LOGI("serial number: %s", number);
 
        mtp_gdbuslib_deviceinfo_complete_get_serial_number(param->object,
                param->invocation, number, result);
@@ -162,8 +156,6 @@ static void __deviceinfo_get_device_version_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -174,12 +166,12 @@ static void __deviceinfo_get_device_version_thread_func(gpointer user_data)
                /* do process */
                version = LIBMTP_Get_Deviceversion(device);
        } else {
-               MTP_LOGE("!!! no MTP device");
-               version = strdup("No Device");
+               version = strdup("N/A");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
-       MTP_LOGI("version: %s, device handle: %p", version, device);
+       MTP_LOGI("device version: %s", version);
 
        mtp_gdbuslib_deviceinfo_complete_get_device_version(param->object,
                param->invocation, version, result);
@@ -195,7 +187,6 @@ static void __deviceinfo_get_bus_location_thread_func(gpointer user_data)
 {
        mtp_param *param = (mtp_param *)user_data;
        mtp_error_e result = MTP_ERROR_NONE;
-       LIBMTP_mtpdevice_t *device = NULL;
        mtp_device_info *device_info;
        int device_id;
        int bus_location = 0;
@@ -204,8 +195,6 @@ static void __deviceinfo_get_bus_location_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -213,11 +202,11 @@ static void __deviceinfo_get_bus_location_thread_func(gpointer user_data)
        if (device_info != NULL) {
                bus_location = device_info->bus_location;
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
-       MTP_LOGI("bus location: %d, device handle: %p", bus_location, device);
+       MTP_LOGI("bus location: %d", bus_location);
 
        mtp_gdbuslib_deviceinfo_complete_get_bus_location(param->object,
                param->invocation, bus_location, result);
@@ -232,7 +221,6 @@ static void __deviceinfo_get_device_number_thread_func(gpointer user_data)
 {
        mtp_param *param = (mtp_param *)user_data;
        mtp_error_e result = MTP_ERROR_NONE;
-       LIBMTP_mtpdevice_t *device = NULL;
        mtp_device_info *device_info;
        int device_id = 0;
        int device_number = 0;
@@ -241,8 +229,6 @@ static void __deviceinfo_get_device_number_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -250,11 +236,11 @@ static void __deviceinfo_get_device_number_thread_func(gpointer user_data)
        if (device_info != NULL) {
                device_number = device_info->device_number;
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
-       MTP_LOGI("device number : %d, device handle: %p", device_number, device);
+       MTP_LOGI("device number: %d", device_number);
 
        mtp_gdbuslib_deviceinfo_complete_get_device_number(param->object,
                param->invocation, device_number, result);
@@ -265,6 +251,41 @@ static void __deviceinfo_get_device_number_thread_func(gpointer user_data)
        g_free(param);
 }
 
+static void __deviceinfo_get_stitching_engine_version_thread_func(gpointer user_data)
+{
+       mtp_param *param = (mtp_param *)user_data;
+       mtp_error_e result = MTP_ERROR_NONE;
+       mtp_device_info *device_info;
+       int device_id = 0;
+       char* stitching_engine_version = NULL;
+
+       g_assert(param != NULL);
+       g_assert(param->object != NULL);
+       g_assert(param->invocation != NULL);
+
+       /* parameter unpacking */
+       device_id = param->param1;
+       device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
+
+       if (device_info != NULL) {
+               if (device_info->stitching_engine_version != NULL)
+                       stitching_engine_version = strdup(device_info->stitching_engine_version);
+       } else {
+               MTP_LOGE("No MTP device");
+               result = MTP_ERROR_NO_DEVICE;
+       }
+
+       MTP_LOGI("stitching_engine_version : %s", stitching_engine_version);
+
+       mtp_gdbuslib_deviceinfo_complete_get_stitching_engine_version(param->object,
+               param->invocation, stitching_engine_version, result);
+
+       /* deinitializing */
+       g_object_unref(param->invocation);
+       g_object_unref(param->object);
+       g_free(param);
+}
+
 gboolean deviceinfo_get_manufacturer_name(
                mtpgdbuslibDeviceinfo *deviceinfo,
                GDBusMethodInvocation *invocation,
@@ -274,9 +295,6 @@ gboolean deviceinfo_get_manufacturer_name(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -292,7 +310,7 @@ gboolean deviceinfo_get_manufacturer_name(
        if (mtp_daemon_controller_push(__deviceinfo_get_manufacturer_name_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -323,9 +341,6 @@ gboolean deviceinfo_get_model_name(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -341,7 +356,7 @@ gboolean deviceinfo_get_model_name(
        if (mtp_daemon_controller_push(__deviceinfo_get_model_name_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -371,9 +386,6 @@ gboolean deviceinfo_get_serial_number(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -389,7 +401,7 @@ gboolean deviceinfo_get_serial_number(
        if (mtp_daemon_controller_push(__deviceinfo_get_serial_number_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -419,9 +431,6 @@ gboolean deviceinfo_get_device_version(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -437,7 +446,7 @@ gboolean deviceinfo_get_device_version(
        if (mtp_daemon_controller_push(__deviceinfo_get_device_version_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -467,9 +476,6 @@ gboolean deviceinfo_get_bus_location(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -485,7 +491,7 @@ gboolean deviceinfo_get_bus_location(
        if (mtp_daemon_controller_push(__deviceinfo_get_bus_location_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -515,9 +521,6 @@ gboolean deviceinfo_get_device_number(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -533,7 +536,7 @@ gboolean deviceinfo_get_device_number(
        if (mtp_daemon_controller_push(__deviceinfo_get_device_number_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -554,3 +557,48 @@ OUT:
        return TRUE;
 }
 
+gboolean deviceinfo_get_stitching_engine_version(
+               mtpgdbuslibDeviceinfo *deviceinfo,
+               GDBusMethodInvocation *invocation,
+               gint handle,
+               gpointer user_data)
+{
+       mtp_param *param = NULL;
+       gint result = MTP_ERROR_NONE;
+
+       param = g_try_new0(mtp_param, 1);
+       if (param == NULL) {
+               MTP_LOGE("Memory allocation failed");
+               result = MTP_ERROR_OUT_OF_MEMORY;
+               goto OUT;
+       }
+
+       param->object = g_object_ref(deviceinfo);
+       param->invocation = g_object_ref(invocation);
+       param->mtp_ctx = (mtp_context *)user_data;
+       param->param1 = handle;
+
+       if (mtp_daemon_controller_push(__deviceinfo_get_stitching_engine_version_thread_func,
+               param, param->mtp_ctx) != MTP_ERROR_NONE) {
+               /* return error if queue was blocked */
+               MTP_LOGE("controller is processing important message");
+               result = MTP_ERROR_CONTROLLER;
+
+               goto OUT;
+       }
+
+       return TRUE;
+
+OUT:
+       if (param != NULL) {
+               g_object_unref(param->invocation);
+               g_object_unref(param->object);
+
+               g_free(param);
+       }
+
+       mtp_gdbuslib_deviceinfo_complete_get_stitching_engine_version(deviceinfo, invocation, 0, result);
+
+       return TRUE;
+}
+
index 88abbe4..fcacf6b 100755 (executable)
@@ -41,8 +41,6 @@ static void __manager_get_devices_thread_func(gpointer user_data)
        g_assert(param->invocation != NULL);
        g_assert(param->mtp_ctx != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        object = (mtpgdbuslibManager *)(param->object);
 
@@ -50,7 +48,6 @@ static void __manager_get_devices_thread_func(gpointer user_data)
        g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
        count = param->mtp_ctx->device_list->device_num;
-       MTP_LOGI("devices_num: %d", count);
 
        for (slot = 1; slot < MTP_MAX_SLOT; slot++) {
                mtp_device_info *device_info;
@@ -63,14 +60,13 @@ static void __manager_get_devices_thread_func(gpointer user_data)
                                g_variant_new_int32(slot));
 
                        g_variant_builder_close(&b);
-
-                       MTP_LOGI("mtp_device : %d, bus_location: %d, device_number : %d",
-                               slot, device_info->bus_location, device_info->device_number);
                }
        }
 
        gv = g_variant_builder_end(&b);
 
+       MTP_LOGI("devices_num: %d", count);
+
        mtp_gdbuslib_manager_complete_get_devices(object, param->invocation, count, gv, result);
 
        /* deinitializing */
@@ -99,8 +95,6 @@ static void __manager_get_storages_thread_func(gpointer user_data)
        g_assert(param->invocation != NULL);
        g_assert(param->mtp_ctx != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -108,15 +102,11 @@ static void __manager_get_storages_thread_func(gpointer user_data)
        if (device_info != NULL)
                device = (LIBMTP_mtpdevice_t *)device_info->device;
 
-       MTP_LOGI("device_id: %d, device: %p", device_id, device);
-
        /* loop over storages */
        g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
        if (device_info != NULL) {
                for (storage = device->storage; storage != NULL; storage = storage->next) {
-                       MTP_LOGI("storage: %p", storage);
-
                        g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
 
                        g_variant_builder_add(&b, "{sv}", "mtp_storage",
@@ -127,7 +117,6 @@ static void __manager_get_storages_thread_func(gpointer user_data)
                        count++;
                }
        } else {
-               MTP_LOGE("!!! no MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
@@ -171,8 +160,6 @@ static void __manager_get_object_handles_thread_func(gpointer user_data)
        g_assert(param->invocation != NULL);
        g_assert(param->mtp_ctx != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        mtp_storage = param->param2;
@@ -202,8 +189,8 @@ static void __manager_get_object_handles_thread_func(gpointer user_data)
                goto END;
        }
 
-       MTP_LOGI("device_id: %d, storage id: %d, format: %d, parent: %d, device: %p",
-               param->param1, param->param2, param->param3, param->param4, device);
+       MTP_LOGI("device_id: %d, storage id: %d, format: %d, parent: %d",
+               param->param1, param->param2, param->param3, param->param4);
 
        if (parent_object_handle > 0) {
                MTPObjectInfo *object_info = NULL;
@@ -269,7 +256,7 @@ static void __manager_get_object_handles_thread_func(gpointer user_data)
 END:
        gv = g_variant_builder_end(&b);
 
-       MTP_LOGI("Real object_num: %d", target_object_num);
+       MTP_LOGI("object_num: %d", target_object_num);
 
        mtp_gdbuslib_manager_complete_get_object_handles(param->object,
                param->invocation, target_object_num, gv, result);
@@ -302,8 +289,6 @@ static void __manager_get_object_thread_func(gpointer user_data)
        g_assert(param->invocation != NULL);
        g_assert(param->mtp_ctx != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        object_handle = param->param2;
@@ -313,7 +298,7 @@ static void __manager_get_object_thread_func(gpointer user_data)
 
        if (device_info != NULL) {
                device = (LIBMTP_mtpdevice_t *)device_info->device;
-               MTP_LOGI("device_id: %d, device: %p, dest_path: %s", device_id, device, dest_path);
+               MTP_LOGI("device_id: %d, oh: %d, dest_path: %s", device_id, object_handle, dest_path);
 
                /* file remove */
                unlink(dest_path);
@@ -335,7 +320,7 @@ static void __manager_get_object_thread_func(gpointer user_data)
                        close(fd);
                }
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
@@ -374,8 +359,6 @@ static void __manager_get_partial_object_thread_func(gpointer user_data)
        g_assert(param->invocation != NULL);
        g_assert(param->mtp_ctx != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        object_handle = param->param2;
@@ -387,7 +370,6 @@ static void __manager_get_partial_object_thread_func(gpointer user_data)
 
        if (device_info != NULL) {
                device = (LIBMTP_mtpdevice_t *)device_info->device;
-               MTP_LOGI("device_id: %d, device: %p, oh : %d, dest_path: %s", device_id, device, object_handle, dest_path);
 
                /* file remove */
                unlink(dest_path);
@@ -399,9 +381,7 @@ static void __manager_get_partial_object_thread_func(gpointer user_data)
                        MTP_LOGE("file open fail - fd: %d, dest_path: %s", fd, dest_path);
                        result = MTP_ERROR_IO_ERROR;
                } else {
-                       MTP_LOGI("offset : %d, max_bytes : %d", offset, max_bytes);
                        ret = LIBMTP_GetPartialObject(device, object_handle, (uint32_t)offset, (uint32_t)max_bytes, &data, &actual_written);
-                       MTP_LOGI("actual_written : %d", actual_written);
 
                        if (ret == 0) {
                                ret = write(fd, data, actual_written);
@@ -412,10 +392,13 @@ static void __manager_get_partial_object_thread_func(gpointer user_data)
                                result = MTP_ERROR_PLUGIN_FAIL;
                        }
 
+                       if (data != NULL)
+                               free (data);
+
                        close(fd);
                }
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
@@ -452,8 +435,6 @@ static void __manager_get_thumbnail_thread_func(gpointer user_data)
        g_assert(param->invocation != NULL);
        g_assert(param->mtp_ctx != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        object_handle = param->param2;
@@ -463,7 +444,6 @@ static void __manager_get_thumbnail_thread_func(gpointer user_data)
 
        if (device_info != NULL) {
                device = (LIBMTP_mtpdevice_t *)device_info->device;
-               MTP_LOGI("device_id: %d, device: %p, dest_path: %s", device_id, device, dest_path);
 
                /* file remove */
                unlink(dest_path);
@@ -488,10 +468,13 @@ static void __manager_get_thumbnail_thread_func(gpointer user_data)
                                result = MTP_ERROR_PLUGIN_FAIL;
                        }
 
+                       if (thumb_data != NULL)
+                               free (thumb_data);
+
                        close(fd);
                }
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
@@ -524,8 +507,6 @@ static void __manager_delete_object_thread_func(gpointer user_data)
        g_assert(param->invocation != NULL);
        g_assert(param->mtp_ctx != NULL);
 
-       MTP_LOGI("%s", __func__);
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -533,15 +514,13 @@ static void __manager_delete_object_thread_func(gpointer user_data)
        if (device_info != NULL) {
                device = (LIBMTP_mtpdevice_t *)device_info->device;
 
-               MTP_LOGI("device_id: %d, device: %p", device_id, device);
-
                object_handle = param->param2;
 
                ret = LIBMTP_Delete_Object(device, object_handle);
                if (ret != 0)
                        result = MTP_ERROR_PLUGIN_FAIL;
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
@@ -563,9 +542,6 @@ gboolean manager_get_devices(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -580,7 +556,7 @@ gboolean manager_get_devices(
        if (mtp_daemon_controller_push(__manager_get_devices_thread_func, param, param->mtp_ctx)
                != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -610,9 +586,6 @@ gboolean manager_get_storages(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -628,7 +601,7 @@ gboolean manager_get_storages(
        if (mtp_daemon_controller_push(__manager_get_storages_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -662,9 +635,6 @@ gboolean manager_get_object_handles(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       /*MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));*/
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -683,7 +653,7 @@ gboolean manager_get_object_handles(
        if (mtp_daemon_controller_push(__manager_get_object_handles_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -716,9 +686,6 @@ gboolean manager_get_object(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       /*MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));*/
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -736,7 +703,7 @@ gboolean manager_get_object(
        if (mtp_daemon_controller_push(__manager_get_object_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -770,8 +737,6 @@ gboolean manager_get_partial_object(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       /*MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));*/
 
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
@@ -792,7 +757,7 @@ gboolean manager_get_partial_object(
        if (mtp_daemon_controller_push(__manager_get_partial_object_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -824,8 +789,6 @@ gboolean manager_get_thumbnail(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       /*MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));*/
 
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
@@ -844,7 +807,7 @@ gboolean manager_get_thumbnail(
        if (mtp_daemon_controller_push(__manager_get_thumbnail_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -878,9 +841,6 @@ gboolean manager_delete_object(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -897,7 +857,7 @@ gboolean manager_delete_object(
        if (mtp_daemon_controller_push(__manager_delete_object_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
index 99682ba..b4c3d31 100755 (executable)
@@ -35,8 +35,6 @@ static void __objectinfo_get_property_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        object_handle = param->param2;
@@ -45,7 +43,6 @@ static void __objectinfo_get_property_thread_func(gpointer user_data)
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
 
        if (device_info != NULL) {
-               MTP_LOGI("Get property start - property %d", property);
                mtp_device = (LIBMTP_mtpdevice_t *)device_info->device;
 
                object_info = LIBMTP_Get_Object_Info(mtp_device, object_handle);
@@ -101,13 +98,13 @@ static void __objectinfo_get_property_thread_func(gpointer user_data)
                                property_value = 0;
                                break;
                        }
-                       MTP_LOGI("Get property end, value is %d", property_value);
+                       MTP_LOGI("property value is %d", property_value);
                } else {
                        property_value = -999;
-                       MTP_LOGE("object_info is NULL!!");
+                       MTP_LOGE("object_info is NULL");
                }
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                property_value = -999;
                result = MTP_ERROR_NO_DEVICE;
        }
@@ -138,8 +135,6 @@ static void __objectinfo_get_property_string_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        object_handle = param->param2;
@@ -148,7 +143,6 @@ static void __objectinfo_get_property_string_thread_func(gpointer user_data)
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
 
        if (device_info != NULL) {
-               MTP_LOGI("Get property start - property %d", property);
                mtp_device = (LIBMTP_mtpdevice_t *)device_info->device;
 
                object_info = LIBMTP_Get_Object_Info(mtp_device, object_handle);
@@ -165,13 +159,13 @@ static void __objectinfo_get_property_string_thread_func(gpointer user_data)
                                property_value = NULL;
                                break;
                        }
-                       MTP_LOGI("Get property end, value is %d", property_value);
+                       MTP_LOGI("property_value is %d", property_value);
                } else {
                        property_value = NULL;
-                       MTP_LOGE("object_info is NULL!!");
+                       MTP_LOGE("object_info is NULL");
                }
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                property_value = NULL;
                result = MTP_ERROR_NO_DEVICE;
        }
@@ -197,9 +191,6 @@ gboolean objectinfo_get_property(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -217,7 +208,7 @@ gboolean objectinfo_get_property(
        if (mtp_daemon_controller_push(__objectinfo_get_property_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -251,9 +242,6 @@ gboolean objectinfo_get_property_string(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -271,7 +259,7 @@ gboolean objectinfo_get_property_string(
        if (mtp_daemon_controller_push(__objectinfo_get_property_string_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
index c07c5cc..3185668 100755 (executable)
@@ -33,8 +33,6 @@ static void __storageinfo_get_description_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -43,7 +41,7 @@ static void __storageinfo_get_description_thread_func(gpointer user_data)
                device = (LIBMTP_mtpdevice_t *)device_info->device;
 
                mtp_storage = param->param2;
-               MTP_LOGI("device_id: %d, device: %p, mtp_storage: %d", device_id, device, mtp_storage);
+
 
                storage = mtp_daemon_util_get_storage_handle(device,
                        mtp_storage, param->mtp_ctx);
@@ -51,9 +49,10 @@ static void __storageinfo_get_description_thread_func(gpointer user_data)
                if (storage)
                        name = storage->StorageDescription;
 
-               MTP_LOGI("StorageDescription: %s, storage handle: %p", name, storage);
+               MTP_LOGI("device_id: %d, mtp_storage: %d, StorageDescription: %s",
+                       device_id, mtp_storage, name);
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
@@ -80,8 +79,6 @@ static void __storageinfo_get_freespace_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -90,7 +87,7 @@ static void __storageinfo_get_freespace_thread_func(gpointer user_data)
                device = (LIBMTP_mtpdevice_t *)device_info->device;
 
                mtp_storage = param->param2;
-               MTP_LOGI("device_id: %d, device: %p, mtp_storage: %d", device_id, device, mtp_storage);
+
 
                storage = mtp_daemon_util_get_storage_handle(device,
                        mtp_storage, param->mtp_ctx);
@@ -98,9 +95,10 @@ static void __storageinfo_get_freespace_thread_func(gpointer user_data)
                if (storage)
                        value = storage->FreeSpaceInBytes;
 
-               MTP_LOGI("FreeSpaceInBytes: %llu, storage handle: %p", value, storage);
+               MTP_LOGI("device_id: %d, mtp_storage: %d, FreeSpaceInBytes: %llu",
+                       device_id, mtp_storage, value);
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
@@ -127,8 +125,6 @@ static void __storageinfo_get_maxcapacity_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -137,7 +133,6 @@ static void __storageinfo_get_maxcapacity_thread_func(gpointer user_data)
                device = (LIBMTP_mtpdevice_t *)device_info->device;
 
                mtp_storage = param->param2;
-               MTP_LOGI("device_id: %d, device: %p, mtp_storage: %d", device_id, device, mtp_storage);
 
                storage = mtp_daemon_util_get_storage_handle(device,
                        mtp_storage, param->mtp_ctx);
@@ -145,9 +140,10 @@ static void __storageinfo_get_maxcapacity_thread_func(gpointer user_data)
                if (storage)
                        value = storage->MaxCapacity;
 
-               MTP_LOGI("MaxCapacity: %llu, storage handle: %p", value, storage);
+               MTP_LOGI("device_id: %d, mtp_storage: %d, MaxCapacity: %llu",
+                       device_id, mtp_storage, value);
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
@@ -174,8 +170,6 @@ static void __storageinfo_get_storagetype_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -184,7 +178,6 @@ static void __storageinfo_get_storagetype_thread_func(gpointer user_data)
                device = (LIBMTP_mtpdevice_t *)device_info->device;
 
                mtp_storage = param->param2;
-               MTP_LOGI("device_id: %d, device: %p, mtp_storage: %d", device_id, device, mtp_storage);
 
                storage = mtp_daemon_util_get_storage_handle(device,
                        mtp_storage, param->mtp_ctx);
@@ -192,9 +185,10 @@ static void __storageinfo_get_storagetype_thread_func(gpointer user_data)
                if (storage)
                        value = storage->StorageType;
 
-               MTP_LOGI("StorageType: %d, storage handle: %p", value, storage);
+               MTP_LOGI("device_id: %d, mtp_storage: %d, StorageType: %d",
+                       device_id, mtp_storage, value);
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
@@ -221,8 +215,6 @@ static void __storageinfo_get_volumeidentifier_thread_func(gpointer user_data)
        g_assert(param->object != NULL);
        g_assert(param->invocation != NULL);
 
-       /*MTP_LOGI("%s", __func__);*/
-
        /* parameter unpacking */
        device_id = param->param1;
        device_info = (mtp_device_info *)param->mtp_ctx->device_list->device_info_list[device_id];
@@ -231,7 +223,6 @@ static void __storageinfo_get_volumeidentifier_thread_func(gpointer user_data)
                device = (LIBMTP_mtpdevice_t *)device_info->device;
 
                mtp_storage = param->param2;
-               MTP_LOGI("device_id: %d, device: %p, mtp_storage: %d", device_id, device, mtp_storage);
 
                storage = mtp_daemon_util_get_storage_handle(device,
                        mtp_storage, param->mtp_ctx);
@@ -239,9 +230,10 @@ static void __storageinfo_get_volumeidentifier_thread_func(gpointer user_data)
                if (storage)
                        name = storage->VolumeIdentifier;
 
-               MTP_LOGI("VolumeIdentifier: %s, storage handle: %p", name, storage);
+               MTP_LOGI("device_id: %d, mtp_storage: %d, VolumeIdentifier: %s",
+                       device_id, mtp_storage, name);
        } else {
-               MTP_LOGE("!!! no MTP device");
+               MTP_LOGE("No MTP device");
                result = MTP_ERROR_NO_DEVICE;
        }
 
@@ -263,9 +255,6 @@ gboolean storageinfo_get_description(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -282,7 +271,7 @@ gboolean storageinfo_get_description(
        if (mtp_daemon_controller_push(__storageinfo_get_description_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -313,9 +302,6 @@ gboolean storageinfo_get_freespace(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -332,7 +318,7 @@ gboolean storageinfo_get_freespace(
        if (mtp_daemon_controller_push(__storageinfo_get_freespace_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -363,9 +349,6 @@ gboolean storageinfo_get_maxcapacity(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -382,7 +365,7 @@ gboolean storageinfo_get_maxcapacity(
        if (mtp_daemon_controller_push(__storageinfo_get_maxcapacity_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -413,9 +396,6 @@ gboolean storageinfo_get_storagetype(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -432,7 +412,7 @@ gboolean storageinfo_get_storagetype(
        if (mtp_daemon_controller_push(__storageinfo_get_storagetype_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
@@ -463,9 +443,6 @@ gboolean storageinfo_get_volumeidentifier(
        mtp_param *param = NULL;
        gint result = MTP_ERROR_NONE;
 
-       MTP_LOGI(">>> REQUEST from [%s]",
-               g_dbus_method_invocation_get_sender(invocation));
-
        param = g_try_new0(mtp_param, 1);
        if (param == NULL) {
                MTP_LOGE("Memory allocation failed");
@@ -482,7 +459,7 @@ gboolean storageinfo_get_volumeidentifier(
        if (mtp_daemon_controller_push(__storageinfo_get_volumeidentifier_thread_func,
                param, param->mtp_ctx) != MTP_ERROR_NONE) {
                /* return error if queue was blocked */
-               MTP_LOGE("controller is processing important message..");
+               MTP_LOGE("controller is processing important message");
                result = MTP_ERROR_CONTROLLER;
 
                goto OUT;
index 7d8cf9a..84ef545 100755 (executable)
@@ -21,9 +21,6 @@ LIBMTP_devicestorage_t *mtp_daemon_util_get_storage_handle(
 {
        LIBMTP_devicestorage_t *storage = NULL;
        int slot;
-       int device_num = mtp_ctx->device_list->device_num;
-
-       MTP_LOGI("device_num: %d", device_num);
 
        /* search device */
        for (slot = 1; slot < MTP_MAX_SLOT; slot++) {
@@ -45,16 +42,12 @@ int mtp_daemon_util_get_device_id(LIBMTP_mtpdevice_t *device, mtp_context *mtp_c
 {
        int slot;
 
-       MTP_LOGI("device: %p, device_num: %d", device, mtp_ctx->device_list->device_num);
-
        for (slot = 1; slot < MTP_MAX_SLOT; slot++) {
                mtp_device_info *device_info;
                device_info = mtp_ctx->device_list->device_info_list[slot];
 
-               if (device_info != NULL && device_info->device == device) {
-                       MTP_LOGI("device id: %d", slot);
+               if (device_info != NULL && device_info->device == device)
                        return slot;
-               }
        }
 
        return -1;
index f497f7e..fd16a54 100755 (executable)
                        <arg type="i" name="device_number" direction="out" />
                        <arg type="i" name="result" direction="out" />
                </method>
+
+               <method name="GetStitchingEngineVersion">
+                       <arg type="i" name="mtp_device" direction="in" />
+                       <arg type="s" name="stitching_engine_version" direction="out" />
+                       <arg type="i" name="result" direction="out" />
+               </method>
        </interface>
        <interface name="org.tizen.mtp.storageinfo">
                <method name="GetDescription">