supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplsession.cpp
changeset 25 73f6c2762ffe
parent 22 4c4ed41530db
child 32 b12ea03c50a3
equal deleted inserted replaced
22:4c4ed41530db 25:73f6c2762ffe
  4168                 {
  4168                 {
  4169                 iNwInitError = EFalse;                    
  4169                 iNwInitError = EFalse;                    
  4170                 HandleSuplInitErrorL(iNwInitCompletionCode);                             
  4170                 HandleSuplInitErrorL(iNwInitCompletionCode);                             
  4171                 }                
  4171                 }                
  4172             else
  4172             else
  4173 	            InitializeL(iRequestID); 
  4173             	{
       
  4174             		if (iRoaming)                
       
  4175                     HandleRoamingCheckCompleteL(KErrNone, EFalse);                    
       
  4176                 else
       
  4177                     {                        
       
  4178                     iEtelRoamingCheck = ETrue;
       
  4179                     iProtocolManager.CheckForRoaming();
       
  4180                     }
       
  4181 	            //InitializeL(iRequestID); 
       
  4182 	          	}
  4174             /*}
  4183             /*}
  4175 
  4184 
  4176             else if (usage == CSuplSettings::ESuplUsageHomeAutomatic || usage == CSuplSettings::ESuplUsageAlwaysAsk)
  4185             else if (usage == CSuplSettings::ESuplUsageHomeAutomatic || usage == CSuplSettings::ESuplUsageAlwaysAsk)
  4177             {
  4186             {
  4178                 if (iRoaming)                
  4187                 if (iRoaming)                
  4266     iEtelRoamingCheck = EFalse;            
  4275     iEtelRoamingCheck = EFalse;            
  4267     if (aErrorCode == KErrNone)            
  4276     if (aErrorCode == KErrNone)            
  4268         {            
  4277         {            
  4269             iUsageHomeNW = aHomeNw;   
  4278             iUsageHomeNW = aHomeNw;   
  4270             iConnRequestor->UpdateSLPListForHomeUsage(iUsageHomeNW);             
  4279             iConnRequestor->UpdateSLPListForHomeUsage(iUsageHomeNW);             
  4271             //CSuplSettings::TSuplSettingsUsage usage = iSuplSettings->SUPLUsage();
       
  4272             
       
  4273             /*if (usage == CSuplSettings::ESuplUsageAlwaysAsk)
       
  4274                 {
       
  4275                 TInt err = KErrNone;                
       
  4276                     if (!aHomeNw)
       
  4277                         {                            
       
  4278                         //iTrace->Trace(_L("Invoking LaunchSuplUsageSettingsUI, user is roaming"), KTraceFileName, __LINE__);
       
  4279                         //err = iProtocolManager.LaunchSuplUsageSettingsUI(this, ETrue);        
       
  4280                         }
       
  4281                     else
       
  4282                         {                            
       
  4283                         //iTrace->Trace(_L("Invoking LaunchSuplUsageSettingsUI, user is not roaming"), KTraceFileName, __LINE__);
       
  4284                         //err = iProtocolManager.LaunchSuplUsageSettingsUI(this, EFalse);        
       
  4285                         }
       
  4286 
       
  4287                 if(KErrNone != err && KErrInUse == err)
       
  4288                     {
       
  4289                         iTrace->Trace(_L("Dialog in use, setting flag"), KTraceFileName, __LINE__);
       
  4290                         SetSuplUsageFlag();                            
       
  4291                     }
       
  4292                 if( KErrNone == err  && iRequestType == ESUPL_NETWORK )
       
  4293                     {
       
  4294                     iTrace->Trace(_L("Network Session , starting timer"), KTraceFileName, __LINE__);
       
  4295                     COMASuplInit* suplInit = static_cast <COMASuplInit*> (iDecodedAsnMessage);
       
  4296                     TOMASuplQop qop;
       
  4297                     TInt retVal = suplInit->Qop(qop);
       
  4298                     TInt delay;
       
  4299                     qop.Delay(delay);
       
  4300                     //if delay is > 7, it is not valid
       
  4301                     if (delay > 7)
       
  4302                         delay = 0;                                
       
  4303                     if(retVal == KErrNone && delay > 0)
       
  4304                         {
       
  4305                         TReal delayReal;
       
  4306                         Math::Pow(delayReal, 2, (TReal)delay);
       
  4307                         delay = (TInt) delayReal;
       
  4308                         TBuf<128> msg(_L("Delay present in message, value is = "));
       
  4309                         msg.AppendNum(delay);
       
  4310                         iTrace->Trace(msg, KTraceFileName, __LINE__); 
       
  4311                         isTimeoutDialogTimerStarted = ETrue;
       
  4312                         iDialogTimer->StartTimer(delay);
       
  4313                         }  	
       
  4314                     else
       
  4315                         {
       
  4316                         if (iSuplInitTimeOut > 0)
       
  4317                             {                                                        
       
  4318                             TBuf<256> msg(_L("Delay value in CR is"));
       
  4319                             msg.AppendNum(iSuplInitTimeOut);
       
  4320                             iTrace->Trace(msg, KTraceFileName, __LINE__); 
       
  4321                             iDialogTimer->StartTimer(iSuplInitTimeOut * KSecond);
       
  4322                             isTimeoutDialogTimerStarted = ETrue;
       
  4323                             }
       
  4324                         else
       
  4325                             iTrace->Trace(_L("Timeout is <= 0"), KTraceFileName, __LINE__);
       
  4326                         }
       
  4327                     iDlgStartTime.HomeTime();
       
  4328                     }
       
  4329                 else if (KErrNone != err)
       
  4330                     {
       
  4331                     iTrace->Trace(_L("Invoking HandleSuplErrorL"), KTraceFileName, __LINE__);
       
  4332                     HandleSuplErrorL(err);
       
  4333                     }
       
  4334 
       
  4335                 }*/
       
  4336             //else if (usage == CSuplSettings::ESuplUsageHomeAutomatic) 
       
  4337             //{                
       
  4338             //if (!aHomeNw)
       
  4339               //  {                
       
  4340                 //TInt err = KErrNone;                
       
  4341                 //if (!iSuplSettings->IsUIActive() )
       
  4342                     {
       
  4343                     //iTrace->Trace(_L("Invoking LaunchSuplUsageSettingsUI, user is roaming"), KTraceFileName, __LINE__);
       
  4344                     //err = iProtocolManager.LaunchSuplUsageSettingsUI(this, ETrue);        
       
  4345 
  4280 
  4346                     if(iSuplMsgType == ESUPL_INIT)
  4281                     if(iSuplMsgType == ESUPL_INIT)
  4347                         {
  4282                         {
  4348                         iTrace->Trace(_L("Dialog timer started"), KTraceFileName, __LINE__);
  4283                         iTrace->Trace(_L("Dialog timer started"), KTraceFileName, __LINE__);
  4349 				     
       
  4350                         COMASuplInit* suplInit = static_cast <COMASuplInit*> (iDecodedAsnMessage);
  4284                         COMASuplInit* suplInit = static_cast <COMASuplInit*> (iDecodedAsnMessage);
  4351                         TOMASuplQop qop;
  4285                         TOMASuplQop qop;
  4352                         TInt retVal = suplInit->Qop(qop);
  4286                         TInt retVal = suplInit->Qop(qop);
  4353                         TInt delay;
  4287                         TInt delay;
  4354                         qop.Delay(delay);
  4288                         qop.Delay(delay);
  4375                                 }
  4309                                 }
  4376                             else
  4310                             else
  4377                                 iTrace->Trace(_L("Timeout is <= 0"), KTraceFileName, __LINE__);
  4311                                 iTrace->Trace(_L("Timeout is <= 0"), KTraceFileName, __LINE__);
  4378                             }
  4312                             }
  4379                         }
  4313                         }
  4380                     }
       
  4381 
       
  4382               /*  if(!iSuplSettings->IsUIActive() && KErrNone != err)
       
  4383                     {
       
  4384                         SetSuplUsageFlag();                            
       
  4385                     }
       
  4386                 else
       
  4387                     {
       
  4388                     iTrace->Trace(_L("Invoking HandleSuplErrorL"), KTraceFileName, __LINE__);
       
  4389                     HandleSuplErrorL(err);
       
  4390                     }*/
       
  4391                 
       
  4392                        
       
  4393                                 
  4314                                 
  4394                 if (iNwInitError)
  4315                 if (iNwInitError)
  4395                     {
  4316                     {
  4396                     iNwInitError = EFalse;                    
  4317                     iNwInitError = EFalse;                    
  4397                     HandleSuplInitErrorL(iNwInitCompletionCode);                             
  4318                     HandleSuplInitErrorL(iNwInitCompletionCode);                             
  4398                     }                
  4319                     }                
  4399                 else
  4320                 else
  4400 	                InitializeL(iRequestID); 
  4321                 {
  4401                                                 
  4322                 	iTrace->Trace(_L("COMASuplSession::InitializeL called after roaming check"), KTraceFileName, __LINE__);
       
  4323 	                InitializeL(iRequestID);  
       
  4324 	              }  
  4402         }
  4325         }
  4403         else
  4326    else
  4404             {
  4327         {
  4405 	        	iSessionObserver.TerminateSession(this, KErrGeneral);	
  4328       	iSessionObserver.TerminateSession(this, KErrGeneral);	
  4406             }                
  4329         }                
  4407     }            
  4330     }            
  4408 TInt COMASuplSession::SuplIpcSessionID() 
  4331 TInt COMASuplSession::SuplIpcSessionID() 
  4409     {
  4332     {
  4410     return iIpcSessionId;
  4333     return iIpcSessionId;
  4411     }    
  4334     }