576 // --------------------------------------------------------- |
392 // --------------------------------------------------------- |
577 // |
393 // |
578 TInt CApSettingsHandlerImpl::RunSettingsL( TUint32 aHighLight, |
394 TInt CApSettingsHandlerImpl::RunSettingsL( TUint32 aHighLight, |
579 TUint32& aSelected ) |
395 TUint32& aSelected ) |
580 { |
396 { |
581 APSETUILOGGER_ENTERFN( EApImpl,"Impl::RunSettingsL") |
397 return 0; |
582 |
|
583 // this function is only called from outside, need to init iEventStore |
|
584 iEventStore = KApUiEventNone; |
|
585 |
|
586 TRAPD( err, HandleRunSettingsL( aHighLight, aSelected ) ); |
|
587 if ( iEventStore & KApUiEventInternal ) |
|
588 { |
|
589 // internal 'exit', not an error, |
|
590 // clear flag and return normally |
|
591 iEventStore &= (~KApUiEventInternal); |
|
592 } |
|
593 else |
|
594 { |
|
595 User::LeaveIfError(err); |
|
596 } |
|
597 |
|
598 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::RunSettingsL") |
|
599 |
|
600 return iEventStore; |
|
601 } |
398 } |
602 |
399 |
603 |
400 |
604 |
401 |
605 // --------------------------------------------------------- |
402 // --------------------------------------------------------- |
606 // CApSettingsHandlerImpl::Cvt() |
403 // CApSettingsHandlerImpl::Cvt() |
607 // --------------------------------------------------------- |
404 // --------------------------------------------------------- |
608 // |
405 // |
609 TInt CApSettingsHandlerImpl::Cvt() |
406 TInt CApSettingsHandlerImpl::Cvt() |
610 { |
407 { |
611 APSETUILOGGER_ENTERFN( EApImpl,"Impl::Cvt") |
408 return KErrNotSupported; |
612 |
|
613 return KErrNone; |
|
614 } |
409 } |
615 |
410 |
616 |
411 |
617 // --------------------------------------------------------- |
412 // --------------------------------------------------------- |
618 // CApSettingsHandlerImpl::DoRunSettingsL |
413 // CApSettingsHandlerImpl::DoRunSettingsL |
619 // --------------------------------------------------------- |
414 // --------------------------------------------------------- |
620 // |
415 // |
621 TInt CApSettingsHandlerImpl::DoRunSettingsL( TUint32 aHighLight, |
416 TInt CApSettingsHandlerImpl::DoRunSettingsL( TUint32 aHighLight, |
622 TUint32& aSelected ) |
417 TUint32& aSelected ) |
623 { |
418 { |
624 APSETUILOGGER_ENTERFN( EApImpl,"Impl::DoRunSettingsL") |
|
625 |
|
626 __ASSERT_DEBUG( iTextOverrides, Panic( ENullPointer ) ); |
|
627 |
|
628 if ( ( iListType == EApSettingsSelListIsPopUp ) || |
|
629 ( iListType == EApSettingsSelListIsPopUpWithNone ) ) |
|
630 { |
|
631 DoRunSetPageSettingsL( aHighLight, aSelected ); |
|
632 } |
|
633 else |
|
634 { |
|
635 DoRunListSettingsL( aHighLight, aSelected ); |
|
636 } |
|
637 |
|
638 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::DoRunSettingsL") |
|
639 return 0; |
419 return 0; |
640 } |
420 } |
641 |
421 |
642 |
422 |
643 // --------------------------------------------------------- |
423 // --------------------------------------------------------- |
644 // CApSettingsHandlerImpl::RunViewerL |
424 // CApSettingsHandlerImpl::RunViewerL |
645 // --------------------------------------------------------- |
425 // --------------------------------------------------------- |
646 // |
426 // |
647 TInt CApSettingsHandlerImpl::RunViewerL( TUint32 aUid ) |
427 TInt CApSettingsHandlerImpl::RunViewerL( TUint32 aUid ) |
648 { |
428 { |
649 APSETUILOGGER_ENTERFN( EApImpl,"Impl::RunViewerL") |
429 return 0; |
650 |
|
651 // this function is only called from outside, need to init iEventStore |
|
652 iEventStore = KApUiEventNone; |
|
653 |
|
654 #ifdef __TEST_OOMDEBUG |
|
655 if ( iMemTestOn ) |
|
656 { |
|
657 TInt leavecode( KErrNoMemory ); |
|
658 TInt ts( GetTestStateL() ); |
|
659 |
|
660 TBuf<48> buf; |
|
661 buf.Format( _L("\r\n\t( ts: %d )"), ts ); |
|
662 APSETUILOGGER_WRITE_BUF( EApImpl, buf ); |
|
663 |
|
664 if ( ts == KViewerTest ) |
|
665 { |
|
666 TBuf<48> buf; |
|
667 APSETUILOGGER_WRITE_BUF( EApImpl, _L("Starting KViewerTest memtest") ); |
|
668 |
|
669 TUint32 rate( 0 ); |
|
670 TUint32 retrycount( KOOMRetryCount ); |
|
671 TUint32 retryoffset( KOOMRetryOffset ); |
|
672 for ( |
|
673 rate = 1; |
|
674 ((rate < 50000) && (leavecode == KErrNoMemory)) |
|
675 || retrycount; |
|
676 rate++ |
|
677 ) |
|
678 { |
|
679 __UHEAP_SETFAIL( RHeap::EDeterministic, rate ); |
|
680 TRAP( leavecode, DoRunViewerL( aUid ) ); |
|
681 __UHEAP_RESET; |
|
682 if ( !leavecode ) |
|
683 { |
|
684 retrycount--; |
|
685 rate += retryoffset; |
|
686 } |
|
687 } |
|
688 User::LeaveIfError( leavecode ); |
|
689 buf.Format( _L("\t Memtest finished, max. rate was: %d )"), rate ); |
|
690 APSETUILOGGER_WRITE_BUF( EApImpl, buf ); |
|
691 } |
|
692 else |
|
693 { |
|
694 DoRunViewerL( aUid ); |
|
695 } |
|
696 } |
|
697 else |
|
698 { |
|
699 DoRunViewerL( aUid ); |
|
700 } |
|
701 #else |
|
702 DoRunViewerL( aUid ); |
|
703 #endif // __TEST_OOMDEBUG |
|
704 |
|
705 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::RunViewerL") |
|
706 |
|
707 return iEventStore; |
|
708 } |
430 } |
709 |
431 |
710 |
432 |
711 |
433 |
712 // --------------------------------------------------------- |
434 // --------------------------------------------------------- |
713 // CApSettingsHandlerImpl::DoRunViewerL |
435 // CApSettingsHandlerImpl::DoRunViewerL |
714 // --------------------------------------------------------- |
436 // --------------------------------------------------------- |
715 // |
437 // |
716 TInt CApSettingsHandlerImpl::DoRunViewerL( TUint32 aUid ) |
438 TInt CApSettingsHandlerImpl::DoRunViewerL( TUint32 aUid ) |
717 { |
439 { |
718 APSETUILOGGER_ENTERFN( EApImpl,"Impl::DoRunViewerL") |
440 return 0; |
719 |
|
720 TInt retval( KErrNone ); |
|
721 |
|
722 TBool protSupported = FeatureManager::FeatureSupported( |
|
723 KFeatureIdSettingsProtection ); |
|
724 |
|
725 |
|
726 TTransactionResult ownTransaction = iModel->StartTransactionLC |
|
727 ( |
|
728 /*aWrite*/EFalse, |
|
729 /*aShowNote*/ETrue, |
|
730 /*aRetry*/ETrue |
|
731 ); |
|
732 if ( ownTransaction != EFailedWithLocked ) |
|
733 { |
|
734 TBool isinuse = iModel->ApUtils()->IsAPInUseL( aUid ); |
|
735 TBool isprotected(EFalse); |
|
736 if ( protSupported ) |
|
737 { |
|
738 isprotected = iModel->ApUtils()->IsReadOnlyL( aUid ); |
|
739 isprotected |= CApProtHandler::IsTableProtectedL( |
|
740 iModel->Database()->Database() ); |
|
741 } |
|
742 |
|
743 TBool isvpn = iModel->VpnEngine()->IsVpnApL( aUid ); |
|
744 |
|
745 if ( ownTransaction == EOwnTransaction ) |
|
746 { |
|
747 TInt err = iModel->CommitTransaction(); |
|
748 User::LeaveIfError( err ); |
|
749 CleanupStack::Pop(); // RollbackTransactionOnLeave |
|
750 } |
|
751 |
|
752 if ( isinuse ) |
|
753 { |
|
754 // Ap is in use right now, can not edit or delete, |
|
755 // show information note qtn_set_note_iap_in_use |
|
756 ShowNoteL( R_APUI_NOTE_AP_IN_USE_EDIT ); |
|
757 } |
|
758 else |
|
759 { |
|
760 if ( protSupported && isprotected ) |
|
761 { |
|
762 ShowNoteL( R_APUI_NOTE_PROTECTED_AP_SETT ); |
|
763 } |
|
764 else |
|
765 { // not in use, not protected, check if it is vpn |
|
766 if ( isvpn ) |
|
767 { |
|
768 ShowNoteL( R_APUI_NOTE_VPN_AP_SETT ); |
|
769 } |
|
770 else |
|
771 { // may start wondering about editing... |
|
772 TApBearerType bearer = iModel->ApUtils()->BearerTypeL( aUid ); |
|
773 #ifdef __TEST_LAN_BEARER |
|
774 if ( bearer == EApBearerTypeLAN ) |
|
775 { |
|
776 User::Leave( KErrNotSupported ); |
|
777 // ShowNoteL( R_APUI_AP_LAN_NOT_SUPPORTED ); |
|
778 // Leave needed? |
|
779 } |
|
780 else |
|
781 { |
|
782 CApSettingsDlg* iMyDialog = |
|
783 CApSettingsDlg::NewL( iIspFilter, |
|
784 iBearerFilter, |
|
785 iExt->iSortType, |
|
786 iEventStore, |
|
787 iReqIpvType |
|
788 ); |
|
789 |
|
790 iMyDialog->SetTextOverrides( iTextOverrides ); |
|
791 |
|
792 retval = iMyDialog->ConstructAndRunLD( |
|
793 *iModel, *this, aUid ); |
|
794 } |
|
795 #else |
|
796 if ( bearer == EApBearerTypeLANModem ) |
|
797 { |
|
798 User::Leave( KErrNotSupported ); |
|
799 // ShowNoteL( R_APUI_AP_LAN_NOT_SUPPORTED ); |
|
800 // Leave needed? |
|
801 } |
|
802 else |
|
803 { |
|
804 CApSettingsDlg* iMyDialog = |
|
805 CApSettingsDlg::NewL( iIspFilter, |
|
806 iBearerFilter, |
|
807 iExt->iSortType, |
|
808 iEventStore, |
|
809 iReqIpvType |
|
810 ); |
|
811 |
|
812 iMyDialog->SetTextOverrides( iTextOverrides ); |
|
813 |
|
814 retval = iMyDialog->ConstructAndRunLD( |
|
815 *iModel, *this, aUid ); |
|
816 } |
|
817 #endif // __TEST_LAN_BEARER |
|
818 } |
|
819 } |
|
820 } |
|
821 } |
|
822 |
|
823 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::DoRunViewerL") |
|
824 |
|
825 return retval; |
|
826 } |
441 } |
827 |
442 |
828 |
443 |
829 |
444 |
830 //---------------------------------------------------------- |
445 //---------------------------------------------------------- |
831 // CApSettingsHandlerImpl::HandleApDeleteCmdL |
446 // CApSettingsHandlerImpl::HandleApDeleteCmdL |
832 //---------------------------------------------------------- |
447 //---------------------------------------------------------- |
833 // |
448 // |
834 void CApSettingsHandlerImpl::HandleApDeleteCmdL( TUint32 aUid, TBool aIsLast ) |
449 void CApSettingsHandlerImpl::HandleApDeleteCmdL( TUint32 aUid, TBool aIsLast ) |
835 { |
450 { |
836 APSETUILOGGER_ENTERFN( EApImpl,"Impl::HandleApDeleteCmdL") |
|
837 |
|
838 // OOD handling. If disk space is low, |
|
839 // we try to get some spare. |
|
840 RFs fs; |
|
841 User::LeaveIfError( fs.Connect() ); |
|
842 CleanupClosePushL<RFs>( fs ); |
|
843 TBool diskLow = SysUtil::FFSSpaceBelowCriticalLevelL |
|
844 ( &fs, KEstimatedDeleteFfsOverhead ); |
|
845 |
|
846 RSharedDataClient sdClient; |
|
847 if ( diskLow ) |
|
848 { |
|
849 User::LeaveIfError( sdClient.Connect() ); |
|
850 CleanupClosePushL<RSharedDataClient>( sdClient ); |
|
851 sdClient.RequestFreeDiskSpaceLC |
|
852 ( KEstimatedDeleteFfsOverhead ); |
|
853 } |
|
854 |
|
855 // check that the Ap is not used so it can be deleted!! |
|
856 TTransactionResult ownTransaction = iModel->StartTransactionLC( |
|
857 /*aWrite*/EFalse, |
|
858 /*aShowNote*/ETrue, |
|
859 /*aRetry*/ETrue ); |
|
860 if ( ownTransaction != EFailedWithLocked ) |
|
861 { |
|
862 TBool isinuse = iModel->ApUtils()->IsAPInUseL( aUid ); |
|
863 TApBearerType bearer = iModel->ApUtils()->BearerTypeL( aUid ); |
|
864 #ifdef __TEST_LAN_BEARER |
|
865 if ( bearer == EApBearerTypeLAN ) |
|
866 { |
|
867 User::Leave( KErrNotSupported ); |
|
868 } |
|
869 #endif // __TEST_LAN_BEARER |
|
870 if ( bearer == EApBearerTypeLANModem ) |
|
871 { |
|
872 User::Leave( KErrNotSupported ); |
|
873 // Leave needed? |
|
874 } |
|
875 |
|
876 TBool protSupported = FeatureManager::FeatureSupported( |
|
877 KFeatureIdSettingsProtection ); |
|
878 TBool isprotected(EFalse); |
|
879 if ( protSupported ) |
|
880 { |
|
881 isprotected = iModel->ApUtils()->IsReadOnlyL( aUid ); |
|
882 } |
|
883 |
|
884 if ( ownTransaction == EOwnTransaction ) |
|
885 { |
|
886 TInt err = iModel->CommitTransaction(); |
|
887 User::LeaveIfError( err ); |
|
888 CleanupStack::Pop(); // RollbackTransactionOnLeave |
|
889 } |
|
890 |
|
891 if ( isinuse ) |
|
892 { |
|
893 // Ap is in use right now, can not edit or delete, |
|
894 // show information note qtn_set_note_iap_in_use |
|
895 ShowNoteL( R_APUI_NOTE_AP_IN_USE_DELETE ); |
|
896 } |
|
897 else |
|
898 { // not in use, maybe protected? |
|
899 if ( protSupported && isprotected ) |
|
900 { |
|
901 ShowNoteL( R_APUI_NOTE_PROTECTED_AP ); |
|
902 } |
|
903 else |
|
904 { // not in use or protected, may start wondering about delete... |
|
905 // need to check whether it is the last one... |
|
906 TBool candelete( ETrue ); |
|
907 // Linked to VPN? |
|
908 TBool isvpn = iModel->VpnEngine()->IsVpnApL( aUid ); |
|
909 if ( !isvpn ) |
|
910 { |
|
911 if ( iExt->iVariant & KApUiEditOnlyVPNs ) |
|
912 { |
|
913 candelete = EFalse; |
|
914 } |
|
915 else |
|
916 { |
|
917 HBufC* sgd = NULL; |
|
918 sgd = iModel->GetLinkedVpnAccessPointLC( aUid ); |
|
919 if ( sgd ) |
|
920 {// has linked VPN, |
|
921 // According to current spec. there should |
|
922 // be something like linked to VPN, Delete? |
|
923 // BUT it causes incomplete access point to exist |
|
924 // hard to handle, therefore last minute change |
|
925 // is that it can not be delted. |
|
926 /* |
|
927 if ( !AskQueryL( R_APUI_IAP_DEL_IAP_ASSOCIATED, sgd ) ) |
|
928 { |
|
929 candelete = EFalse; |
|
930 } |
|
931 */ |
|
932 ShowNoteL( R_APUI_NOTE_AP_IN_USE_DELETE ); |
|
933 candelete = EFalse; |
|
934 |
|
935 CleanupStack::PopAndDestroy( sgd ); |
|
936 } |
|
937 else |
|
938 { // simply confirm |
|
939 candelete = ConfirmDeleteL( aUid, aIsLast ); |
|
940 } |
|
941 } |
|
942 } |
|
943 else |
|
944 { // simply confirm |
|
945 candelete = ConfirmDeleteL( aUid, aIsLast ); |
|
946 } |
|
947 if ( candelete ) |
|
948 { // seems that we can delete it, so let's go on |
|
949 iModel->RemoveApL( aUid ); |
|
950 iEventStore |= KApUiEventDeleted; |
|
951 } |
|
952 } |
|
953 } |
|
954 } |
|
955 |
|
956 if ( diskLow ) |
|
957 { |
|
958 // Cancel RequestFreeDiskSpaceLC (by popping off an destroy); |
|
959 // close sdClient. |
|
960 CleanupStack::PopAndDestroy( 2 ); |
|
961 } |
|
962 CleanupStack::PopAndDestroy(); // fs, will also close it |
|
963 |
|
964 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::HandleApDeleteCmdL") |
|
965 } |
451 } |
966 |
452 |
967 |
453 |
968 //---------------------------------------------------------- |
454 //---------------------------------------------------------- |
969 // CApSettingsHandlerImpl::HandleApBlankNewL |
455 // CApSettingsHandlerImpl::HandleApBlankNewL |
970 //---------------------------------------------------------- |
456 //---------------------------------------------------------- |
971 // |
457 // |
972 TUint32 CApSettingsHandlerImpl::HandleApBlankNewL( TInt aBearers, TInt aIsps ) |
458 TUint32 CApSettingsHandlerImpl::HandleApBlankNewL( TInt aBearers, TInt aIsps ) |
973 { |
459 { |
974 APSETUILOGGER_ENTERFN( EApImpl,"Impl::HandleApBlankNewL") |
460 return 0; |
975 |
|
976 TUint32 retval( KErrNone ); |
|
977 |
|
978 #ifdef __TEST_OOMDEBUG |
|
979 if ( iMemTestOn ) |
|
980 { |
|
981 TInt leavecode( KErrNoMemory ); |
|
982 |
|
983 TInt ts( GetTestStateL() ); |
|
984 |
|
985 if ( ts == KCreateBlankTest ) |
|
986 { |
|
987 TBuf<48> buf; |
|
988 APSETUILOGGER_WRITE_BUF( EApImpl, _L("Starting KCreateBlankTest memtest") ); |
|
989 |
|
990 TUint32 rate( 0 ); |
|
991 TUint32 retrycount( KOOMRetryCount ); |
|
992 TUint32 retryoffset( KOOMRetryOffset ); |
|
993 for ( |
|
994 rate = 1; |
|
995 ((rate < 50000) && (leavecode == KErrNoMemory)) |
|
996 || retrycount; |
|
997 rate++ |
|
998 ) |
|
999 { |
|
1000 __UHEAP_SETFAIL( RHeap::EDeterministic, rate ); |
|
1001 TRAP( leavecode, |
|
1002 retval = DoHandleApBlankNewL( aBearers, aIsps ) ); |
|
1003 __UHEAP_RESET; |
|
1004 if ( !leavecode ) |
|
1005 { |
|
1006 retrycount--; |
|
1007 rate += retryoffset; |
|
1008 } |
|
1009 } |
|
1010 User::LeaveIfError( leavecode ); |
|
1011 buf.Format( _L("\t Memtest finished, max. rate was: %d )"), rate ); |
|
1012 APSETUILOGGER_WRITE_BUF( EApImpl, buf ); |
|
1013 } |
|
1014 else |
|
1015 { |
|
1016 retval = DoHandleApBlankNewL( aBearers, aIsps ); |
|
1017 } |
|
1018 } |
|
1019 else |
|
1020 { |
|
1021 retval = DoHandleApBlankNewL( aBearers, aIsps ); |
|
1022 } |
|
1023 #else |
|
1024 retval = DoHandleApBlankNewL( aBearers, aIsps ); |
|
1025 #endif // __TEST_OOMDEBUG |
|
1026 |
|
1027 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::HandleApBlankNewL") |
|
1028 return retval; |
|
1029 } |
461 } |
1030 |
462 |
1031 |
463 |
1032 |
464 |
1033 |
465 |
1035 // CApSettingsHandlerImpl::HandleApUseOldNewL |
467 // CApSettingsHandlerImpl::HandleApUseOldNewL |
1036 //---------------------------------------------------------- |
468 //---------------------------------------------------------- |
1037 // |
469 // |
1038 TUint32 CApSettingsHandlerImpl::HandleApUseOldNewL() |
470 TUint32 CApSettingsHandlerImpl::HandleApUseOldNewL() |
1039 { |
471 { |
1040 APSETUILOGGER_ENTERFN( EApImpl,"Impl::HandleApUseOldNewL") |
472 return 0; |
1041 |
|
1042 TUint32 retval = KErrNone; |
|
1043 |
|
1044 #ifdef __TEST_OOMDEBUG |
|
1045 if ( iMemTestOn ) |
|
1046 { |
|
1047 TInt leavecode( KErrNoMemory ); |
|
1048 TInt ts( GetTestStateL() ); |
|
1049 |
|
1050 TBuf<48> buf; |
|
1051 buf.Format( _L("\r\n\t( ts: %d )"), ts ); |
|
1052 APSETUILOGGER_WRITE_BUF( EApImpl, buf ); |
|
1053 |
|
1054 if ( ts == KQueryTest ) |
|
1055 { |
|
1056 TBuf<48> buf; |
|
1057 APSETUILOGGER_WRITE_BUF( EApImpl, _L("Starting KQueryTest memtest") ); |
|
1058 TUint32 rate( 0 ); |
|
1059 TUint32 retrycount( KOOMRetryCount ); |
|
1060 TUint32 retryoffset( KOOMRetryOffset ); |
|
1061 for ( |
|
1062 rate = 1; |
|
1063 ((rate < 50000) && (leavecode == KErrNoMemory)) |
|
1064 || retrycount; |
|
1065 rate++ |
|
1066 ) |
|
1067 { |
|
1068 __UHEAP_MARK; |
|
1069 __UHEAP_SETFAIL( RHeap::EDeterministic, rate ); |
|
1070 TRAP( leavecode, retval = SelectApToCopyL() ); |
|
1071 __UHEAP_RESET; |
|
1072 __UHEAP_MARKEND; |
|
1073 if ( !leavecode ) |
|
1074 { |
|
1075 retrycount--; |
|
1076 rate += retryoffset; |
|
1077 } |
|
1078 } |
|
1079 User::LeaveIfError( leavecode ); |
|
1080 buf.Format( _L("\t Memtest finished, max. rate was: %d )"), rate ); |
|
1081 APSETUILOGGER_WRITE_BUF( EApImpl, buf ); |
|
1082 } |
|
1083 else |
|
1084 { |
|
1085 retval = SelectApToCopyL(); |
|
1086 } |
|
1087 } |
|
1088 else |
|
1089 { |
|
1090 retval = SelectApToCopyL(); |
|
1091 } |
|
1092 #else |
|
1093 retval = SelectApToCopyL(); |
|
1094 #endif // __TEST_OOMDEBUG |
|
1095 |
|
1096 if ( retval != (TUint32)KErrNone ) |
|
1097 { // so user had chosen something |
|
1098 #ifdef __TEST_OOMDEBUG |
|
1099 if ( iMemTestOn ) |
|
1100 { |
|
1101 TInt leavecode( KErrNoMemory ); |
|
1102 TInt ts( GetTestStateL() ); |
|
1103 if ( ts == KCreateUseExistTest ) |
|
1104 { |
|
1105 TBuf<48> buf; |
|
1106 APSETUILOGGER_WRITE_BUF |
|
1107 ( _L("Starting KCreateUseExistTest memtest") ); |
|
1108 TUint32 rate( 0 ); |
|
1109 TUint32 retrycount( KOOMRetryCount ); |
|
1110 TUint32 retryoffset( KOOMRetryOffset ); |
|
1111 for ( |
|
1112 rate = 1; |
|
1113 ((rate < 50000) && (leavecode == KErrNoMemory)) |
|
1114 || retrycount; |
|
1115 rate++ |
|
1116 ) |
|
1117 { |
|
1118 __UHEAP_SETFAIL( RHeap::EDeterministic, rate ); |
|
1119 TRAP( leavecode, retval = DoHandleApUseOldNewL( retval ) ); |
|
1120 __UHEAP_RESET; |
|
1121 if ( !leavecode ) |
|
1122 { |
|
1123 retrycount--; |
|
1124 rate += retryoffset; |
|
1125 } |
|
1126 } |
|
1127 User::LeaveIfError( leavecode ); |
|
1128 buf.Format( _L("\t Memtest finished, max. rate was: %d )"), |
|
1129 rate ); |
|
1130 APSETUILOGGER_WRITE_BUF( EApImpl, buf ); |
|
1131 } |
|
1132 else |
|
1133 { |
|
1134 retval = DoHandleApUseOldNewL( retval ); |
|
1135 } |
|
1136 } |
|
1137 else |
|
1138 { |
|
1139 retval = DoHandleApUseOldNewL( retval ); |
|
1140 } |
|
1141 #else |
|
1142 retval = DoHandleApUseOldNewL( retval ); |
|
1143 #endif // __TEST_OOMDEBUG |
|
1144 } |
|
1145 |
|
1146 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::HandleApUseOldNewL") |
|
1147 |
|
1148 return retval; |
|
1149 } |
473 } |
1150 |
474 |
1151 |
475 |
1152 |
476 |
1153 //---------------------------------------------------------- |
477 //---------------------------------------------------------- |
1187 TInt aBearerFilter, |
495 TInt aBearerFilter, |
1188 TInt aSortType, |
496 TInt aSortType, |
1189 TVpnFilterType aVpnFilterType, |
497 TVpnFilterType aVpnFilterType, |
1190 TBool aIncludeEasyWlan ) |
498 TBool aIncludeEasyWlan ) |
1191 { |
499 { |
1192 APSETUILOGGER_ENTERFN( EApImpl,"Impl::DoConstructL") |
|
1193 |
|
1194 iExt = new ( ELeave )TApSetHandlerImplExtra; |
|
1195 iExt->iResOffset = 0; |
|
1196 iExt->iIsIpv6Supported = EFalse; |
|
1197 iExt->iIsFeatureManagerInitialised = EFalse; |
|
1198 iExt->iExtra = 0; |
|
1199 iExt->iSortType = KEApSortNameAscending; |
|
1200 iExt->iVpnFilterType = aVpnFilterType; |
|
1201 iExt->iVariant = GetVariantL(); |
|
1202 iExt->iIncludeEasyWlan = aIncludeEasyWlan; |
|
1203 |
|
1204 #ifdef __TEST_CDMA_WRITE_PROTECT |
|
1205 iExt->iVariant |= KApUiEditOnlyVPNs; |
|
1206 #endif // __TEST_CDMA_WRITE_PROTECT |
|
1207 iIspFilter = KEApIspTypeAll; |
|
1208 iBearerFilter = aBearerFilter; |
|
1209 |
|
1210 // get IPv6 features from feature manager |
|
1211 FeatureManager::InitializeLibL(); |
|
1212 iExt->iIsFeatureManagerInitialised = ETrue; |
|
1213 |
|
1214 iExt->iIsIpv6Supported = |
|
1215 FeatureManager::FeatureSupported( KFeatureIdIPv6 ); |
|
1216 #ifdef __TEST_IPV6_SUPPORT |
|
1217 iExt->iIsIpv6Supported = ETrue; |
|
1218 #endif // __TEST_IPV6_SUPPORT |
|
1219 |
|
1220 // we ask IPv6 only if it is asked by client AND supported by the phone |
|
1221 iReqIpvType = iExt->iIsIpv6Supported ? iReqIpvType : EIPv4; |
|
1222 |
|
1223 |
|
1224 #ifdef __TEST_OOMDEBUG |
|
1225 RFs fs; |
|
1226 User::LeaveIfError( fs.Connect() ); |
|
1227 CleanupClosePushL<RFs>( fs ); |
|
1228 TUint att; |
|
1229 if ( fs.Att( KTestFileName, att ) == KErrNone ) |
|
1230 { |
|
1231 iMemTestOn = ETrue; |
|
1232 } |
|
1233 else |
|
1234 { |
|
1235 iMemTestOn = EFalse; |
|
1236 } |
|
1237 CleanupStack::PopAndDestroy(); // fs, will also close it |
|
1238 #endif // __TEST_OOMDEBUG |
|
1239 iTextOverrides = CTextOverrides::NewL(); |
|
1240 // No need to PushL( iTextOverrides ), it's pointer is owned |
|
1241 // & will be deleted in destructor, because 'this' is already |
|
1242 // on the CleanupStack... |
|
1243 if ( aDb ) |
|
1244 { |
|
1245 iModel = CApSettingsModel::NewL( *aDb, aIspFilter, |
|
1246 aBearerFilter, aSortType, |
|
1247 iReqIpvType, |
|
1248 iExt->iVpnFilterType, |
|
1249 iExt->iVariant, |
|
1250 iExt->iIncludeEasyWlan, |
|
1251 iNoEdit ); |
|
1252 } |
|
1253 else |
|
1254 { |
|
1255 iModel = CApSettingsModel::NewL( aIspFilter, aBearerFilter, |
|
1256 aSortType, iReqIpvType, |
|
1257 iExt->iVpnFilterType, |
|
1258 iExt->iVariant, |
|
1259 iExt->iIncludeEasyWlan, |
|
1260 iNoEdit ); |
|
1261 } |
|
1262 SetFilterL( aIspFilter, aBearerFilter, aSortType ); |
|
1263 |
|
1264 // can't use resource here because it has not been added yet.... |
|
1265 TFileName resourceFile; |
|
1266 resourceFile.Append( KApSettingsResDriveZ ); |
|
1267 resourceFile.Append( KDC_RESOURCE_FILES_DIR ); |
|
1268 resourceFile.Append( KApSettingsResFileName ); |
|
1269 BaflUtils::NearestLanguageFile( iModel->EikEnv()->FsSession(), |
|
1270 resourceFile ); |
|
1271 // as we are not an Application having iCoeEnv, we must figure it out, |
|
1272 // no matter what it takes. Also it is getted once per construction... |
|
1273 iExt->iResOffset = iModel->EikEnv()->AddResourceFileL( resourceFile ); |
|
1274 |
|
1275 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::DoConstructL") |
|
1276 } |
500 } |
1277 |
501 |
1278 |
502 |
1279 |
503 |
1280 |
504 |
1357 //---------------------------------------------------------- |
518 //---------------------------------------------------------- |
1358 // |
519 // |
1359 void CApSettingsHandlerImpl::DoRunListSettingsL( TUint32 aHighLight, |
520 void CApSettingsHandlerImpl::DoRunListSettingsL( TUint32 aHighLight, |
1360 TUint32& aSelected ) |
521 TUint32& aSelected ) |
1361 { |
522 { |
1362 APSETUILOGGER_ENTERFN( EApImpl,"Impl::DoRunListSettingsL") |
|
1363 |
|
1364 CApSelectorDialog* iMyDialog = CApSelectorDialog::NewL |
|
1365 ( |
|
1366 iListType, |
|
1367 iSelMenuType, |
|
1368 iIspFilter, |
|
1369 iBearerFilter, |
|
1370 iExt->iSortType, |
|
1371 iEventStore, |
|
1372 iNoEdit, |
|
1373 iReqIpvType |
|
1374 ); |
|
1375 iMyDialog->SetTextOverrides( iTextOverrides ); |
|
1376 |
|
1377 iMyDialog->ConstructAndRunLD( *iModel, *this, aHighLight, aSelected ); |
|
1378 |
|
1379 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::DoRunListSettingsL") |
|
1380 } |
523 } |
1381 |
524 |
1382 |
525 |
1383 |
526 |
1384 //---------------------------------------------------------- |
527 //---------------------------------------------------------- |
1385 // CApSettingsHandlerImpl::DoHandleApUseOldNewL |
528 // CApSettingsHandlerImpl::DoHandleApUseOldNewL |
1386 //---------------------------------------------------------- |
529 //---------------------------------------------------------- |
1387 // |
530 // |
1388 TUint32 CApSettingsHandlerImpl::DoHandleApUseOldNewL( TUint32 aSelected ) |
531 TUint32 CApSettingsHandlerImpl::DoHandleApUseOldNewL( TUint32 aSelected ) |
1389 { |
532 { |
1390 APSETUILOGGER_ENTERFN( EApImpl,"Impl::DoHandleApUseOldNewL") |
533 return KErrNotSupported; |
1391 |
|
1392 TInt retval = KErrNone; |
|
1393 |
|
1394 TTransactionResult ownTransaction = iModel->StartTransactionLC |
|
1395 ( /*aWrite*/ETrue, |
|
1396 /*aShowNote*/ETrue, |
|
1397 /*aRetry*/ETrue |
|
1398 ); |
|
1399 if ( ownTransaction != EFailedWithLocked ) |
|
1400 { |
|
1401 // check the original bearer's type |
|
1402 TApBearerType bearer = iModel->ApUtils()->BearerTypeL( aSelected ); |
|
1403 #ifdef __TEST_LAN_BEARER |
|
1404 if ( bearer == EApBearerTypeLAN ) |
|
1405 { |
|
1406 User::Leave( KErrNotSupported ); |
|
1407 // ShowNoteL( R_APUI_AP_LAN_NOT_SUPPORTED ); |
|
1408 // User::Leave( KLeaveWithoutAlert ); |
|
1409 } |
|
1410 #endif // __TEST_LAN_BEARER |
|
1411 if ( bearer == EApBearerTypeLANModem ) |
|
1412 { |
|
1413 User::Leave( KErrNotSupported ); |
|
1414 // ShowNoteL( R_APUI_AP_LAN_NOT_SUPPORTED ); |
|
1415 // User::Leave( KLeaveWithoutAlert ); |
|
1416 } |
|
1417 TBool isprotected( EFalse ); |
|
1418 |
|
1419 TBool protSupported = FeatureManager::FeatureSupported( |
|
1420 KFeatureIdSettingsProtection ); |
|
1421 |
|
1422 if ( protSupported ) |
|
1423 { |
|
1424 isprotected = iModel->ApUtils()->IsReadOnlyL( aSelected ); |
|
1425 isprotected |= CApProtHandler::IsTableProtectedL( |
|
1426 iModel->Database()->Database() ); |
|
1427 } |
|
1428 if ( isprotected ) |
|
1429 { |
|
1430 ShowNoteL( R_APUI_NOTE_PROTECTED_AP_SETT ); |
|
1431 } |
|
1432 if ( !isprotected ) |
|
1433 { |
|
1434 TUint32 aUid = iModel->DataHandler()->CreateCopyFromL( aSelected ); |
|
1435 if ( ownTransaction == EOwnTransaction ) |
|
1436 { |
|
1437 TInt err = iModel->CommitTransaction(); |
|
1438 User::LeaveIfError( err ); |
|
1439 CleanupStack::Pop(); // RollbackTransactionOnLeave |
|
1440 } |
|
1441 iEventStore |= KApUiEventCreatedUsedOld; |
|
1442 retval = aUid; |
|
1443 EditAfterCreateL( aUid ); |
|
1444 } |
|
1445 else |
|
1446 { |
|
1447 if ( ownTransaction == EOwnTransaction ) |
|
1448 { |
|
1449 TInt err = iModel->CommitTransaction(); |
|
1450 User::LeaveIfError( err ); |
|
1451 CleanupStack::Pop(); // RollbackTransactionOnLeave |
|
1452 } |
|
1453 } |
|
1454 } |
|
1455 |
|
1456 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::DoHandleApUseOldNewL") |
|
1457 return retval; |
|
1458 } |
534 } |
1459 |
535 |
1460 |
536 |
1461 |
537 |
1462 //---------------------------------------------------------- |
538 //---------------------------------------------------------- |
1463 // CApSettingsHandlerImpl::SelectApToCopyL |
539 // CApSettingsHandlerImpl::SelectApToCopyL |
1464 //---------------------------------------------------------- |
540 //---------------------------------------------------------- |
1465 // |
541 // |
1466 TUint32 CApSettingsHandlerImpl::SelectApToCopyL() |
542 TUint32 CApSettingsHandlerImpl::SelectApToCopyL() |
1467 { |
543 { |
1468 APSETUILOGGER_ENTERFN( EApImpl,"Impl::SelectApToCopyL") |
544 return KErrNotSupported; |
1469 |
|
1470 // = KErrNone just to suppress compiler warning C4701 |
|
1471 TUint32 aSelected = KErrNone; |
|
1472 TUint32 retval = KErrNone; |
|
1473 |
|
1474 CApSelQueryDialog* dlg = new ( ELeave ) CApSelQueryDialog( *iModel, |
|
1475 &aSelected ); |
|
1476 TInt iQueryOk = dlg->ExecuteLD( R_LIST_QUERY ); |
|
1477 if ( iQueryOk ) |
|
1478 { |
|
1479 retval = aSelected; |
|
1480 } |
|
1481 |
|
1482 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::SelectApToCopyL") |
|
1483 return retval; |
|
1484 } |
545 } |
1485 |
546 |
1486 |
547 |
1487 |
548 |
1488 |
549 |
1491 // CApSettingsHandlerImpl::DoHandleApBlankNewL |
552 // CApSettingsHandlerImpl::DoHandleApBlankNewL |
1492 //---------------------------------------------------------- |
553 //---------------------------------------------------------- |
1493 // |
554 // |
1494 TUint32 CApSettingsHandlerImpl::DoHandleApBlankNewL( TInt aBearers, TInt aIsps ) |
555 TUint32 CApSettingsHandlerImpl::DoHandleApBlankNewL( TInt aBearers, TInt aIsps ) |
1495 { |
556 { |
1496 APSETUILOGGER_ENTERFN( EApImpl,"Impl::DoHandleApBlankNewL") |
557 return 0; |
1497 |
|
1498 CApAccessPointItem* apitem = CApAccessPointItem::NewLC(); |
|
1499 /* |
|
1500 KEApIspTypeInternetOnly: |
|
1501 EApBearerTypeCSD, EApBearerTypeHSCSD, EApBearerTypeGPRS |
|
1502 |
|
1503 KEApIspTypeInternetAndWAP |
|
1504 EApBearerTypeCSD, EApBearerTypeHSCSD, EApBearerTypeGPRS |
|
1505 |
|
1506 KEApIspTypeWAPOnly |
|
1507 EApBearerTypeCSD, EApBearerTypeHSCSD, EApBearerTypeSMS, EApBearerTypeGPRS |
|
1508 |
|
1509 KEApIspTypeWAPMandatory |
|
1510 EApBearerTypeCSD, EApBearerTypeHSCSD, EApBearerTypeSMS, EApBearerTypeGPRS |
|
1511 |
|
1512 KEApIspTypeAll |
|
1513 All |
|
1514 |
|
1515 |
|
1516 EIspTypeInternetOnly, |
|
1517 EIspTypeWAPOnly, |
|
1518 EIspTypeInternetAndWAP |
|
1519 |
|
1520 */ |
|
1521 ChooseBearerTypeL( aBearers, *apitem ); |
|
1522 |
|
1523 if ( aIsps & KEApIspTypeAll ) |
|
1524 { |
|
1525 apitem->WriteUint( EApIspIspType, EIspTypeInternetAndWAP ); |
|
1526 } |
|
1527 else |
|
1528 { |
|
1529 if ( aIsps & KEApIspTypeWAPOnly ) |
|
1530 { // EApBearerTypeCSD, EApBearerTypeHSCSD, EApBearerTypeGPRS, |
|
1531 apitem->WriteUint( EApIspIspType, EIspTypeWAPOnly ); |
|
1532 } |
|
1533 else |
|
1534 { |
|
1535 if ( aIsps & |
|
1536 ( KEApIspTypeWAPMandatory | KEApIspTypeMMSMandatory ) ) |
|
1537 { // EApBearerTypeCSD, EApBearerTypeHSCSD, EApBearerTypeGPRS |
|
1538 apitem->WriteUint( EApIspIspType, EIspTypeInternetAndWAP ); |
|
1539 } |
|
1540 else |
|
1541 { |
|
1542 if ( aIsps & KEApIspTypeInternetAndWAP ) |
|
1543 { |
|
1544 apitem->WriteUint( EApIspIspType, EIspTypeInternetAndWAP ); |
|
1545 } |
|
1546 else |
|
1547 { |
|
1548 if ( aIsps & KEApIspTypeInternetOnly ) |
|
1549 { |
|
1550 apitem->WriteUint( EApIspIspType, |
|
1551 EIspTypeInternetOnly ); |
|
1552 } |
|
1553 else |
|
1554 { |
|
1555 __ASSERT_DEBUG( EFalse, Panic( EInvalidIspRequest ) ); |
|
1556 } |
|
1557 } |
|
1558 } |
|
1559 } |
|
1560 } |
|
1561 /* |
|
1562 KEApIspTypeInternetOnly |
|
1563 KEApIspTypeWAPOnly |
|
1564 KEApIspTypeInternetAndWAP |
|
1565 KEApIspTypeWAPMandatory |
|
1566 KEApIspTypeAll |
|
1567 */ |
|
1568 |
|
1569 // apitem->WriteUint( EApIspIspType, EIspTypeInternetOnly ); |
|
1570 |
|
1571 TUint32 aUid( KApNoneUID ); |
|
1572 HBufC* buf = HBufC::NewLC( KApMaxConnNameLength ); |
|
1573 TPtr16 ptr( buf->Des() ); |
|
1574 apitem->ReadTextL( EApWapAccessPointName, ptr ); |
|
1575 |
|
1576 TTransactionResult ownTransaction = iModel->StartTransactionLC( |
|
1577 ETrue, // aWrite |
|
1578 ETrue, // aShowNote |
|
1579 ETrue ); // aRetry |
|
1580 if ( ownTransaction != EFailedWithLocked ) |
|
1581 { |
|
1582 if ( iModel->ApUtils()->MakeValidNameL( ptr ) ) |
|
1583 { |
|
1584 apitem->SetNamesL( ptr ); |
|
1585 } |
|
1586 if ( ownTransaction == EOwnTransaction ) |
|
1587 { |
|
1588 TInt err = iModel->CommitTransaction(); |
|
1589 User::LeaveIfError( err ); |
|
1590 CleanupStack::Pop(); // RollbackTransactionOnLeave |
|
1591 } |
|
1592 } |
|
1593 |
|
1594 aUid = EditAfterCreateL( KApNoneUID, apitem ); |
|
1595 CleanupStack::PopAndDestroy( 2 ); // apitem, buf |
|
1596 |
|
1597 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::DoHandleApBlankNewL") |
|
1598 return aUid; |
|
1599 } |
558 } |
1600 |
559 |
1601 |
560 |
1602 |
561 |
1603 |
562 |
1605 // CApSettingsHandlerImpl::HandleNetworkDeleteCmdL |
564 // CApSettingsHandlerImpl::HandleNetworkDeleteCmdL |
1606 //---------------------------------------------------------- |
565 //---------------------------------------------------------- |
1607 // |
566 // |
1608 void CApSettingsHandlerImpl::HandleNetworkDeleteCmdL( TUint32 aUid ) |
567 void CApSettingsHandlerImpl::HandleNetworkDeleteCmdL( TUint32 aUid ) |
1609 { |
568 { |
1610 APSETUILOGGER_ENTERFN( EApImpl,"Impl::HandleNetworkDeleteCmdL") |
|
1611 |
|
1612 // check that the Ap is not used so it can be deleted!! |
|
1613 TTransactionResult ownTransaction = iModel->StartTransactionLC( |
|
1614 /*aWrite*/EFalse, |
|
1615 /*aShowNote*/ETrue, |
|
1616 /*aRetry*/ETrue ); |
|
1617 if ( ownTransaction != EFailedWithLocked ) |
|
1618 { |
|
1619 TBool protSupported = FeatureManager::FeatureSupported( |
|
1620 KFeatureIdSettingsProtection ); |
|
1621 if ( protSupported ) |
|
1622 { |
|
1623 TBool isprotected = iModel->ApUtils()->IsReadOnlyL( aUid ); |
|
1624 if ( isprotected ) |
|
1625 { |
|
1626 ShowNoteL( R_APUI_NOTE_PROTECTED_AP ); |
|
1627 return; |
|
1628 } |
|
1629 } |
|
1630 if ( ownTransaction == EOwnTransaction ) |
|
1631 { |
|
1632 TInt err = iModel->CommitTransaction(); |
|
1633 User::LeaveIfError( err ); |
|
1634 CleanupStack::Pop(); // RollbackTransactionOnLeave |
|
1635 } |
|
1636 |
|
1637 // not protected, may start wondering about delete... |
|
1638 // simply confirm |
|
1639 |
|
1640 // OOD handling. If disk space is low, |
|
1641 // we try to get some spare. |
|
1642 RFs fs; |
|
1643 User::LeaveIfError( fs.Connect() ); |
|
1644 CleanupClosePushL<RFs>( fs ); |
|
1645 TBool diskLow = SysUtil::FFSSpaceBelowCriticalLevelL |
|
1646 ( &fs, KEstimatedDeleteFfsOverhead ); |
|
1647 RSharedDataClient sdClient; |
|
1648 if ( diskLow ) |
|
1649 { |
|
1650 User::LeaveIfError( sdClient.Connect() ); |
|
1651 CleanupClosePushL<RSharedDataClient>( sdClient ); |
|
1652 sdClient.RequestFreeDiskSpaceLC |
|
1653 ( KEstimatedDeleteFfsOverhead ); |
|
1654 } |
|
1655 // Handle getting the name, showing the query, |
|
1656 // and deleting the network group. |
|
1657 // get the name: |
|
1658 CApNetworkItem* net = CApNetworkItem::NewLC(); |
|
1659 iModel->DataHandler()->ReadNetworkL( aUid, *net ); |
|
1660 HBufC* buf = net->Name().AllocLC(); |
|
1661 if ( AskQueryL( R_APUI_IAP_ARE_YOU_SURE_TO_DEL, buf ) ) |
|
1662 { |
|
1663 iModel->DataHandler()->RemoveNetworkL( aUid ); |
|
1664 } |
|
1665 CleanupStack::PopAndDestroy( buf ); // buf |
|
1666 CleanupStack::PopAndDestroy( net ); |
|
1667 if ( diskLow ) |
|
1668 { |
|
1669 // Cancel RequestFreeDiskSpaceLC (by popping off an destroy); |
|
1670 // close scClient. |
|
1671 CleanupStack::PopAndDestroy( 2 ); |
|
1672 } |
|
1673 CleanupStack::PopAndDestroy(); // fs, will also close it |
|
1674 } |
|
1675 |
|
1676 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::HandleNetworkDeleteCmdL") |
|
1677 } |
569 } |
1678 |
570 |
1679 |
571 |
1680 |
572 |
1681 //---------------------------------------------------------- |
573 //---------------------------------------------------------- |
1780 //---------------------------------------------------------- |
608 //---------------------------------------------------------- |
1781 // |
609 // |
1782 void CApSettingsHandlerImpl::HandleRunSettingsL( TUint32 aHighLight, |
610 void CApSettingsHandlerImpl::HandleRunSettingsL( TUint32 aHighLight, |
1783 TUint32& aSelected ) |
611 TUint32& aSelected ) |
1784 { |
612 { |
1785 APSETUILOGGER_ENTERFN( EApImpl,"Impl::HandleRunSettingsL") |
|
1786 |
|
1787 if ( iStartWithSelection == EFalse ) |
|
1788 { |
|
1789 RunViewerL( aHighLight ); |
|
1790 } |
|
1791 else |
|
1792 { |
|
1793 #ifdef __TEST_OOMDEBUG |
|
1794 if ( iMemTestOn ) |
|
1795 { |
|
1796 TInt leavecode( KErrNoMemory ); |
|
1797 TInt state( GetTestStateL() ); |
|
1798 |
|
1799 if ( ( ( |
|
1800 ( iListType == EApSettingsSelListIsPopUp ) || |
|
1801 ( iListType == EApSettingsSelListIsPopUpWithNone ) ) && |
|
1802 ( state == KPopupListTest ) ) |
|
1803 || |
|
1804 ( |
|
1805 ( iListType == EApSettingsSelListIsListPane ) && |
|
1806 ( state == KDialogListTest ) ) ) |
|
1807 { |
|
1808 TBuf<48> buf; |
|
1809 if ( state == KDialogListTest ) |
|
1810 { |
|
1811 APSETUILOGGER_WRITE_BUF( EApImpl, \ |
|
1812 _L("Doing memtest KDialogListTest") ); |
|
1813 } |
|
1814 if ( state == KPopupListTest ) |
|
1815 { |
|
1816 APSETUILOGGER_WRITE_BUF( EApImpl, \ |
|
1817 _L("Doing memtest KPopupListTest") ); |
|
1818 } |
|
1819 TUint32 rate( 0 ); |
|
1820 TUint32 retrycount( KOOMRetryCount ); |
|
1821 TUint32 retryoffset( KOOMRetryOffset ); |
|
1822 for ( |
|
1823 rate = 1; |
|
1824 ((rate < 50000) && (leavecode == KErrNoMemory)) |
|
1825 || retrycount; |
|
1826 rate++ |
|
1827 ) |
|
1828 { |
|
1829 __UHEAP_SETFAIL( RHeap::EDeterministic, rate ); |
|
1830 TRAP( leavecode, |
|
1831 DoRunSettingsL( aHighLight, aSelected ) ); |
|
1832 __UHEAP_RESET; |
|
1833 if ( !leavecode ) |
|
1834 { |
|
1835 retrycount--; |
|
1836 rate += retryoffset; |
|
1837 } |
|
1838 } |
|
1839 User::LeaveIfError( leavecode ); |
|
1840 buf.Format( _L("\t Memtest finished, max. rate was: %d )"), |
|
1841 rate ); |
|
1842 APSETUILOGGER_WRITE_BUF( EApImpl, buf ); |
|
1843 } |
|
1844 else |
|
1845 { |
|
1846 DoRunSettingsL( aHighLight, aSelected ); |
|
1847 } |
|
1848 } |
|
1849 else |
|
1850 { |
|
1851 DoRunSettingsL( aHighLight, aSelected ); |
|
1852 } |
|
1853 #else |
|
1854 DoRunSettingsL( aHighLight, aSelected ); |
|
1855 #endif // __TEST_OOMDEBUG |
|
1856 } |
|
1857 |
|
1858 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::HandleRunSettingsL") |
|
1859 } |
613 } |
1860 |
614 |
1861 |
615 |
1862 //---------------------------------------------------------- |
616 //---------------------------------------------------------- |
1863 // CApSettingsHandlerImpl::ChooseBearerTypeL |
617 // CApSettingsHandlerImpl::ChooseBearerTypeL |
1864 //---------------------------------------------------------- |
618 //---------------------------------------------------------- |
1865 // |
619 // |
1866 void CApSettingsHandlerImpl::ChooseBearerTypeL( TInt aBearers, |
620 void CApSettingsHandlerImpl::ChooseBearerTypeL( TInt aBearers, |
1867 CApAccessPointItem& aItem ) |
621 CApAccessPointItem& aItem ) |
1868 { |
622 { |
1869 APSETUILOGGER_ENTERFN( EApImpl,"Impl::ChooseBearerTypeL") |
|
1870 |
|
1871 // Check for support in each case!!!!! |
|
1872 TBool gprssupported = ETrue; |
|
1873 TBool csdsupported = ETrue; // OK |
|
1874 TBool hscsdsupported = ETrue; // NO WAY TO CHECK IT |
|
1875 TBool wlansupported = ETrue; // OK |
|
1876 TBool lansupported = ETrue; // NO WAY TO CHECK IT |
|
1877 TBool lanmodemsupported = ETrue; // NO WAY TO CHECK IT |
|
1878 TBool cdmasupported = ETrue; // OK |
|
1879 |
|
1880 if ( iExt->iIsFeatureManagerInitialised ) |
|
1881 { |
|
1882 cdmasupported = FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ); |
|
1883 csdsupported = FeatureManager::FeatureSupported( KFeatureIdAppCsdSupport ); |
|
1884 wlansupported = FeatureManager::FeatureSupported( KFeatureIdProtocolWlan ); |
|
1885 } |
|
1886 |
|
1887 if ( ( ( aBearers & EApBearerTypeAll ) || |
|
1888 ( aBearers & EApBearerTypeGPRS ) ) && |
|
1889 gprssupported ) |
|
1890 { |
|
1891 aItem.SetBearerTypeL( EApBearerTypeGPRS ); |
|
1892 } |
|
1893 else |
|
1894 { |
|
1895 if ( ( ( aBearers & EApBearerTypeAll ) || |
|
1896 ( aBearers & EApBearerTypeHSCSD ) ) |
|
1897 && hscsdsupported ) |
|
1898 { |
|
1899 aItem.SetBearerTypeL( EApBearerTypeHSCSD ); |
|
1900 } |
|
1901 else |
|
1902 { |
|
1903 if ( ( ( aBearers & EApBearerTypeAll ) || |
|
1904 (aBearers & EApBearerTypeCSD ) ) && csdsupported ) |
|
1905 { |
|
1906 aItem.SetBearerTypeL( EApBearerTypeCSD ); |
|
1907 } |
|
1908 else |
|
1909 { |
|
1910 if ( ( ( aBearers & EApBearerTypeAll ) || |
|
1911 ( aBearers & EApBearerTypeWLAN ) ) |
|
1912 && wlansupported ) |
|
1913 { |
|
1914 aItem.SetBearerTypeL( EApBearerTypeWLAN ); |
|
1915 } |
|
1916 else |
|
1917 { |
|
1918 if ( ( ( aBearers & EApBearerTypeAll ) || |
|
1919 ( aBearers & EApBearerTypeLAN ) ) |
|
1920 && lansupported ) |
|
1921 { |
|
1922 aItem.SetBearerTypeL( EApBearerTypeLAN ); |
|
1923 } |
|
1924 else |
|
1925 { |
|
1926 if ( ( ( aBearers & EApBearerTypeAll ) || |
|
1927 ( aBearers & EApBearerTypeLANModem ) ) |
|
1928 && lanmodemsupported ) |
|
1929 { |
|
1930 aItem.SetBearerTypeL( EApBearerTypeLANModem ); |
|
1931 } |
|
1932 else |
|
1933 { |
|
1934 if ( ( ( aBearers & EApBearerTypeAll ) || |
|
1935 ( aBearers & EApBearerTypeCDMA ) ) |
|
1936 && cdmasupported ) |
|
1937 { |
|
1938 aItem.SetBearerTypeL( EApBearerTypeCDMA ); |
|
1939 } |
|
1940 else |
|
1941 { |
|
1942 User::Leave( KErrInvalidBearerType ); |
|
1943 } |
|
1944 } |
|
1945 } |
|
1946 } |
|
1947 } |
|
1948 } |
|
1949 } |
|
1950 |
|
1951 APSETUILOGGER_LEAVEFN( EApImpl,"Impl::ChooseBearerTypeL") |
|
1952 } |
623 } |
1953 |
624 |
1954 |
625 |
1955 |
626 |
1956 |
627 |