diff -r 468cfcb53fd1 -r 47c263f7e521 usbengines/usbotgwatcher/src/cusbstatehosthandle.cpp --- a/usbengines/usbotgwatcher/src/cusbstatehosthandle.cpp Mon Jan 18 21:13:23 2010 +0200 +++ b/usbengines/usbotgwatcher/src/cusbstatehosthandle.cpp Tue Jan 26 12:55:41 2010 +0200 @@ -62,6 +62,7 @@ FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::ConstructL" ) ); iTooMuchPowerTimer = CUsbTimer::NewL(this, ETooMuchPowerRequiredTimer); + iDriversNotFoundTimer = CUsbTimer::NewL(this, EDriversNotFoundTimer); } @@ -74,6 +75,7 @@ FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::~CUsbStateHostHandle" ) ); delete iTooMuchPowerTimer; + delete iDriversNotFoundTimer; } // --------------------------------------------------------------------------- @@ -106,6 +108,8 @@ void CUsbStateHostHandle::JustBeforeLeavingThisStateL() { iTooMuchPowerTimer->Cancel(); + iDriversNotFoundTimer->Cancel(); + iWatcher->NotifManager()->CloseAllNotifiers(); } // --------------------------------------------------------------------------- @@ -224,13 +228,11 @@ { case EUsbWatcherErrDriversNotFound: { - FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL DriversNotFound" ) ); - // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped - iWatcher->Usb().BusDrop(); - iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, - EUsbOtgUnsupportedDevice, this); - + FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DoHandleL DriversNotFound" ) ); + + iDriversNotFoundTimer->After(KTimeDriversNotFound); break; + } case EUsbWatcherHubsNotSupported: { @@ -443,15 +445,13 @@ { FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DeviceAttachedL" ) ); - if (iTooMuchPowerTimer->IsActive()) + if (iTooMuchPowerTimer->IsActive() || iDriversNotFoundTimer->IsActive()) { ChangeHostStateL(EUsbStateHostAInitiate); iWatcher->DeviceAttachedL(aDevEventInfo); + return; } - else - { - FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DeviceAttachedL Unexpected situation" ) ); - } + FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::DeviceAttachedL Unexpected situation" ) ); } // --------------------------------------------------------------------------- @@ -586,6 +586,16 @@ EUsbOtgTooMuchPowerRequired, this); break; } + case EDriversNotFoundTimer: + { + FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::TimerElapsedL - EDriversNotFoundTimer" ) ); + // Ignore any errors when calling BusDrop(). Those indicate that VBus already dropped + iWatcher->Usb().BusDrop(); + iWatcher->NotifManager()->ShowNotifierL(KUsbUiNotifOtgError, + EUsbOtgUnsupportedDevice, this); + + break; + } default: { FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostHandle::TimerElapsedL - Unknown timer" ) );