usb: disable usb mode according to the current mode 19/91019/2 accepted/tizen/3.0/ivi/20161011.043840 accepted/tizen/3.0/mobile/20161015.032757 accepted/tizen/3.0/tv/20161016.004031 accepted/tizen/3.0/wearable/20161015.081948 accepted/tizen/common/20161005.165637 accepted/tizen/ivi/20161005.232241 accepted/tizen/mobile/20161005.232152 accepted/tizen/tv/20161005.232206 accepted/tizen/wearable/20161005.232221 submit/tizen/20161005.104253 submit/tizen/20161005.114937 submit/tizen_3.0_ivi/20161010.000001 submit/tizen_3.0_mobile/20161015.000001 submit/tizen_3.0_tv/20161015.000001 submit/tizen_3.0_wearable/20161015.000001
authortaeyoung <ty317.kim@samsung.com>
Wed, 5 Oct 2016 09:57:46 +0000 (18:57 +0900)
committertaeyoung <ty317.kim@samsung.com>
Wed, 5 Oct 2016 10:16:30 +0000 (19:16 +0900)
- Previously, usb mode is disabled according to the selected mode.
  Selected mode means that User selected the mode as the next mode.
  However Selected mode can be different with current mode since
  usb mode setting can be failed or there is no mode if usb cable
  is not connected. Thus usb mode should be disabled according to
  the current mode.

Change-Id: If3b825910aa1360cf92ccab68442f4931b5f2ec6
Signed-off-by: taeyoung <ty317.kim@samsung.com>
src/usb/usb.c

index 6b17a9f..7dfea04 100644 (file)
@@ -260,7 +260,7 @@ static int usb_state_changed(int status)
                break;
        case USB_DISCONNECTED:
                _I("USB cable is disconnected");
-               usb_operation_stop(usb_state_get_selected_mode());
+               usb_operation_stop(usb_state_get_current_mode());
                usb_state_update_state(USB_DISCONNECTED, USB_FUNCTION_NONE);
                
                ret = usb_config_disable();