supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplsession2.cpp
changeset 22 4c4ed41530db
parent 20 82ee1f804b63
child 25 73f6c2762ffe
--- a/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplsession2.cpp	Mon May 03 12:54:42 2010 +0300
+++ b/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplsession2.cpp	Fri May 14 16:17:02 2010 +0300
@@ -1719,8 +1719,7 @@
     TOMASuplUtcTime UtcTime;
     TOMASuplPositionEstimate PosEstimate;
     TDateTime TimeStamp;
-    TInt ZoneCode,Zone,altitude, HorizontalAccuracy;
-	TInt AltitudeUncertainty = 0;
+    TInt ZoneCode,Zone,altitude,AltitudeUncertainty, HorizontalAccuracy;
     TOMASuplAltitudeInfo AltitudeInfo;
     TInt latitude,longitude;
     TOMASuplPositionEstimate::TOMASuplLatitudeSign LatSign;
@@ -1904,8 +1903,7 @@
     TOMASuplUtcTime UtcTime;
     TOMASuplPositionEstimate PosEstimate;
     TDateTime TimeStamp;
-    TInt ZoneCode,Zone,altitude, HorizontalAccuracy;
-	TInt AltitudeUncertainty = 0;
+    TInt ZoneCode,Zone,altitude,AltitudeUncertainty, HorizontalAccuracy;
     TOMASuplAltitudeInfo AltitudeInfo;
     TInt latitude,longitude;
     TOMASuplPositionEstimate::TOMASuplLatitudeSign LatSign;
@@ -2177,7 +2175,7 @@
         iTrace->Trace(msg,KTraceFileName, __LINE__); 
         }
 
-    CSuplSettings::TSuplSettingsUsage usage = iSuplSettings->SUPLUsage();
+        /*CSuplSettings::TSuplSettingsUsage usage = iSuplSettings->SUPLUsage();
 
     if (usage == CSuplSettings::ESuplUsageDisabled)
         {                
@@ -2185,7 +2183,7 @@
         iTrace->Trace(msg,KTraceFileName, __LINE__); 
         iSessionObserver.TerminateSession(this, KErrGeneral);	
         return;
-        }
+            }*/
 
     COMASuplAsnMessageBase::TSuplMessageType messageType = aDecodedAsnMessage->MessageType();
 
@@ -2197,10 +2195,6 @@
         {
         CreateCloneMessageL(aDecodedAsnMessage);		
         UpdateSuplSessionIDL();
-		if (iRequestType == ESUPL_NETWORK && messageType == COMASuplAsnMessageBase::ESUPL_INIT)
-			{
-			ServerAddressCheckForSuplInitL();
-			}
  
         iSuplSessionState = ESUPL_INITIALIZED;
         iSuplMsgType = ESUPL_END;
@@ -2234,9 +2228,9 @@
     
                 if (iSuplStorageSettings->GetDefaultServer(serverParams) == KErrNotFound )
                     {
-	                iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
-	                hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
-	                hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
+                    iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
+                    hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
+                    hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
                     }
                 else
                     {
@@ -3624,6 +3618,9 @@
                     return;
                     }
                 }
+			//Comment to ignore coverity missing break error
+			//coverity[MISSING_BREAK  :FALSE]
+    		       
             case COMASuplState::ESUPL_POS_INIT:
                 {
                 cancelSendRequestor = EFalse;
@@ -3917,11 +3914,11 @@
 		CleanupStack::PopAndDestroy(serverParams);
 
         }
+    CleanupStack::PushL(hslpAdress);
 
     delete iSuplState;
     iSuplState = NULL;
 
-    CleanupStack::PushL(hslpAdress);
     if(setStatusCode)
         {
         iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
@@ -4448,11 +4445,11 @@
 					
 						if (iSuplStorageSettings->GetDefaultServer(serverParams) == KErrNotFound )
 							{
-                            iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
-                            hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
-                            hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
+	                    	iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
+	                    	hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
+	                    	hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
 							}
-						else
+							else
 							{
 							iTrace->Trace(_L("Sending End with ver for Default HSLP"), KTraceFileName, __LINE__);
 							TInt64 slpId;
@@ -4471,33 +4468,34 @@
 						CleanupStack::PopAndDestroy(serverParams);
                     	}
 
-                    delete iSuplState;
-                    iSuplState = NULL;
-                    CleanupStack::PushL(hslpAdress);
-                    ServerAddressCheckForSuplInitL();
-                    iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
-                    CleanupStack::PopAndDestroy(hslpAdress);
-
-                    // Set the SessionId.
-                    iTrace->Trace(_L("COMASuplSession::CheckProtocolVersionL Update SLP Session ID"), KTraceFileName, __LINE__);
-                    UpdateSLPSessionIDL(SessionID);
-    
-                    iTrace->Trace(_L("COMASuplSession::CheckProtocolVersionL Update SET Session ID"), KTraceFileName, __LINE__);
-                    UpdateSETSessionIDL(SessionID);
-                    iSuplState->SetMsgStateObserver(this);
-                    iSuplState->GenerateMessageL();
-                    iSuplSessionState = ESUPL_GENERATE;
-                    }
-                else
-                    {                                
-                    iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl);		
-                    UpdateSLPSessionIDL(SessionID);
-                    UpdateSETSessionIDL(SessionID);
-                    iSuplState->SetMsgStateObserver(this);
-                    iRequestType = ESUPL_INVALID_SESSION;
-                    iSuplSessionState = ESUPL_GENERATE;
-                    iSuplState->GenerateMessageL();
-                    }
+			    delete iSuplState;
+			    iSuplState = NULL;
+                CleanupStack::PushL(hslpAdress);
+                ServerAddressCheckForSuplInitL();
+                iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
+                CleanupStack::PopAndDestroy(hslpAdress);
+
+                // Set the SessionId.
+                iTrace->Trace(_L("COMASuplSession::CheckProtocolVersionL Update SLP Session ID"), KTraceFileName, __LINE__);
+                UpdateSLPSessionIDL(SessionID);
+
+                iTrace->Trace(_L("COMASuplSession::CheckProtocolVersionL Update SET Session ID"), KTraceFileName, __LINE__);
+                UpdateSETSessionIDL(SessionID);
+                iSuplState->SetMsgStateObserver(this);
+                iSuplState->GenerateMessageL();
+                iSuplSessionState = ESUPL_GENERATE;
+                            }
+                        else
+                            {                                
+					        iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl);		
+						    UpdateSLPSessionIDL(SessionID);
+						    UpdateSETSessionIDL(SessionID);
+						    iSuplState->SetMsgStateObserver(this);
+                            iRequestType = ESUPL_INVALID_SESSION;
+						    iSuplSessionState = ESUPL_GENERATE;
+						    iSuplState->GenerateMessageL();
+                            }
+
                 } 
             else 							
                 {
@@ -4697,7 +4695,7 @@
 // COMASuplSession::SettingsUsageUICompletedL
 // 
 // -----------------------------------------------------------------------------
-void COMASuplSession::SettingsUsageUICompletedL(TInt aError)
+/*void COMASuplSession::SettingsUsageUICompletedL(TInt aError)
     {
     iUIFlag = EFalse;
     TBuf<64> msg;	
@@ -4743,7 +4741,7 @@
         iSessionObserver.TerminateSession(this, KErrGeneral);	
         return;
         }
-    }
+	}*/
 
 // -----------------------------------------------------------------------------
 // COMASuplSession::CheckForSuplUsageL
@@ -4753,7 +4751,7 @@
     {
     iTrace->Trace(_L("COMASuplSession::CheckForSuplUsageL Start"), KTraceFileName, __LINE__); 
 
-    if (iSuplUsage >= 1)
+    /*if (iSuplUsage >= 1)
         {            
         CSuplSettings::TSuplSettingsUsage usage = iSuplSettings->SUPLUsage();
         if (usage == CSuplSettings::ESuplUsageDisabled)
@@ -4762,7 +4760,7 @@
             iSessionObserver.TerminateSession(this, KErrGeneral);	
             }
         else if (usage == CSuplSettings::ESuplUsageAutomatic)
-            {            
+            { */           
             if (iNwInitError)
                 {
                 iNwInitError = EFalse;                    
@@ -4773,7 +4771,7 @@
                 iTrace->Trace(_L("CheckForSuplUsageL, Initializing"), KTraceFileName, __LINE__); 
                 InitializeL(iRequestID); 
                 }
-            }
+            /*}
 
         else if (usage == CSuplSettings::ESuplUsageHomeAutomatic || usage == CSuplSettings::ESuplUsageAlwaysAsk)
             {
@@ -4787,7 +4785,7 @@
             }            
         }            
     else
-        InitializeL(iRequestID); 
+	        InitializeL(iRequestID); */
 
     }        
 
@@ -4870,9 +4868,9 @@
         {            
         iUsageHomeNW = aHomeNw;   
         iConnRequestor->UpdateSLPListForHomeUsage(iUsageHomeNW);             
-        CSuplSettings::TSuplSettingsUsage usage = iSuplSettings->SUPLUsage();
-
-        if (usage == CSuplSettings::ESuplUsageAlwaysAsk)
+            //CSuplSettings::TSuplSettingsUsage usage = iSuplSettings->SUPLUsage();
+
+            /*if (usage == CSuplSettings::ESuplUsageAlwaysAsk)
             {
             TInt err;                
             if (!aHomeNw)
@@ -4934,16 +4932,16 @@
                 HandleSuplErrorL(err);
                 }
 
-            }
-        else if (usage == CSuplSettings::ESuplUsageHomeAutomatic) 
-            {                
-            if (!aHomeNw)
-                {                
-                TInt err;                
+                }*/
+            //else if (usage == CSuplSettings::ESuplUsageHomeAutomatic) 
+            //{                
+            //if (!aHomeNw)
+              //  {                
+                //TInt err = KErrNone;                
                 //if (!iSuplSettings->IsUIActive() )
-                {
-                iTrace->Trace(_L("Invoking LaunchSuplUsageSettingsUI, user is roaming"), KTraceFileName, __LINE__);
-                err = iProtocolManager.LaunchSuplUsageSettingsUI(this, ETrue);        
+                    {
+                    //iTrace->Trace(_L("Invoking LaunchSuplUsageSettingsUI, user is roaming"), KTraceFileName, __LINE__);
+                    //err = iProtocolManager.LaunchSuplUsageSettingsUI(this, ETrue);        
 
                 if(iSuplMsgType == ESUPL_INIT)
                     {
@@ -4982,7 +4980,7 @@
                 }
 
 
-                if(!iSuplSettings->IsUIActive() && KErrNone != err)
+              /*  if(!iSuplSettings->IsUIActive() && KErrNone != err)
                     {
                     SetSuplUsageFlag();                            
                     }
@@ -4990,19 +4988,18 @@
                     {
                     iTrace->Trace(_L("Invoking HandleSuplErrorL"), KTraceFileName, __LINE__);
                     HandleSuplErrorL(err);
-                    }
-                }
-            else            
-                {                
+                    }*/
+                
+                       
+                                
                 if (iNwInitError)
                     {
                     iNwInitError = EFalse;                    
                     HandleSuplInitErrorL(iNwInitCompletionCode);                             
                     }                
                 else
-                    InitializeL(iRequestID); 
-                }                
-            }                
+	                InitializeL(iRequestID); 
+                                                
         }
     else
         {
@@ -5072,7 +5069,7 @@
     return iUsageDialog;
     }        
 
-void COMASuplSession::StartUsageDialogLaunchL()
+/*void COMASuplSession::StartUsageDialogLaunchL()
     {
     iTrace->Trace(_L("COMASuplSession::StartUsageDialogLaunchL"), KTraceFileName, __LINE__);
     ReSetSuplUsageFlag();            
@@ -5238,7 +5235,7 @@
                 InitializeL(iRequestID); 
             }                
         }                
-    }
+    }*/
 
 TBool COMASuplSession::IsEtelNotifySet()
     {
@@ -5278,10 +5275,10 @@
         iTrace->Trace(_L("Timer Expired for SUPL Dialog"), KTraceFileName, __LINE__); 
 
 
-        if (!iIapDialogShown)
-            iProtocolManager.LaunchSuplDialogTimeoutUI(this);
-        else
-            iIapDlgTimerExpired = ETrue;            
+    //if (!iIapDialogShown)
+	   // iProtocolManager.LaunchSuplDialogTimeoutUI(this);
+   // else
+       // iIapDlgTimerExpired = ETrue;            
 
         }
     return;	
@@ -5291,14 +5288,14 @@
 // COMASuplSession::SettingsTimeOutUICompletedL
 // 
 // -----------------------------------------------------------------------------
-void COMASuplSession::SettingsTimeOutUICompletedL(TInt aError)
+void COMASuplSession::SettingsTimeOutUICompletedL(TInt /*aError*/)
     {
 
-    TBuf<64> msg;	
-    msg.Copy(_L("SUPL Timeout UI completed with ... "));
-    msg.AppendNum(aError);
-    iTrace->Trace(msg,KTraceFileName, __LINE__); 
-    iSessionObserver.TerminateSession(this, KErrGeneral);	
+	  //  TBuf<64> msg;	
+	  //  msg.Copy(_L("SUPL Timeout UI completed with ... "));
+	  //  msg.AppendNum(aError);
+	  //  iTrace->Trace(msg,KTraceFileName, __LINE__); 
+	  //  iSessionObserver.TerminateSession(this, KErrGeneral);	
     return;
 
     }
@@ -5612,7 +5609,14 @@
 						}	
 
             CTriggerParams* activeSessionParam = CTriggerParams::NewLC();
+            TTime endTime;
+            endTime.HomeTime();
+            TTimeIntervalSeconds period;
+            period = iNumFixes * iInterval;
+            endTime = endTime + period;
             activeSessionParam->Set(iSETSessionUniqueId,iRequestorName,ETrue,ETrue,CTriggerParams::EPeriodic,requestType,iNumFixes,iInterval);
+            activeSessionParam->SetTriggerEndTime(endTime);
+            
             iTrace->Trace(_L("Session Id : "), KTraceFileName, __LINE__);
             TBuf<64> sessionId;
             sessionId.AppendNum(iSETSessionUniqueId);
@@ -5694,11 +5698,13 @@
     CTriggerParams::TRequestType requestType;
     TUint64 outstandingTrigger;
     TUint64 interval;
+    TTime endTime;
 
 	HBufC* sessionName = HBufC::NewL( KMaxSessionNameLength );
 	
 		aParamValues->Get(sessionId,sessionName->Des(),notificationPresent,triggerNotificationStatus,
                            triggerType,requestType,outstandingTrigger,interval);
+		aParamValues->GetTriggerEndTime(endTime);                                                            
                            //triggerNotificationStatus = ETrue;
 	
 		UpdateActiveTriggerSession(); //Update UI for trigger info...