Remove unnecessary delay 11/316111/1
authorJihoon Jung <jh8801.jung@samsung.com>
Tue, 10 Dec 2024 08:41:13 +0000 (17:41 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Tue, 10 Dec 2024 08:41:13 +0000 (17:41 +0900)
Change-Id: I803303baf5283eb1ecd826d26387db95239e3834
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
src/daemon/mtp_daemon_event.c

index c287b60dffc1684ff4a6764ea02f66f395d88639..65cc9b5913e52ee635a96fb0fb97179b43902947 100644 (file)
@@ -110,9 +110,10 @@ int __usb_host_status_changed_cb(struct libusb_context *ctx,
        MTP_LOGI("bus_no : %03d, dev_no : %03d", bus_no, dev_no);
 
        if (event == LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED) {
-               MTP_LOGI("device added");
-               usleep(200000);
+               MTP_LOGI("USB device added");
+
                LIBMTP_Detect_Raw_Devices(&raw_devices, &num_of_devices);
+               MTP_LOGI("LIBMTP_Detect_Raw_Devices completed : %d", num_of_devices);
                for (slot = 0; slot < num_of_devices; slot++) {
                        if (bus_no == raw_devices[slot].bus_location && dev_no == raw_devices[slot].devnum) {
                                int empty_slot = 0;
@@ -128,6 +129,7 @@ int __usb_host_status_changed_cb(struct libusb_context *ctx,
                                        raw_devices[slot].bus_location, raw_devices[slot].devnum);
 
                                __wait_smack_labeling(usb_node);
+                               MTP_LOGI("Smack labeling completed : %s", usb_node);
 
                                device = LIBMTP_Open_Raw_Device_Uncached(&raw_devices[slot]);
                                if (device == NULL) {
@@ -135,6 +137,7 @@ int __usb_host_status_changed_cb(struct libusb_context *ctx,
                                        continue;
                                }
 
+                               MTP_LOGI("LIBMTP_Open_Raw_Device_Uncached completed");
                                device_info = g_new0(mtp_device_info, 1);
 
                                device_info->device = device;
@@ -150,7 +153,7 @@ int __usb_host_status_changed_cb(struct libusb_context *ctx,
                                g_thread_pool_push(mtp_ctx->device_list->threads, (gpointer)device, NULL);
                                g_source_remove(mtp_ctx->quit_timer);
 
-                               MTP_LOGI("MTP Device added");
+                               MTP_LOGI("MTP device added");
                                mtp_daemon_gdbus_emit_event(MTP_INITIATOR_EVENT_DEVICE_ADDED, empty_slot, mtp_ctx);
                                __print_device_list(mtp_ctx);
                        }