181 // |
181 // |
182 void CSIPProfileCacheItem::RefreshIAPsFailed() |
182 void CSIPProfileCacheItem::RefreshIAPsFailed() |
183 { |
183 { |
184 iProfile->SetLastRegistrationError(KErrNoMemory); |
184 iProfile->SetLastRegistrationError(KErrNoMemory); |
185 iCurrentState->RefreshIAPsFailed(*this); |
185 iCurrentState->RefreshIAPsFailed(*this); |
186 SwitchToUnregisteredState(); |
186 SwitchToUnregisteredState(EFalse); |
187 PassAlrErrorToClient(KErrNoMemory, Profile().IapId()); |
187 PassAlrErrorToClient(KErrNoMemory, Profile().IapId()); |
188 } |
188 } |
189 |
189 |
190 // ----------------------------------------------------------------------------- |
190 // ----------------------------------------------------------------------------- |
191 // CSIPProfileCacheItem::SetProfile |
191 // CSIPProfileCacheItem::SetProfile |
762 PROFILE_DEBUG4("ProfileCacheItem::HandleError id,err", ProfileId(), aError) |
762 PROFILE_DEBUG4("ProfileCacheItem::HandleError id,err", ProfileId(), aError) |
763 |
763 |
764 if (iCurrentState->ErrorOccurred(*this, aError)) |
764 if (iCurrentState->ErrorOccurred(*this, aError)) |
765 { |
765 { |
766 PROFILE_DEBUG1("ProfileCacheItem::HandleError go unregistered") |
766 PROFILE_DEBUG1("ProfileCacheItem::HandleError go unregistered") |
767 |
767 |
768 SwitchToUnregisteredState(); |
768 if(SwitchToUnregisteredState(ETrue)) |
769 |
769 { |
|
770 return EFalse; |
|
771 } |
|
772 |
770 if (aError != KErrNone) |
773 if (aError != KErrNone) |
771 { |
774 { |
772 iProfile->SetLastRegistrationError(aError); |
775 iProfile->SetLastRegistrationError(aError); |
773 } |
776 } |
774 return ETrue; |
777 return ETrue; |
1277 // CSIPProfileCacheItem::SwitchToUnregisteredState |
1280 // CSIPProfileCacheItem::SwitchToUnregisteredState |
1278 // Enter unregistered state. Don't use ChangeStateL to avoid loop where profile |
1281 // Enter unregistered state. Don't use ChangeStateL to avoid loop where profile |
1279 // would register again (if auto-registration on). |
1282 // would register again (if auto-registration on). |
1280 // ----------------------------------------------------------------------------- |
1283 // ----------------------------------------------------------------------------- |
1281 // |
1284 // |
1282 void CSIPProfileCacheItem::SwitchToUnregisteredState() |
1285 TBool CSIPProfileCacheItem::SwitchToUnregisteredState(TBool aResume) |
1283 { |
1286 { |
1284 CSIPProfileState& unregistered = iServerCore.UnregisteredState(); |
1287 CSIPProfileState& unregistered = iServerCore.UnregisteredState(); |
1285 iProfile->SetStatus(unregistered.Name()); |
1288 iProfile->SetStatus(unregistered.Name()); |
1286 iCurrentState = &unregistered; |
1289 iCurrentState = &unregistered; |
1287 SetSnapRetryCounter(0); |
1290 |
1288 |
1291 if(iQueuedProfile) |
|
1292 { |
|
1293 if(aResume) |
|
1294 { |
|
1295 TRAPD(err, ResumeL()); |
|
1296 if(KErrNone == err) |
|
1297 return ETrue; |
|
1298 } |
|
1299 delete iProfile; |
|
1300 iProfile = iQueuedProfile; |
|
1301 iQueuedProfile = NULL; |
|
1302 } |
1289 // No need to monitor SNAP anymore. |
1303 // No need to monitor SNAP anymore. |
|
1304 SetSnapRetryCounter(0); |
1290 StopSnapMonitoring(); |
1305 StopSnapMonitoring(); |
1291 RemoveAllUsers(); |
1306 RemoveAllUsers(); |
|
1307 return EFalse; |
1292 } |
1308 } |
1293 |
1309 |
1294 // ----------------------------------------------------------------------------- |
1310 // ----------------------------------------------------------------------------- |
1295 // CSIPProfileCacheItem::SetSnapRetryCounter |
1311 // CSIPProfileCacheItem::SetSnapRetryCounter |
1296 // ----------------------------------------------------------------------------- |
1312 // ----------------------------------------------------------------------------- |