Revision: 201015
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 12:54:42 +0300
changeset 20 82ee1f804b63
parent 18 3825cf2dc8c2
child 22 4c4ed41530db
Revision: 201015 Kit: 201018
locationmapnavfw/library/src/mnmapviewserviceclient.cpp
locationsystemui/locationsysui/locsysuiview/inc/locpossettings.h
locationsystemui/locationsysui/queryandnotification/src/EPos_CPosPrivacyNotifierExtension.cpp
locationtriggering/tsrc/lbtengine_test/Additionaltests/CreateTest/group/CreateTest.mmp
locationtriggering/tsrc/lbtengine_test/Additionaltests/DeleteTest/group/DeleteTest.mmp
locationtriggering/tsrc/lbtengine_test/Additionaltests/HandlingprocessTest/group/HandlingprocessTest.mmp
locationtriggering/tsrc/lbtengine_test/Additionaltests/ModifyTest/group/ModifyTest.mmp
locationtriggering/tsrc/lbtengine_test/Additionaltests/NotificationTest/group/NotificationTest.mmp
locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelCreateIteratorTest/group/CancelCreateIteratorTest.mmp
locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelCreateTest/group/CancelCreateTest.mmp
locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelDeleteTest/group/CancelDeleteTest.mmp
locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelGetTriggersTest/group/CancelGetTriggersTest.mmp
locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelListTriggersTest/group/CancelListTriggersTest.mmp
locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelSetTriggersTest/group/CancelSetTriggersTest.mmp
locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/testlbtcancellation/conf/testlbtcancellation.cfg
locationtriggering/tsrc/lbtengine_test/firingofstartuptriggerandlisttrigger/CreateTest/group/CreateTest.mmp
locationtriggering/tsrc/lbtengine_test/lbtbctest/conf/lbtbctest.cfg
locationtriggering/tsrc/lbtengine_test/t_deletetriggers/src/t_deletetriggersBlocks.cpp
locationtriggering/tsrc/lbtengine_test/t_mgmtsettings/CreateTest/group/CreateTest.mmp
locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasuplinitver2.h
locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasupllocationidver2.h
locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasuplsetcapabilitiesver2.h
locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasuplstartver2.h
locsrv_pub/location_triggering_api/inc/lbttriggerinfo.h
supl/locationomasuplpostester/epos_comasuplpostestermodulecfg/group/epos_comasuplpostestermodulecfg.mmp
supl/locationomasuplprotocolhandler/protocolhandler/src/epos_comasuplprotocolmanager.cpp
supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplsession.cpp
supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplsession2.cpp
supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplstartstate.cpp
--- a/locationmapnavfw/library/src/mnmapviewserviceclient.cpp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationmapnavfw/library/src/mnmapviewserviceclient.cpp	Mon May 03 12:54:42 2010 +0300
@@ -79,7 +79,7 @@
     args.Set( EMnIpcMapLmIdsParamIndex, &idsDes );
 
     TInt err = SendReceive( EMnIpcAddLmIdsToShow, args );
-    delete ids;
+    delete[] ids;
     User::LeaveIfError( err );
     }
 
--- a/locationsystemui/locationsysui/locsysuiview/inc/locpossettings.h	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationsystemui/locationsysui/locsysuiview/inc/locpossettings.h	Mon May 03 12:54:42 2010 +0300
@@ -45,7 +45,7 @@
          *
          * @return	CLocPosSettings*	Pointer to the created object.
          */
-        EXPORT_C static CLocPosSettings* NewL();
+        IMPORT_C static CLocPosSettings* NewL();
        
         /**
          * Two Phase Constructor. The funcion leaves the CLocationSettings object
@@ -53,7 +53,7 @@
          *
          * @return	CLocPosSettings*	Pointer to the created object.
          */         
-        EXPORT_C static CLocPosSettings* NewLC();
+        IMPORT_C static CLocPosSettings* NewLC();
         
         /**
          * C++ Destructor
--- a/locationsystemui/locationsysui/queryandnotification/src/EPos_CPosPrivacyNotifierExtension.cpp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationsystemui/locationsysui/queryandnotification/src/EPos_CPosPrivacyNotifierExtension.cpp	Mon May 03 12:54:42 2010 +0300
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:
+* Description:   Class for privacy notifier extension helper.
 *
 */
 
@@ -24,6 +24,7 @@
 #include "EPos_CPosPrivacyNotifierExtension.h"
 #include "EPos_CPosRequestHandler.h"
 
+
 // ================= MEMBER FUNCTIONS =======================
 
 // C++ default constructor can NOT contain any code, that
@@ -140,21 +141,9 @@
     TPosQNRequestId aRequestId,
     TInt aCompletionCode)
     {
-    TInt index = Find(aRequestId);
-    if (index != KErrNotFound)
+    if (RemoveRequestFromArray(aRequestId) != KErrNotFound)
         {
-        if (iRequestArray[index].iType == TPosQNInputData::EQuery)
-            {
-            // A verification request and the requestor is expecting a response
-            iMessage.Complete(aCompletionCode);
-            }
-        else
-            {
-            // Intentionally empty. The request was for displaying a notification
-            // The requestor is not expecting a response
-            }
-
-        iRequestArray.Remove(index);
+        iMessage.Complete(aCompletionCode);
         ResetData();
         }
     }
@@ -214,6 +203,7 @@
 //
 TPtrC8 CPosPrivacyNotifierExtension::StartL(const TDesC8& /*aBuffer*/)
     {
+    User::Leave(KErrNotSupported);
     return TPtrC8();
     }
 
--- a/locationtriggering/tsrc/lbtengine_test/Additionaltests/CreateTest/group/CreateTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/Additionaltests/CreateTest/group/CreateTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src 
      
 SOURCE          CreateTest.cpp
 SOURCE 			t_triggerfireobserver.cpp
--- a/locationtriggering/tsrc/lbtengine_test/Additionaltests/DeleteTest/group/DeleteTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/Additionaltests/DeleteTest/group/DeleteTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,8 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
-     
+SOURCEPATH      ../src     
 SOURCE          DeleteTest.cpp
 SOURCE 			t_triggerfireobserver.cpp
 
--- a/locationtriggering/tsrc/lbtengine_test/Additionaltests/HandlingprocessTest/group/HandlingprocessTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/Additionaltests/HandlingprocessTest/group/HandlingprocessTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src 
      
 SOURCE          HandlingprocessTest.cpp
 SOURCE 			t_triggerfireobserver.cpp
--- a/locationtriggering/tsrc/lbtengine_test/Additionaltests/ModifyTest/group/ModifyTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/Additionaltests/ModifyTest/group/ModifyTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src 
      
 SOURCE          ModifyTest.cpp
 SOURCE 			t_triggerfireobserver.cpp
--- a/locationtriggering/tsrc/lbtengine_test/Additionaltests/NotificationTest/group/NotificationTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/Additionaltests/NotificationTest/group/NotificationTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src
      
 SOURCE          NotificationTest.cpp
 SOURCE 			t_triggerfireobserver.cpp
--- a/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelCreateIteratorTest/group/CancelCreateIteratorTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelCreateIteratorTest/group/CancelCreateIteratorTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src 
      
 SOURCE          CancelCreateIteratorTest.cpp
 
--- a/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelCreateTest/group/CancelCreateTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelCreateTest/group/CancelCreateTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src 
      
 SOURCE          CancelCreateTest.cpp
 
--- a/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelDeleteTest/group/CancelDeleteTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelDeleteTest/group/CancelDeleteTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src 
      
 SOURCE          CancelDeleteTest.cpp
 
--- a/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelGetTriggersTest/group/CancelGetTriggersTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelGetTriggersTest/group/CancelGetTriggersTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src 
      
 SOURCE          CancelGetTriggersTest.cpp
 
--- a/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelListTriggersTest/group/CancelListTriggersTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelListTriggersTest/group/CancelListTriggersTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src 
      
 SOURCE          CancelListTriggersTest.cpp
 
--- a/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelSetTriggersTest/group/CancelSetTriggersTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/CancelSetTriggersTest/group/CancelSetTriggersTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src 
      
 SOURCE          CancelSetTriggersTest.cpp
 
--- a/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/testlbtcancellation/conf/testlbtcancellation.cfg	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/LbtCancellationTest/testlbtcancellation/conf/testlbtcancellation.cfg	Mon May 03 12:54:42 2010 +0300
@@ -684,7 +684,7 @@
 foobar testCancelNotifyTriggerChangeEvent2 3
 delete foobar
 [Endtest] 
-
+/*
 [Test]
 title testCanceltNotifyTriggerFired_0
 create testlbtcancellation foobar
@@ -712,7 +712,7 @@
 foobar testCanceltNotifyTriggerFired 3
 delete foobar
 [Endtest] 
-
+*/
 [Test]
 title testCancelNotifyTriggeringSettingsChange_0
 create testlbtcancellation foobar
@@ -797,12 +797,6 @@
 delete foobar
 [Endtest] 
 
-[Test]
-title testPartialDeleteTriggers1L
-create testlbtcancellation foobar
-foobar testPartialDeleteTriggers1L 1
-delete foobar
-[Endtest]
 
 
 
--- a/locationtriggering/tsrc/lbtengine_test/firingofstartuptriggerandlisttrigger/CreateTest/group/CreateTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/firingofstartuptriggerandlisttrigger/CreateTest/group/CreateTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src 
      
 SOURCE          CreateTest.cpp
 SOURCE 			t_triggerfireobserver.cpp
--- a/locationtriggering/tsrc/lbtengine_test/lbtbctest/conf/lbtbctest.cfg	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/lbtbctest/conf/lbtbctest.cfg	Mon May 03 12:54:42 2010 +0300
@@ -760,12 +760,6 @@
 delete foobar
 [Endtest] 
 [Test]
-title LBTBCTest82
-create lbtbctest foobar
-foobar LBTBCTest82 
-delete foobar
-[Endtest] 
-[Test]
 title LBTBCTest83
 create lbtbctest foobar
 foobar LBTBCTest83 
--- a/locationtriggering/tsrc/lbtengine_test/t_deletetriggers/src/t_deletetriggersBlocks.cpp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/t_deletetriggers/src/t_deletetriggersBlocks.cpp	Mon May 03 12:54:42 2010 +0300
@@ -402,7 +402,7 @@
         
     TRAPD(err,lbt.DeleteTriggerL(trigId));
            
-    AssertTrueL( KErrNone==err,_L("wrong error code"));
+    AssertTrueL( KErrNotFound==err,_L("wrong error code"));
     
     CleanupStack::PopAndDestroy( &lbt );
     CleanupStack::PopAndDestroy( &lbtserver );
@@ -434,7 +434,7 @@
         
     TRAPD(err,lbt.DeleteTriggerL(trigId));
            
-    AssertTrueL( KErrNone==err,_L("wrong error code"));
+    AssertTrueL( KErrNotFound==err,_L("wrong error code"));
     
     CleanupStack::PopAndDestroy( &lbt );
     CleanupStack::PopAndDestroy( &lbtserver );
--- a/locationtriggering/tsrc/lbtengine_test/t_mgmtsettings/CreateTest/group/CreateTest.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/locationtriggering/tsrc/lbtengine_test/t_mgmtsettings/CreateTest/group/CreateTest.mmp	Mon May 03 12:54:42 2010 +0300
@@ -33,7 +33,7 @@
 //TARGETPATH      ?target_path
 //DEFFILE         CreateTest.def
 
-SOURCEPATH      ../src ../../src
+SOURCEPATH      ../src
      
 SOURCE          CreateTest.cpp
 SOURCE 			t_triggerfireobserver.cpp
--- a/locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasuplinitver2.h	Fri Apr 16 15:23:31 2010 +0300
+++ b/locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasuplinitver2.h	Mon May 03 12:54:42 2010 +0300
@@ -152,7 +152,7 @@
     /**
      *Constructor for TOMASuplHistoricReporting
      */
-    TOMASuplHistoricReporting();
+    IMPORT_C TOMASuplHistoricReporting();
 
     /**
      * Setter method  for allowed reporting criteria type
@@ -556,7 +556,7 @@
 
    	    void ConstructL();        
 
-   	    COMASuplInitVer2(); 
+   	    IMPORT_C COMASuplInitVer2(); 
 
 
    	protected:    // Data
--- a/locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasupllocationidver2.h	Fri Apr 16 15:23:31 2010 +0300
+++ b/locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasupllocationidver2.h	Mon May 03 12:54:42 2010 +0300
@@ -233,7 +233,7 @@
       * @param aTOMASuplVer2CellInfo TOMASuplVer2CellInfoExtn
       * @return None                                           
       */   
-     void SetVer2CellInfo(TOMASuplVer2CellInfoExtn aTOMASuplVer2CellInfo);
+     IMPORT_C void SetVer2CellInfo(TOMASuplVer2CellInfoExtn aTOMASuplVer2CellInfo);
 
      /**
       * Clone Method for COMASuplLocationIdVer2
--- a/locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasuplsetcapabilitiesver2.h	Fri Apr 16 15:23:31 2010 +0300
+++ b/locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasuplsetcapabilitiesver2.h	Mon May 03 12:54:42 2010 +0300
@@ -312,14 +312,14 @@
 class TOMASuplSessionCapabilities
     {
 public:
-    TOMASuplSessionCapabilities();
-    TInt GetMaxNumberTotalSessions(TInt &aMaxNumberTotalSessions)const;
-    TInt GetMaxNumberPeriodicSessions(TInt8 &aMaxNumberPeriodicSessions)const;
-    TInt GetMaxNumberTriggeredSessions(TInt8 &aMaxNumberTriggeredSessions)const;
+		IMPORT_C TOMASuplSessionCapabilities();
+    IMPORT_C TInt GetMaxNumberTotalSessions(TInt &aMaxNumberTotalSessions)const;
+    IMPORT_C TInt GetMaxNumberPeriodicSessions(TInt8 &aMaxNumberPeriodicSessions)const;
+    IMPORT_C TInt GetMaxNumberTriggeredSessions(TInt8 &aMaxNumberTriggeredSessions)const;
 public:
-    void SetMaxNumberTotalSessions(const TInt aMaxNumberTotalSessions);
-    void SetMaxNumberPeriodicSessions(const TInt8 aMaxNumberPeriodicSessions);
-    void SetMaxNumberTriggeredSessions(const TInt8 aMaxNumberTriggeredSessions);
+    IMPORT_C void SetMaxNumberTotalSessions(const TInt aMaxNumberTotalSessions);
+    IMPORT_C void SetMaxNumberPeriodicSessions(const TInt8 aMaxNumberPeriodicSessions);
+    IMPORT_C void SetMaxNumberTriggeredSessions(const TInt8 aMaxNumberTriggeredSessions);
 
 private:
     TInt iOptionalMask;
@@ -390,16 +390,16 @@
 class TOMAServiceCapabilities
     {
 public:
-    TOMAServiceCapabilities();
-    TInt GetSuplServiceSupported(TOMASuplServiceSupported& aServicesSupported)const;
-    TInt GetSuplReportingCap(TOMASuplReportingCap& aReportingCapabilities)const;
-    TInt GetEventTriggerCapabilities(TOMASuplEventTriggerCapabilities& aEventTriggerCapabilities)const;
-    TInt GetSuplSessionCapabilities(TOMASuplSessionCapabilities& aSessionCapabilities)const;
+    IMPORT_C TOMAServiceCapabilities();
+    IMPORT_C TInt GetSuplServiceSupported(TOMASuplServiceSupported& aServicesSupported)const;
+    IMPORT_C TInt GetSuplReportingCap(TOMASuplReportingCap& aReportingCapabilities)const;
+    IMPORT_C TInt GetEventTriggerCapabilities(TOMASuplEventTriggerCapabilities& aEventTriggerCapabilities)const;
+    IMPORT_C TInt GetSuplSessionCapabilities(TOMASuplSessionCapabilities& aSessionCapabilities)const;
 public:
-    void SetSuplServiceSupported(const TOMASuplServiceSupported aServicesSupported);
-    void SetSuplReportingCap(const TOMASuplReportingCap aReportingCapabilities);
-    void SetEventTriggerCapabilities(const TOMASuplEventTriggerCapabilities aEventTriggerCapabilities);
-    void SetSuplSessionCapabilities(const TOMASuplSessionCapabilities aSessionCapabilities);
+    IMPORT_C void SetSuplServiceSupported(const TOMASuplServiceSupported aServicesSupported);
+    IMPORT_C void SetSuplReportingCap(const TOMASuplReportingCap aReportingCapabilities);
+    IMPORT_C void SetEventTriggerCapabilities(const TOMASuplEventTriggerCapabilities aEventTriggerCapabilities);
+    IMPORT_C void SetSuplSessionCapabilities(const TOMASuplSessionCapabilities aSessionCapabilities);
 
 private:
 
--- a/locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasuplstartver2.h	Fri Apr 16 15:23:31 2010 +0300
+++ b/locsrv_plat/oma_supl_asn_codec_plugin_api/inc/epos_comasuplstartver2.h	Mon May 03 12:54:42 2010 +0300
@@ -602,9 +602,9 @@
          
    	protected: 
       
-      void ConstructL();        
+      IMPORT_C void ConstructL();        
       
-      COMASuplStartVer2(); 
+      IMPORT_C COMASuplStartVer2(); 
       
 	  
     protected:    // Data
--- a/locsrv_pub/location_triggering_api/inc/lbttriggerinfo.h	Fri Apr 16 15:23:31 2010 +0300
+++ b/locsrv_pub/location_triggering_api/inc/lbttriggerinfo.h	Mon May 03 12:54:42 2010 +0300
@@ -132,7 +132,7 @@
     /**
      * Default constructor.
      */
-    CLbtTriggerInfo();
+    IMPORT_C CLbtTriggerInfo();
 
 private:    
     /**
--- a/supl/locationomasuplpostester/epos_comasuplpostestermodulecfg/group/epos_comasuplpostestermodulecfg.mmp	Fri Apr 16 15:23:31 2010 +0300
+++ b/supl/locationomasuplpostester/epos_comasuplpostestermodulecfg/group/epos_comasuplpostestermodulecfg.mmp	Mon May 03 12:54:42 2010 +0300
@@ -78,7 +78,7 @@
 
 START RESOURCE ../data/postester.rss
 HEADER
-TARGETPATH Resource 
+TARGETPATH resource 
 END
  
 // End of File
--- a/supl/locationomasuplprotocolhandler/protocolhandler/src/epos_comasuplprotocolmanager.cpp	Fri Apr 16 15:23:31 2010 +0300
+++ b/supl/locationomasuplprotocolhandler/protocolhandler/src/epos_comasuplprotocolmanager.cpp	Mon May 03 12:54:42 2010 +0300
@@ -369,17 +369,33 @@
 		{			
 		HandlePacketError(errorCode);
 		return;
-		} 
+		}
+	
+	//Work out what SUPL Protocol Hanlder version should be used
 	if( major == 1 )
 		{
+		//SUPL v1
 		if(iOMASuplProtocolHandler1)
 		    {
 		    iOMASuplProtocolHandler1->HandlePacket(aPacket,aPortNum);
 		    }
 		}
+	else if( major == 2)
+		{
+		//SUPL v2
+		if(iOMASuplProtocolHandler2)
+            {
+            iOMASuplProtocolHandler2->HandlePacket(aPacket,aPortNum);
+            }
+		}
 	else 
 		{
-		if(iOMASuplProtocolHandler2)
+		//Use either of the Protocol Handlers to handle the packet
+		if(iOMASuplProtocolHandler1)
+		    {
+		    iOMASuplProtocolHandler1->HandlePacket(aPacket,aPortNum);
+		    }
+		else if(iOMASuplProtocolHandler2)
             {
             iOMASuplProtocolHandler2->HandlePacket(aPacket,aPortNum);
             }	
@@ -501,17 +517,32 @@
 		return;
 		}
 
+	//Work out what SUPL Protocol Hanlder version should be used
 	TInt major = aSuplSession->GetSUPLVersion();	
 	if( major == 1 )
 		{
+		//SUPL v1
 		if(iOMASuplProtocolHandler1)
 		    {
 		    iOMASuplProtocolHandler1->HandleSuplMessageL(aSuplSession,aStatus,aMessage);
 		    }
 		}
+	else if( major == 2 )
+		{
+		//SUPL v2
+		if(iOMASuplProtocolHandler2)
+		    {
+		    iOMASuplProtocolHandler2->HandleSuplMessageL(aSuplSession,aStatus,aMessage);
+		    }
+		}
 	else 
 		{
-		if(iOMASuplProtocolHandler2)
+		//Use either of the Protocol Handlers (if they exist) to handle the packet
+		if(iOMASuplProtocolHandler1)
+		    {
+		    iOMASuplProtocolHandler1->HandleSuplMessageL(aSuplSession,aStatus,aMessage);
+		    }
+		else if(iOMASuplProtocolHandler2)
 		    {
 		    iOMASuplProtocolHandler2->HandleSuplMessageL(aSuplSession,aStatus,aMessage);
 		    }
--- a/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplsession.cpp	Fri Apr 16 15:23:31 2010 +0300
+++ b/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplsession.cpp	Mon May 03 12:54:42 2010 +0300
@@ -83,6 +83,7 @@
 #include "epos_omasuplconfigurationkeys.h"
 #include "epos_csuplsettingparams.h"
 #include "epos_comasuplasnbase.h"
+#include "epos_csuplsettingsconstants.h"
 
 
 _LIT(KTraceFileName,"SUPL_OMA_SESSION::EPos_COMASuplSession.cpp");
@@ -1512,7 +1513,8 @@
 			TOMASuplUtcTime UtcTime;
 			TOMASuplPositionEstimate PosEstimate;
 			TDateTime TimeStamp;
-			TInt ZoneCode,Zone,altitude,AltitudeUncertainty, HorizontalAccuracy;
+			TInt ZoneCode,Zone,altitude, HorizontalAccuracy;
+			TInt AltitudeUncertainty = 0;
 			TOMASuplAltitudeInfo AltitudeInfo;
 			TInt latitude,longitude;
 			TOMASuplPositionEstimate::TOMASuplLatitudeSign LatSign;
@@ -1696,7 +1698,8 @@
 			TOMASuplUtcTime UtcTime;
 			TOMASuplPositionEstimate PosEstimate;
 			TDateTime TimeStamp;
-			TInt ZoneCode,Zone,altitude,AltitudeUncertainty, HorizontalAccuracy;
+			TInt ZoneCode,Zone,altitude, HorizontalAccuracy;
+			TInt AltitudeUncertainty = 0;
 			TOMASuplAltitudeInfo AltitudeInfo;
 			TInt latitude,longitude;
 			TOMASuplPositionEstimate::TOMASuplLatitudeSign LatSign;
@@ -1947,101 +1950,126 @@
 //
 void COMASuplSession::HandleOMASuplMessageL(COMASuplAsnMessageBase* aDecodedAsnMessage,TRequestStatus& aStatus,TInt aSessionIdSeed,TInt aErrorCode)
 	{
-		delete iSuplState;
-		iSuplState = NULL;
-		
-		iSETSessionUniqueId = aSessionIdSeed;
-		iRunRequestStatus = & aStatus;
-	    *iRunRequestStatus = KRequestPending;
-	    
-		TInt networkMode = 1;
-		networkMode = GetNetworkModeL();
-		
-		TBuf<64> msg;
-		if ( networkMode == ECoreAppUIsNetworkConnectionNotAllowed )
-			{
-				msg.Copy(_L("The device is in OFFLINE mode."));
-				iTrace->Trace(msg,KTraceFileName, __LINE__); 
-				iSessionObserver.TerminateSession(this, KErrGeneral);
-				return;
-			}
-		else
-			{
-				msg.Copy(_L("The device is in ON LINE mode."));
-				iTrace->Trace(msg,KTraceFileName, __LINE__); 
-			}
-
-        CSuplSettings::TSuplSettingsUsage usage = iSuplSettings->SUPLUsage();
-
-        if (usage == CSuplSettings::ESuplUsageDisabled)
-            {                
-			msg.Copy(_L("SUPL Usage is disabled"));
-			iTrace->Trace(msg,KTraceFileName, __LINE__); 
-	        iSessionObserver.TerminateSession(this, KErrGeneral);	
-			return;
+    delete iSuplState;
+    iSuplState = NULL;
+    
+    iSETSessionUniqueId = aSessionIdSeed;
+    iRunRequestStatus = & aStatus;
+    *iRunRequestStatus = KRequestPending;
+    
+    TInt networkMode = 1;
+    networkMode = GetNetworkModeL();
+    
+    TBuf<64> msg;
+    if ( networkMode == ECoreAppUIsNetworkConnectionNotAllowed )
+        {
+            msg.Copy(_L("The device is in OFFLINE mode."));
+            iTrace->Trace(msg,KTraceFileName, __LINE__); 
+            iSessionObserver.TerminateSession(this, KErrGeneral);
+            return;
+        }
+    else
+        {
+            msg.Copy(_L("The device is in ON LINE mode."));
+            iTrace->Trace(msg,KTraceFileName, __LINE__); 
+        }
+
+    CSuplSettings::TSuplSettingsUsage usage = iSuplSettings->SUPLUsage();
+
+    if (usage == CSuplSettings::ESuplUsageDisabled)
+        {                
+        msg.Copy(_L("SUPL Usage is disabled"));
+        iTrace->Trace(msg,KTraceFileName, __LINE__); 
+        iSessionObserver.TerminateSession(this, KErrGeneral);	
+        return;
+        }
+    
+    COMASuplAsnMessageBase::TSuplMessageType messageType = aDecodedAsnMessage->MessageType();
+    
+    if(messageType == COMASuplAsnMessageBase::ESUPL_INIT && aErrorCode == KErrNone)
+        {
+            HandleOMASuplMessageL(aDecodedAsnMessage);
+        }
+    else //Other messages than SUPL_INIT.... Send End
+        {
+        CreateCloneMessageL(aDecodedAsnMessage);		
+        UpdateSuplSessionIDL();
+        if (iRequestType == ESUPL_NETWORK && messageType == COMASuplAsnMessageBase::ESUPL_INIT)
+            {
+            ServerAddressCheckForSuplInitL();
             }
-	    
-	    COMASuplAsnMessageBase::TSuplMessageType messageType = aDecodedAsnMessage->MessageType();
-	    
-	    if(messageType == COMASuplAsnMessageBase::ESUPL_INIT && aErrorCode == KErrNone)
-	    	{
-	    		HandleOMASuplMessageL(aDecodedAsnMessage);
-	    	}
-	    else //Other messages than SUPL_INIT.... Send End
-	    	{
-	    		CreateCloneMessageL(aDecodedAsnMessage);		
-	    		UpdateSuplSessionIDL();
- 
-				iSuplSessionState = ESUPL_INITIALIZED;
-				iSuplMsgType = ESUPL_END;
-
-	    		if((aErrorCode == KErrCompletion && messageType == COMASuplAsnMessageBase::ESUPL_INIT) ||
-	    			(aErrorCode == KErrOMASuplOutOfRangeParameter && messageType == COMASuplAsnMessageBase::ESUPL_INIT) ||
-	    			(aErrorCode == KErrOMASuplMessageLengthMismatch && messageType == COMASuplAsnMessageBase::ESUPL_INIT) ||
-						(aErrorCode == KErrOMASuplShortFrame && messageType == COMASuplAsnMessageBase::ESUPL_INIT))	    			
-	    			{
-	    				iErrorStatusCode = COMASuplEnd::EUnexpectedDataValue;
-	    				if(aErrorCode == KErrOMASuplMessageLengthMismatch)
-	    					{
-	    						iErrorStatusCode = COMASuplEnd::EProtocolError;
-	    					}
-      				if(aErrorCode == KErrOMASuplShortFrame)
-	    					{
-	    						iErrorStatusCode = COMASuplEnd::EDataMissing;
-	    					}
-						TInt len = iHSLPAddress.Length();
-						HBufC8 *hslpAdress = NULL;
-						if(len > 0)
-						{
-							hslpAdress = HBufC8::NewL(iHSLPAddress.Length());
-							hslpAdress->Des().Copy(iHSLPAddress);
-						}
-						
-						else if(len ==0)
-						{
-						iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
-						hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
-						CleanupStack::PushL(hslpAdress);
-						hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
-						CleanupStack::Pop(hslpAdress);						
-						}
-						CleanupStack::PushL(hslpAdress);
-						iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
-						CleanupStack::PopAndDestroy(hslpAdress);
-	    			}
-	    		else
-	    			{
-	    				iErrorStatusCode = COMASuplEnd::EUnexpectedMessage;
-	    				iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl);
-	    			}	
-	    			
-	    		SetPOSMsgPluginState(COMASuplPosSessionBase::EOMASuplCreating);	
-				iSuplState->SetMsgStateObserver(this);
-				//SMP Changes
-				iSuplSessionState = ESUPL_GENERATE;
-				iSuplState->GenerateMessageL();
-				 
-	    	}	
+
+        iSuplSessionState = ESUPL_INITIALIZED;
+        iSuplMsgType = ESUPL_END;
+
+        if((aErrorCode == KErrCompletion && messageType == COMASuplAsnMessageBase::ESUPL_INIT) ||
+            (aErrorCode == KErrOMASuplOutOfRangeParameter && messageType == COMASuplAsnMessageBase::ESUPL_INIT) ||
+            (aErrorCode == KErrOMASuplMessageLengthMismatch && messageType == COMASuplAsnMessageBase::ESUPL_INIT) ||
+            (aErrorCode == KErrOMASuplShortFrame && messageType == COMASuplAsnMessageBase::ESUPL_INIT))	    			
+            {
+            iErrorStatusCode = COMASuplEnd::EUnexpectedDataValue;
+            if(aErrorCode == KErrOMASuplMessageLengthMismatch)
+                {
+                    iErrorStatusCode = COMASuplEnd::EProtocolError;
+                }
+            if(aErrorCode == KErrOMASuplShortFrame)
+                {
+                    iErrorStatusCode = COMASuplEnd::EDataMissing;
+                }
+            TInt len = iHSLPAddress.Length();
+            HBufC8 *hslpAdress = NULL;
+            if(len > 0)
+                {
+                hslpAdress = HBufC8::NewL(iHSLPAddress.Length());
+                hslpAdress->Des().Copy(iHSLPAddress);
+                }
+            else if(len ==0)
+                {
+                CServerParams* serverParams = CServerParams::NewL();
+                CleanupStack::PushL(serverParams);
+            
+                if (iSuplStorageSettings->GetDefaultServer(serverParams) == KErrNotFound )
+                    {
+                    iTrace->Trace(_L("HSLP generated frm IMSI"), KTraceFileName, __LINE__);
+                    hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
+                    hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
+                    }		
+                else
+                    {
+                    iTrace->Trace(_L("Sending End with ver for Default HSLP"), KTraceFileName, __LINE__);
+                    TInt64 slpId;
+                    TBool aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable;
+                    HBufC* serverAddr = HBufC::NewL(KMaxHSLPAddrLen);
+                    HBufC* iapName = HBufC::NewL(KMaxIAPLen);
+                    CleanupStack::PushL(serverAddr);
+                    CleanupStack::PushL(iapName);
+                    serverParams->Get(slpId,serverAddr->Des(),iapName->Des(),aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable);
+                    hslpAdress = HBufC8::NewL(serverAddr->Length());
+                    hslpAdress->Des().Copy(*serverAddr);
+                
+                    CleanupStack::PopAndDestroy(iapName);
+                    CleanupStack::PopAndDestroy(serverAddr);
+                    }
+                CleanupStack::PopAndDestroy(serverParams);
+                }
+            delete iSuplState;
+            iSuplState = NULL;
+            CleanupStack::PushL(hslpAdress);
+            iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
+            CleanupStack::PopAndDestroy(hslpAdress);
+            }
+        else
+            {
+            iErrorStatusCode = COMASuplEnd::EUnexpectedMessage;
+            iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl);
+            }	
+            
+        SetPOSMsgPluginState(COMASuplPosSessionBase::EOMASuplCreating);	
+        iSuplState->SetMsgStateObserver(this);
+        //SMP Changes
+        iSuplState->GenerateMessageL(); //Has to be here because initialisation has to be done for NI case in decode failed scenario.
+        iSuplSessionState = ESUPL_GENERATE;
+        }	
 	}
 
 // -----------------------------------------------------------------------------
@@ -2052,10 +2080,10 @@
 //
 void COMASuplSession::HandleOMASuplMessageL(COMASuplAsnMessageBase* aDecodedAsnMessage)
 	{
+		CreateCloneMessageL(aDecodedAsnMessage);		
 		if(CheckProtocolVersionL(aDecodedAsnMessage)) //Checks version with supported version
 		{
 			COMASuplAsnMessageBase::TSuplMessageType messageType = aDecodedAsnMessage->MessageType();
-			CreateCloneMessageL(aDecodedAsnMessage);		
 			if(messageType != COMASuplAsnMessageBase::ESUPL_POS)
 				{
 					iCompleteSelfRequestor->CompleteSelf(); //This will result in call of RequestCompleted()
@@ -3190,106 +3218,123 @@
 //
 void COMASuplSession::HandleSuplInitErrorL(TInt aErr)
 	{
-		iTrace->Trace(_L("Start COMASuplSession::HandleSuplInitError"), KTraceFileName, __LINE__); 
-		
-		if(aErr == KErrOMAInvalidHSLPAddress)
-			{
-				iTrace->Trace(_L("COMASuplSession::HandleSuplInitError HSLP Address is not matching..."), KTraceFileName, __LINE__);
-				//Close Connection : bug Fix.
-				iConnRequestor->CloseConnection();
-                iPortNum = 0;
-				iSessionObserver.TerminateSession(this, KErrCompletion);
-				return;
-			}
-				
-		TBool setStatusCode = ETrue;
-		
-	
-		
-		if(aErr == KErrSuplInvalidSessionID)
-			{
-				iTrace->Trace(_L("COMASuplSession::HandleSuplInitError Received SET Session ID"), KTraceFileName, __LINE__);
-				iErrorStatusCode = COMASuplEnd::EInvalidSessionId;	
-
-			    COMASuplSessionID* retrivedSessionID = NULL;
-			    iDecodedAsnMessage->SessionId(retrivedSessionID);
-
-			    // Set the SessionId.
-				iTrace->Trace(_L("COMASuplSession::HandleSuplInitError Update SET Session ID"), KTraceFileName, __LINE__);
-			    UpdateSETSessionIDL(retrivedSessionID);
-
-			}
-			
-		if(aErr == KErrOMANonProxyModeNotSupported)
-			{
-				iTrace->Trace(_L("COMASuplSession::HandleSuplInitError Received Nonproxymode data"), KTraceFileName, __LINE__);
-				iErrorStatusCode = COMASuplEnd::ENonProxyModeNotSupported;	
-			}
-
-		if(KErrAccessDenied == aErr || KErrOMASuplDenied == aErr)
-			{
-				iTrace->Trace(_L("COMASuplSession::HandleSuplInitError KErrAccessDenied|| KErrOMASuplDenied"), KTraceFileName, __LINE__);
-				iErrorStatusCode = COMASuplEnd::EConsentDeniedByUser;	
-			}
-	
-		if(aErr == KErrOMASuplNoPosition || KErrOMASuplInformationOnly == aErr)
-			{
-				//Supl End with No Position
-				iTrace->Trace(_L("COMASuplSession::HandleSuplInitError KErrOMASuplNoPosition || KErrOMASuplInformationOnly"), KTraceFileName, __LINE__);
-				setStatusCode = EFalse;
-			}
-		
-		if(KErrOMASuplAccepted == aErr)
-			{
-				iTrace->Trace(_L("COMASuplSession::HandleSuplInitError EConsentGrantedByUser"), KTraceFileName, __LINE__);
-				iErrorStatusCode = COMASuplEnd::EConsentGrantedByUser;	
-			}
-		
-		TInt len = iHSLPAddress.Length();
-		HBufC8 *hslpAdress = NULL;
-		if(len > 0)
-		{
-			hslpAdress = HBufC8::NewL(iHSLPAddress.Length());
-			hslpAdress->Des().Copy(iHSLPAddress);
-		}
-		
-			else if(len ==0)
-				{
-					iTrace->Trace(_L("HSLP generated frm IMSI"), KTraceFileName, __LINE__);
-					hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
-					CleanupStack::PushL(hslpAdress);
-					hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());
-					CleanupStack::Pop(hslpAdress);	
-					
-				}
-		CleanupStack::PushL(hslpAdress);
-		
-		delete iSuplState;
-		iSuplState = NULL;
-		
- 		if(setStatusCode)
- 			{
-	 			iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
- 			}
- 		else
- 			{
- 				iSuplState = COMASuplEndState::NewL(iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress );
- 			} 		
- 			
- 		CleanupStack::PopAndDestroy(hslpAdress);
- 		
-		iTrace->Trace(_L("COMASuplSession::HandleSuplInitError Send SUPL_END for SUPL_INIT"), KTraceFileName, __LINE__);
-		
-		//iSuplSessionState = ESUPL_GENERATE;		
-		iSuplSessionState = ESUPL_INITIALIZED;
-		iSuplState->SetMsgStateObserver(this);
-		iSuplMsgType = ESUPL_END;
-		SetPOSMsgPluginState(COMASuplPosSessionBase::EOMASuplCreating);	
-		//SMP Changes
-		
-		iSuplState->GenerateMessageL();
-		iSuplSessionState = ESUPL_GENERATE; // HAs to be here because initialisation has to be complete..
-	
+    iTrace->Trace(_L("Start COMASuplSession::HandleSuplInitError"), KTraceFileName, __LINE__); 
+    
+    if(aErr == KErrOMAInvalidHSLPAddress)
+        {
+            iTrace->Trace(_L("COMASuplSession::HandleSuplInitError HSLP Address is not matching..."), KTraceFileName, __LINE__);
+            //Close Connection : bug Fix.
+            iConnRequestor->CloseConnection();
+            iPortNum = 0;
+            iSessionObserver.TerminateSession(this, KErrCompletion);
+            return;
+        }
+            
+    TBool setStatusCode = ETrue;
+    
+
+    
+    if(aErr == KErrSuplInvalidSessionID)
+        {
+            iTrace->Trace(_L("COMASuplSession::HandleSuplInitError Received SET Session ID"), KTraceFileName, __LINE__);
+            iErrorStatusCode = COMASuplEnd::EInvalidSessionId;	
+
+            COMASuplSessionID* retrivedSessionID = NULL;
+            iDecodedAsnMessage->SessionId(retrivedSessionID);
+
+            // Set the SessionId.
+            iTrace->Trace(_L("COMASuplSession::HandleSuplInitError Update SET Session ID"), KTraceFileName, __LINE__);
+            UpdateSETSessionIDL(retrivedSessionID);
+
+        }
+        
+    if(aErr == KErrOMANonProxyModeNotSupported)
+        {
+            iTrace->Trace(_L("COMASuplSession::HandleSuplInitError Received Nonproxymode data"), KTraceFileName, __LINE__);
+            iErrorStatusCode = COMASuplEnd::ENonProxyModeNotSupported;	
+        }
+
+    if(KErrAccessDenied == aErr || KErrOMASuplDenied == aErr)
+        {
+            iTrace->Trace(_L("COMASuplSession::HandleSuplInitError KErrAccessDenied|| KErrOMASuplDenied"), KTraceFileName, __LINE__);
+            iErrorStatusCode = COMASuplEnd::EConsentDeniedByUser;	
+        }
+
+    if(aErr == KErrOMASuplNoPosition || KErrOMASuplInformationOnly == aErr)
+        {
+            //Supl End with No Position
+            iTrace->Trace(_L("COMASuplSession::HandleSuplInitError KErrOMASuplNoPosition || KErrOMASuplInformationOnly"), KTraceFileName, __LINE__);
+            setStatusCode = EFalse;
+        }
+    
+    if(KErrOMASuplAccepted == aErr)
+        {
+            iTrace->Trace(_L("COMASuplSession::HandleSuplInitError EConsentGrantedByUser"), KTraceFileName, __LINE__);
+            iErrorStatusCode = COMASuplEnd::EConsentGrantedByUser;	
+        }
+    
+    TInt len = iHSLPAddress.Length();
+    HBufC8 *hslpAdress = NULL;
+    if(len > 0)
+        {
+        hslpAdress = HBufC8::NewL(iHSLPAddress.Length());
+        hslpAdress->Des().Copy(iHSLPAddress);
+        }
+    else if(len ==0)
+        {
+        CServerParams* serverParams = CServerParams::NewL();
+        CleanupStack::PushL(serverParams);
+        
+        if (iSuplStorageSettings->GetDefaultServer(serverParams) == KErrNotFound )
+            {
+            iTrace->Trace(_L("HSLP generated frm IMSI"), KTraceFileName, __LINE__);
+            hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
+            hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());
+            }
+        else
+            {
+            iTrace->Trace(_L("Default HSLP"), KTraceFileName, __LINE__);
+            TInt64 slpId;
+            TBool aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable;
+            HBufC* serverAddr = HBufC::NewL(KMaxHSLPAddrLen);
+            HBufC* iapName = HBufC::NewL(KMaxIAPLen);
+            CleanupStack::PushL(serverAddr);
+            CleanupStack::PushL(iapName);
+            serverParams->Get(slpId,serverAddr->Des(),iapName->Des(),aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable);
+            hslpAdress = HBufC8::NewL(serverAddr->Length());
+            hslpAdress->Des().Copy(*serverAddr);
+        
+            CleanupStack::PopAndDestroy(iapName);
+            CleanupStack::PopAndDestroy(serverAddr);
+            }
+        CleanupStack::PopAndDestroy(serverParams);	
+        }
+
+    delete iSuplState;
+    iSuplState = NULL;
+    CleanupStack::PushL(hslpAdress);
+    if(setStatusCode)
+        {
+            iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
+        }
+    else
+        {
+            iSuplState = COMASuplEndState::NewL(iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress );
+        } 		
+        
+    CleanupStack::PopAndDestroy(hslpAdress);
+    
+    iTrace->Trace(_L("COMASuplSession::HandleSuplInitError Send SUPL_END for SUPL_INIT"), KTraceFileName, __LINE__);
+    
+    //iSuplSessionState = ESUPL_GENERATE;		
+    iSuplSessionState = ESUPL_INITIALIZED;
+    iSuplState->SetMsgStateObserver(this);
+    iSuplMsgType = ESUPL_END;
+    SetPOSMsgPluginState(COMASuplPosSessionBase::EOMASuplCreating);	
+    //SMP Changes
+    
+    iSuplState->GenerateMessageL();
+    iSuplSessionState = ESUPL_GENERATE; // HAs to be here because initialisation has to be complete..
 	}
 
 // -----------------------------------------------------------------------------
@@ -3758,6 +3803,8 @@
 
 					if(iRequestType == ESUPL_NETWORK )
 					{
+                if (messageType == COMASuplAsnMessageBase::ESUPL_INIT)    
+                    {                                
 						
 						iSuplSessionState = ESUPL_INITIALIZED;
 					    TInt len = iHSLPAddress.Length();
@@ -3769,14 +3816,39 @@
 					    }
 				   	else if(len ==0)
 					{
-					iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
-					hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
-					CleanupStack::PushL(hslpAdress);
-					hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
-					CleanupStack::Pop(hslpAdress);
-					    }
+                        CServerParams* serverParams = CServerParams::NewL();
+                        CleanupStack::PushL(serverParams);
+        
+                        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());	
+                            }		
+                        else
+                            {
+                            iTrace->Trace(_L("Sending End with ver for Default HSLP"), KTraceFileName, __LINE__);
+                            TInt64 slpId;
+                            TBool aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable;
+                            HBufC* serverAddr = HBufC::NewL(KMaxHSLPAddrLen);
+                            HBufC* iapName = HBufC::NewL(KMaxIAPLen);
+                            CleanupStack::PushL(serverAddr);
+                            CleanupStack::PushL(iapName);
+                            serverParams->Get(slpId,serverAddr->Des(),iapName->Des(),aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable);
+                            hslpAdress = HBufC8::NewL(serverAddr->Length());
+                            hslpAdress->Des().Copy(*serverAddr);
+            
+                            CleanupStack::PopAndDestroy(iapName);
+                            CleanupStack::PopAndDestroy(serverAddr);
+						    }
+                        CleanupStack::PopAndDestroy(serverParams);
+                        }
+                    
+	                    delete iSuplState;
+	                    iSuplState = NULL;
 						
 					    CleanupStack::PushL(hslpAdress);
+	                    ServerAddressCheckForSuplInitL();
 					    iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
 					    CleanupStack::PopAndDestroy(hslpAdress);
 
@@ -3789,6 +3861,17 @@
 						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 							
--- a/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplsession2.cpp	Fri Apr 16 15:23:31 2010 +0300
+++ b/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplsession2.cpp	Mon May 03 12:54:42 2010 +0300
@@ -90,6 +90,7 @@
 #include "epos_omasuplconfigurationkeys.h"
 #include "epos_csuplsettingparams.h"
 #include "epos_comasuplasnbase.h"
+#include "epos_csuplsettingsconstants.h"
 
 
 _LIT(KTraceFileName,"SUPL_OMA_SESSION::EPos_COMASuplSession2.cpp");
@@ -1718,7 +1719,8 @@
     TOMASuplUtcTime UtcTime;
     TOMASuplPositionEstimate PosEstimate;
     TDateTime TimeStamp;
-    TInt ZoneCode,Zone,altitude,AltitudeUncertainty, HorizontalAccuracy;
+    TInt ZoneCode,Zone,altitude, HorizontalAccuracy;
+	TInt AltitudeUncertainty = 0;
     TOMASuplAltitudeInfo AltitudeInfo;
     TInt latitude,longitude;
     TOMASuplPositionEstimate::TOMASuplLatitudeSign LatSign;
@@ -1902,7 +1904,8 @@
     TOMASuplUtcTime UtcTime;
     TOMASuplPositionEstimate PosEstimate;
     TDateTime TimeStamp;
-    TInt ZoneCode,Zone,altitude,AltitudeUncertainty, HorizontalAccuracy;
+    TInt ZoneCode,Zone,altitude, HorizontalAccuracy;
+	TInt AltitudeUncertainty = 0;
     TOMASuplAltitudeInfo AltitudeInfo;
     TInt latitude,longitude;
     TOMASuplPositionEstimate::TOMASuplLatitudeSign LatSign;
@@ -2194,6 +2197,10 @@
         {
         CreateCloneMessageL(aDecodedAsnMessage);		
         UpdateSuplSessionIDL();
+		if (iRequestType == ESUPL_NETWORK && messageType == COMASuplAsnMessageBase::ESUPL_INIT)
+			{
+			ServerAddressCheckForSuplInitL();
+			}
  
         iSuplSessionState = ESUPL_INITIALIZED;
         iSuplMsgType = ESUPL_END;
@@ -2222,12 +2229,35 @@
 
             else if(len ==0)
                 {
-                iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
-                hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
-                CleanupStack::PushL(hslpAdress);
-                hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
-                CleanupStack::Pop(hslpAdress);						
+                CServerParams* serverParams = CServerParams::NewL();
+                CleanupStack::PushL(serverParams);
+    
+                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());	
+                    }
+                else
+                    {
+                    iTrace->Trace(_L("Sending End with ver for Default HSLP"), KTraceFileName, __LINE__);
+                    TInt64 slpId;
+                    TBool aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable;
+                    HBufC* serverAddr = HBufC::NewL(KMaxHSLPAddrLen);
+                    HBufC* iapName = HBufC::NewL(KMaxIAPLen);
+                    CleanupStack::PushL(serverAddr);
+                    CleanupStack::PushL(iapName);
+                    serverParams->Get(slpId,serverAddr->Des(),iapName->Des(),aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable);
+                    hslpAdress = HBufC8::NewL(serverAddr->Length());
+                    hslpAdress->Des().Copy(*serverAddr);
+    
+                    CleanupStack::PopAndDestroy(iapName);
+                    CleanupStack::PopAndDestroy(serverAddr);
+                    }
+                CleanupStack::PopAndDestroy(serverParams);
                 }
+            delete iSuplState;
+            iSuplState=NULL;
             CleanupStack::PushL(hslpAdress);
             iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
             CleanupStack::PopAndDestroy(hslpAdress);
@@ -3857,18 +3887,41 @@
 
     else if(len ==0)
         {
-        iTrace->Trace(_L("HSLP generated frm IMSI"), KTraceFileName, __LINE__);
-        hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
-        CleanupStack::PushL(hslpAdress);
-        hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());
-        CleanupStack::Pop(hslpAdress);	
+		CServerParams* serverParams = CServerParams::NewL();
+		CleanupStack::PushL(serverParams);
+		
+		if (iSuplStorageSettings->GetDefaultServer(serverParams) == KErrNotFound )
+			{
+	        iTrace->Trace(_L("HSLP generated frm IMSI"), KTraceFileName, __LINE__);
+	        hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
+	        CleanupStack::PushL(hslpAdress);
+	        hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());
+	        CleanupStack::Pop(hslpAdress);	
+			}
+		else
+			{
+			iTrace->Trace(_L("Default HSLP"), KTraceFileName, __LINE__);
+			TInt64 slpId;
+			TBool aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable;
+			HBufC* serverAddr = HBufC::NewL(KMaxHSLPAddrLen);
+			HBufC* iapName = HBufC::NewL(KMaxIAPLen);
+			CleanupStack::PushL(serverAddr);
+			CleanupStack::PushL(iapName);
+			serverParams->Get(slpId,serverAddr->Des(),iapName->Des(),aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable);
+			hslpAdress = HBufC8::NewL(serverAddr->Length());
+			hslpAdress->Des().Copy(*serverAddr);
+		
+			CleanupStack::PopAndDestroy(iapName);
+			CleanupStack::PopAndDestroy(serverAddr);
+			}
+		CleanupStack::PopAndDestroy(serverParams);
 
         }
-    CleanupStack::PushL(hslpAdress);
 
     delete iSuplState;
     iSuplState = NULL;
 
+    CleanupStack::PushL(hslpAdress);
     if(setStatusCode)
         {
         iSuplState = COMASuplEndState::NewL(iErrorStatusCode,iOMASuplAsnHandlerBaseImpl,iEncodedSuplInit,hslpAdress);		
@@ -4390,39 +4443,61 @@
                     	}
                 	else if(len ==0)
                     	{
-                    	iTrace->Trace(_L("Length of HSLP Address is = 0, passing the HSLP generated frm IMSI"), KTraceFileName, __LINE__);
-                    	hslpAdress = HBufC8::NewL(iSuplSettings->SLPAddressfromImsi().Length());
-                    	CleanupStack::PushL(hslpAdress);
-                    	hslpAdress->Des().Copy(iSuplSettings->SLPAddressfromImsi());	
-                    	CleanupStack::Pop(hslpAdress);
+						CServerParams* serverParams = CServerParams::NewL();
+						CleanupStack::PushL(serverParams);
+					
+						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());	
+							}
+						else
+							{
+							iTrace->Trace(_L("Sending End with ver for Default HSLP"), KTraceFileName, __LINE__);
+							TInt64 slpId;
+            				TBool aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable;
+							HBufC* serverAddr = HBufC::NewL(KMaxHSLPAddrLen);
+							HBufC* iapName = HBufC::NewL(KMaxIAPLen);
+							CleanupStack::PushL(serverAddr);
+							CleanupStack::PushL(iapName);
+							serverParams->Get(slpId,serverAddr->Des(),iapName->Des(),aServerEnabled, aSimChangeRemove, aUsageInHomeNw, aEditable);
+							hslpAdress = HBufC8::NewL(serverAddr->Length());
+							hslpAdress->Des().Copy(*serverAddr);
+			
+							CleanupStack::PopAndDestroy(iapName);
+							CleanupStack::PopAndDestroy(serverAddr);
+							}
+						CleanupStack::PopAndDestroy(serverParams);
                     	}
 
-                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 							
                 {
--- a/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplstartstate.cpp	Fri Apr 16 15:23:31 2010 +0300
+++ b/supl/locationomasuplprotocolhandler/protocolhandlerver2/src/epos_comasuplstartstate.cpp	Mon May 03 12:54:42 2010 +0300
@@ -655,29 +655,32 @@
 					}
 			}
 			
-		COMASuplGSMCellInfo* cellInfo;
+		COMASuplGSMCellInfo* cellInfo = COMASuplGSMCellInfo::NewL();
         COMASuplLocationId::TOMASuplStatus status;
-        aLocationId->SuplLocationId(cellInfo, status);
+        TInt err = aLocationId->SuplLocationId(cellInfo, status);
 		
-		TInt refMNC,refMCC,refCI,refLac;
-		cellInfo->SuplGSMCellInfo(refMNC,refMCC,refCI,refLac);
-		
-        COMASuplGSMCellInfo* cellInfoClone = COMASuplGSMCellInfo::NewL();
-        cellInfoClone->SetSuplGSMCellInfo(refMNC,refMCC,refCI,refLac);
-		iLocationId2->SetSuplLocationId(cellInfoClone, status);
+		if(err == KErrNone)
+			{
+			TInt refMNC,refMCC,refCI,refLac;
+			cellInfo->SuplGSMCellInfo(refMNC,refMCC,refCI,refLac);
+			
+	        COMASuplGSMCellInfo* cellInfoClone = COMASuplGSMCellInfo::NewL();
+	        cellInfoClone->SetSuplGSMCellInfo(refMNC,refMCC,refCI,refLac);
+			iLocationId2->SetSuplLocationId(cellInfoClone, status);
 
-        iLocationId = aLocationId;
+	        iLocationId = aLocationId;
 
-		if(iECId)
-			{
-				iTrace->Trace(_L("COMASuplStartState::LocationIDRequestCompletedL...Retrive E-CellId"), KTraceFileName, __LINE__); 					
-				iGenerationStatus = ETrue;
-				iLocationIDRequestor->GetECellID();
+			if(iECId)
+				{
+					iTrace->Trace(_L("COMASuplStartState::LocationIDRequestCompletedL...Retrive E-CellId"), KTraceFileName, __LINE__); 					
+					iGenerationStatus = ETrue;
+					iLocationIDRequestor->GetECellID();
+				}
+			else
+				{	
+					GetAssistceDataFromPluginL(aErrorCode);
+				}
 			}
-		else
-			{	
-				GetAssistceDataFromPluginL(aErrorCode);
-			}	
 	}
 
 // -----------------------------------------------------------------------------