securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp
changeset 38 e0432375ea67
parent 37 7bad16cccaca
child 45 5d3e34b7618a
--- a/securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp	Wed Jun 23 19:10:54 2010 +0300
+++ b/securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp	Tue Jul 06 15:15:05 2010 +0300
@@ -204,8 +204,8 @@
     TBuf<0x80> iCaption;
     iCaption.Copy(_L("ChangePinL"));
     TInt iShowError = 1;
-    ChangePinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError);
-    RDEBUG("0", 0);
+    TInt err = ChangePinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError);
+    RDEBUG("err", err);
     }
 
 //
@@ -226,9 +226,9 @@
     TBuf<0x80> iCaption;
     iCaption.Copy(_L("ChangeUPinL"));
     TInt iShowError = 1;
-    ChangeUPinParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
+    TInt err = ChangeUPinParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
             iShowError);
-    RDEBUG("0", 0);
+    RDEBUG("err", err);
 
     }
 
@@ -250,10 +250,9 @@
     TBuf<0x80> iCaption;
     iCaption.Copy(_L("ChangePin2L"));
     TInt iShowError = 1;
-    ChangePin2ParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
+    TInt err = ChangePin2ParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
             iShowError);
-    RDEBUG("0", 0);
-
+    RDEBUG("err", err);
     }
 //
 // ----------------------------------------------------------
@@ -273,9 +272,9 @@
     TBuf<0x80> iCaption;
     iCaption.Copy(_L("ChangeSecCodeL"));
     TInt iShowError = 1;
-    ChangeSecCodeParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
+    TInt err = ChangeSecCodeParamsL(iOldPassword, iNewPassword, iFlags, iCaption,
             iShowError);
-    RDEBUG("0", 0);
+    RDEBUG("err", err);
     }
 //
 // ----------------------------------------------------------
@@ -357,7 +356,7 @@
 // a) first the RemoteMsg is enable, and this function is used to change it
 // b) if lock was disabled, the "change RemoteMsg" menu is not available.
 // ----------------------------------------------------------
-// no qtdone
+// qtdone
 TInt CSecuritySettings::RemoteLockCodeQueryL(TDes& aRemoteLockCode)
     {
 
@@ -406,7 +405,7 @@
                 RDEBUG( "WaitForRequestL res", res );
 #ifdef __WINS__
                 if (res == KErrNotSupported || res == KErrTimedOut)
-                res = 0xffffec50;	// TODO this means KErrGsm0707IncorrectPassword = incorrect code
+                res = KErrGsm0707IncorrectPassword;	// KErrGsm0707IncorrectPassword = incorrect code
 #endif
 								RDEBUG( "KErrGsm0707IncorrectPassword", KErrGsm0707IncorrectPassword );
                 if(res == KErrNone)
@@ -428,7 +427,7 @@
 // Changes lock setting in domestic OS. Changing the domestic OS lock setting
 // requires user to enter the security code.
 // ----------------------------------------------------------
-// no qtdone
+// qtdone
 TInt CSecuritySettings::RemoteLockSetLockSettingL(TBool aLockSetting)
     {
     TInt retValue( KErrNone );
@@ -621,12 +620,14 @@
     TBuf<0x80> iCaption;
     iCaption.Copy(_L("ChangePinRequestL"));
     TInt iShowError = 1;
-    ChangePinRequestParamsL(
+    TInt err = ChangePinRequestParamsL(
             1/* it's imposible to know if we want to set or clear*/,
             iOldPassword, iFlags, iCaption, iShowError);
-    RDEBUG("0", 0);
-
-    return ETrue;
+    RDEBUG("err", err);
+		if(err==KErrNone)
+    	return ETrue;
+		else
+   		return EFalse;
     }
 
 //
@@ -1650,7 +1651,7 @@
         if (res != KErrNone)
             {
             ShowResultNoteL(res, CAknNoteDialog::EErrorTone);
-            return res; // TODO not sure if it's wise to exit now.
+            return res; // not sure if it's wise to exit now.
             }
 
         newPassword = _L("");
@@ -2042,7 +2043,7 @@
 
     RDEBUG("codeInfo.iRemainingEntryAttempts",
             codeInfo.iRemainingEntryAttempts);
-    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) // TODO this might be 10
+    if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts)
         codeInfo.iRemainingEntryAttempts = -1;
 
     /* request PIN using QT */
@@ -2524,7 +2525,7 @@
     if (simRemoved)
         {
         ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone);
-        return EFalse;
+        return KErrAccessDenied;
         }
 
     RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
@@ -2603,7 +2604,7 @@
             // not allowed with this sim
             ShowResultNoteL(R_OPERATION_NOT_ALLOWED,
                     CAknNoteDialog::EErrorTone);
-            return EFalse;
+            return KErrGsm0707OperationNotAllowed;
             }
         case KErrGsm0707IncorrectPassword:
         case KErrAccessDenied:
@@ -2615,11 +2616,11 @@
         case KErrGsmSSPasswordAttemptsViolation:
         case KErrLocked:
             {
-            return ETrue;
+            return KErrLocked;
             }
         case KErrAbort:
             {
-            return EFalse;
+            return KErrAbort;
             }
         default:
             {
@@ -2627,7 +2628,7 @@
                     aCaption, aShowError);
             }
         }
-    return ETrue;
+    return KErrNone;
     }
 
 //