cbsatplugin/atmisccmdplugin/src/cfuncommandhandler.cpp
branchRCL_3
changeset 53 eede1356aa52
parent 35 95674584745d
--- a/cbsatplugin/atmisccmdplugin/src/cfuncommandhandler.cpp	Mon Jun 21 15:51:46 2010 +0300
+++ b/cbsatplugin/atmisccmdplugin/src/cfuncommandhandler.cpp	Thu Jul 15 18:50:18 2010 +0300
@@ -154,7 +154,7 @@
     TInt systemState;
     
     TInt ret = iProperty.Get(systemState);
-    if (ret != KErrNone)
+    if (ret == KErrNone)
         {
         if (systemState != iExpectedState)
             {
@@ -166,6 +166,7 @@
             ret = RestartDevice();
             }
         }
+    
     if (!IsActive())
         {
         if (ret != KErrNone)
@@ -206,7 +207,7 @@
         TRACE_FUNC_EXIT
         return err;
         }
-    
+   
     switch (aFunc)
         {
         case (0):
@@ -216,15 +217,17 @@
             // issue the profile change request and start monitoring the property
             if (systemState != ESwStateNormalRfOff)
                 {
-                err = SetActiveProfile(KOfflineProfileId);
-                
-                
+                err = SetActiveProfile(KOfflineProfileId);                
                 if (err == KErrNone)
                     {
                     iExpectedState = ESwStateNormalRfOff;
                     iProperty.Subscribe(iStatus);
                     SetActive();
-                    }           
+                    }       
+                }
+            else if (iReset)
+                {
+                err = RestartDevice();
                 }
             break;
             }
@@ -243,6 +246,10 @@
                     SetActive();
                     }
                 }
+            else if (iReset)
+                {
+                err = RestartDevice();
+                }
             break;
             }
         default: