securitydialogs/SecUi/Src/SecUiManualSecuritySettings.cpp
branchRCL_3
changeset 67 79bd6bd83ec3
parent 50 03674e5abf46
equal deleted inserted replaced
57:ead42e28e519 67:79bd6bd83ec3
   397 
   397 
   398     #if defined(_DEBUG)
   398     #if defined(_DEBUG)
   399     RDebug::Print(_L("(SECUI)CManualSecuritySettings::LockSimL(): Param length: %d"), length);
   399     RDebug::Print(_L("(SECUI)CManualSecuritySettings::LockSimL(): Param length: %d"), length);
   400     #endif
   400     #endif
   401 
   401 
   402     if (aType.CompareF(Operator) == 0)
   402     // make sure aLockCode's length won't exceed KSimLockMaxPasswordSize
   403         {
   403     if( aLockCode.Length() <= KSimLockMaxPasswordSize )
   404         aLockType = RMmCustomAPI::EOperator;
   404         {
   405         ret = iCustomPhone.ActivateSimLock( aLockCode,aLockType );
   405         if ( aType.CompareF( Operator ) == 0 )
   406         }
   406             {
   407 
   407             aLockType = RMmCustomAPI::EOperator;
   408     if (aType.CompareF(Gid1) == 0)
   408             ret = iCustomPhone.ActivateSimLock( aLockCode, aLockType );
   409         {
   409             }
   410         aLockType = RMmCustomAPI::EGid1;
   410 
   411         ret = iCustomPhone.ActivateSimLock( aLockCode,aLockType );
   411         if ( aType.CompareF( Gid1 ) == 0 )
   412         }
   412             {
   413 
   413             aLockType = RMmCustomAPI::EGid1;
   414     if (aType.CompareF(Gid2) == 0)
   414             ret = iCustomPhone.ActivateSimLock( aLockCode, aLockType );
   415         {
   415             }
   416         aLockType = RMmCustomAPI::EGid2;
   416 
   417         ret = iCustomPhone.ActivateSimLock( aLockCode,aLockType );
   417         if ( aType.CompareF( Gid2 ) == 0 )
   418         }
   418             {
   419 
   419             aLockType = RMmCustomAPI::EGid2;
   420     if (aType.CompareF(Imsi) == 0)
   420             ret = iCustomPhone.ActivateSimLock( aLockCode, aLockType );
   421         {
   421             }
   422         aLockType = RMmCustomAPI::EImsi;
   422 
   423         ret = iCustomPhone.ActivateSimLock( aLockCode,aLockType );
   423         if ( aType.CompareF( Imsi ) == 0 )
   424         }
   424             {
   425 
   425             aLockType = RMmCustomAPI::EImsi;
   426     if (aType.CompareF(Operator_Gid1) == 0)
   426             ret = iCustomPhone.ActivateSimLock( aLockCode, aLockType );
   427         {    
   427             }
   428         aLockType = RMmCustomAPI::EOperator_Gid1;
   428 
   429         ret = iCustomPhone.ActivateSimLock( aLockCode,aLockType );
   429         if ( aType.CompareF( Operator_Gid1 ) == 0 )
   430         }
   430             {    
   431 
   431             aLockType = RMmCustomAPI::EOperator_Gid1;
   432     if (aType.CompareF(Operator_Gid2) == 0)
   432             ret = iCustomPhone.ActivateSimLock( aLockCode, aLockType );
   433         {
   433             }
   434         aLockType = RMmCustomAPI::EOperator_Gid2;
   434 
   435         ret = iCustomPhone.ActivateSimLock( aLockCode,aLockType );
   435         if ( aType.CompareF( Operator_Gid2 ) == 0 )
       
   436             {
       
   437             aLockType = RMmCustomAPI::EOperator_Gid2;
       
   438             ret = iCustomPhone.ActivateSimLock( aLockCode, aLockType );
       
   439             }
   436         }
   440         }
   437 
   441 
   438     #if defined(_DEBUG)
   442     #if defined(_DEBUG)
   439     RDebug::Print(_L("(SECUI)CManualSecuritySettings::LockSimL() RESULT: %d"), ret);
   443     RDebug::Print(_L("(SECUI)CManualSecuritySettings::LockSimL() RESULT: %d"), ret);
   440     #endif
   444     #endif
   498     TInt length = aUnlockCode.Length();
   502     TInt length = aUnlockCode.Length();
   499 
   503 
   500     #if defined(_DEBUG)
   504     #if defined(_DEBUG)
   501     RDebug::Print(_L("(SECUI)CManualSecuritySettings::UnLockSimL(): Param length: %d"), length);
   505     RDebug::Print(_L("(SECUI)CManualSecuritySettings::UnLockSimL(): Param length: %d"), length);
   502     #endif
   506     #endif
   503     
   507 
   504     if (aType.CompareF(Operator) == 0)
   508     // make sure aUnlockCode's length won't exceed KSimLockMaxPasswordSize
   505         {
   509     if( aUnlockCode.Length() <= KSimLockMaxPasswordSize )
   506         aLockType = RMmCustomAPI::EOperator;
   510         {
   507         ret = iCustomPhone.DeActivateSimLock( aUnlockCode,aLockType );
   511         if ( aType.CompareF( Operator ) == 0 )
   508         }
   512             {
   509 
   513             aLockType = RMmCustomAPI::EOperator;
   510     if (aType.CompareF(Gid1) == 0)
   514             ret = iCustomPhone.DeActivateSimLock( aUnlockCode, aLockType );
   511         {
   515             }
   512         aLockType = RMmCustomAPI::EGid1;
   516 
   513         ret = iCustomPhone.DeActivateSimLock( aUnlockCode,aLockType );
   517         if ( aType.CompareF( Gid1 ) == 0 )
   514         }
   518             {
   515 
   519             aLockType = RMmCustomAPI::EGid1;
   516     if (aType.CompareF(Gid2) == 0)
   520             ret = iCustomPhone.DeActivateSimLock( aUnlockCode, aLockType );
   517         {
   521             }
   518         aLockType = RMmCustomAPI::EGid2;
   522 
   519         ret = iCustomPhone.DeActivateSimLock( aUnlockCode,aLockType );
   523         if ( aType.CompareF( Gid2 ) == 0 )
   520         }
   524             {
   521 
   525             aLockType = RMmCustomAPI::EGid2;
   522     if (aType.CompareF(Imsi) == 0)
   526             ret = iCustomPhone.DeActivateSimLock( aUnlockCode, aLockType );
   523         {
   527             }
   524         aLockType = RMmCustomAPI::EImsi;
   528 
   525         ret = iCustomPhone.DeActivateSimLock( aUnlockCode,aLockType );
   529         if ( aType.CompareF( Imsi ) == 0 )
   526         }
   530             {
   527 
   531             aLockType = RMmCustomAPI::EImsi;
   528     if (aType.CompareF(Operator_Gid1) == 0)
   532             ret = iCustomPhone.DeActivateSimLock( aUnlockCode, aLockType );
   529         {    
   533             }
   530         aLockType = RMmCustomAPI::EOperator_Gid1;
   534 
   531         ret = iCustomPhone.DeActivateSimLock( aUnlockCode,aLockType );
   535         if ( aType.CompareF( Operator_Gid1 ) == 0 )
   532         }
   536             {    
   533 
   537             aLockType = RMmCustomAPI::EOperator_Gid1;
   534     if (aType.CompareF(Operator_Gid2) == 0)
   538             ret = iCustomPhone.DeActivateSimLock( aUnlockCode, aLockType );
   535         {
   539             }
   536         aLockType = RMmCustomAPI::EOperator_Gid2;
   540 
   537         ret = iCustomPhone.DeActivateSimLock( aUnlockCode,aLockType );
   541         if ( aType.CompareF( Operator_Gid2 ) == 0 )
   538         }
   542             {
   539     if (aType.CompareF(GlobalUnlock) == 0)
   543             aLockType = RMmCustomAPI::EOperator_Gid2;
   540         {
   544             ret = iCustomPhone.DeActivateSimLock( aUnlockCode, aLockType );
   541         aLockType = RMmCustomAPI::EGlobalUnlock;
   545             }
   542         ret = iCustomPhone.DeActivateSimLock( aUnlockCode,aLockType );
   546         if ( aType.CompareF( GlobalUnlock ) == 0 )
   543         }    
   547             {
   544         
   548             aLockType = RMmCustomAPI::EGlobalUnlock;
       
   549             ret = iCustomPhone.DeActivateSimLock( aUnlockCode, aLockType );
       
   550             }
       
   551         }
   545     #if defined(_DEBUG)
   552     #if defined(_DEBUG)
   546     RDebug::Print(_L("(SECUI)CManualSecuritySettings::UnLockSimL() RESULT: %d"), ret);
   553     RDebug::Print(_L("(SECUI)CManualSecuritySettings::UnLockSimL() RESULT: %d"), ret);
   547     #endif
   554     #endif
   548     switch (ret)
   555     switch (ret)
   549         {
   556         {