Revision: 201017 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 16:32:45 +0300
branchRCL_3
changeset 19 8517a9ac4a23
parent 16 43c4dec3cb1f
child 20 a7d1e54a7332
Revision: 201017 Kit: 201019
realtimenetprots/sipfw/Data/101f413c.cre
realtimenetprots/sipfw/Group/bld.inf
realtimenetprots/sipfw/ProfileAgent/Group/sipietfagent.mmp
realtimenetprots/sipfw/ProfileAgent/Group/sipimsagent.mmp
realtimenetprots/sipfw/ProfileAgent/Group/sipprofilefsm.mmp
realtimenetprots/sipfw/ProfileAgent/Group/sipprofileserver.mmp
realtimenetprots/sipfw/ProfileAgent/Group/sipproxyrsv.mmp
realtimenetprots/sipfw/ProfileAgent/Server/Inc/SipProfileServerCore.h
realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileServerCore.cpp
realtimenetprots/sipfw/rom/sipsw.iby
Binary file realtimenetprots/sipfw/Data/101f413c.cre has changed
--- a/realtimenetprots/sipfw/Group/bld.inf	Tue Apr 27 17:00:49 2010 +0300
+++ b/realtimenetprots/sipfw/Group/bld.inf	Tue May 11 16:32:45 2010 +0300
@@ -35,8 +35,6 @@
 ../Data/101F413C.txt z:/private/10202be9/101f413c.txt
 // ProfileAgent's cenrep configuration file for expiry duration
 ../Data/2001F889.txt z:/private/10202be9/2001f889.txt
-// ProfileAgent's default cre file
-../Data/101f413c.cre z:/private/10202be9/101f413c.cre
 
 // ConfML files
 ../conf/sipframework.confml          MW_LAYER_EXPORTS_CONFML(sipframework.confml)
--- a/realtimenetprots/sipfw/ProfileAgent/Group/sipietfagent.mmp	Tue Apr 27 17:00:49 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/Group/sipietfagent.mmp	Tue May 11 16:32:45 2010 +0300
@@ -60,6 +60,6 @@
 
 VENDORID 0x70000001
 
-CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData
+CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData NetworkControl
 
 SMPSAFE
--- a/realtimenetprots/sipfw/ProfileAgent/Group/sipimsagent.mmp	Tue Apr 27 17:00:49 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/Group/sipimsagent.mmp	Tue May 11 16:32:45 2010 +0300
@@ -87,6 +87,6 @@
 
 VENDORID 0x70000001
 
-CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData
+CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData NetworkControl
 
 SMPSAFE
--- a/realtimenetprots/sipfw/ProfileAgent/Group/sipprofilefsm.mmp	Tue Apr 27 17:00:49 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/Group/sipprofilefsm.mmp	Tue May 11 16:32:45 2010 +0300
@@ -58,6 +58,6 @@
 
 VENDORID 0x70000001
 
-CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData
+CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData NetworkControl
 
 SMPSAFE
--- a/realtimenetprots/sipfw/ProfileAgent/Group/sipprofileserver.mmp	Tue Apr 27 17:00:49 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/Group/sipprofileserver.mmp	Tue May 11 16:32:45 2010 +0300
@@ -97,7 +97,7 @@
 
 VENDORID 0x70000001
 
-CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData
+CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData NetworkControl
 
 // MACRO 	PLAT_SEC_TEST
 
--- a/realtimenetprots/sipfw/ProfileAgent/Group/sipproxyrsv.mmp	Tue Apr 27 17:00:49 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/Group/sipproxyrsv.mmp	Tue May 11 16:32:45 2010 +0300
@@ -43,6 +43,6 @@
 
 VENDORID 0x70000001
 
-CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData
+CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData NetworkControl
 
 SMPSAFE
--- a/realtimenetprots/sipfw/ProfileAgent/Server/Inc/SipProfileServerCore.h	Tue Apr 27 17:00:49 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/Server/Inc/SipProfileServerCore.h	Tue May 11 16:32:45 2010 +0300
@@ -770,9 +770,23 @@
          */
         TBool CheckIapSettings(TUint32 aProfileId);
         
+        /**
+         * Issues the change of APN to PrimaryAPN 
+         */
         void UsePrimaryApn(TUint32 aIapId);
-
+        
+        /**
+         * Issues the change of APN to SecondaryAPN
+         */
         void UseBackupApn( TUint32 aIapId, TBool aFatalFailure = ETrue );
+        
+        /**
+         * Compares the two plugin typr info
+         * @returns ETrue if the match completely
+         * EFalse otherwise
+         */ 
+        static TBool Compare(const TSIPProfileTypeInfo& first,
+                        const TSIPProfileTypeInfo& second);
 		
         
 	private: // Data
--- a/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileServerCore.cpp	Tue Apr 27 17:00:49 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileServerCore.cpp	Tue May 11 16:32:45 2010 +0300
@@ -622,7 +622,12 @@
             CImplementationInformation* ecomInfo = infoArray[i];
             TSIPProfileTypeInfo info;
             ConvertTypeInfoL(*ecomInfo, info);
-            array.AppendL(info);
+            TIdentityRelation<TSIPProfileTypeInfo> identityRelation(CSIPProfileServerCore::Compare);
+            TInt alreadyExits = array.Find(info,identityRelation);
+            if(alreadyExits == KErrNotFound)
+                {
+                array.AppendL(info);
+                }
             }
         }
     CleanupStack::Pop(&infoArray);
@@ -1067,7 +1072,15 @@
                 }
             }
         else
-            User::LeaveIfError(KErrNotSupported);
+            {
+            // At this point the registration has failed fatally already and profile will be in 
+            // unregistered state. Since we cann't do any regisrtation related activity and 
+            // not to lose user's updated data we are doing this.
+            if(item->UsedProfile().Status() == CSIPConcreteProfile::EUnregistered)
+                {
+                item->ClearOldProfile();
+                }
+            }
         }
     else
         {
@@ -2353,11 +2366,34 @@
     }
 
 // ----------------------------------------------------------------------------
+// CSIPProfileServerCore::Compare
+// ----------------------------------------------------------------------------
+//
+TBool CSIPProfileServerCore::Compare(const TSIPProfileTypeInfo& first,
+        const TSIPProfileTypeInfo& second)
+    {
+    TInt result = first.iSIPProfileName.Compare(second.iSIPProfileName);
+    return ( 0 == result && first.iSIPProfileClass == second.iSIPProfileClass);
+    }
+
+// ----------------------------------------------------------------------------
 // CSIPProfileServerCore::IsUpdateAllowed
 // ----------------------------------------------------------------------------
 //
 TBool CSIPProfileServerCore::IsUpdateAllowed( CSIPConcreteProfile *aProfile )
     {
-    PROFILE_DEBUG1("CSIPIMSProfileAgent::IsUpdateAllowed, enter")
-    return !(iApnManager->IsFailed(aProfile->IapId()));
+    PROFILE_DEBUG1("CSIPProfileServerCore::IsUpdateAllowed, enter")
+    TBool allowed(ETrue);     
+    CSIPProfileCacheItem* item = ProfileCacheItem(aProfile->Id());
+    if(item)
+        {
+        CSIPConcreteProfile& profile = item->LatestProfile();
+        TBool iapIdChange(profile.IapId()!=aProfile->IapId());
+        if(iapIdChange && 
+            (iApnManager->IsFailed(aProfile->IapId()) || iApnManager->IsFailed(profile.IapId())))
+            {
+            allowed = EFalse;
+            }
+        }
+    return allowed;
     }
--- a/realtimenetprots/sipfw/rom/sipsw.iby	Tue Apr 27 17:00:49 2010 +0300
+++ b/realtimenetprots/sipfw/rom/sipsw.iby	Tue May 11 16:32:45 2010 +0300
@@ -108,9 +108,6 @@
 /* Resources - XML for secure profile backup*/
 data=ZPRIVATE\101F413C\backup_registration.xml private\101F413C\backup_registration.xml
 
-// ProfileAgent's default cre file
-data=DATAZ_\private\10202be9\101f413c.cre private\10202be9\101f413c.cre
-
 #endif /* SYMBIAN_EXCLUDE_SIP*/
 
 #endif /* __SIPSW_IBY__ */