if (usb_state_get_current_mode() != USB_FUNCTION_NONE)
usb_state_update_state(USB_CONNECTED, USB_FUNCTION_NONE);
- if (mode != selected)
- usb_change_gadget(mode);
+ if (!is_emulator()) {
+ if (mode != selected)
+ usb_change_gadget(mode);
- 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);
}
- ret = usb_config_disable();
- if (ret != 0)
- _E("Failed to disable usb config (%d)", ret);
+ if (!is_emulator()) {
+ ret = usb_config_disable();
+ if (ret != 0)
+ _E("Failed to disable usb config (%d)", ret);
+ }
pm_unlock_internal(INTERNAL_LOCK_USB,
LCD_OFF, STAY_CUR_STATE);
{
int ret;
- ret = usb_probe();
- if (ret < 0) {
- _E("USB client cannot be used (%d)", ret);
- return;
- }
-
usb_state_retrieve_selected_mode();
-
- ret = usb_config_init();
- if (ret < 0)
- _E("Failed to initialize usb configuation");
+
+ if (!is_emulator()) {
+ 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_dbus_init();
if (ret < 0)
{
remove_usb_tethering_handler();
usb_state_update_state(USB_DISCONNECTED, USB_FUNCTION_NONE);
- usb_config_deinit();
- usb_release();
+
+ if (!is_emulator()) {
+ usb_config_deinit();
+ usb_release();
+ }
}
struct extcon_ops extcon_usb_ops = {