alwayson_net_plugin/pdpcontextmanager2/src/caosettings.cpp
changeset 73 70ee5458c95d
parent 4 77415202bfc8
equal deleted inserted replaced
72:0c32cf868819 73:70ee5458c95d
     1 /*
     1 /*
     2 * Copyright (c) 2004,2006 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   507 // ---------------------------------------------------------------------------
   507 // ---------------------------------------------------------------------------
   508 //
   508 //
   509 void CAOSettings::UpdateLingerTimerSetting()
   509 void CAOSettings::UpdateLingerTimerSetting()
   510     {
   510     {
   511     LOG_1( _L("CAOSettings::UpdateLingerTimerSetting"));
   511     LOG_1( _L("CAOSettings::UpdateLingerTimerSetting"));
   512         
   512 
   513     TInt           count( 0 );
   513     TInt           count( 0 );
   514     TInt           err( KErrNone );
   514     TInt           err( KErrNone );
   515     TLingerSetting ls;
   515     TLingerSetting ls;
   516         
   516 
   517     iLingerSettings.Reset();
   517     iLingerSettings.Reset();
   518     
   518 
   519     // Get number of entries (iapId&linger) in Centrep
   519     // Get number of entries (iapId&linger) in Centrep
   520     err = iRepository->Get( KPdpContextManagerLingerArrayCount, count );
   520     err = iRepository->Get( KPdpContextManagerLingerArrayCount, count );
   521         
   521 
   522     if ( err == KErrNone )
   522     if ( err == KErrNone )
   523         {
   523         {
   524         // read all entries from Centrep
   524         // read all entries from Centrep
   525         for ( TInt row=1; row <= count; row++ )
   525         for ( TInt row=1; row <= count; row++ )
   526             {
   526             {
   527             err = iRepository->Get( ( KIapColumn | row ), ls.iIap ); 
   527             err = iRepository->Get( ( KIapColumn | row ), ls.iIap );
   528         
   528 
   529             if ( err == KErrNone )
   529             if ( err == KErrNone )
   530                 {
   530                 {
   531                 err = iRepository->Get( ( KLingerColumn | row ), ls.iInterval );     
   531                 err = iRepository->Get( ( KLingerColumn | row ), ls.iInterval );
   532                 }
   532                 }
   533                 
   533 
   534             if ( err == KErrNone ) 
   534             if ( err == KErrNone )
   535                 {
   535                 {
   536                 iLingerSettings.Append( ls );    
   536                 err = iLingerSettings.Append( ls );
       
   537                 if ( err )
       
   538                     {
       
   539                     LOG_2( _L("iLingerSettings.Append >> err: %d"), err);
       
   540                     }
   537                 }
   541                 }
   538             else
   542             else
   539                 {
   543                 {
   540                 LOG_3( _L("CRepository::Get() failed >> err: %d, row: %d"),
   544                 LOG_3( _L("CRepository::Get() failed >> err: %d, row: %d"),
   541                 err, row);
   545                 err, row);
   542                 
   546 
   543                 return;        
   547                 break; // for-loop
   544                 }    
   548                 }
   545             }
   549             }
   546         }
   550         }
   547     else
   551     else
   548         {
   552         {
   549         LOG_2( _L("CRepository::Get( KPdpContextManagerLingerArrayCount) >> err: %d"),
   553         LOG_2( _L("CRepository::Get( KPdpContextManagerLingerArrayCount) >> err: %d"),
   550                 err);       
   554                 err);
   551         }        
   555         }
   552       
   556 
   553     // Write to log    
   557     // Write to log
   554     for ( TInt j=0; j < iLingerSettings.Count(); j++ )
   558     for ( TInt j=0; j < iLingerSettings.Count(); j++ )
   555         {
   559         {
   556         LOG_3( _L("iLingerSettings >> iap: %d, interval: %d"),
   560         LOG_3( _L("iLingerSettings >> iap: %d, interval: %d"),
   557         iLingerSettings[ j ].iIap,
   561         iLingerSettings[ j ].iIap,
   558         iLingerSettings[ j ].iInterval);    
   562         iLingerSettings[ j ].iInterval);
   559         }
   563         }
   560     }
   564     }
   561 
   565 
   562 // ---------------------------------------------------------------------------
   566 // ---------------------------------------------------------------------------
   563 // CAOSettings::UpdateSetting
   567 // CAOSettings::UpdateSetting