usbengines/usbwatcher/src/cusbwatcher.cpp
branchRCL_3
changeset 22 5b2a402e96ac
parent 7 ff9df6630274
child 23 25fce757be94
--- a/usbengines/usbwatcher/src/cusbwatcher.cpp	Thu Jul 15 19:48:29 2010 +0300
+++ b/usbengines/usbwatcher/src/cusbwatcher.cpp	Thu Aug 19 10:54:11 2010 +0300
@@ -254,15 +254,6 @@
                 }
             LOG1( "Starting USB personality in device state: %d", aStateNew );
             iPersonalityHandler->StateChangeNotify( aStateOld, aStateNew );
-            // Check AskOnConnection setting every time
-            if( ( iSupportedPersonalities.Count() > 1 ) &&
-                    !IsAskOnConnectionSuppression() )
-                {
-                // read setting if there is more than one personality
-                iPersonalityRepository->Get(
-                        KUsbWatcherChangeOnConnectionSetting,
-                        iAskOnConnectionSetting );
-                }
 
             if( ( iState == EUsbIdle ) && !iPersonalityChangeOngoing )
                 {
@@ -274,10 +265,6 @@
                 Start();
                 }
 
-            // Let's turn ask on connection off after start cause we will
-            // issue it only when cable is connected
-            iAskOnConnectionSetting = KUsbWatcherChangeOnConnectionOff;
-
             //start usbdevcon only in normal global state
             TInt globalState =
                     CUsbGlobalSystemStateObserver::GlobalSystemState();
@@ -530,17 +517,7 @@
     if( EUsbDeviceStateAttached == state || EUsbDeviceStatePowered == state)
         {
         LOG( "Starting USB personality" );
-        TInt err = iPersonalityRepository->Get(
-           KUsbWatcherChangeOnConnectionSetting, iAskOnConnectionSetting );
-        if( KErrNone == err )
-            {
-            Start();
-            iAskOnConnectionSetting = KUsbWatcherChangeOnConnectionOff;
-            }
-        else
-            {
-            LOG1( "Error: CRepository::Get = %d", err );
-            }
+        Start();
         }
     }
 
@@ -770,8 +747,7 @@
                 iStarted = ETrue;
                 // Restore personality to normal in charging mode
                 iSetPreviousPersonalityOnDisconnect = ETrue;
-                iPersonalityHandler->StartPersonality( iPersonalityId,
-                    KUsbWatcherChangeOnConnectionOff, iStatus );
+                iPersonalityHandler->StartPersonality( iPersonalityId, iStatus );
                 }
             else
                 {
@@ -790,8 +766,7 @@
                 RProperty::Set( KPSUidUsbWatcher,
                             KUsbWatcherSelectedPersonality, iPersonalityId );
                 iStarted = ETrue;
-                iPersonalityHandler->StartPersonality( iPersonalityId,
-                        iAskOnConnectionSetting, iStatus );
+                iPersonalityHandler->StartPersonality( iPersonalityId, iStatus );
                 }
             else
                 {
@@ -1034,27 +1009,6 @@
     }
 
 // ----------------------------------------------------------------------------
-// Check if there is an observer with ask on connection suppression
-// ----------------------------------------------------------------------------
-//
-TBool CUsbWatcher::IsAskOnConnectionSuppression()
-    {
-    LOG_FUNC
-    
-    TBool ret( EFalse );
-    for( TInt i = 0; i < iObservers.Count(); i++ )
-        {
-        if( iObservers[i]->IsAskOnConnectionSuppressed() )
-            {
-            ret = ETrue;
-            break;
-            }
-        }
-    LOG1( "Return = %d", ret );
-    return ret;
-    }
-
-// ----------------------------------------------------------------------------
 // Check current A or B device state
 // ----------------------------------------------------------------------------
 //