65 * The class providing core functionality of profile server. |
66 * The class providing core functionality of profile server. |
66 */ |
67 */ |
67 class CSIPProfileServerCore : public CBase, |
68 class CSIPProfileServerCore : public CBase, |
68 public MSIPProfileAgentObserver, |
69 public MSIPProfileAgentObserver, |
69 public MSipProfileErrorHandler, |
70 public MSipProfileErrorHandler, |
70 public MSipSystemStateObserver |
71 public MSipSystemStateObserver, |
|
72 public MSIPApnChangeObserver |
71 { |
73 { |
|
74 |
|
75 public: |
|
76 /* |
|
77 * struct to store ApnSwitchEnabled profiles in the event |
|
78 * when IAPSettings are not same as required. |
|
79 */ |
|
80 struct TStoreSwitchEnabledProfile |
|
81 { |
|
82 public: |
|
83 enum TOperation |
|
84 { |
|
85 Update =1, |
|
86 Enable, |
|
87 Register |
|
88 }; |
|
89 CSIPConcreteProfile* iProfile; |
|
90 const MSIPExtendedConcreteProfileObserver* iObserver; |
|
91 TOperation operation; |
|
92 }; |
|
93 |
72 public: // Constructors and destructor |
94 public: // Constructors and destructor |
73 |
95 |
74 /** |
96 /** |
75 * Two-phased constructor. |
97 * Two-phased constructor. |
76 * @param aServer server of the session |
98 * @param aServer server of the session |
439 CSIPProfileState& UnregisteredState(); |
465 CSIPProfileState& UnregisteredState(); |
440 |
466 |
441 TUint32 GenerateProfileIdL(); |
467 TUint32 GenerateProfileIdL(); |
442 |
468 |
443 /** |
469 /** |
444 * Sends forcibly disable profile added event to all clients |
470 * Sends forcibly disable profile added event to all clients |
445 * @param aProfileId: Id of the profile being disabled forcibly |
471 * @param aProfileId: Id of the profile being disabled forcibly |
446 */ |
472 */ |
447 void SendProfileForciblyDisabledEvent(const CSIPProfileCacheItem& aItem) const; |
473 void SendProfileForciblyDisabledEvent(const CSIPProfileCacheItem& aItem) const; |
448 |
474 |
449 /** |
475 /** |
450 * Gets cached profile, leave if not found |
476 * Gets cached profile, leave if not found |
451 * ownership is not transfered |
477 * ownership is not transfered |
452 * @param aProfileId id of profile. |
478 * @param aProfileId id of profile. |
453 * @return profile cache item |
479 * @return profile cache item |
454 */ |
480 */ |
455 CSIPProfileCacheItem* ProfileCacheItemL(TUint32 aProfileId) const; |
481 CSIPProfileCacheItem* ProfileCacheItemL(TUint32 aProfileId) const; |
|
482 |
|
483 /** |
|
484 *Starts timer of type CDeltaTimer, |
|
485 *which callback is ConnectionCloseTimerExpired function |
|
486 */ |
|
487 void StartConnectionCloseTimer(); |
|
488 |
|
489 /** |
|
490 * A callback for CDeltaTimer |
|
491 */ |
|
492 static TInt ConnectionCloseTimerExpired(TAny* aPtr); |
|
493 |
|
494 /** |
|
495 * Notify system state monitor about event processing completion |
|
496 */ |
|
497 void ConfirmSystemstateMonitor( |
|
498 CSipSystemStateMonitor::TSystemVariable aVariable); |
|
499 |
|
500 /* |
|
501 * Checks whether the Update can be performed when the profile |
|
502 * has IAP as modem bearer. |
|
503 */ |
|
504 TBool IsUpdateAllowed( CSIPConcreteProfile *aProfile ); |
456 |
505 |
457 private: |
506 private: |
458 |
507 |
459 /** |
508 /** |
460 * Default constructor |
509 * Default constructor |
611 * aParam aRestoreOngoing ETrue if restore is ongoing, |
660 * aParam aRestoreOngoing ETrue if restore is ongoing, |
612 * EFalse if backup is ongoing |
661 * EFalse if backup is ongoing |
613 */ |
662 */ |
614 void ReserveStorageL(TBool aRestoreOngoing); |
663 void ReserveStorageL(TBool aRestoreOngoing); |
615 |
664 |
616 /** |
665 /** |
617 * Cleans up array in case of failure |
666 * Cleans up array in case of failure |
618 * ownership of aArray is transferred |
667 * ownership of aArray is transferred |
619 * @param aArray array to be cleaned up |
668 * @param aArray array to be cleaned up |
620 */ |
669 */ |
621 static void ResetAndDestroy(TAny* aArray); |
670 static void ResetAndDestroy(TAny* aArray); |
622 |
671 |
623 /** |
672 /** |
624 * Cleans up array in case of failure |
673 * Cleans up array in case of failure |
625 * ownership of aArray is transferred |
674 * ownership of aArray is transferred |
626 * @param aArray array to be cleaned up |
675 * @param aArray array to be cleaned up |
627 */ |
676 */ |
628 static void ResetAndDestroyInfo(TAny* aArray); |
677 static void ResetAndDestroyInfo(TAny* aArray); |
629 |
678 |
630 /** |
679 /** |
631 * Reverts back cache in case of failure |
680 * Reverts back cache in case of failure |
632 * @param aItem cache cleanup item |
681 * @param aItem cache cleanup item |
633 */ |
682 */ |
634 static void CrashRevert(TAny* aItem); |
683 static void CrashRevert(TAny* aItem); |
635 |
684 |
636 /** |
685 /** |
637 * Handles the errors occured during the profile restore |
686 * Handles the errors occured during the profile restore |
638 * @param aErr |
687 * @param aErr |
639 * @param fileStore specifies the kind of the file on which |
688 * @param fileStore specifies the kind of the file on which |
640 * the storage error has occured |
689 * the storage error has occured |
641 */ |
690 */ |
642 void HandleProfileStorageErrorL(TInt aErr, TBool fileStore=EFalse); |
691 void HandleProfileStorageErrorL(TInt aErr, TBool fileStore=EFalse); |
643 |
692 |
644 /** |
693 /** |
645 * Remove the cached profile entry identified by aProfileId. |
694 * Remove the cached profile entry identified by aProfileId. |
646 * @param aProfileId Profile id |
695 * @param aProfileId Profile id |
647 */ |
696 */ |
648 void RemoveProfileItem(TUint32 aProfileId); |
697 void RemoveProfileItem(TUint32 aProfileId); |
649 |
698 |
650 /** |
699 /** |
651 * Removes unused migration controllers, except if it uses the specified |
700 * Removes unused migration controllers, except if it uses the specified |
652 * SNAP id. |
701 * SNAP id. |
653 * @param aSnapId SNAP id |
702 * @param aSnapId SNAP id |
654 */ |
703 */ |
655 void RemoveUnusedMigrationControllers(TUint32 aSnapId); |
704 void RemoveUnusedMigrationControllers(TUint32 aSnapId); |
656 |
705 |
657 void LoadSystemStateMonitorL(); |
706 void LoadSystemStateMonitorL(); |
658 |
707 |
659 /** |
708 /** |
660 * Gets the default profile |
709 * Gets the default profile |
661 * @return Pointer to the default profile, or NULL if not found. |
710 * @return Pointer to the default profile, or NULL if not found. |
662 */ |
711 */ |
663 CSIPConcreteProfile* FindDefaultProfile() const; |
712 CSIPConcreteProfile* FindDefaultProfile() const; |
664 |
713 |
665 TBool ShouldChangeIap(CSIPConcreteProfile& aProfile, TInt aError) const; |
714 TBool ShouldChangeIap(CSIPConcreteProfile& aProfile, TInt aError) const; |
666 |
715 |
667 /** |
716 /** |
668 * @return ETrue if any registered profile is using aIap |
717 * @return ETrue if any registered profile is using aIap |
669 */ |
718 */ |
670 TBool AnyRegisteredProfileUsesIap(TUint aIap) const; |
719 TBool AnyRegisteredProfileUsesIap(TUint aIap) const; |
|
720 |
|
721 /** |
|
722 * Add profiles in Profile Cache |
|
723 * @param aProfiles Array of the profiles to be added |
|
724 * @param aNotifyProfileCreation specifies whether the notification |
|
725 * to be sent to the profile clients |
|
726 */ |
|
727 void AddProfilesInCacheL(RPointerArray<CSIPConcreteProfile>& aProfiles, |
|
728 TBool aNotifyProfileCreation); |
|
729 |
|
730 /** |
|
731 * Gets the IAP Count in the Snap |
|
732 * @return number of aIaps in the Snap |
|
733 */ |
|
734 TInt IAPCountL(TUint32 aSnapId) const; |
|
735 |
|
736 /* |
|
737 * Checks whether the current seetings are same as |
|
738 * required seetings for Registeration. |
|
739 * @ returns ETrue when the seetings are correct |
|
740 * EFalse otherwise |
|
741 */ |
|
742 |
|
743 TBool IsRegistrationAllowedWithCurrentApnSettings( TUint32 aIapId ); |
671 |
744 |
672 /** |
745 /** |
673 * Add profiles in Profile Cache |
746 ** Selecting Initial Apn for the profile |
674 * @param aProfiles Array of the profiles to be added |
747 **/ |
675 * @param aNotifyProfileCreation specifies whether the notification to be sent to the profile clients |
748 void SelectInitialApnL( const CSIPConcreteProfile& aProfile ); |
676 */ |
|
677 void AddProfilesInCacheL(RPointerArray<CSIPConcreteProfile>& aProfiles,TBool aNotifyProfileCreation); |
|
678 |
749 |
679 /** |
750 /** |
680 * Gets the IAP Count in the Snap |
751 * Checks whether the profile's IAP is switch enabled |
681 * @return number of aIaps in the Snap |
752 * @ returns ETrue when the profile is APN switch enabled |
682 */ |
753 * EFalse otherwise |
683 TInt IAPCountL(TUint32 aSnapId) const; |
754 */ |
|
755 TBool CheckApnSwitchEnabledL( const CSIPConcreteProfile& aProfile ); |
|
756 |
|
757 /** |
|
758 * Checks the IAP settings |
|
759 * @ returns ETrue when all the settings are correct |
|
760 * EFalse otherwise |
|
761 */ |
|
762 TBool CheckIapSettings(TUint32 aProfileId); |
|
763 |
|
764 void UsePrimaryApn(TUint32 aIapId); |
|
765 |
|
766 void UseBackupApn( TUint32 aIapId, TBool aFatalFailure = ETrue ); |
|
767 |
684 |
768 |
685 private: // Data |
769 private: // Data |
686 |
770 |
687 RFs iFs; |
771 RFs iFs; |
688 TBool iBackupInProgress; |
772 TBool iBackupInProgress; |