325 SetActive(); |
316 SetActive(); |
326 break; |
317 break; |
327 } |
318 } |
328 case (CCLCKCommandHandler::ECLCKLockSet): |
319 case (CCLCKCommandHandler::ECLCKLockSet): |
329 { |
320 { |
330 if (iPassword.Compare(KNullDesC8) == 0) |
321 if (iPassword.Length() == 0) |
331 { |
322 { |
332 iCallback->CreateReplyAndComplete( EReplyTypeError); |
323 iCallback->CreateReplyAndComplete( EReplyTypeError); |
333 } |
324 } |
334 else |
325 else |
335 { |
326 { |
336 // Set the property to ignore security events in other clients |
327 // Set the property to ignore security events in other clients |
337 // it allows to avoid GUI promt for security code |
328 // it allows to avoid GUI promt for security code |
338 TInt ret = KErrNone; |
329 TInt ret = KErrNone; |
339 // TODO: reenable when KIgnoreSecurityEvent propety definition is submitted to codeline |
330 if (iLockType == RMobilePhone::ELockICC) |
340 // if (iLockType == RMobilePhone::ELockICC) |
331 { |
341 // { |
332 ret = RProperty::Set(KPSUidStartup, KIgnoreSecurityEvent, EPSIgnoreSecurityEventEPin1Required); |
342 // ret = RProperty::Set(KPSUidStartup, KIgnoreSecurityEvent, EPSIgnoreSecurityEventEPin1Required); |
333 } |
343 // } |
334 else |
344 // else |
335 { |
345 // { |
336 ret = RProperty::Set(KPSUidStartup, KIgnoreSecurityEvent, EPSIgnoreSecurityEventEPhonePasswordRequired); |
346 // ret = RProperty::Set(KPSUidStartup, KIgnoreSecurityEvent, EPSIgnoreSecurityEventEPhonePasswordRequired); |
337 } |
347 // } |
|
348 Trace(KDebugPrintD, "RProperty::Set: ", ret); |
338 Trace(KDebugPrintD, "RProperty::Set: ", ret); |
349 if (ret == KErrNone) |
339 if (ret == KErrNone) |
350 { |
340 { |
351 // Start security event handler - this will notify whether a |
341 // Start security event handler - this will notify whether a |
352 // password is required to complete the set lock request. |
342 // password is required to complete the set lock request. |
544 } |
534 } |
545 |
535 |
546 TInt CCLCKCommandHandler::ParseCCLCKCommand() |
536 TInt CCLCKCommandHandler::ParseCCLCKCommand() |
547 { |
537 { |
548 TRACE_FUNC_ENTRY |
538 TRACE_FUNC_ENTRY |
549 TCmdFacilityType facilityType = ECmdFacilityTypeUnknown; |
539 TPtrC8 command; |
550 TInt mode = 0; |
540 TInt ret = iATCmdParser.NextTextParam(command); |
551 TInt ret = KErrNone; |
541 if (ret != KErrNone) |
552 |
|
553 TPtrC8 command = iATCmdParser.NextTextParam(ret); |
|
554 if (!command.Compare(KNullDesC8) || ret != KErrNone) |
|
555 { |
542 { |
556 TRACE_FUNC_EXIT |
543 TRACE_FUNC_EXIT |
557 return KErrArgument; |
544 return KErrArgument; |
558 } |
545 } |
559 |
546 |
|
547 TInt mode = 0; |
560 ret = iATCmdParser.NextIntParam(mode); |
548 ret = iATCmdParser.NextIntParam(mode); |
561 if (!command.Compare(KNullDesC8) || ret != KErrNone) |
549 if (ret != KErrNone) |
562 { |
550 { |
563 TRACE_FUNC_EXIT |
551 TRACE_FUNC_EXIT |
564 return KErrArgument; |
552 return KErrArgument; |
565 } |
553 } |
566 |
554 |
567 iPassword.Create(iATCmdParser.NextTextParam(ret)); |
555 TPtrC8 tmpPwd; |
568 Trace(KDebugPrintD, "NextTextParam returned: ", ret); |
556 ret = iATCmdParser.NextTextParam(tmpPwd); |
569 if (ret != KErrNone && ret != KErrNotFound) |
557 if (ret != KErrNone && ret != KErrNotFound) |
570 { |
558 { |
571 TRACE_FUNC_EXIT |
559 TRACE_FUNC_EXIT |
572 return KErrArgument; |
560 return KErrArgument; |
573 } |
561 } |
574 |
562 |
575 if (iPassword.Compare(KNullDesC8) != 0) |
563 iPassword.Create(tmpPwd); |
576 { |
564 if (iPassword.Length() != 0) |
577 ret = iATCmdParser.NextIntParam(iInfoClass); |
565 { |
578 Trace(KDebugPrintD, "NextIntParam(iInfoClass): ", ret); |
566 ret = iATCmdParser.NextIntParam(iInfoClass);; |
579 if (ret == KErrNotFound) |
567 if (ret == KErrNotFound) |
580 { |
568 { |
581 iInfoClass = 7; |
569 iInfoClass = 7; // Default value, see ETSI TS 127 007 V6.9.0 (2007-06) |
582 } |
570 } |
583 if ((ret != KErrNone && ret != KErrNotFound ) || |
571 else if (ret != KErrNone || iATCmdParser.NextParam().Length() != 0) |
584 iATCmdParser.NextParam().Compare(KNullDesC8) != 0) |
|
585 { |
572 { |
586 TRACE_FUNC_EXIT |
573 TRACE_FUNC_EXIT |
587 return KErrArgument; |
574 return KErrArgument; |
588 } |
575 } |
589 } |
576 } |
590 |
577 |
591 if (command.Compare(KATCLCKPS) == 0) |
578 TCmdFacilityType facilityType = ECmdFacilityTypeUnknown; |
|
579 |
|
580 if (command.CompareF(KATCLCKPS) == 0) |
592 { |
581 { |
593 // Lock phone to SIM on/off |
582 // Lock phone to SIM on/off |
594 iSecurityCode = RMobilePhone::ESecurityCodePhonePassword; |
583 iSecurityCode = RMobilePhone::ESecurityCodePhonePassword; |
595 iLockType = RMobilePhone::ELockPhoneToICC; |
584 iLockType = RMobilePhone::ELockPhoneToICC; |
596 facilityType = ECmdFacilityTypeLock; |
585 facilityType = ECmdFacilityTypeLock; |
597 } |
586 } |
598 else if (command.Compare(KATCLCKSC) == 0) |
587 else if (command.CompareF(KATCLCKSC) == 0) |
599 { |
588 { |
600 // PIN on/off |
589 // PIN on/off |
601 iSecurityCode = RMobilePhone::ESecurityCodePin1; |
590 iSecurityCode = RMobilePhone::ESecurityCodePin1; |
602 iLockType = RMobilePhone::ELockICC; |
591 iLockType = RMobilePhone::ELockICC; |
603 facilityType = ECmdFacilityTypeLock; |
592 facilityType = ECmdFacilityTypeLock; |
604 } |
593 } |
605 else if (command.Compare(KATCLCKAO) == 0) |
594 else if (command.CompareF(KATCLCKAO) == 0) |
606 { |
595 { |
607 iCondition = RMobilePhone::EBarAllOutgoing; |
596 iCondition = RMobilePhone::EBarAllOutgoing; |
608 facilityType = ECmdFacilityTypeBarring; |
597 facilityType = ECmdFacilityTypeBarring; |
609 } |
598 } |
610 else if (command.Compare(KATCLCKOI) == 0) |
599 else if (command.CompareF(KATCLCKOI) == 0) |
611 { |
600 { |
612 iCondition = RMobilePhone::EBarOutgoingInternational; |
601 iCondition = RMobilePhone::EBarOutgoingInternational; |
613 facilityType = ECmdFacilityTypeBarring; |
602 facilityType = ECmdFacilityTypeBarring; |
614 } |
603 } |
615 else if (command.Compare(KATCLCKOX) == 0) |
604 else if (command.CompareF(KATCLCKOX) == 0) |
616 { |
605 { |
617 iCondition = RMobilePhone::EBarOutgoingInternationalExHC; |
606 iCondition = RMobilePhone::EBarOutgoingInternationalExHC; |
618 facilityType = ECmdFacilityTypeBarring; |
607 facilityType = ECmdFacilityTypeBarring; |
619 } |
608 } |
620 else if (command.Compare(KATCLCKAI) == 0) |
609 else if (command.CompareF(KATCLCKAI) == 0) |
621 { |
610 { |
622 iCondition = RMobilePhone::EBarAllIncoming; |
611 iCondition = RMobilePhone::EBarAllIncoming; |
623 facilityType = ECmdFacilityTypeBarring; |
612 facilityType = ECmdFacilityTypeBarring; |
624 } |
613 } |
625 else if (command.Compare(KATCLCKIR) == 0) |
614 else if (command.CompareF(KATCLCKIR) == 0) |
626 { |
615 { |
627 iCondition = RMobilePhone::EBarIncomingRoaming; |
616 iCondition = RMobilePhone::EBarIncomingRoaming; |
628 facilityType = ECmdFacilityTypeBarring; |
617 facilityType = ECmdFacilityTypeBarring; |
629 } |
618 } |
630 else if (command.Compare(KATCLCKAB) == 0) |
619 else if (command.CompareF(KATCLCKAB) == 0) |
631 { |
620 { |
632 iCondition = RMobilePhone::EBarAllCases; |
621 iCondition = RMobilePhone::EBarAllCases; |
633 facilityType = ECmdFacilityTypeAllBarring; |
622 facilityType = ECmdFacilityTypeAllBarring; |
634 } |
623 } |
635 else if (command.Compare(KATCLCKAG) == 0) |
624 else if (command.CompareF(KATCLCKAG) == 0) |
636 { |
625 { |
637 iCondition = RMobilePhone::EBarAllOutgoingServices; |
626 iCondition = RMobilePhone::EBarAllOutgoingServices; |
638 facilityType = ECmdFacilityTypeAllBarring; |
627 facilityType = ECmdFacilityTypeAllBarring; |
639 } |
628 } |
640 else if (command.Compare(KATCLCKAC) == 0) |
629 else if (command.CompareF(KATCLCKAC) == 0) |
641 { |
630 { |
642 iCondition = RMobilePhone::EBarAllIncomingServices; |
631 iCondition = RMobilePhone::EBarAllIncomingServices; |
643 facilityType = ECmdFacilityTypeAllBarring; |
632 facilityType = ECmdFacilityTypeAllBarring; |
644 } |
633 } |
645 else |
634 else |