193 // |
195 // |
194 // ---------------------------------------------------------- |
196 // ---------------------------------------------------------- |
195 // CSecuritySettings::ChangePinL() |
197 // CSecuritySettings::ChangePinL() |
196 // Changes PIN1 |
198 // Changes PIN1 |
197 // ---------------------------------------------------------- |
199 // ---------------------------------------------------------- |
198 // |
200 // qtdone |
199 EXPORT_C void CSecuritySettings::ChangePinL() |
201 EXPORT_C void CSecuritySettings::ChangePinL() |
200 { |
202 { |
201 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
203 RDEBUG( "0", 0 ); |
|
204 RMobilePhone::TMobilePassword iOldPassword; |
|
205 RMobilePhone::TMobilePassword iNewPassword; |
|
206 TInt iFlags=ESecUiTypeLock; |
|
207 iOldPassword.Copy(_L("")); |
|
208 iNewPassword.Copy(_L("")); |
|
209 |
|
210 TBuf<0x80> iCaption; |
|
211 iCaption.Copy(_L("ChangePinL")); |
|
212 TInt iShowError=1; |
|
213 ChangePinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError); |
|
214 RDEBUG( "0", 0 ); |
|
215 } |
|
216 |
|
217 // |
|
218 // ---------------------------------------------------------- |
|
219 // CSecuritySettings::ChangeUPinL() |
|
220 // Changes Universal PIN |
|
221 // ---------------------------------------------------------- |
|
222 // qtdone |
|
223 EXPORT_C void CSecuritySettings::ChangeUPinL() |
|
224 { |
|
225 RDEBUG( "0", 0 ); |
|
226 RMobilePhone::TMobilePassword iOldPassword; |
|
227 RMobilePhone::TMobilePassword iNewPassword; |
|
228 TInt iFlags=ESecUiTypeLock; |
|
229 iOldPassword.Copy(_L("")); |
|
230 iNewPassword.Copy(_L("")); |
|
231 |
|
232 TBuf<0x80> iCaption; |
|
233 iCaption.Copy(_L("ChangeUPinL")); |
|
234 TInt iShowError=1; |
|
235 ChangeUPinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError); |
|
236 RDEBUG( "0", 0 ); |
|
237 |
|
238 } |
|
239 |
|
240 // |
|
241 // ---------------------------------------------------------- |
|
242 // CSecuritySettings::ChangePin2L() |
|
243 // Changes PIN2 |
|
244 // ---------------------------------------------------------- |
|
245 // qtdone |
|
246 EXPORT_C void CSecuritySettings::ChangePin2L() |
|
247 { |
|
248 RDEBUG( "0", 0 ); |
|
249 RMobilePhone::TMobilePassword iOldPassword; |
|
250 RMobilePhone::TMobilePassword iNewPassword; |
|
251 TInt iFlags=ESecUiTypeLock; |
|
252 iOldPassword.Copy(_L("")); |
|
253 iNewPassword.Copy(_L("")); |
|
254 |
|
255 TBuf<0x80> iCaption; |
|
256 iCaption.Copy(_L("ChangePin2L")); |
|
257 TInt iShowError=1; |
|
258 ChangePin2ParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError); |
|
259 RDEBUG( "0", 0 ); |
|
260 |
|
261 } |
|
262 // |
|
263 // ---------------------------------------------------------- |
|
264 // CSecuritySettings::ChangeSecCodeL() |
|
265 // Changes security code |
|
266 // ---------------------------------------------------------- |
|
267 // qtdone |
|
268 EXPORT_C void CSecuritySettings::ChangeSecCodeL() |
|
269 { |
|
270 RDEBUG( "0", 0 ); |
202 RMobilePhone::TMobilePassword iOldPassword; |
271 RMobilePhone::TMobilePassword iOldPassword; |
203 RMobilePhone::TMobilePassword iNewPassword; |
272 RMobilePhone::TMobilePassword iNewPassword; |
204 TInt iFlags=0; |
273 TInt iFlags=0; |
205 RDebug::Printf( "%s %s (%u) iOldPassword=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
206 iOldPassword.Copy(_L("")); |
274 iOldPassword.Copy(_L("")); |
207 RDebug::Printf( "%s %s (%u) iNewPassword=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
208 iNewPassword.Copy(_L("")); |
275 iNewPassword.Copy(_L("")); |
209 |
276 |
210 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
211 TBuf<0x80> iCaption; |
277 TBuf<0x80> iCaption; |
212 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
213 iCaption.Copy(_L("ChangePinL")); |
|
214 RDebug::Printf( "%s %s (%u) iCaption=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
215 RDebug::Print(iCaption); |
|
216 TInt iShowError=1; |
|
217 ChangePinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError); |
|
218 RDebug::Printf( "%s %s (%u) iCaption=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
219 } |
|
220 |
|
221 // |
|
222 // ---------------------------------------------------------- |
|
223 // CSecuritySettings::ChangeUPinL() |
|
224 // Changes Universal PIN |
|
225 // ---------------------------------------------------------- |
|
226 // |
|
227 EXPORT_C void CSecuritySettings::ChangeUPinL() |
|
228 { |
|
229 TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); |
|
230 TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); |
|
231 if(wcdmaSupported || upinSupported) |
|
232 { |
|
233 #if defined(_DEBUG) |
|
234 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinL()")); |
|
235 #endif |
|
236 TInt simState; |
|
237 TInt err( KErrGeneral ); |
|
238 err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); |
|
239 User::LeaveIfError( err ); |
|
240 TBool simRemoved(simState == ESimNotPresent); |
|
241 |
|
242 if ( simRemoved ) |
|
243 { |
|
244 ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone); |
|
245 return; |
|
246 } |
|
247 |
|
248 RMobilePhone::TMobilePhoneSecurityCode secCodeType; |
|
249 secCodeType = RMobilePhone::ESecurityUniversalPin; |
|
250 |
|
251 RMobilePhone::TMobilePassword oldPassword; |
|
252 RMobilePhone::TMobilePassword newPassword; |
|
253 RMobilePhone::TMobilePassword verifcationPassword; |
|
254 RMobilePhone::TMobilePhonePasswordChangeV1 passwords; |
|
255 RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; |
|
256 RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); |
|
257 |
|
258 CCodeQueryDialog* verdlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone); |
|
259 CleanupStack::PushL(verdlg); |
|
260 |
|
261 CCodeQueryDialog* newdlg = new (ELeave) CCodeQueryDialog(newPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone); |
|
262 CleanupStack::PushL(newdlg); |
|
263 |
|
264 CCodeQueryDialog* dlg = new (ELeave) CCodeQueryDialog (oldPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone); |
|
265 CleanupStack::PushL(dlg); |
|
266 |
|
267 RMobilePhone::TMobilePhoneLock lockType; |
|
268 RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; |
|
269 |
|
270 lockType = RMobilePhone::ELockUniversalPin; |
|
271 |
|
272 RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); |
|
273 iWait->SetRequestType(EMobilePhoneGetLockInfo); |
|
274 iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); |
|
275 TInt res = iWait->WaitForRequestL(); |
|
276 User::LeaveIfError(res); |
|
277 |
|
278 if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) |
|
279 { |
|
280 CleanupStack::PopAndDestroy(3,verdlg); |
|
281 ShowResultNoteL(R_UPIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone); |
|
282 return; |
|
283 } |
|
284 |
|
285 CleanupStack::Pop(); // dlg |
|
286 // ask pin |
|
287 iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); |
|
288 iPhone.GetSecurityCodeInfo(iWait->iStatus, secCodeType, codeInfoPkg); |
|
289 res = iWait->WaitForRequestL(); |
|
290 User::LeaveIfError(res); |
|
291 |
|
292 if(codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) |
|
293 res = dlg->ExecuteLD(R_UPIN_QUERY); |
|
294 else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt) |
|
295 { |
|
296 HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_UPIN_ATTEMPTS, codeInfo.iRemainingEntryAttempts); |
|
297 res = dlg->ExecuteLD(R_UPIN_QUERY, *queryPrompt); |
|
298 CleanupStack::PopAndDestroy(queryPrompt); |
|
299 } |
|
300 else |
|
301 { |
|
302 HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_UPIN_ATTEMPT); |
|
303 res = dlg->ExecuteLD(R_UPIN_QUERY, *queryPrompt); |
|
304 CleanupStack::PopAndDestroy(queryPrompt); |
|
305 } |
|
306 |
|
307 |
|
308 |
|
309 if( !res ) |
|
310 { |
|
311 CleanupStack::PopAndDestroy(2,verdlg); |
|
312 return; |
|
313 } |
|
314 CleanupStack::Pop(); // newdlg |
|
315 // new pin code query |
|
316 if (!(newdlg->ExecuteLD(R_NEW_UPIN_CODE_QUERY))) |
|
317 { |
|
318 CleanupStack::PopAndDestroy(verdlg); |
|
319 return; |
|
320 } |
|
321 |
|
322 CleanupStack::Pop(); // verdlg |
|
323 // verification code query |
|
324 if (!(verdlg->ExecuteLD(R_VERIFY_NEW_UPIN_CODE_QUERY))) |
|
325 return; |
|
326 |
|
327 while (newPassword.CompareF(verifcationPassword) != 0) |
|
328 { |
|
329 // codes do not match -> note -> ask new pin and verification codes again |
|
330 ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone); |
|
331 |
|
332 newPassword = _L(""); |
|
333 verifcationPassword = _L(""); |
|
334 |
|
335 // new pin code query |
|
336 CCodeQueryDialog* newdlg = new (ELeave) CCodeQueryDialog (newPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone); |
|
337 if (!(newdlg->ExecuteLD(R_NEW_UPIN_CODE_QUERY))) |
|
338 return; |
|
339 |
|
340 // verification code query |
|
341 CCodeQueryDialog* verdlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH,ESecUiNone); |
|
342 if (!(verdlg->ExecuteLD(R_VERIFY_NEW_UPIN_CODE_QUERY))) |
|
343 return; |
|
344 } |
|
345 |
|
346 // send code |
|
347 passwords.iOldPassword = oldPassword; |
|
348 passwords.iNewPassword = newPassword; |
|
349 iWait->SetRequestType(EMobilePhoneChangeSecurityCode); |
|
350 iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords); |
|
351 res = iWait->WaitForRequestL(); |
|
352 #if defined(_DEBUG) |
|
353 RDebug::Print( _L("(SECUI)CSecuritySettings::ChangePinL(): RETURN CODE: %d"), res); |
|
354 #endif |
|
355 switch(res) |
|
356 { |
|
357 case KErrNone: |
|
358 { |
|
359 // code changed |
|
360 ShowResultNoteL(R_UPIN_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); |
|
361 break; |
|
362 } |
|
363 case KErrGsm0707IncorrectPassword: |
|
364 case KErrAccessDenied: |
|
365 { |
|
366 // code was entered erroneously |
|
367 ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); |
|
368 ChangeUPinL(); |
|
369 break; |
|
370 } |
|
371 case KErrGsmSSPasswordAttemptsViolation: |
|
372 case KErrLocked: |
|
373 { |
|
374 return; |
|
375 } |
|
376 case KErrGsm0707OperationNotAllowed: |
|
377 { |
|
378 // not allowed with this sim |
|
379 ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); |
|
380 return; |
|
381 } |
|
382 case KErrAbort: |
|
383 { |
|
384 break; |
|
385 } |
|
386 default: |
|
387 { |
|
388 ShowErrorNoteL(res); |
|
389 ChangeUPinL(); |
|
390 break; |
|
391 } |
|
392 } |
|
393 } |
|
394 |
|
395 } |
|
396 |
|
397 // |
|
398 // ---------------------------------------------------------- |
|
399 // CSecuritySettings::ChangePin2L() |
|
400 // Changes PIN2 |
|
401 // ---------------------------------------------------------- |
|
402 // |
|
403 EXPORT_C void CSecuritySettings::ChangePin2L() |
|
404 { |
|
405 /***************************************************** |
|
406 * Series 60 Customer / ETel |
|
407 * Series 60 ETel API |
|
408 *****************************************************/ |
|
409 #if defined(_DEBUG) |
|
410 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePin2L()")); |
|
411 #endif |
|
412 TInt simState; |
|
413 TInt err( KErrGeneral ); |
|
414 err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); |
|
415 User::LeaveIfError( err ); |
|
416 TBool simRemoved(simState == ESimNotPresent); |
|
417 |
|
418 if ( simRemoved ) |
|
419 { |
|
420 ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone); |
|
421 return; |
|
422 } |
|
423 |
|
424 RMmCustomAPI::TSecurityCodeType secCodeType; |
|
425 RMobilePhone::TMobilePhoneSecurityCode EtelsecCodeType; |
|
426 secCodeType = RMmCustomAPI::ESecurityCodePin2; |
|
427 RMobilePhone::TMobilePassword oldPassword; |
|
428 RMobilePhone::TMobilePassword newPassword; |
|
429 RMobilePhone::TMobilePassword verifcationPassword; |
|
430 RMobilePhone::TMobilePhonePasswordChangeV1 passwords; |
|
431 RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; |
|
432 RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); |
|
433 |
|
434 // check if pin2 is blocked... |
|
435 TBool isBlocked = EFalse; |
|
436 |
|
437 TInt ret = iCustomPhone.IsBlocked(secCodeType,isBlocked); |
|
438 |
|
439 if(isBlocked) |
|
440 return; |
|
441 |
|
442 if (ret != KErrNone) |
|
443 { |
|
444 switch (ret) |
|
445 { |
|
446 // PIN2 Blocked. |
|
447 case KErrGsm0707SIMPuk2Required: |
|
448 break; |
|
449 case KErrGsmSSPasswordAttemptsViolation: |
|
450 case KErrLocked: |
|
451 // Pin2 features blocked permanently! |
|
452 ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone); |
|
453 break; |
|
454 case KErrGsm0707SimNotInserted: |
|
455 // not allowed with this sim |
|
456 ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); |
|
457 break; |
|
458 default: |
|
459 ShowErrorNoteL(ret); |
|
460 break; |
|
461 } |
|
462 return; |
|
463 } |
|
464 |
|
465 CCodeQueryDialog* verdlg = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone); |
|
466 CleanupStack::PushL(verdlg); |
|
467 |
|
468 CCodeQueryDialog* newdlg = new (ELeave) CCodeQueryDialog(newPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone); |
|
469 CleanupStack::PushL(newdlg); |
|
470 |
|
471 CCodeQueryDialog* dlg = new (ELeave) CCodeQueryDialog (oldPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone); |
|
472 CleanupStack::PushL(dlg); |
|
473 |
|
474 |
|
475 // Security code must be changed to Etel API format |
|
476 // Custom API Pin1 and Pin2 have the same enum values as the Etel ones |
|
477 EtelsecCodeType = (RMobilePhone::TMobilePhoneSecurityCode)secCodeType; |
|
478 #ifndef __WINS__ |
|
479 iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); |
|
480 iPhone.GetSecurityCodeInfo(iWait->iStatus, EtelsecCodeType, codeInfoPkg); |
|
481 ret = iWait->WaitForRequestL(); |
|
482 User::LeaveIfError(ret); |
|
483 #else |
|
484 codeInfo.iRemainingEntryAttempts = 1; |
|
485 #endif //__WINS__ |
|
486 |
|
487 if(codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) |
|
488 ret = dlg->ExecuteLD(R_PIN2_QUERY); |
|
489 else if(codeInfo.iRemainingEntryAttempts > KLastRemainingInputAttempt) |
|
490 { |
|
491 HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_REMAINING_PIN2_ATTEMPTS, codeInfo.iRemainingEntryAttempts ); |
|
492 ret = dlg->ExecuteLD(R_PIN2_QUERY, *queryPrompt); |
|
493 CleanupStack::PopAndDestroy(queryPrompt); |
|
494 } |
|
495 else |
|
496 { |
|
497 HBufC* queryPrompt = StringLoader::LoadLC(R_SECUI_FINAL_PIN2_ATTEMPT); |
|
498 ret = dlg->ExecuteLD(R_PIN2_QUERY, *queryPrompt); |
|
499 CleanupStack::PopAndDestroy(queryPrompt); |
|
500 } |
|
501 |
|
502 CleanupStack::Pop(); // dlg |
|
503 if(!ret) |
|
504 { |
|
505 CleanupStack::PopAndDestroy(2,verdlg); |
|
506 return; |
|
507 } |
|
508 |
|
509 // new pin code query |
|
510 CleanupStack::Pop(); // newdlg |
|
511 if(!(newdlg->ExecuteLD(R_NEW_PIN2_CODE_QUERY))) |
|
512 { |
|
513 CleanupStack::PopAndDestroy(verdlg); |
|
514 return; |
|
515 } |
|
516 |
|
517 // verification code query |
|
518 CleanupStack::Pop(); // verdlg |
|
519 if(!(verdlg->ExecuteLD(R_VERIFY_NEW_PIN2_CODE_QUERY))) |
|
520 { |
|
521 return; |
|
522 } |
|
523 |
|
524 while (newPassword.CompareF(verifcationPassword) != 0) |
|
525 { |
|
526 // codes do not match -> note -> ask new pin and verification codes again |
|
527 ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone); |
|
528 |
|
529 newPassword = _L(""); |
|
530 verifcationPassword = _L(""); |
|
531 |
|
532 // new pin code query |
|
533 CCodeQueryDialog* dlg = new (ELeave) CCodeQueryDialog (newPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone); |
|
534 if(!(dlg->ExecuteLD(R_NEW_PIN2_CODE_QUERY))) |
|
535 return; |
|
536 |
|
537 // verification code query |
|
538 CCodeQueryDialog* dlg2 = new (ELeave) CCodeQueryDialog (verifcationPassword,SEC_C_PIN2_CODE_MIN_LENGTH,SEC_C_PIN2_CODE_MAX_LENGTH,ESecUiNone); |
|
539 if(!(dlg2->ExecuteLD(R_VERIFY_NEW_PIN2_CODE_QUERY))) |
|
540 return; |
|
541 } |
|
542 |
|
543 |
|
544 passwords.iOldPassword = oldPassword; |
|
545 passwords.iNewPassword = newPassword; |
|
546 iWait->SetRequestType(EMobilePhoneChangeSecurityCode); |
|
547 iPhone.ChangeSecurityCode(iWait->iStatus,EtelsecCodeType,passwords); |
|
548 TInt res = iWait->WaitForRequestL(); |
|
549 #if defined(_DEBUG) |
|
550 RDebug::Print( _L("(SECUI)CSecuritySettings::ChangePin2L(): RETURN CODE: %d"), res); |
|
551 #endif |
|
552 switch(res) |
|
553 { |
|
554 case KErrNone: |
|
555 { |
|
556 // code changed |
|
557 ShowResultNoteL(R_PIN2_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); |
|
558 break; |
|
559 } |
|
560 case KErrGsm0707IncorrectPassword: |
|
561 case KErrAccessDenied: |
|
562 { |
|
563 ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); |
|
564 ChangePin2L(); |
|
565 break; |
|
566 } |
|
567 case KErrGsmSSPasswordAttemptsViolation: |
|
568 case KErrLocked: |
|
569 { |
|
570 // Pin2 blocked! |
|
571 ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); |
|
572 CSecurityHandler* handler = new(ELeave) CSecurityHandler(iPhone); |
|
573 CleanupStack::PushL(handler); |
|
574 handler->HandleEventL(RMobilePhone::EPuk2Required); |
|
575 CleanupStack::PopAndDestroy(handler); // handler |
|
576 return; |
|
577 } |
|
578 case KErrGsm0707OperationNotAllowed: |
|
579 { |
|
580 // not allowed with this sim |
|
581 ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); |
|
582 return; |
|
583 } |
|
584 case KErrAbort: |
|
585 { |
|
586 break; |
|
587 } |
|
588 default: |
|
589 { |
|
590 ShowErrorNoteL(res); |
|
591 ChangePin2L(); |
|
592 break; |
|
593 } |
|
594 } |
|
595 } |
|
596 // |
|
597 // ---------------------------------------------------------- |
|
598 // CSecuritySettings::ChangeSecCodeL() |
|
599 // Changes security code |
|
600 // ---------------------------------------------------------- |
|
601 // |
|
602 EXPORT_C void CSecuritySettings::ChangeSecCodeL() |
|
603 { |
|
604 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
605 RMobilePhone::TMobilePassword iOldPassword; |
|
606 RMobilePhone::TMobilePassword iNewPassword; |
|
607 TInt iFlags=0; |
|
608 RDebug::Printf( "%s %s (%u) iOldPassword=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
609 iOldPassword.Copy(_L("")); |
|
610 RDebug::Printf( "%s %s (%u) iNewPassword=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
611 iNewPassword.Copy(_L("")); |
|
612 |
|
613 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
614 TBuf<0x80> iCaption; |
|
615 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
616 iCaption.Copy(_L("ChangeSecCodeL")); |
278 iCaption.Copy(_L("ChangeSecCodeL")); |
617 RDebug::Printf( "%s %s (%u) iCaption=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
618 RDebug::Print(iCaption); |
|
619 TInt iShowError=1; |
279 TInt iShowError=1; |
620 ChangeSecCodeParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError); |
280 ChangeSecCodeParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError); |
621 RDebug::Printf( "%s %s (%u) iCaption=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
281 RDEBUG( "0", 0 ); |
622 } |
282 } |
623 // |
283 // |
624 // ---------------------------------------------------------- |
284 // ---------------------------------------------------------- |
625 // CSecuritySettings::ChangeAutoLockPeriodL() |
285 // CSecuritySettings::ChangeAutoLockPeriodL() |
626 // Changes autolock period |
286 // Changes autolock period |
627 // ---------------------------------------------------------- |
287 // ---------------------------------------------------------- |
628 // |
288 // qtdone |
629 EXPORT_C TInt CSecuritySettings::ChangeAutoLockPeriodL(TInt aPeriod) |
289 EXPORT_C TInt CSecuritySettings::ChangeAutoLockPeriodL(TInt aPeriod) |
630 { |
290 { |
631 /***************************************************** |
291 TInt ret=0; |
632 * Series 60 Customer / ETel |
292 RDEBUG( "aPeriod", aPeriod ); |
633 * Series 60 ETel API |
293 RMobilePhone::TMobilePassword iOldPassword; |
634 *****************************************************/ |
294 TInt iFlags=0; |
635 #if defined(_DEBUG) |
295 TInt iShowError=1; |
636 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodLXXXX()")); |
296 TBuf<0x80> iCaption; |
637 #endif |
297 iCaption.Copy(_L("ChangeAutoLockPeriodL")); |
638 RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled); |
298 iOldPassword.Copy(_L("")); |
639 RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; |
299 ret = ChangeAutoLockPeriodParamsL(aPeriod, iOldPassword, iFlags, iCaption, iShowError); |
640 TInt currentItem = 0; |
300 RDEBUG( "ret", ret ); |
641 TInt oldPeriod = aPeriod; |
301 return ret; |
642 |
|
643 #if defined(_DEBUG) |
|
644 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() ReadDesC16ArrayResourceL")); |
|
645 #endif |
|
646 |
|
647 |
|
648 CCoeEnv* coeEnv = CCoeEnv::Static(); |
|
649 CDesCArrayFlat* items = coeEnv->ReadDesC16ArrayResourceL(R_AUTOLOCK_LBX); |
|
650 CleanupStack::PushL(items); |
|
651 |
|
652 if (aPeriod == 0) |
|
653 { |
|
654 currentItem = 0; // autolock off |
|
655 } |
|
656 else |
|
657 { |
|
658 currentItem = 1; // user defined |
|
659 } |
|
660 |
|
661 |
|
662 #if defined(_DEBUG) |
|
663 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() New autolocksettingpage")); |
|
664 #endif |
|
665 |
|
666 CAutoLockSettingPage* dlg = new (ELeave)CAutoLockSettingPage(R_AUTOLOCK_SETTING_PAGE, currentItem, items, aPeriod); |
|
667 CleanupStack::PushL(dlg); |
|
668 dlg->ConstructL(); |
|
669 TInt maxPeriod; |
|
670 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw )) |
|
671 { |
|
672 // Retrieve the current autolock period max. value from the SCP server, |
|
673 // and check that the value the user |
|
674 // selected is ok from the Corporate Policy point of view. |
|
675 RSCPClient scpClient; |
|
676 TInt ret = scpClient.Connect(); |
|
677 if ( ret == KErrNone ) |
|
678 { |
|
679 CleanupClosePushL( scpClient ); |
|
680 TBuf<KSCPMaxIntLength> maxPeriodBuf; |
|
681 if ( scpClient.GetParamValue( ESCPMaxAutolockPeriod, maxPeriodBuf ) == KErrNone ) |
|
682 { |
|
683 TLex lex( maxPeriodBuf ); |
|
684 if ( ( lex.Val( maxPeriod ) == KErrNone ) && ( maxPeriod > 0 ) ) |
|
685 { |
|
686 dlg->SetPeriodMaximumValue(maxPeriod); |
|
687 } |
|
688 else |
|
689 { |
|
690 maxPeriod = 0; |
|
691 dlg->SetPeriodMaximumValue(maxPeriod); |
|
692 } |
|
693 |
|
694 } |
|
695 else |
|
696 { |
|
697 #if defined(_DEBUG) |
|
698 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL():\ |
|
699 ERROR: Failed to retrieve max period")); |
|
700 #endif |
|
701 } |
|
702 } |
|
703 else |
|
704 { |
|
705 #if defined(_DEBUG) |
|
706 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL():\ |
|
707 ERROR: Failed to connect to SCP.")); |
|
708 #endif |
|
709 } |
|
710 CleanupStack::PopAndDestroy(); // scpClient |
|
711 } |
|
712 CleanupStack::Pop(); //dlg |
|
713 if (!dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged)) |
|
714 { |
|
715 CleanupStack::PopAndDestroy(items); |
|
716 return oldPeriod; |
|
717 } |
|
718 |
|
719 CleanupStack::PopAndDestroy(); // items |
|
720 |
|
721 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw )) |
|
722 { |
|
723 TBool allow = ETrue; |
|
724 |
|
725 if ((aPeriod == 0) && (maxPeriod > 0)) |
|
726 { |
|
727 #if defined(_DEBUG) |
|
728 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() \ |
|
729 The period: %d is not allowed by TARM; max: %d"),aPeriod, maxPeriod ); |
|
730 #endif |
|
731 allow = EFalse; |
|
732 HBufC* prompt; |
|
733 prompt = StringLoader::LoadLC( R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE ); |
|
734 CAknNoteDialog* noteDlg = new (ELeave) CAknNoteDialog( REINTERPRET_CAST(CEikDialog**,¬eDlg) ); |
|
735 noteDlg->PrepareLC( R_CODE_ERROR ); |
|
736 noteDlg->SetTextL( *prompt ); |
|
737 noteDlg->SetTimeout( CAknNoteDialog::ELongTimeout ); |
|
738 noteDlg->SetTone( CAknNoteDialog::EErrorTone ); |
|
739 noteDlg->RunLD(); |
|
740 |
|
741 CleanupStack::PopAndDestroy( prompt ); |
|
742 } |
|
743 |
|
744 if ( !allow ) |
|
745 { |
|
746 return ChangeAutoLockPeriodL( oldPeriod ); |
|
747 } |
|
748 } |
|
749 |
|
750 if (aPeriod == 0) |
|
751 { |
|
752 |
|
753 #ifdef RD_REMOTELOCK |
|
754 |
|
755 // If remote lock is enabled, don't disable the domestic OS device lock |
|
756 // since that would render the RemoteLock useless. |
|
757 // Instead just re-set the DOS lock to enabled which as a side effect |
|
758 // requests the security code from the user. |
|
759 |
|
760 TBool remoteLockStatus( EFalse ); |
|
761 CRemoteLockSettings* remoteLockSettings = CRemoteLockSettings::NewL(); |
|
762 |
|
763 if ( remoteLockSettings->GetEnabled( remoteLockStatus ) ) |
|
764 { |
|
765 if ( remoteLockStatus ) |
|
766 { |
|
767 // Remote lock is enabled |
|
768 #ifdef _DEBUG |
|
769 RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeAutoLockPeriodL() - RemoteLock is enabled: lockChange = RMobilePhone::ELockSetEnabled" ) ); |
|
770 #endif // _DEBUG |
|
771 |
|
772 lockChange = RMobilePhone::ELockSetEnabled; |
|
773 } |
|
774 else |
|
775 { |
|
776 // Remote lock is disabled |
|
777 #ifdef _DEBUG |
|
778 RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeAutoLockPeriodL() - RemoteLock is disabled: lockChange = RMobilePhone::ELockSetDisabled" ) ); |
|
779 #endif // _DEBUG |
|
780 |
|
781 lockChange = RMobilePhone::ELockSetDisabled; |
|
782 } |
|
783 } |
|
784 else |
|
785 { |
|
786 // Failed to get remote lock status |
|
787 #ifdef _DEBUG |
|
788 RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeAutoLockPeriodL() - Failed to get RemoteLock status" ) ); |
|
789 #endif // _DEBUG |
|
790 } |
|
791 |
|
792 delete remoteLockSettings; |
|
793 remoteLockSettings = NULL; |
|
794 |
|
795 #else // not defined RD_REMOTELOCK |
|
796 |
|
797 lockChange = RMobilePhone::ELockSetDisabled; |
|
798 |
|
799 #endif // RD_REMOTELOCK |
|
800 } |
|
801 else |
|
802 { |
|
803 lockChange = RMobilePhone::ELockSetEnabled; |
|
804 } |
|
805 #if defined(_DEBUG) |
|
806 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() SetLockSetting")); |
|
807 #endif |
|
808 iWait->SetRequestType(EMobilePhoneSetLockSetting); |
|
809 RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk); |
|
810 iPhone.SetLockSetting(iWait->iStatus,lockType,lockChange); |
|
811 TInt status = iWait->WaitForRequestL(); |
|
812 #if defined(_DEBUG) |
|
813 RDebug::Print( _L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL(): RETURN CODE: %d"), status); |
|
814 #endif |
|
815 switch(status) |
|
816 { |
|
817 case KErrNone: |
|
818 #if defined(_DEBUG) |
|
819 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() KErrNone")); |
|
820 #endif |
|
821 break; |
|
822 case KErrGsmSSPasswordAttemptsViolation: |
|
823 case KErrLocked: |
|
824 #if defined(_DEBUG) |
|
825 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() PasswordAttemptsViolation")); |
|
826 #endif |
|
827 return ChangeAutoLockPeriodL(oldPeriod); |
|
828 case KErrGsm0707IncorrectPassword: |
|
829 case KErrAccessDenied: |
|
830 #if defined(_DEBUG) |
|
831 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() IncorrectPassword")); |
|
832 #endif |
|
833 // code was entered erroneously |
|
834 return ChangeAutoLockPeriodL(oldPeriod); |
|
835 case KErrAbort: |
|
836 // User pressed "cancel" in the code query dialog. |
|
837 return oldPeriod; |
|
838 default: |
|
839 #if defined(_DEBUG) |
|
840 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() default")); |
|
841 #endif |
|
842 return ChangeAutoLockPeriodL(oldPeriod); |
|
843 } |
|
844 #if defined(_DEBUG) |
|
845 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() END")); |
|
846 #endif |
|
847 return aPeriod; |
|
848 } |
302 } |
849 |
303 |
850 |
304 |
851 |
305 |
852 // |
306 // |
853 // ---------------------------------------------------------- |
307 // ---------------------------------------------------------- |
854 // CSecuritySettings::ChangeRemoteLockStatusL() |
308 // CSecuritySettings::ChangeRemoteLockStatusL() |
855 // Changes remote lock status (on/off) |
309 // Changes remote lock status (on/off) |
856 // ---------------------------------------------------------- |
310 // ---------------------------------------------------------- |
857 // |
311 // no qtdone |
858 EXPORT_C TInt CSecuritySettings::ChangeRemoteLockStatusL( TBool& aRemoteLockStatus, TDes& aRemoteLockCode, TInt aAutoLockPeriod ) |
312 EXPORT_C TInt CSecuritySettings::ChangeRemoteLockStatusL( TBool& aRemoteLockStatus, TDes& aRemoteLockCode, TInt aAutoLockPeriod ) |
859 { |
313 { |
860 #ifdef RD_REMOTELOCK |
314 #ifdef RD_REMOTELOCK |
861 TInt retValue( KErrNone ); |
315 TInt retValue( KErrNone ); |
862 |
316 |
1722 // |
1188 // |
1723 // ---------------------------------------------------------- |
1189 // ---------------------------------------------------------- |
1724 // CSecuritySettings::IsLockEnabledL() |
1190 // CSecuritySettings::IsLockEnabledL() |
1725 // Return is lock enabled/disabled |
1191 // Return is lock enabled/disabled |
1726 // ---------------------------------------------------------- |
1192 // ---------------------------------------------------------- |
1727 // |
1193 // qtdone |
1728 EXPORT_C TBool CSecuritySettings::IsLockEnabledL(RMobilePhone::TMobilePhoneLock aLockType) |
1194 EXPORT_C TBool CSecuritySettings::IsLockEnabledL(RMobilePhone::TMobilePhoneLock aLockType) |
1729 { |
1195 { |
1730 /***************************************************** |
1196 TBool ret=EFalse; |
1731 * Series 60 Customer / ETel |
|
1732 * Series 60 ETel API |
|
1733 *****************************************************/ |
|
1734 #if defined(_DEBUG) |
|
1735 RDebug::Print(_L("(SECUI)CSecuritySettings::IsLockEnabledL()")); |
|
1736 #endif |
|
1737 #ifdef __WINS__ |
|
1738 |
|
1739 return EFalse; |
|
1740 |
|
1741 #else //WINS |
|
1742 |
|
1743 RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; |
1197 RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; |
1744 |
|
1745 //get lock info |
1198 //get lock info |
1746 RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); |
1199 RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); |
1747 iWait->SetRequestType(EMobilePhoneGetLockInfo); |
1200 iWait->SetRequestType(EMobilePhoneGetLockInfo); |
|
1201 RDEBUG( "GetLockInfo", 0 ); |
1748 iPhone.GetLockInfo(iWait->iStatus, aLockType, lockInfoPkg); |
1202 iPhone.GetLockInfo(iWait->iStatus, aLockType, lockInfoPkg); |
|
1203 RDEBUG( "WaitForRequestL", 0 ); |
1749 TInt res = iWait->WaitForRequestL(); |
1204 TInt res = iWait->WaitForRequestL(); |
|
1205 RDEBUG( "WaitForRequestL res", res ); |
1750 |
1206 |
1751 if (res != KErrNone) |
1207 if (res != KErrNone) |
1752 return ETrue; |
1208 ret = ETrue; |
1753 |
|
1754 //lock is enabled return true |
1209 //lock is enabled return true |
1755 if (lockInfo.iSetting == RMobilePhone::ELockSetEnabled) |
1210 else if (lockInfo.iSetting == RMobilePhone::ELockSetEnabled) |
1756 { |
1211 { |
1757 return ETrue; |
1212 ret = ETrue; |
1758 } |
1213 } |
1759 |
1214 RDEBUG( "ret", ret ); |
1760 // lock is disabled return false |
1215 return ret; |
1761 return EFalse; |
|
1762 |
|
1763 #endif |
|
1764 |
|
1765 } |
1216 } |
1766 // |
1217 // |
1767 // ---------------------------------------------------------- |
1218 // ---------------------------------------------------------- |
1768 // CSecuritySettings::AskSecCodeL() |
1219 // CSecuritySettings::AskSecCodeL() |
1769 // For asking security code e.g in settings |
1220 // For asking security code e.g in settings |
1770 // ---------------------------------------------------------- |
1221 // ---------------------------------------------------------- |
1771 // |
1222 // qtdone |
1772 EXPORT_C TBool CSecuritySettings::AskSecCodeL() |
1223 EXPORT_C TBool CSecuritySettings::AskSecCodeL() |
1773 { |
1224 { |
1774 return iSecurityHandler->AskSecCodeL(); |
1225 return iSecurityHandler->AskSecCodeL(); |
1775 } |
1226 } |
1776 // |
1227 // |
1777 // ---------------------------------------------------------- |
1228 // ---------------------------------------------------------- |
1778 // CSecuritySettings::AskPin2L() |
1229 // CSecuritySettings::AskPin2L() |
1779 // Asks PIN2 |
1230 // Asks PIN2 |
1780 // ---------------------------------------------------------- |
1231 // ---------------------------------------------------------- |
1781 // |
1232 // qtdone |
1782 EXPORT_C TBool CSecuritySettings::AskPin2L() |
1233 EXPORT_C TBool CSecuritySettings::AskPin2L() |
1783 { |
1234 { |
1784 /***************************************************** |
1235 /***************************************************** |
1785 * Series 60 Customer / ETel |
1236 * Series 60 Customer / ETel |
1786 * Series 60 ETel API |
1237 * Series 60 ETel API |
1787 *****************************************************/ |
1238 *****************************************************/ |
1788 #if defined(_DEBUG) |
1239 RDEBUG( "0", 0 ); |
1789 RDebug::Print(_L("(SECUI)CSecuritySettings::AskPin2L()")); |
1240 TInt retPhone = 0; |
1790 #endif |
|
1791 TInt ret = 0; |
|
1792 // check if pin2 is blocked... |
1241 // check if pin2 is blocked... |
1793 RMmCustomAPI::TSecurityCodeType secCodeType = RMmCustomAPI::ESecurityCodePin2; |
1242 RMmCustomAPI::TSecurityCodeType secCodeType = RMmCustomAPI::ESecurityCodePin2; |
1794 RMobilePhone::TMobilePhoneSecurityCode etelsecCodeType(RMobilePhone::ESecurityCodePin2); |
1243 RMobilePhone::TMobilePhoneSecurityCode etelsecCodeType(RMobilePhone::ESecurityCodePin2); |
1795 RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; |
1244 RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; |
1796 RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); |
1245 RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); |
|
1246 RMobilePhone::TMobilePassword password; |
1797 TBool isBlocked = EFalse; |
1247 TBool isBlocked = EFalse; |
|
1248 TInt queryAccepted = KErrCancel; |
1798 //Check whether PIN2 is blocked |
1249 //Check whether PIN2 is blocked |
1799 ret = iCustomPhone.IsBlocked(secCodeType,isBlocked); |
1250 retPhone = iCustomPhone.IsBlocked(secCodeType,isBlocked); |
1800 |
1251 |
1801 #if defined(_DEBUG) |
1252 RDEBUG( "retPhone", retPhone ); |
1802 RDebug::Print(_L("(SECUI)CSecuritySettings::AskPin2L() IsBlocked return value: %d"), ret); |
1253 RDEBUG( "isBlocked", isBlocked ); |
1803 #endif |
1254 #ifdef __WINS__ |
|
1255 if (retPhone == KErrNotSupported) |
|
1256 retPhone = KErrNone; |
|
1257 #endif |
1804 if(isBlocked) |
1258 if(isBlocked) |
1805 return EFalse; |
1259 return EFalse; |
1806 |
1260 |
1807 if (ret != KErrNone) |
1261 if (retPhone != KErrNone) |
1808 { |
1262 { |
1809 switch (ret) |
1263 switch (retPhone) |
1810 { |
1264 { |
1811 // PIN2 Blocked. |
1265 // PIN2 Blocked. |
1812 case KErrGsm0707SIMPuk2Required: |
1266 case KErrGsm0707SIMPuk2Required: |
1813 break; |
1267 break; |
1814 case KErrGsmSSPasswordAttemptsViolation: |
1268 case KErrGsmSSPasswordAttemptsViolation: |
2049 */ |
1503 */ |
2050 CHbDeviceMessageBoxSymbian* messageBox = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning); |
1504 CHbDeviceMessageBoxSymbian* messageBox = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning); |
2051 CleanupStack::PushL(messageBox); |
1505 CleanupStack::PushL(messageBox); |
2052 _LIT(KText, "ShowResultNoteL: "); |
1506 _LIT(KText, "ShowResultNoteL: "); |
2053 TBuf<0x200> title; |
1507 TBuf<0x200> title; |
|
1508 TBuf<0x200> titleTr; |
2054 title.Zero(); |
1509 title.Zero(); |
|
1510 titleTr.Zero(); |
2055 title.Append(KText); |
1511 title.Append(KText); |
2056 title.AppendNum(aResourceID); |
1512 title.AppendNum(aResourceID); |
2057 _LIT(KSeparator, " "); |
1513 _LIT(KSeparator, " "); |
2058 title.Append(KSeparator); |
1514 title.Append(KSeparator); |
2059 switch(aResourceID) |
1515 switch(aResourceID) |
2060 { |
1516 { |
2061 case 0: |
1517 case 0: |
|
1518 titleTr.Append(_L("OK")); |
2062 title.Append(_L("OK")); |
1519 title.Append(_L("OK")); |
2063 break; |
1520 break; |
2064 case KErrGsm0707IncorrectPassword: |
1521 case KErrGsm0707IncorrectPassword: |
2065 title.Append(_L("KErrGsm0707IncorrectPassword")); |
1522 titleTr.Append(_L("KErrGsm0707IncorrectPassword")); |
|
1523 title.Append(_L("Incorrect Password")); |
2066 break; |
1524 break; |
2067 case KErrAccessDenied: |
1525 case KErrAccessDenied: |
2068 title.Append(_L("KErrAccessDenied")); |
1526 titleTr.Append(_L("KErrAccessDenied")); |
|
1527 title.Append(_L("Access Denied")); |
2069 break; |
1528 break; |
2070 case KErrGsmSSPasswordAttemptsViolation: |
1529 case KErrGsmSSPasswordAttemptsViolation: |
2071 title.Append(_L("KErrGsmSSPasswordAttemptsViolation")); |
1530 titleTr.Append(_L("KErrGsmSSPasswordAttemptsViolation")); |
|
1531 title.Append(_L("Password Attempts Violation")); |
2072 break; |
1532 break; |
2073 case KErrLocked: |
1533 case KErrLocked: |
2074 title.Append(_L("KErrLocked")); |
1534 titleTr.Append(_L("KErrLocked")); |
|
1535 title.Append(_L("Locked")); |
2075 break; |
1536 break; |
2076 case KErrGsm0707OperationNotAllowed: |
1537 case KErrGsm0707OperationNotAllowed: |
2077 title.Append(_L("KErrGsm0707OperationNotAllowed")); |
1538 titleTr.Append(_L("KErrGsm0707OperationNotAllowed")); |
|
1539 title.Append(_L("Operation Not Allowed")); |
2078 break; |
1540 break; |
2079 case KErrAbort: |
1541 case KErrAbort: |
2080 title.Append(_L("KErrAbort")); |
1542 titleTr.Append(_L("KErrAbort")); |
|
1543 title.Append(_L("Abort")); |
2081 break; |
1544 break; |
2082 case KErrNotSupported: |
1545 case KErrNotSupported: |
2083 title.Append(_L("KErrNotSupported")); |
1546 titleTr.Append(_L("KErrNotSupported")); |
|
1547 title.Append(_L("Not Supported")); |
2084 break; |
1548 break; |
2085 case R_SEC_BLOCKED: |
1549 case R_SEC_BLOCKED: |
2086 title.Append(_L("R_SEC_BLOCKED")); |
1550 titleTr.Append(_L("R_SEC_BLOCKED")); |
|
1551 title.Append(_L("BLOCKED")); |
2087 break; |
1552 break; |
2088 case R_CODE_ERROR: |
1553 case R_CODE_ERROR: |
2089 title.Append(_L("R_CODE_ERROR")); |
1554 titleTr.Append(_L("R_CODE_ERROR")); |
|
1555 title.Append(_L("ERROR")); |
2090 break; |
1556 break; |
2091 case KErrGsmInvalidParameter: |
1557 case KErrGsmInvalidParameter: |
2092 title.Append(_L("KErrGsmInvalidParameter")); |
1558 titleTr.Append(_L("KErrGsmInvalidParameter")); |
|
1559 title.Append(_L("Invalid Parameter")); |
2093 break; |
1560 break; |
2094 case R_CONFIRMATION_NOTE: |
1561 case R_CONFIRMATION_NOTE: |
2095 title.Append(_L("R_CONFIRMATION_NOTE")); |
1562 titleTr.Append(_L("R_CONFIRMATION_NOTE")); |
|
1563 title.Append(_L("CONFIRMED")); |
2096 break; |
1564 break; |
2097 case R_CODES_DONT_MATCH: |
1565 case R_CODES_DONT_MATCH: |
2098 title.Append(_L("R_CODES_DONT_MATCH")); |
1566 titleTr.Append(_L("R_CODES_DONT_MATCH")); |
|
1567 title.Append(_L("CODES DONT MATCH")); |
2099 break; |
1568 break; |
2100 case R_PIN_CODE_CHANGED_NOTE: |
1569 case R_PIN_CODE_CHANGED_NOTE: |
2101 title.Append(_L("R_PIN_CODE_CHANGED_NOTE")); |
1570 titleTr.Append(_L("R_PIN_CODE_CHANGED_NOTE")); |
|
1571 title.Append(_L("PIN CODE CHANGED")); |
2102 break; |
1572 break; |
2103 case R_SECURITY_CODE_CHANGED_NOTE: |
1573 case R_SECURITY_CODE_CHANGED_NOTE: |
2104 title.Append(_L("R_SECURITY_CODE_CHANGED_NOTE")); |
1574 titleTr.Append(_L("R_SECURITY_CODE_CHANGED_NOTE")); |
|
1575 title.Append(_L("SECURITY CODE CHANGED")); |
2105 break; |
1576 break; |
2106 default: |
1577 case R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE: |
|
1578 titleTr.Append(_L("R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE")); |
|
1579 title.Append(_L("AUTOLOCK MUST BE ACTIVE")); |
|
1580 break; |
|
1581 case KErrServerTerminated: |
|
1582 titleTr.Append(_L("KErrServerTerminated")); |
|
1583 title.Append(_L("Server Terminated")); |
|
1584 break; |
|
1585 case KErrServerBusy: |
|
1586 titleTr.Append(_L("KErrServerBusy")); |
|
1587 title.Append(_L("Server Busy")); |
|
1588 break; |
|
1589 case R_PIN2_REJECTED: |
|
1590 titleTr.Append(_L("R_PIN2_REJECTED")); |
|
1591 title.Append(_L("PIN2 REJECTED")); |
|
1592 break; |
|
1593 case R_OPERATION_NOT_ALLOWED: |
|
1594 titleTr.Append(_L("R_OPERATION_NOT_ALLOWED")); |
|
1595 title.Append(_L("OPERATION NOT ALLOWED")); |
|
1596 break; |
|
1597 case R_UPIN_NOT_ALLOWED: |
|
1598 titleTr.Append(_L("R_UPIN_NOT_ALLOWED")); |
|
1599 title.Append(_L("UPIN NOT ALLOWED")); |
|
1600 break; |
|
1601 case R_PIN_NOT_ALLOWED: |
|
1602 titleTr.Append(_L("R_PIN_NOT_ALLOWED")); |
|
1603 title.Append(_L("PIN NOT ALLOWED")); |
|
1604 break; |
|
1605 case R_INSERT_SIM: |
|
1606 titleTr.Append(_L("R_INSERT_SIM")); |
|
1607 title.Append(_L("INSERT SIM")); |
|
1608 break; |
|
1609 case R_SIM_ON: |
|
1610 titleTr.Append(_L("R_SIM_ON")); |
|
1611 title.Append(_L("SIM ON")); |
|
1612 break; |
|
1613 case KErrTimedOut: |
|
1614 titleTr.Append(_L("KErrTimedOut")); |
|
1615 title.Append(_L("Timed Out")); |
|
1616 break; |
|
1617 case R_PIN2_CODE_CHANGED_NOTE: |
|
1618 titleTr.Append(_L("R_PIN2_CODE_CHANGED_NOTE")); |
|
1619 title.Append(_L("PIN2 CODE CHANGED")); |
|
1620 break; |
|
1621 case KErrArgument: |
|
1622 titleTr.Append(_L("KErrArgument")); |
|
1623 title.Append(_L("Error Argument")); |
|
1624 break; |
|
1625 |
|
1626 default: // " " |
|
1627 titleTr.Append(_L("Specific Error")); |
2107 title.Append(_L("Specific Error")); |
1628 title.Append(_L("Specific Error")); |
2108 break; |
1629 break; |
2109 } |
1630 } |
2110 messageBox->SetTextL(title); |
1631 messageBox->SetTextL(title); |
2111 RDebug::Printf( "%s %s (%u) aResourceID=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aResourceID ); |
1632 RDEBUG( "aResourceID", aResourceID ); |
|
1633 RDebug::Print( titleTr ); |
2112 |
1634 |
2113 _LIT(KIconName, "qtg_small_smiley_wondering"); |
1635 _LIT(KIconName, "qtg_small_smiley_wondering"); |
2114 messageBox->SetIconNameL(KIconName); |
1636 messageBox->SetIconNameL(KIconName); |
2115 |
1637 // TODO use aTone for sound |
2116 messageBox->ExecL(); |
1638 |
|
1639 // use default timeout |
|
1640 messageBox->ShowL(); |
2117 CleanupStack::PopAndDestroy(); // messageBox |
1641 CleanupStack::PopAndDestroy(); // messageBox |
2118 |
1642 |
2119 } |
1643 } |
2120 |
1644 |
2121 // |
1645 // |
2122 // ---------------------------------------------------------- |
1646 // ---------------------------------------------------------- |
2123 // CSecuritySettings::IsUpinSupportedL() |
1647 // CSecuritySettings::IsUpinSupportedL() |
2124 // Return is UPIN supported |
1648 // Return is UPIN supported |
2125 // ---------------------------------------------------------- |
1649 // ---------------------------------------------------------- |
2126 // |
1650 // qtdone |
2127 EXPORT_C TBool CSecuritySettings::IsUpinSupportedL() |
1651 EXPORT_C TBool CSecuritySettings::IsUpinSupportedL() |
2128 { |
1652 { |
2129 TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); |
1653 TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); |
2130 TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); |
1654 TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); |
|
1655 TBool isSupported = EFalse; |
2131 if(wcdmaSupported || upinSupported) |
1656 if(wcdmaSupported || upinSupported) |
2132 { |
1657 { |
2133 #if defined(_DEBUG) |
1658 #if defined(_DEBUG) |
2134 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported() BEGIN")); |
1659 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported() BEGIN")); |
2135 #endif |
1660 #endif |
2136 #ifdef __WINS__ |
|
2137 |
|
2138 return EFalse; |
|
2139 |
|
2140 #else //WINS |
|
2141 |
1661 |
2142 RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; |
1662 RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; |
2143 |
1663 |
2144 //get lock info |
1664 //get lock info |
2145 RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); |
1665 RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); |
2146 iWait->SetRequestType(EMobilePhoneGetLockInfo); |
1666 iWait->SetRequestType(EMobilePhoneGetLockInfo); |
2147 #if defined(_DEBUG) |
1667 RDEBUG( "GetLockInfo", 0 ); |
2148 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported() GetLockInfo")); |
|
2149 #endif |
|
2150 iPhone.GetLockInfo(iWait->iStatus, RMobilePhone::ELockUniversalPin, lockInfoPkg); |
1668 iPhone.GetLockInfo(iWait->iStatus, RMobilePhone::ELockUniversalPin, lockInfoPkg); |
|
1669 RDEBUG( "WaitForRequestL", 0 ); |
2151 TInt res = iWait->WaitForRequestL(); |
1670 TInt res = iWait->WaitForRequestL(); |
2152 #if defined(_DEBUG) |
1671 RDEBUG( "WaitForRequestL res", res ); |
2153 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported() GetLockInfo DONE")); |
|
2154 #endif |
|
2155 if ((res == KErrNotSupported) || (res == KErrGsmInvalidParameter)) |
1672 if ((res == KErrNotSupported) || (res == KErrGsmInvalidParameter)) |
2156 { |
1673 { |
2157 #if defined(_DEBUG) |
1674 #if defined(_DEBUG) |
2158 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported(): NOT SUPPORTED")); |
1675 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported(): NOT SUPPORTED")); |
2159 #endif |
1676 #endif |
2160 return EFalse; |
1677 isSupported = EFalse; |
2161 } |
1678 } |
2162 #if defined(_DEBUG) |
1679 else |
2163 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported(): SUPPORTED: %d"), res); |
1680 { |
2164 #endif |
1681 RDEBUG( "0", 0 ); |
2165 #if defined(_DEBUG) |
1682 |
2166 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported() END")); |
1683 isSupported = ETrue; |
2167 #endif |
1684 } |
2168 return ETrue; |
|
2169 |
|
2170 #endif //WINS |
|
2171 } |
1685 } |
2172 else |
1686 else |
2173 return EFalse; |
1687 isSupported = EFalse; |
|
1688 RDEBUG( "isSupported", isSupported ); |
|
1689 return isSupported; |
2174 } |
1690 } |
2175 // |
1691 // |
2176 // ---------------------------------------------------------- |
1692 // ---------------------------------------------------------- |
2177 // CSecuritySettings::IsCodeBlocked() |
1693 // CSecuritySettings::IsUpinBlocked() |
2178 // Return is a code blocked |
1694 // Return is a code blocked |
2179 // ---------------------------------------------------------- |
1695 // ---------------------------------------------------------- |
2180 // |
1696 // qtdone |
2181 EXPORT_C TBool CSecuritySettings::IsUpinBlocked() |
1697 EXPORT_C TBool CSecuritySettings::IsUpinBlocked() |
2182 { |
1698 { |
2183 TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); |
1699 TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); |
2184 TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); |
1700 TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); |
2185 if(wcdmaSupported || upinSupported) |
1701 if(wcdmaSupported || upinSupported) |
2186 { |
1702 { |
2187 #ifdef __WINS__ |
|
2188 return EFalse; |
|
2189 #else//__WINS__ |
|
2190 #if defined(_DEBUG) |
|
2191 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinBlocked() BEGIN")); |
|
2192 #endif |
|
2193 RMmCustomAPI::TSecurityCodeType secCodeType; |
1703 RMmCustomAPI::TSecurityCodeType secCodeType; |
2194 secCodeType = RMmCustomAPI::ESecurityUniversalPin; |
1704 secCodeType = RMmCustomAPI::ESecurityUniversalPin; |
2195 TBool isBlocked = EFalse; |
1705 TBool isBlocked = EFalse; |
2196 #if defined(_DEBUG) |
1706 RDEBUG( "IsBlocked", 0 ); |
2197 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinBlocked() IsBlocked")); |
|
2198 #endif |
|
2199 TInt ret = iCustomPhone.IsBlocked(secCodeType,isBlocked); |
1707 TInt ret = iCustomPhone.IsBlocked(secCodeType,isBlocked); |
2200 #if defined(_DEBUG) |
1708 RDEBUG( "ret", ret ); |
2201 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinBlocked() DONE.RETURN: %d"), ret); |
1709 RDEBUG( "isBlocked", isBlocked ); |
2202 #endif |
|
2203 #if defined(_DEBUG) |
|
2204 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinBlocked():isblocked: %d"), isBlocked); |
|
2205 #endif |
|
2206 #if defined(_DEBUG) |
|
2207 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinBlocked() END")); |
|
2208 #endif |
|
2209 return isBlocked; |
1710 return isBlocked; |
2210 #endif //__WINS__ |
|
2211 } |
1711 } |
2212 else |
1712 else |
2213 return EFalse; |
1713 return EFalse; |
2214 } |
1714 } |
2215 // |
1715 // |
2216 // ---------------------------------------------------------- |
1716 // ---------------------------------------------------------- |
2217 // CSecuritySettings::GetActivePinCode() |
1717 // CSecuritySettings::IsUpinActive() |
2218 // Return the code active in current application (PIN/UPIN) |
1718 // Return the code active in current application (PIN/UPIN) |
2219 // ---------------------------------------------------------- |
1719 // ---------------------------------------------------------- |
2220 // |
1720 // qtdone |
2221 EXPORT_C TBool CSecuritySettings::IsUpinActive() |
1721 EXPORT_C TBool CSecuritySettings::IsUpinActive() |
2222 { |
1722 { |
2223 TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); |
1723 TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); |
2224 TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); |
1724 TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); |
2225 if(wcdmaSupported || upinSupported) |
1725 if(wcdmaSupported || upinSupported) |
2226 { |
1726 { |
2227 #ifdef __WINS__ |
|
2228 return EFalse; |
|
2229 #else//__WINS__ |
|
2230 #if defined(_DEBUG) |
|
2231 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive() BEGIN")); |
|
2232 #endif |
|
2233 RMobilePhone::TMobilePhoneSecurityCode activePin; |
1727 RMobilePhone::TMobilePhoneSecurityCode activePin; |
2234 #if defined(_DEBUG) |
1728 RDEBUG( "GetActivePin", 0 ); |
2235 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive() GetActivePin")); |
1729 iCustomPhone.GetActivePin(activePin); |
2236 #endif |
1730 RDEBUG( "activePin", activePin ); |
2237 iCustomPhone.GetActivePin(activePin); |
1731 RDEBUG( "RMobilePhone::ESecurityUniversalPin", RMobilePhone::ESecurityUniversalPin ); |
2238 #if defined(_DEBUG) |
|
2239 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive() GetActivePin DONE")); |
|
2240 #endif |
|
2241 if(activePin == RMobilePhone::ESecurityUniversalPin) |
1732 if(activePin == RMobilePhone::ESecurityUniversalPin) |
2242 { |
1733 { |
2243 #if defined(_DEBUG) |
|
2244 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive(): UPIN ACTIVE")); |
|
2245 #endif |
|
2246 return ETrue; |
1734 return ETrue; |
2247 } |
1735 } |
2248 #if defined(_DEBUG) |
|
2249 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive(): UPIN NOT ACTIVE")); |
|
2250 #endif |
|
2251 #if defined(_DEBUG) |
|
2252 RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinActive(): END")); |
|
2253 #endif |
|
2254 return EFalse; |
1736 return EFalse; |
2255 #endif //__WINS__ |
|
2256 } |
1737 } |
2257 else |
1738 else |
2258 return EFalse; |
1739 return EFalse; |
2259 } |
1740 } |
2260 |
1741 |
|
1742 /**************************/ |
|
1743 // qtdone |
2261 EXPORT_C TInt CSecuritySettings::ChangePinParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
1744 EXPORT_C TInt CSecuritySettings::ChangePinParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
2262 { |
1745 { |
2263 TInt ret = KErrNone; |
1746 RDEBUG( "aFlags", aFlags ); |
2264 RDebug::Printf( "%s %s (%u) aFlags=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aFlags ); |
1747 RDEBUG( "aOldPassword", 0 ); |
2265 RDebug::Printf( "%s %s (%u) aOldPassword=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
2266 RDebug::Print(aOldPassword); |
1748 RDebug::Print(aOldPassword); |
2267 RDebug::Printf( "%s %s (%u) aOldPassword=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1749 RDEBUG( "aNewPassword", 0 ); |
2268 RDebug::Print(aNewPassword); |
1750 RDebug::Print(aNewPassword); |
2269 RDebug::Printf( "%s %s (%u) aCaption=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1751 RDEBUG( "aCaption", 0 ); |
2270 RDebug::Print(aCaption); |
1752 RDebug::Print(aCaption); |
2271 RDebug::Printf( "%s %s (%u) aShowError=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aShowError ); |
1753 RDEBUG( "aShowError", aShowError ); |
2272 |
1754 |
2273 |
1755 |
2274 /***************************************************** |
1756 /***************************************************** |
2275 * Series 60 Customer / ETel |
1757 * Series 60 Customer / ETel |
2276 * Series 60 ETel API |
1758 * Series 60 ETel API |
2297 RMobilePhone::TMobilePassword newPassword; |
1779 RMobilePhone::TMobilePassword newPassword; |
2298 RMobilePhone::TMobilePassword verifcationPassword; |
1780 RMobilePhone::TMobilePassword verifcationPassword; |
2299 RMobilePhone::TMobilePhonePasswordChangeV1 passwords; |
1781 RMobilePhone::TMobilePhonePasswordChangeV1 passwords; |
2300 RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; |
1782 RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; |
2301 RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); |
1783 RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); |
2302 TBool queryAccepted = EFalse; |
1784 TInt queryAccepted = KErrCancel; |
2303 |
1785 |
2304 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1786 RDEBUG( "0", 0 ); |
2305 |
1787 |
2306 RMobilePhone::TMobilePhoneLock lockType; |
1788 RMobilePhone::TMobilePhoneLock lockType; |
2307 RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; |
1789 RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; |
2308 |
1790 |
2309 lockType = RMobilePhone::ELockICC; |
1791 lockType = RMobilePhone::ELockICC; |
2310 |
1792 |
2311 RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); |
1793 RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); |
2312 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1794 RDEBUG( "0", 0 ); |
2313 iWait->SetRequestType(EMobilePhoneGetLockInfo); |
1795 iWait->SetRequestType(EMobilePhoneGetLockInfo); |
2314 #ifndef __WINS__ |
1796 TInt res = KErrNone; |
|
1797 RDEBUG( "GetLockInfo", 0 ); |
2315 iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); |
1798 iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); |
2316 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1799 RDEBUG( "WaitForRequestL", 0 ); |
2317 TInt res = iWait->WaitForRequestL(); |
1800 res = iWait->WaitForRequestL(); |
2318 #else |
1801 RDEBUG( "WaitForRequestL res", res ); |
2319 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1802 #ifdef __WINS__ |
2320 TInt res = KErrNone; |
1803 if (res == KErrTimedOut) |
|
1804 { |
|
1805 lockInfo.iSetting = RMobilePhone::ELockSetEnabled; |
|
1806 res = KErrNone; |
|
1807 } |
2321 #endif |
1808 #endif |
|
1809 |
2322 User::LeaveIfError(res); |
1810 User::LeaveIfError(res); |
2323 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
2324 |
1811 |
2325 if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) |
1812 if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) |
2326 { |
1813 { |
2327 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1814 RDEBUG( "RMobilePhone::ELockSetDisabled", RMobilePhone::ELockSetDisabled ); |
2328 // CleanupStack::PopAndDestroy(1,dlg); // TODO sure about dlg ? |
|
2329 ShowResultNoteL(R_PIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone); |
1815 ShowResultNoteL(R_PIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone); |
2330 return; |
1816 return KErrAccessDenied; |
2331 } |
1817 } |
2332 |
1818 |
2333 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1819 RDEBUG( "0", 0 ); |
2334 iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); |
1820 iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); |
2335 #ifndef __WINS__ |
1821 RDEBUG( "GetSecurityCodeInfo", 0 ); |
2336 iPhone.GetSecurityCodeInfo(iWait->iStatus, secCodeType, codeInfoPkg); |
1822 iPhone.GetSecurityCodeInfo(iWait->iStatus, secCodeType, codeInfoPkg); |
|
1823 RDEBUG( "WaitForRequestL", 0 ); |
2337 res = iWait->WaitForRequestL(); |
1824 res = iWait->WaitForRequestL(); |
2338 #else |
1825 RDEBUG( "WaitForRequestL res", res ); |
2339 res = KErrNone; |
1826 #ifdef __WINS__ |
2340 #endif |
1827 if (res == KErrNotSupported || res == KErrTimedOut) |
|
1828 { |
|
1829 res = KErrNone; |
|
1830 codeInfo.iRemainingEntryAttempts=KMaxNumberOfPINAttempts; |
|
1831 } |
|
1832 #endif |
2341 User::LeaveIfError(res); |
1833 User::LeaveIfError(res); |
2342 RDebug::Printf( "%s %s (%u) codeInfo.iRemainingEntryAttempts=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, codeInfo.iRemainingEntryAttempts ); |
1834 RDEBUG( "codeInfo.iRemainingEntryAttempts", codeInfo.iRemainingEntryAttempts ); |
2343 codeInfo.iRemainingEntryAttempts=KMaxNumberOfPINAttempts; |
1835 RDEBUG( "checking aOldPassword", 0 ); |
2344 |
|
2345 RDebug::Printf( "%s %s (%u) checking aOldPassword=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
2346 if(aOldPassword.Length()==0) |
1836 if(aOldPassword.Length()==0) |
2347 { |
1837 { |
2348 RDebug::Printf( "%s %s (%u) asking aOldPassword=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1838 RDEBUG( "asking aOldPassword", 0 ); |
2349 /* request PIN using QT */ |
1839 /* request PIN using QT */ |
2350 queryAccepted = EFalse; |
1840 queryAccepted = KErrCancel; |
2351 CSecQueryUi *iSecQueryUi; |
1841 CSecQueryUi *iSecQueryUi; |
2352 iSecQueryUi = CSecQueryUi::NewL(); |
1842 iSecQueryUi = CSecQueryUi::NewL(); |
2353 queryAccepted = iSecQueryUi->SecQueryDialog( _L("PIN1-Old"), oldPassword, 4, 8, ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); |
1843 TBuf<0x100> title; title.Zero(); title.Append(_L("PIN1-Old")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); |
2354 RDebug::Printf( "%s %s (%u) oldPassword=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
1844 queryAccepted = iSecQueryUi->SecQueryDialog( title, oldPassword, 4, 8, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); |
|
1845 RDEBUG( "oldPassword", 0 ); |
2355 RDebug::Print( oldPassword ); |
1846 RDebug::Print( oldPassword ); |
2356 RDebug::Printf( "%s %s (%u) queryAccepted=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
1847 RDEBUG( "queryAccepted", queryAccepted ); |
2357 delete iSecQueryUi; |
1848 delete iSecQueryUi; |
2358 if(!queryAccepted) |
1849 if( queryAccepted!=KErrNone ) |
2359 return; |
1850 return KErrAbort; |
2360 res=1; // indicate that everything is ok |
1851 res=1; // indicate that everything is ok |
2361 /* end request PIN using QT */ |
1852 /* end request PIN using QT */ |
2362 newPassword = _L(""); |
1853 newPassword = _L(""); |
2363 verifcationPassword = _L(""); |
1854 verifcationPassword = _L(""); |
2364 } |
1855 } |
2473 break; |
1950 break; |
2474 } |
1951 } |
2475 } |
1952 } |
2476 return res; |
1953 return res; |
2477 } |
1954 } |
|
1955 /*********************************************/ |
|
1956 // qtdone |
2478 EXPORT_C TInt CSecuritySettings::ChangeUPinParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
1957 EXPORT_C TInt CSecuritySettings::ChangeUPinParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
2479 { |
1958 { |
2480 TInt ret = KErrNone; |
1959 RDEBUG( "aFlags", aFlags ); |
2481 #if defined(_DEBUG) |
1960 |
2482 RDebug::Printf( "%s %s (%u) aFlags=%x aShowError=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aFlags, aShowError ); |
1961 RDebug::Print(aOldPassword); |
2483 #endif |
1962 RDebug::Print(aNewPassword); |
|
1963 RDebug::Print(aCaption); |
|
1964 |
|
1965 TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); |
|
1966 TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); |
|
1967 if(! (wcdmaSupported || upinSupported)) |
|
1968 { |
|
1969 RDEBUG( "! upinSupported", upinSupported ); |
|
1970 return KErrAccessDenied; |
|
1971 } |
|
1972 |
|
1973 RDEBUG( "upinSupported", upinSupported ); |
|
1974 TInt simState; |
|
1975 TInt err( KErrGeneral ); |
|
1976 err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); |
|
1977 User::LeaveIfError( err ); |
|
1978 TBool simRemoved(simState == ESimNotPresent); |
|
1979 |
|
1980 if ( simRemoved ) |
|
1981 { |
|
1982 ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone); |
|
1983 return KErrAccessDenied; |
|
1984 } |
|
1985 |
|
1986 RMobilePhone::TMobilePhoneSecurityCode secCodeType; |
|
1987 secCodeType = RMobilePhone::ESecurityUniversalPin; |
|
1988 |
|
1989 RMobilePhone::TMobilePassword oldPassword; |
|
1990 RMobilePhone::TMobilePassword newPassword; |
|
1991 RMobilePhone::TMobilePassword verifcationPassword; |
|
1992 RMobilePhone::TMobilePhonePasswordChangeV1 passwords; |
|
1993 RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; |
|
1994 RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); |
|
1995 RMobilePhone::TMobilePhoneLock lockType; |
|
1996 RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; |
|
1997 TInt queryAccepted = KErrCancel; |
|
1998 |
|
1999 lockType = RMobilePhone::ELockUniversalPin; |
|
2000 |
|
2001 RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); |
|
2002 iWait->SetRequestType(EMobilePhoneGetLockInfo); |
|
2003 RDEBUG( "GetLockInfo", 0 ); |
|
2004 iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); |
|
2005 RDEBUG( "WaitForRequestL", 0 ); |
|
2006 TInt res = iWait->WaitForRequestL(); |
|
2007 RDEBUG( "WaitForRequestL res", res ); |
|
2008 #ifdef __WINS__ |
|
2009 if (res == KErrNotSupported) |
|
2010 { |
|
2011 res = KErrNone; |
|
2012 lockInfo.iSetting = RMobilePhone::ELockSetEnabled; |
|
2013 } |
|
2014 #endif |
|
2015 User::LeaveIfError(res); |
|
2016 |
|
2017 RDEBUG( "lockInfo.iSetting", lockInfo.iSetting ); |
|
2018 RDEBUG( "RMobilePhone::ELockSetDisabled", RMobilePhone::ELockSetDisabled ); |
|
2019 if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) |
|
2020 { |
|
2021 ShowResultNoteL(R_UPIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone); |
|
2022 return KErrAccessDenied; |
|
2023 } |
|
2024 |
|
2025 iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); |
|
2026 RDEBUG( "GetSecurityCodeInfo", 0 ); |
|
2027 iPhone.GetSecurityCodeInfo(iWait->iStatus, secCodeType, codeInfoPkg); |
|
2028 RDEBUG( "WaitForRequestL", 0 ); |
|
2029 res = iWait->WaitForRequestL(); |
|
2030 RDEBUG( "WaitForRequestL res", res ); |
|
2031 #ifdef __WINS__ |
|
2032 if (res == KErrNotSupported || res == KErrTimedOut) |
|
2033 { |
|
2034 res = KErrNone; |
|
2035 codeInfo.iRemainingEntryAttempts=KMaxNumberOfPINAttempts; |
|
2036 } |
|
2037 #endif |
|
2038 User::LeaveIfError(res); |
|
2039 |
|
2040 /* request PIN using QT */ |
|
2041 queryAccepted = KErrCancel; |
|
2042 CSecQueryUi *iSecQueryUi; |
|
2043 iSecQueryUi = CSecQueryUi::NewL(); |
|
2044 TBuf<0x100> title; title.Zero(); title.Append(_L("UPIN-Old")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); |
|
2045 queryAccepted = iSecQueryUi->SecQueryDialog( title, oldPassword, 4, 8, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); |
|
2046 RDEBUG( "oldPassword", 0 ); |
|
2047 RDebug::Print( oldPassword ); |
|
2048 RDEBUG( "queryAccepted", queryAccepted ); |
|
2049 delete iSecQueryUi; |
|
2050 if( queryAccepted!=KErrNone ) |
|
2051 return KErrAbort; |
|
2052 res=1; // indicate that everything is ok |
|
2053 |
|
2054 { |
|
2055 queryAccepted = KErrCancel; |
|
2056 CSecQueryUi *iSecQueryUi; |
|
2057 iSecQueryUi = CSecQueryUi::NewL(); |
|
2058 // this queries both, and verifies itself |
|
2059 queryAccepted = iSecQueryUi->SecQueryDialog( _L("PIN1-New|PIN1-Ver"), newPassword, 4, 8, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); |
|
2060 RDEBUG( "newPassword", 0 ); |
|
2061 RDebug::Print( newPassword ); |
|
2062 RDEBUG( "queryAccepted", queryAccepted ); |
|
2063 delete iSecQueryUi; |
|
2064 if( queryAccepted!=KErrNone ) |
|
2065 return KErrAbort; |
|
2066 } |
|
2067 // send code |
|
2068 passwords.iOldPassword = oldPassword; |
|
2069 passwords.iNewPassword = newPassword; |
|
2070 iWait->SetRequestType(EMobilePhoneChangeSecurityCode); |
|
2071 RDEBUG( "ChangeSecurityCode", 0 ); |
|
2072 iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords); |
|
2073 RDEBUG( "WaitForRequestL", 0 ); |
|
2074 res = iWait->WaitForRequestL(); |
|
2075 RDEBUG( "WaitForRequestL res", res ); |
|
2076 #ifdef __WINS__ |
|
2077 if (res == KErrNotSupported) |
|
2078 res = KErrNone; |
|
2079 #endif |
|
2080 switch(res) |
|
2081 { |
|
2082 case KErrNone: |
|
2083 { |
|
2084 // code changed |
|
2085 ShowResultNoteL(R_UPIN_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); |
|
2086 break; |
|
2087 } |
|
2088 case KErrGsm0707IncorrectPassword: |
|
2089 case KErrAccessDenied: |
|
2090 { |
|
2091 // code was entered erroneously |
|
2092 ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); |
|
2093 ChangeUPinParamsL(_L(""), _L(""), aFlags, aCaption, aShowError); |
|
2094 break; |
|
2095 } |
|
2096 case KErrGsmSSPasswordAttemptsViolation: |
|
2097 case KErrLocked: |
|
2098 { |
|
2099 return KErrLocked; |
|
2100 } |
|
2101 case KErrGsm0707OperationNotAllowed: |
|
2102 { |
|
2103 // not allowed with this sim |
|
2104 ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); |
|
2105 return KErrGsm0707OperationNotAllowed; |
|
2106 } |
|
2107 case KErrAbort: |
|
2108 { |
|
2109 break; |
|
2110 } |
|
2111 default: |
|
2112 { |
|
2113 ShowErrorNoteL(res); |
|
2114 ChangeUPinParamsL(_L(""), _L(""), aFlags, aCaption, aShowError); |
|
2115 break; |
|
2116 } |
|
2117 } |
|
2118 return res; |
2484 } |
2119 } |
|
2120 /***************************************/ |
|
2121 // qtdone |
2485 EXPORT_C TInt CSecuritySettings::ChangePin2ParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
2122 EXPORT_C TInt CSecuritySettings::ChangePin2ParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
2486 { |
2123 { |
2487 TInt ret = KErrNone; |
2124 #if defined(_DEBUG) |
2488 #if defined(_DEBUG) |
2125 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePin2ParamsL()")); |
2489 RDebug::Printf( "%s %s (%u) aFlags=%x aShowError=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aFlags, aShowError ); |
2126 #endif |
2490 #endif |
2127 TInt simState; |
|
2128 TInt err( KErrGeneral ); |
|
2129 err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); |
|
2130 User::LeaveIfError( err ); |
|
2131 TBool simRemoved(simState == ESimNotPresent); |
|
2132 |
|
2133 if ( simRemoved ) |
|
2134 { |
|
2135 ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone); |
|
2136 return KErrAccessDenied; |
|
2137 } |
|
2138 |
|
2139 RMmCustomAPI::TSecurityCodeType secCodeType; |
|
2140 RMobilePhone::TMobilePhoneSecurityCode EtelsecCodeType; |
|
2141 secCodeType = RMmCustomAPI::ESecurityCodePin2; |
|
2142 RMobilePhone::TMobilePassword oldPassword; |
|
2143 RMobilePhone::TMobilePassword newPassword; |
|
2144 RMobilePhone::TMobilePassword verifcationPassword; |
|
2145 RMobilePhone::TMobilePhonePasswordChangeV1 passwords; |
|
2146 RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; |
|
2147 RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); |
|
2148 TInt queryAccepted = KErrCancel; |
|
2149 |
|
2150 // check if pin2 is blocked... |
|
2151 TBool isBlocked = EFalse; |
|
2152 |
|
2153 TInt ret = iCustomPhone.IsBlocked(secCodeType,isBlocked); |
|
2154 RDEBUG( "isBlocked", isBlocked ); |
|
2155 if(isBlocked) |
|
2156 return KErrAccessDenied; |
|
2157 RDEBUG( "ret", ret ); |
|
2158 #ifdef __WINS__ |
|
2159 if (ret == KErrNotSupported) |
|
2160 ret = KErrNone; |
|
2161 #endif |
|
2162 |
|
2163 if (ret != KErrNone) |
|
2164 { |
|
2165 switch (ret) |
|
2166 { |
|
2167 // PIN2 Blocked. |
|
2168 case KErrGsm0707SIMPuk2Required: |
|
2169 break; |
|
2170 case KErrGsmSSPasswordAttemptsViolation: |
|
2171 case KErrLocked: |
|
2172 // Pin2 features blocked permanently! |
|
2173 ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone); |
|
2174 break; |
|
2175 case KErrGsm0707SimNotInserted: |
|
2176 // not allowed with this sim |
|
2177 ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); |
|
2178 break; |
|
2179 default: |
|
2180 ShowErrorNoteL(ret); |
|
2181 break; |
|
2182 } |
|
2183 return KErrAccessDenied; |
|
2184 } |
|
2185 |
|
2186 |
|
2187 // Security code must be changed to Etel API format |
|
2188 // Custom API Pin1 and Pin2 have the same enum values as the Etel ones |
|
2189 EtelsecCodeType = (RMobilePhone::TMobilePhoneSecurityCode)secCodeType; |
|
2190 iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); |
|
2191 RDEBUG( "GetSecurityCodeInfo", 0 ); |
|
2192 iPhone.GetSecurityCodeInfo(iWait->iStatus, EtelsecCodeType, codeInfoPkg); |
|
2193 RDEBUG( "WaitForRequestL", 0 ); |
|
2194 ret = iWait->WaitForRequestL(); |
|
2195 RDEBUG( "WaitForRequestL ret", ret ); |
|
2196 #ifdef __WINS__ |
|
2197 if ( ret == KErrNotSupported || ret == KErrTimedOut) |
|
2198 { |
|
2199 codeInfo.iRemainingEntryAttempts = 1; |
|
2200 ret = KErrNone; |
|
2201 } |
|
2202 #endif |
|
2203 User::LeaveIfError(ret); |
|
2204 |
|
2205 /* request PIN using QT */ |
|
2206 queryAccepted = KErrCancel; |
|
2207 CSecQueryUi *iSecQueryUi; |
|
2208 iSecQueryUi = CSecQueryUi::NewL(); |
|
2209 TBuf<0x100> title; title.Zero(); title.Append(_L("PIN2-Old")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); |
|
2210 queryAccepted = iSecQueryUi->SecQueryDialog( title, oldPassword, SEC_C_PIN2_CODE_MIN_LENGTH, SEC_C_PIN2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); |
|
2211 RDEBUG( "oldPassword", 0 ); |
|
2212 RDebug::Print( oldPassword ); |
|
2213 RDEBUG( "queryAccepted", queryAccepted ); |
|
2214 delete iSecQueryUi; |
|
2215 if( queryAccepted!=KErrNone ) |
|
2216 return KErrAbort; |
|
2217 /* end request PIN using QT */ |
|
2218 |
|
2219 /* request PIN using QT */ |
|
2220 { |
|
2221 queryAccepted = KErrCancel; |
|
2222 CSecQueryUi *iSecQueryUi; |
|
2223 iSecQueryUi = CSecQueryUi::NewL(); |
|
2224 // this queries both, and verifies itself |
|
2225 queryAccepted = iSecQueryUi->SecQueryDialog( _L("PIN2-New|PIN2-Ver"), newPassword, SEC_C_PIN2_CODE_MIN_LENGTH, SEC_C_PIN2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); |
|
2226 RDEBUG( "newPassword", 0 ); |
|
2227 RDebug::Print( newPassword ); |
|
2228 RDEBUG( "queryAccepted", queryAccepted ); |
|
2229 delete iSecQueryUi; |
|
2230 if( queryAccepted!=KErrNone ) |
|
2231 return KErrAbort; |
|
2232 } |
|
2233 /* end request PIN using QT */ |
|
2234 |
|
2235 passwords.iOldPassword = oldPassword; |
|
2236 passwords.iNewPassword = newPassword; |
|
2237 iWait->SetRequestType(EMobilePhoneChangeSecurityCode); |
|
2238 RDEBUG( "ChangeSecurityCode", 0 ); |
|
2239 iPhone.ChangeSecurityCode(iWait->iStatus,EtelsecCodeType,passwords); |
|
2240 RDEBUG( "WaitForRequestL", 0 ); |
|
2241 TInt res = iWait->WaitForRequestL(); |
|
2242 RDEBUG( "WaitForRequestL res", res ); |
|
2243 #ifdef __WINS__ |
|
2244 if (res == KErrNotSupported) |
|
2245 res = KErrNone; |
|
2246 #endif |
|
2247 switch(res) |
|
2248 { |
|
2249 case KErrNone: |
|
2250 { |
|
2251 // code changed |
|
2252 ShowResultNoteL(R_PIN2_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); |
|
2253 break; |
|
2254 } |
|
2255 case KErrGsm0707IncorrectPassword: |
|
2256 case KErrAccessDenied: |
|
2257 { |
|
2258 ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); |
|
2259 ChangePin2ParamsL(_L(""), _L(""), aFlags, aCaption, aShowError); |
|
2260 break; |
|
2261 } |
|
2262 case KErrGsmSSPasswordAttemptsViolation: |
|
2263 case KErrLocked: |
|
2264 { |
|
2265 // Pin2 blocked! |
|
2266 ShowResultNoteL(KErrLocked, CAknNoteDialog::EErrorTone); |
|
2267 CSecurityHandler* handler = new(ELeave) CSecurityHandler(iPhone); |
|
2268 CleanupStack::PushL(handler); |
|
2269 handler->HandleEventL(RMobilePhone::EPuk2Required); |
|
2270 CleanupStack::PopAndDestroy(handler); // handler |
|
2271 return KErrLocked; |
|
2272 } |
|
2273 case KErrGsm0707OperationNotAllowed: |
|
2274 { |
|
2275 // not allowed with this sim |
|
2276 ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); |
|
2277 return KErrGsm0707OperationNotAllowed; |
|
2278 } |
|
2279 case KErrAbort: |
|
2280 { |
|
2281 break; |
|
2282 } |
|
2283 default: |
|
2284 { |
|
2285 ShowErrorNoteL(res); |
|
2286 ChangePin2ParamsL(_L(""), _L(""), aFlags, aCaption, aShowError); |
|
2287 break; |
|
2288 } |
|
2289 } |
|
2290 return res; |
2491 } |
2291 } |
|
2292 /************************************************/ |
|
2293 // qtdone |
2492 EXPORT_C TInt CSecuritySettings::ChangeSecCodeParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
2294 EXPORT_C TInt CSecuritySettings::ChangeSecCodeParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
2493 { |
2295 { |
2494 TInt ret = KErrNone; |
2296 RDEBUG( "aFlags", aFlags ); |
2495 #if defined(_DEBUG) |
2297 RDEBUG( "aShowError", aShowError ); |
2496 RDebug::Printf( "%s %s (%u) aFlags=%x aShowError=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aFlags, aShowError ); |
|
2497 #endif |
|
2498 /***************************************************** |
2298 /***************************************************** |
2499 * Series 60 Customer / ETel |
2299 * Series 60 Customer / ETel |
2500 * Series 60 ETel API |
2300 * Series 60 ETel API |
2501 *****************************************************/ |
2301 *****************************************************/ |
2502 #if defined(_DEBUG) |
2302 #if defined(_DEBUG) |
2503 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeSecCodeParamsL()")); |
2303 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeSecCodeParamsL()")); |
2504 #endif |
2304 #endif |
2505 TInt res=0; |
2305 TInt res=0; |
2506 TBool queryAccepted = EFalse; |
2306 TInt queryAccepted = KErrCancel; |
2507 RMobilePhone::TMobilePassword newPassword; |
2307 RMobilePhone::TMobilePassword newPassword; |
2508 |
2308 |
2509 RMobilePhone::TMobilePhoneSecurityCode secCodeType; |
2309 RMobilePhone::TMobilePhoneSecurityCode secCodeType; |
2510 secCodeType = RMobilePhone::ESecurityCodePhonePassword; |
2310 secCodeType = RMobilePhone::ESecurityCodePhonePassword; |
2511 RMobilePhone::TMobilePassword oldPassword; |
2311 RMobilePhone::TMobilePassword oldPassword; |
2556 // codes do not match -> note -> ask new pin and verification codes again |
2361 // codes do not match -> note -> ask new pin and verification codes again |
2557 if(newPassword.Length()>0) |
2362 if(newPassword.Length()>0) |
2558 ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone); |
2363 ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone); |
2559 |
2364 |
2560 { |
2365 { |
2561 queryAccepted = EFalse; |
2366 queryAccepted = KErrCancel; |
2562 CSecQueryUi *iSecQueryUi; |
2367 CSecQueryUi *iSecQueryUi; |
2563 iSecQueryUi = CSecQueryUi::NewL(); |
2368 iSecQueryUi = CSecQueryUi::NewL(); |
2564 queryAccepted = iSecQueryUi->SecQueryDialog( _L("Lock-New"), newPassword, 4, 8, ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); |
2369 // will ask both codes and compare itself |
2565 RDebug::Printf( "%s %s (%u) newPassword=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
2370 // mix, max , is handled using TARM params, in the dialog itself |
|
2371 TInt lType = ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType; |
|
2372 RDEBUG( "lType", lType ); |
|
2373 queryAccepted = iSecQueryUi->SecQueryDialog( _L("Lock-New|Lock-Verif"), newPassword, 4, 8, lType ); |
|
2374 RDEBUG( "newPassword", 0 ); |
2566 RDebug::Print( newPassword ); |
2375 RDebug::Print( newPassword ); |
2567 RDebug::Printf( "%s %s (%u) queryAccepted=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
2376 RDEBUG( "queryAccepted", queryAccepted ); |
2568 delete iSecQueryUi; |
2377 delete iSecQueryUi; |
2569 if(!queryAccepted) |
2378 if( queryAccepted!=KErrNone ) |
2570 return KErrAbort; |
2379 return KErrAbort; |
2571 } |
2380 } |
2572 |
2381 verifcationPassword.Copy(newPassword); // break the while |
2573 { |
|
2574 queryAccepted = EFalse; |
|
2575 CSecQueryUi *iSecQueryUi; |
|
2576 iSecQueryUi = CSecQueryUi::NewL(); |
|
2577 queryAccepted = iSecQueryUi->SecQueryDialog( _L("Lock-Verif"), verifcationPassword, 4, 8, ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); |
|
2578 RDebug::Printf( "%s %s (%u) verifcationPassword=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 ); |
|
2579 RDebug::Print( verifcationPassword ); |
|
2580 RDebug::Printf( "%s %s (%u) queryAccepted=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
2581 delete iSecQueryUi; |
|
2582 if(!queryAccepted) |
|
2583 return KErrAbort; |
|
2584 // TODO allow and handle Cancel |
|
2585 } |
|
2586 |
2382 |
2587 } // while |
2383 } // while |
2588 |
2384 |
2589 // change code |
2385 // change code |
2590 RDebug::Printf( "%s %s (%u) res=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, res ); |
2386 RDEBUG( "res", res ); |
2591 if (res == KErrNone) |
2387 if (res == KErrNone) |
2592 { |
2388 { |
2593 passwords.iOldPassword = oldPassword; |
2389 passwords.iOldPassword = oldPassword; |
2594 passwords.iNewPassword = newPassword; |
2390 passwords.iNewPassword = newPassword; |
2595 iWait->SetRequestType(EMobilePhoneChangeSecurityCode); |
2391 iWait->SetRequestType(EMobilePhoneChangeSecurityCode); |
2596 RDebug::Printf( "%s %s (%u) ChangeSecurityCode=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
2392 RDEBUG( "ChangeSecurityCode", 0 ); |
2597 iPhone.ChangeSecurityCode(iWait->iStatus,secCodeType,passwords); |
2393 iPhone.ChangeSecurityCode(iWait->iStatus,secCodeType,passwords); |
|
2394 RDEBUG( "WaitForRequestL", 0 ); |
2598 res = iWait->WaitForRequestL(); |
2395 res = iWait->WaitForRequestL(); |
2599 RDebug::Printf( "%s %s (%u) res=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, res ); |
2396 RDEBUG( "WaitForRequestL res", res ); |
|
2397 #ifdef __WINS__ |
|
2398 if (res == KErrNotSupported) |
|
2399 res = KErrNone; |
|
2400 #endif |
2600 |
2401 |
2601 if(res==KErrNone && 1==0 ) // TODO not possible to enable because it asks code again |
2402 if(res==KErrNone && 1==0 ) // TODO not possible to enable because it asks code again |
2602 { |
2403 { |
2603 RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; |
2404 RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; |
2604 RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = RMobilePhone::ELockSetEnabled; |
2405 RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = RMobilePhone::ELockSetEnabled; |
2605 if(oldPassword.Length()==6) |
2406 if(oldPassword.Length()==6) |
2606 { |
2407 { |
2607 lockChangeSetting = RMobilePhone::ELockSetDisabled; |
2408 lockChangeSetting = RMobilePhone::ELockSetDisabled; |
2608 RDebug::Printf( "%s %s (%u) RMobilePhone::ELockSetDisabled=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, RMobilePhone::ELockSetDisabled ); |
2409 RDEBUG( "RMobilePhone::ELockSetDisabled", RMobilePhone::ELockSetDisabled ); |
2609 } |
2410 } |
2610 iWait->SetRequestType(EMobilePhoneSetLockSetting); |
2411 iWait->SetRequestType(EMobilePhoneSetLockSetting); |
2611 RDebug::Printf( "%s %s (%u) SetLockSetting=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
2412 RDEBUG( "SetLockSetting", 0 ); |
2612 iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting ); |
2413 iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting ); |
|
2414 RDEBUG( "WaitForRequestL", 0 ); |
2613 res = iWait->WaitForRequestL(); |
2415 res = iWait->WaitForRequestL(); |
2614 RDebug::Printf( "%s %s (%u) res=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, res ); |
2416 RDEBUG( "WaitForRequestL res", res ); |
|
2417 #ifdef __WINS__ |
|
2418 if (res == KErrNotSupported) |
|
2419 res = KErrNone; |
|
2420 #endif |
2615 } |
2421 } |
2616 } |
2422 } |
2617 |
2423 |
2618 RDebug::Printf( "%s %s (%u) res=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, res ); |
2424 RDEBUG( "res", res ); |
2619 #if defined(_DEBUG) |
|
2620 RDebug::Print( _L("(SECUI)CSecuritySettings::ChangeSecCodeParamsL(): RETURN CODE: %d"), res); |
|
2621 #endif |
|
2622 switch(res) |
2425 switch(res) |
2623 { |
2426 { |
2624 case KErrNone: |
2427 case KErrNone: |
2625 { |
2428 { |
2626 // code changed |
2429 // code changed |
2627 ShowResultNoteL(R_SECURITY_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); |
2430 ShowResultNoteL(R_SECURITY_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); |
2628 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) && |
2431 { |
2629 !(FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements ))) |
2432 // Send the changed code to the SCP server, even with device lock enhancements. |
2630 { |
2433 RDEBUG( "scpClient.Connect", 0 ); |
2631 // Send the changed code to the SCP server. Not used with device lock enhancements. |
|
2632 RDebug::Printf( "%s %s (%u) scpClient.Connect=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
|
2633 RSCPClient scpClient; |
2434 RSCPClient scpClient; |
2634 TSCPSecCode newCode; |
2435 TSCPSecCode newCode; |
|
2436 TSCPSecCode oldPassword; |
2635 newCode.Copy( newPassword ); |
2437 newCode.Copy( newPassword ); |
2636 if ( scpClient.Connect() == KErrNone ) |
2438 if ( scpClient.Connect() == KErrNone ) |
2637 { |
2439 { |
2638 RDebug::Printf( "%s %s (%u) scpClient.StoreCode=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); |
2440 RDEBUG( "scpClient.StoreCode", 0 ); |
2639 scpClient.StoreCode( newCode ); |
2441 /* |
|
2442 // scpClient.StoreCode( newCode ); |
|
2443 RArray<TDevicelockPolicies> aFailedPolicies; |
|
2444 TDevicelockPolicies failedPolicy; |
|
2445 TInt retLockcode = KErrNone; |
|
2446 retLockcode = scpClient.StoreLockcode( newCode, oldPassword, aFailedPolicies ); |
|
2447 RDEBUG( "retLockcode", retLockcode ); |
|
2448 RDEBUG( "aFailedPolicies.Count()", aFailedPolicies.Count() ); |
|
2449 for(TInt i=0; i<aFailedPolicies.Count(); i++) |
|
2450 { |
|
2451 failedPolicy = aFailedPolicies[i]; |
|
2452 RDEBUG( "failedPolicy", failedPolicy ); |
|
2453 } |
|
2454 */ |
2640 scpClient.Close(); |
2455 scpClient.Close(); |
2641 } |
2456 } |
2642 } |
2457 } |
2643 break; |
2458 break; |
2644 } |
2459 } |
2666 ShowErrorNoteL(res); |
2481 ShowErrorNoteL(res); |
2667 ChangeSecCodeParamsL(aOldPassword, aNewPassword, aFlags, aCaption, aShowError); |
2482 ChangeSecCodeParamsL(aOldPassword, aNewPassword, aFlags, aCaption, aShowError); |
2668 break; |
2483 break; |
2669 } |
2484 } |
2670 } // switch |
2485 } // switch |
|
2486 return res; |
2671 } |
2487 } |
|
2488 |
|
2489 /**************************************/ |
|
2490 // qtdone |
2672 EXPORT_C TInt CSecuritySettings::ChangeAutoLockPeriodParamsL(TInt aPeriod, RMobilePhone::TMobilePassword aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
2491 EXPORT_C TInt CSecuritySettings::ChangeAutoLockPeriodParamsL(TInt aPeriod, RMobilePhone::TMobilePassword aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
2673 { |
2492 { |
2674 TInt ret = KErrNone; |
2493 RDEBUG( "aPeriod", aPeriod ); |
2675 #if defined(_DEBUG) |
2494 RDEBUG( "aFlags", aFlags ); |
2676 RDebug::Printf( "%s %s (%u) aFlags=%x aShowError=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aFlags, aShowError ); |
2495 /***************************************************** |
2677 #endif |
2496 * Series 60 Customer / ETel |
|
2497 * Series 60 ETel API |
|
2498 *****************************************************/ |
|
2499 |
|
2500 RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled); |
|
2501 RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; |
|
2502 TInt oldPeriod = aPeriod; |
|
2503 |
|
2504 TInt maxPeriod=0; |
|
2505 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw )) |
|
2506 { |
|
2507 // Retrieve the current autolock period max. value from the SCP server, |
|
2508 // and check that the value the user |
|
2509 // selected is ok from the Corporate Policy point of view. |
|
2510 RSCPClient scpClient; |
|
2511 TInt ret = scpClient.Connect(); |
|
2512 if ( ret == KErrNone ) |
|
2513 { |
|
2514 CleanupClosePushL( scpClient ); |
|
2515 TBuf<KSCPMaxIntLength> maxPeriodBuf; |
|
2516 if ( scpClient.GetParamValue( ESCPMaxAutolockPeriod, maxPeriodBuf ) == KErrNone ) |
|
2517 { |
|
2518 TLex lex( maxPeriodBuf ); |
|
2519 if ( ( lex.Val( maxPeriod ) == KErrNone ) && ( maxPeriod > 0 ) ) |
|
2520 { |
|
2521 RDEBUG( "from SCP maxPeriod", maxPeriod ); |
|
2522 // nothing to do |
|
2523 } |
|
2524 else |
|
2525 { |
|
2526 maxPeriod = 0; |
|
2527 RDEBUG( "not from SCP maxPeriod", maxPeriod ); |
|
2528 } |
|
2529 } |
|
2530 else |
|
2531 { |
|
2532 RDEBUG( "Failed to retrieve max period", maxPeriod ); |
|
2533 } |
|
2534 } |
|
2535 else |
|
2536 { |
|
2537 RDEBUG( "Failed to connect to SCP", 0 ); |
|
2538 } |
|
2539 CleanupStack::PopAndDestroy(); // scpClient |
2678 } |
2540 } |
|
2541 RDEBUG( "maxPeriod", maxPeriod ); |
|
2542 if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw )) |
|
2543 { |
|
2544 TBool allow = ETrue; |
|
2545 |
|
2546 if ((aPeriod == 0) && (maxPeriod > 0)) |
|
2547 { |
|
2548 #if defined(_DEBUG) |
|
2549 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() \ |
|
2550 The period: %d is not allowed by TARM; max: %d"),aPeriod, maxPeriod ); |
|
2551 #endif |
|
2552 allow = EFalse; |
|
2553 ShowResultNoteL(R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE, CAknNoteDialog::EErrorTone); |
|
2554 } |
|
2555 if ( !allow ) |
|
2556 { |
|
2557 return ChangeAutoLockPeriodParamsL(aPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again |
|
2558 } |
|
2559 } |
|
2560 |
|
2561 if (aPeriod == 0) |
|
2562 { |
|
2563 #ifdef RD_REMOTELOCK |
|
2564 |
|
2565 // If remote lock is enabled, don't disable the domestic OS device lock |
|
2566 // since that would render the RemoteLock useless. |
|
2567 // Instead just re-set the DOS lock to enabled which as a side effect |
|
2568 // requests the security code from the user. |
|
2569 |
|
2570 TBool remoteLockStatus( EFalse ); |
|
2571 CRemoteLockSettings* remoteLockSettings = CRemoteLockSettings::NewL(); |
|
2572 |
|
2573 if ( remoteLockSettings->GetEnabled( remoteLockStatus ) ) |
|
2574 { |
|
2575 if ( remoteLockStatus ) |
|
2576 { |
|
2577 // Remote lock is enabled |
|
2578 lockChange = RMobilePhone::ELockSetEnabled; |
|
2579 RDEBUG( "RemoteLock is enabled lockChange", lockChange ); |
|
2580 } |
|
2581 else |
|
2582 { |
|
2583 // Remote lock is disabled |
|
2584 lockChange = RMobilePhone::ELockSetDisabled; |
|
2585 RDEBUG( "RemoteLock is disabled lockChange", lockChange ); |
|
2586 } |
|
2587 } |
|
2588 else |
|
2589 { |
|
2590 // Failed to get remote lock status |
|
2591 RDEBUG( "Failed to get remote lock status lockChange", lockChange ); |
|
2592 } |
|
2593 |
|
2594 delete remoteLockSettings; |
|
2595 remoteLockSettings = NULL; |
|
2596 |
|
2597 #else // not defined RD_REMOTELOCK |
|
2598 |
|
2599 lockChange = RMobilePhone::ELockSetDisabled; |
|
2600 |
|
2601 #endif // RD_REMOTELOCK |
|
2602 } |
|
2603 else |
|
2604 { |
|
2605 lockChange = RMobilePhone::ELockSetEnabled; |
|
2606 RDEBUG( "aPeriod != 0 lockChange", lockChange ); |
|
2607 } |
|
2608 |
|
2609 iWait->SetRequestType(EMobilePhoneSetLockSetting); |
|
2610 RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk); |
|
2611 RDEBUG( "SetLockSetting", 0 ); |
|
2612 iPhone.SetLockSetting(iWait->iStatus,lockType,lockChange); // this eventually calls PassPhraseRequiredL |
|
2613 RDEBUG( "WaitForRequestL", 0 ); |
|
2614 TInt status = KErrNone; |
|
2615 status = iWait->WaitForRequestL(); |
|
2616 RDEBUG( "WaitForRequestL status", status ); |
|
2617 #ifdef __WINS__ |
|
2618 if (status == KErrNotSupported) |
|
2619 status = KErrNone; |
|
2620 #endif |
|
2621 switch(status) |
|
2622 { |
|
2623 case KErrNone: |
|
2624 #if defined(_DEBUG) |
|
2625 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() KErrNone")); |
|
2626 #endif |
|
2627 break; |
|
2628 case KErrGsmSSPasswordAttemptsViolation: |
|
2629 case KErrLocked: |
|
2630 #if defined(_DEBUG) |
|
2631 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() PasswordAttemptsViolation")); |
|
2632 #endif |
|
2633 ShowResultNoteL(KErrLocked, CAknNoteDialog::EErrorTone); // the old code didn't show messages |
|
2634 return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again |
|
2635 case KErrGsm0707IncorrectPassword: |
|
2636 case KErrAccessDenied: |
|
2637 #if defined(_DEBUG) |
|
2638 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() IncorrectPassword")); |
|
2639 #endif |
|
2640 // code was entered erroneously |
|
2641 ShowResultNoteL(KErrAccessDenied, CAknNoteDialog::EErrorTone); // the old code didn't show messages |
|
2642 return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again |
|
2643 case KErrAbort: |
|
2644 // User pressed "cancel" in the code query dialog. |
|
2645 return oldPeriod; |
|
2646 default: |
|
2647 #if defined(_DEBUG) |
|
2648 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() default")); |
|
2649 #endif |
|
2650 ShowResultNoteL(status, CAknNoteDialog::EErrorTone); // the old code didn't show messages |
|
2651 return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again |
|
2652 } |
|
2653 #if defined(_DEBUG) |
|
2654 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() END")); |
|
2655 #endif |
|
2656 return aPeriod; |
|
2657 } |
|
2658 /*****************************/ |
|
2659 // qtdone |
2679 EXPORT_C TInt CSecuritySettings::ChangePinRequestParamsL(TInt aEnable, RMobilePhone::TMobilePassword aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
2660 EXPORT_C TInt CSecuritySettings::ChangePinRequestParamsL(TInt aEnable, RMobilePhone::TMobilePassword aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError) |
2680 { |
2661 { |
2681 TInt ret = KErrNone; |
2662 RDEBUG( "aEnable", aEnable ); |
2682 #if defined(_DEBUG) |
2663 RDEBUG( "aFlags", aFlags ); |
2683 RDebug::Printf( "%s %s (%u) aFlags=%x aShowError=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aFlags, aShowError ); |
|
2684 #endif |
|
2685 /***************************************************** |
2664 /***************************************************** |
2686 * Series 60 Customer / ETel |
2665 * Series 60 Customer / ETel |
2687 * Series 60 ETel API |
2666 * Series 60 ETel API |
2688 *****************************************************/ |
2667 *****************************************************/ |
2689 #if defined(_DEBUG) |
2668 #if defined(_DEBUG) |
2690 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestL()")); |
2669 RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestParamsL()")); |
2691 #endif |
2670 #endif |
2692 TInt simState=0; |
2671 TInt simState=0; |
2693 TInt lEnable=aEnable; |
2672 TInt lEnable=aEnable; |
2694 TInt err( KErrGeneral ); |
2673 TInt err( KErrGeneral ); |
2695 err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); |
2674 err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); |