fotaapplication/fotaserver/FotaServer/src/FotaServer.cpp
changeset 24 bf47f3b79154
parent 22 19fb38abab1d
--- a/fotaapplication/fotaserver/FotaServer/src/FotaServer.cpp	Fri Apr 16 15:52:47 2010 +0300
+++ b/fotaapplication/fotaserver/FotaServer/src/FotaServer.cpp	Mon May 03 13:19:46 2010 +0300
@@ -24,8 +24,9 @@
 #include <schtime.h>
 #include <csch_cli.h>
 #include <e32property.h>
-#include <ApUtils.h> 
-#include <commdb.h>
+#include <nsmldmconst.h>
+#include <cmmanager.h>
+#include <cmconnectionmethod.h>
 #include <DevManInternalCRKeys.h>
 #include <nsmlconstants.h>
 #include <centralrepository.h>
@@ -2278,12 +2279,15 @@
 TBool CFotaServer::CheckIapExistsL(TUint32 aIapId)
     {
     FLOG(_L("CFotaServer::CheckIapExistsL >>"));
-    CCommsDatabase* commDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
-    CleanupStack::PushL( commDb );
-    CApUtils* aputils = CApUtils::NewLC(*commDb);
-    TBool exists = aputils->IAPExistsL( aIapId);      
-    CleanupStack::PopAndDestroy( aputils );
-    CleanupStack::PopAndDestroy( commDb );
+    TBool exists = EFalse;  
+    RCmManager cmManager;    
+    cmManager.OpenLC();
+    RCmConnectionMethod conn;
+    TRAPD(err, conn = cmManager.ConnectionMethodL( aIapId ));
+    if(err == KErrNone)//connection method exists
+       exists = ETrue;
+    conn.Close();
+    CleanupStack::PopAndDestroy();//cmManager                    
     FLOG(_L("CFotaServer::CheckIapExistsL <<"));
     return exists;
     }