diff -r 5b2a402e96ac -r 25fce757be94 usbengines/usbwatcher/src/cusbwatcher.cpp --- a/usbengines/usbwatcher/src/cusbwatcher.cpp Thu Aug 19 10:54:11 2010 +0300 +++ b/usbengines/usbwatcher/src/cusbwatcher.cpp Tue Aug 31 16:13:57 2010 +0300 @@ -26,7 +26,6 @@ #include #include #include //for global system state -#include //FeatureManager #include "cusbwatcher.h" #include "cusbactivestate.h" @@ -107,6 +106,7 @@ iGlobalStateObserver = CUsbGlobalSystemStateObserver::NewL( *this ); iUsbDevConStarter = CUsbDevConStarter::NewL(); iActiveState = CUsbActiveState::NewL( iUsbMan, *this ); + iUsbIndicatorHandler = CUsbIndicatorHandler::NewL(); } // ---------------------------------------------------------------------------- @@ -148,6 +148,7 @@ delete iUsbDeviceLock; delete iGlobalStateObserver; iSupportedPersonalities.Close(); + delete iUsbIndicatorHandler; } // ---------------------------------------------------------------------------- @@ -218,7 +219,7 @@ // This method notifies CUsbWatcher class about USB state changes. // ---------------------------------------------------------------------------- // -void CUsbWatcher::StateChangeNotify( TUsbDeviceState aStateOld, +void CUsbWatcher::StateChangeNotifyL( TUsbDeviceState aStateOld, TUsbDeviceState aStateNew ) { LOG_FUNC @@ -227,7 +228,7 @@ // Not show USB indicator in charging mode if ( iNormalStart ) { - iUsbIndicatorHandler.HandleDeviceStateChange( aStateOld, aStateNew ); + iUsbIndicatorHandler->HandleDeviceStateChangeL( aStateOld, aStateNew, iPersonalityId ); } if ( IsDeviceA() ) // Will be handled by UsbOtgWatcher @@ -983,31 +984,14 @@ TInt CUsbWatcher::GetChargingPersonalityId( TInt& aPersonalityId ) { LOG_FUNC - - TUint32 chargingKey( KUsbWatcherChargingDefaultPersonality ); - // Check if it is now in certificate test mode - TRAPD(ret, FeatureManager::InitializeLibL()); - LOG1( "FeatureManager::InitializeLibL(): %d", ret ); - if ( KErrNone == ret ) - { - if( FeatureManager::FeatureSupported( - KFeatureIdEnableIsiCommunicationInUsbChargingMode ) ) - { - chargingKey = KUsbWatcherCertTestChargingPersonality; - LOG( "KFeatureIdEnableIsiCommunicationInUsbChargingMode true" ); - } - else - { - LOG( "KFeatureIdEnableIsiCommunicationInUsbChargingMode false" ); - } - FeatureManager::UnInitializeLib(); - } - ret = iPersonalityRepository->Get( chargingKey, aPersonalityId ); - LOG2( "ret = %d ( aPersonalityId: %d )", ret, aPersonalityId ); + TInt ret = iPersonalityRepository->Get( + KUsbWatcherChargingDefaultPersonality, aPersonalityId ); return ret; } + + // ---------------------------------------------------------------------------- // Check current A or B device state // ----------------------------------------------------------------------------