usbotg popup : fix bugs in UsbStorageNotiOn and remove useless code in mount, unmount 66/107866/1
authorlokilee73 <changjoo.lee@samsung.com>
Fri, 30 Dec 2016 08:31:15 +0000 (17:31 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Fri, 30 Dec 2016 08:31:23 +0000 (17:31 +0900)
Change-Id: I90f3d2d723dc7f04a8bc0e4bc4b96638aaf885fa
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
signal-sender/signal-sender.c
src/usb/usbotg-mobile.c

index e699343b65a57f8cdaec31974fca79b3cd84bdde..ec2a1a32e73aaf5b022131fb6a0ed019c47ebedf 100755 (executable)
@@ -252,8 +252,8 @@ static int send_usbstorage_unmount_popup_signal(char *path)
        param[2] = "_DEVICE_PATH_";
        param[3] = buf;
 
-       return request_to_launch_by_dbus(BUS_NAME, POPUP_PATH_SYSTEM, POPUP_IFACE_SYSTEM,
-                       "PopupLaunchDouble", "ssss", param);
+       return request_to_launch_by_dbus_for_pairs(BUS_NAME, POPUP_PATH_SYSTEM, POPUP_IFACE_SYSTEM,
+                       "PopupLaunch", sizeof(param)/sizeof(param[0]), param);
 }
 
 static int send_cooldown_popup_signal(void)
index b68ce05cd9504f3912f88c139fe3114e06ee4ef4..d83bba52d22de940809149d5290262ce22812938 100755 (executable)
@@ -53,7 +53,7 @@ static const struct popup_ops storage_removed_unsafe_ops;
 static void remove_otg_popup(const struct popup_ops *ops, char *path)
 {
        int len;
-       char *popup_path;
+       char *popup_path = NULL;
 
        if (ops == &storage_mounted_ops)
                popup_path = added_path;
@@ -180,23 +180,15 @@ static void storage_unmount(const struct popup_ops *ops)
 
 static int storage_mounted_launch(bundle *b, const struct popup_ops *ops)
 {
-       int ret;
-       struct object_ops *obj;
        char *path;
 
        if (!ops)
                return -1;
 
-       ret = get_object_by_ops(ops, &obj);
-       if (ret < 0) {
-               _E("Failed to get object (%d)", ret);
-               return -2;
-       }
-
-       path = (char *)bundle_get_val(obj->b, USB_MOUNT_PATH);
+       path = (char *)bundle_get_val(b, USB_MOUNT_PATH);
        if (!path) {
                _E("Failed to get mount path");
-               return -3;
+               return -2;
        }
 
        _I("USB storage mount path (%s)", path);
@@ -206,24 +198,15 @@ static int storage_mounted_launch(bundle *b, const struct popup_ops *ops)
 
 static int unmount_storage_launch(bundle *b, const struct popup_ops *ops)
 {
-       int ret;
-       struct object_ops *obj;
        char *path;
 
        if (!ops)
                return -1;
 
-       ret = get_object_by_ops(ops, &obj);
-       _D("ops = %s obj = %s", ops, obj);
-       if (ret < 0) {
-               _E("Failed to get object (%d)", ret);
-               return -2;
-       }
-
-       path = (char *)bundle_get_val(obj->b, USB_MOUNT_PATH);
+       path = (char *)bundle_get_val(b, USB_MOUNT_PATH);
        if (!path) {
                _E("Failed to get mount path");
-               return -3;
+               return -2;
        }
 
        remove_otg_popup(&storage_mounted_ops, path);