if (usb_state_get_current_mode() != USB_FUNCTION_NONE)
usb_state_update_state(USB_CONNECTED, USB_FUNCTION_NONE);
- if (!is_emulator()) {
- ret = usb_config_enable();
- if (ret < 0) {
- _E("Failed to enable usb config: %d", ret);
- return ret;
- }
+ ret = usb_config_enable();
+ if (ret < 0) {
+ _E("Failed to enable usb config: %d", ret);
+ return ret;
}
usb_state_update_state(USB_CONNECTED, mode);
usb_state_update_state(USB_DISCONNECTED, USB_FUNCTION_NONE);
}
- if (!is_emulator()) {
- ret = usb_config_disable();
- if (ret != 0)
- _E("Failed to disable usb config: %d", ret);
- }
+ ret = usb_config_disable();
+ if (ret != 0)
+ _E("Failed to disable usb config: %d", ret);
if (disp_plgn.pm_unlock_internal)
disp_plgn.pm_unlock_internal(INTERNAL_LOCK_USB, LCD_OFF, STAY_CUR_STATE);
}
}
- if (!is_emulator()) {
- ret = usb_change_gadget(mode);
- if (ret < 0) {
- _E("Failed to change gadget: %d", ret);
- mode = usb_state_get_selected_mode();
- }
+ ret = usb_change_gadget(mode);
+ if (ret < 0) {
+ _E("Failed to change gadget: %d", ret);
+ mode = usb_state_get_selected_mode();
}
(void)usb_state_set_selected_mode(mode);
usb_state_retrieve_selected_mode();
- if (!is_emulator()) {
- ret = usb_probe();
- if (ret < 0) {
- _E("USB client cannot be used: %d", ret);
- return;
- }
+ ret = usb_probe();
+ if (ret < 0) {
+ _E("USB client cannot be used: %d", ret);
+ return;
+ }
- ret = usb_config_init();
- if (ret < 0)
- _E("Failed to initialize usb configuation.");
+ ret = usb_config_init();
+ if (ret < 0)
+ _E("Failed to initialize usb configuation.");
- ret = register_udev_uevent_control(&uh);
- if (ret < 0)
- _E("Failed to register udev event(%d)", ret);
- }
+ ret = register_udev_uevent_control(&uh);
+ if (ret < 0)
+ _E("Failed to register udev event(%d)", ret);
ret = usb_dbus_init();
if (ret < 0)
remove_usb_tethering_handler();
usb_state_update_state(USB_DISCONNECTED, USB_FUNCTION_NONE);
- if (!is_emulator()) {
- unregister_udev_uevent_control(&uh);
- usb_config_deinit();
- usb_release();
- }
+ unregister_udev_uevent_control(&uh);
+ usb_config_deinit();
+ usb_release();
}
struct extcon_ops extcon_usb_ops = {