securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp
changeset 63 989397f9511c
parent 59 881d92421467
child 66 67b3e3c1fc87
equal deleted inserted replaced
62:3255e7d5bd67 63:989397f9511c
   536     {
   536     {
   537     /*****************************************************
   537     /*****************************************************
   538      *    Series 60 Customer / ETel
   538      *    Series 60 Customer / ETel
   539      *    Series 60  ETel API
   539      *    Series 60  ETel API
   540      *****************************************************/
   540      *****************************************************/
       
   541     askChangeSimSecurityL:
   541     RDEBUG("0", 0);
   542     RDEBUG("0", 0);
   542     RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
   543     RMobilePhone::TMobilePhoneLockInfoV1 lockInfo;
   543     RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
   544     RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo);
   544     RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneToICC;
   545     RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneToICC;
   545     RMobilePhone::TMobilePhoneLockSetting lockChangeSetting;
   546     RMobilePhone::TMobilePhoneLockSetting lockChangeSetting;
   575         {
   576         {
   576         lockChangeSetting = RMobilePhone::ELockSetEnabled;
   577         lockChangeSetting = RMobilePhone::ELockSetEnabled;
   577         }
   578         }
   578     RDEBUG("lockChangeSetting", lockChangeSetting);
   579     RDEBUG("lockChangeSetting", lockChangeSetting);
   579 
   580 
       
   581     RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
       
   582 				CWait* newWait = NULL;
       
   583         newWait = CWait::NewL();
       
   584     RDEBUG("newWait SetLockSetting", 0);
       
   585     iPhone.SetLockSetting(newWait->iStatus, lockType, lockChangeSetting); // this invokes the handler
       
   586         RDEBUG("newWait WaitForRequestL",
       
   587                 0);
       
   588         status = newWait->WaitForRequestL();
       
   589         RDEBUG("newWait WaitForRequestL status",
       
   590                 status);
       
   591         delete newWait;
       
   592 
       
   593 /*
   580     iWait->SetRequestType(EMobilePhoneSetLockSetting);
   594     iWait->SetRequestType(EMobilePhoneSetLockSetting);
   581     RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
   595     RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk);
   582     RDEBUG("SetLockSetting", 0);
   596     RDEBUG("SetLockSetting", 0);
   583     iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting); // this invokes the handler
   597     iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting); // this invokes the handler
   584     RDEBUG("WaitForRequestL", 0);
   598     RDEBUG("WaitForRequestL", 0);
   585     status = iWait->WaitForRequestL();
   599     status = iWait->WaitForRequestL();
   586     RDEBUG("WaitForRequestL status", status);
   600     RDEBUG("WaitForRequestL status", status);
       
   601 */
   587 #ifdef __WINS__
   602 #ifdef __WINS__
   588     if (status == KErrNotSupported || status == KErrTimedOut)
   603     if (status == KErrNotSupported || status == KErrTimedOut)
   589         status = KErrNone;
   604         status = KErrNone;
   590 #endif
   605 #endif
   591 
   606 
   596         case KErrNone:
   611         case KErrNone:
   597             {
   612             {
   598             break;
   613             break;
   599             }
   614             }
   600         case KErrGsm0707IncorrectPassword:
   615         case KErrGsm0707IncorrectPassword:
       
   616             {
       
   617             // code was entered erroneously
       
   618     				RDEBUG("KErrGsm0707IncorrectPassword", KErrGsm0707IncorrectPassword);
       
   619             goto askChangeSimSecurityL;
       
   620             }
   601         case KErrAccessDenied:
   621         case KErrAccessDenied:
   602             {
   622             {
   603             // code was entered erroneously
   623             // code was entered erroneously
   604     				RDEBUG("KErrAccessDenied", KErrAccessDenied);
   624     				RDEBUG("KErrAccessDenied", KErrAccessDenied);
   605             return ChangeSimSecurityL();
   625             goto askChangeSimSecurityL;
   606             }
   626             }
   607         case KErrGsmSSPasswordAttemptsViolation:
   627         case KErrGsmSSPasswordAttemptsViolation:
   608         case KErrLocked:
   628         case KErrLocked:
   609             {
   629             {
   610     				RDEBUG("KErrLocked", KErrLocked);
   630     				RDEBUG("KErrLocked", KErrLocked);
   611             return ChangeSimSecurityL();
   631             goto askChangeSimSecurityL;
   612             }
   632             }
   613         case KErrAbort:
   633         case KErrAbort:
   614             {
   634             {
   615     				RDEBUG("KErrAbort", KErrAbort);
   635     				RDEBUG("KErrAbort", KErrAbort);
   616             return EFalse;
   636             return EFalse;
   617             }
   637             }
   618         default:
   638         default:
   619             {
   639             {
   620     				RDEBUG("default", status);
   640     				RDEBUG("default", status);
   621             ShowErrorNoteL(status);
   641             ShowErrorNoteL(status);
   622             return ChangeSimSecurityL();
   642             goto askChangeSimSecurityL;
   623             }
   643             }
   624         }
   644         }
   625 
   645 
   626     return ETrue;
   646     return ETrue;
   627     }
   647     }
  2574         CleanupStack::PopAndDestroy(); // scpClient 
  2594         CleanupStack::PopAndDestroy(); // scpClient 
  2575         }
  2595         }
  2576     RDEBUG("maxPeriod", maxPeriod);
  2596     RDEBUG("maxPeriod", maxPeriod);
  2577     if (FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw))
  2597     if (FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw))
  2578         {
  2598         {
  2579         TBool allow = ETrue;
       
  2580 
       
  2581         if ((aPeriod == 0) && (maxPeriod > 0))
  2599         if ((aPeriod == 0) && (maxPeriod > 0))
  2582             {
  2600             {
  2583             RDEBUG("The period is not allowed by TARM", aPeriod);
  2601             RDEBUG("The period is not allowed by TARM", aPeriod);
  2584             RDEBUG( "maxPeriod", maxPeriod );
  2602             RDEBUG( "maxPeriod", maxPeriod );
  2585             allow = EFalse;
       
  2586             ShowResultNoteL(R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE, CAknNoteDialog::EErrorTone);
  2603             ShowResultNoteL(R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE, CAknNoteDialog::EErrorTone);
  2587             }
  2604             return R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE; // don't ask again. Settings will roll-back
  2588         if (!allow)
  2605           	}
  2589             {
       
  2590             return ChangeAutoLockPeriodParamsL(aPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again
       
  2591             }
       
  2592         }
  2606         }
  2593 
  2607 
  2594     if (aPeriod == 0)
  2608     if (aPeriod == 0)
  2595         {
  2609         {
  2596         // If remote lock is enabled, don't disable the domestic OS device lock
  2610         // If remote lock is enabled, don't disable the domestic OS device lock