diff -r 79859ed3eea9 -r 919f36ff910f browserutilities/feedsengine/FeedsServer/Server/src/UpdateManager.cpp --- a/browserutilities/feedsengine/FeedsServer/Server/src/UpdateManager.cpp Tue Aug 31 16:17:46 2010 +0300 +++ b/browserutilities/feedsengine/FeedsServer/Server/src/UpdateManager.cpp Wed Sep 01 12:28:30 2010 +0100 @@ -55,6 +55,7 @@ iLazyCaller = CIdle::NewL(CActive::EPriorityIdle ); iHttpConnection = CServerHttpConnection::NewL( aAutoUpdateAP ); iRoamingInfo = CRoamingInfo::NewL(this); + iRoamingInfo->IssueRequestL(); iAutoUpdateAp = aAutoUpdateAP; iLastAutoUpdate.HomeTime(); } @@ -139,14 +140,10 @@ if (iStatus.Int() == KErrNone || iStatus.Int() == KErrAbort) { StartTimer(); - if(iAutoUpdateWhileRoaming) + if(iAutoUpdateWhileRoaming || !iRoamingInfo->Roaming()) { UpdateL(); } - else - { - iRoamingInfo->CheckForRoaming(); - } } } @@ -155,7 +152,7 @@ // // Handles the Update of feed // ----------------------------------------------------------------------------- -TInt CUpdateManager::StartL() +void CUpdateManager::StartL() { iCurrentFeedCount = 0; @@ -365,7 +362,7 @@ // ----------------------------------------------------------------------------- // CRoamingInfo::CRoamingInfo(CUpdateManager *aUpdateManager) - :CActive(CActive::EPriorityStandard),iUpdateManager(aUpdateManager) + :CActive(CActive::EPriorityStandard),iNetworkRegistrationV1Pckg(iNetworkRegistrationV1),iUpdateManager(aUpdateManager) { } @@ -383,22 +380,13 @@ } // ----------------------------------------------------------------------------- -// CRoamingInfo::CheckForRoaming +// CRoamingInfo::Roaming // -// Check for roaming. +// Check for roaming. Returns true if in roaming // ----------------------------------------------------------------------------- -void CRoamingInfo::CheckForRoaming() +TBool CRoamingInfo::Roaming() { - -#ifndef __WINSCW__ - - CTelephony::TNetworkRegistrationV1Pckg RegStatusPkg(iRegStatus); - iTelephony->GetNetworkRegistrationStatus(iStatus, RegStatusPkg); - SetActive(); - -#else - TRAP_IGNORE( iUpdateManager->UpdateL() ); -#endif + return (iNetworkRegistrationV1.iRegStatus == CTelephony::ERegisteredRoaming); } // ----------------------------------------------------------------------------- @@ -408,14 +396,23 @@ // ----------------------------------------------------------------------------- // void CRoamingInfo::RunL() - { - if (iStatus.Int() == KErrNone) + { + IssueRequestL(); + } + +// ----------------------------------------------------------------------------- +// CRoamingInfo::IssueRequestL +// +// Issue the request for change in network registration +// ----------------------------------------------------------------------------- +void CRoamingInfo::IssueRequestL() + { + if (iStatus.Int() == KErrNone || iStatus.Int() == KErrAbort) { - if(iRegStatus.iRegStatus != CTelephony::ERegisteredRoaming) - { - iUpdateManager->UpdateL(); - } - } + iTelephony->NotifyChange( iStatus, CTelephony::ENetworkRegistrationStatusChange, + iNetworkRegistrationV1Pckg); + SetActive(); + } } // ----------------------------------------------------------------------------- @@ -426,5 +423,5 @@ // void CRoamingInfo::DoCancel() { - iTelephony->CancelAsync(CTelephony::EGetCurrentNetworkInfoCancel ); + iTelephony->CancelAsync(CTelephony::ENetworkRegistrationStatusChangeCancel ); }