630 * variables. |
630 * variables. |
631 */ |
631 */ |
632 BURStatus CFeatMgrServer::Goto_ErrorState( BURStatus aCurrent ) |
632 BURStatus CFeatMgrServer::Goto_ErrorState( BURStatus aCurrent ) |
633 { |
633 { |
634 BURStatus aNewState = EFeatMgrBURState_None; // fail safe: all roads lead to normal state |
634 BURStatus aNewState = EFeatMgrBURState_None; // fail safe: all roads lead to normal state |
635 TInt err( KErrNone ); |
|
636 |
635 |
637 switch( aCurrent ) |
636 switch( aCurrent ) |
638 { |
637 { |
639 case( EFeatMgrBURState_BackupStarted ) : |
638 case( EFeatMgrBURState_BackupStarted ) : |
640 iBURInProgress = EFalse; |
639 iBURInProgress = EFalse; |
644 iPluginsReady = EFalse; |
643 iPluginsReady = EFalse; |
645 iPluginsDeleted = EFalse; |
644 iPluginsDeleted = EFalse; |
646 iPendingRequests = ETrue; |
645 iPendingRequests = ETrue; |
647 iFeaturesReady = EFalse; |
646 iFeaturesReady = EFalse; |
648 // re-read the new features; |
647 // re-read the new features; |
649 ClearFeatures(); |
648 TRAP_IGNORE(ClearFeaturesL() ); |
650 TRAP( err, LoadFeaturesL() ); |
649 TRAP_IGNORE(LoadFeaturesL() ); |
651 // Stop queuing |
650 // Stop queuing |
652 iPluginsReady = ETrue; |
651 iPluginsReady = ETrue; |
653 // commit the pending change requests |
652 // commit the pending change requests |
654 ServicePendingRequests(); |
653 ServicePendingRequests(); |
655 break; |
654 break; |
701 iFeaturesReady = EFalse; |
700 iFeaturesReady = EFalse; |
702 |
701 |
703 // re-read the new features |
702 // re-read the new features |
704 // Only call the next function if the previous one was |
703 // Only call the next function if the previous one was |
705 // successfully completed. |
704 // successfully completed. |
706 ClearFeatures(); |
705 TRAP(err, ClearFeaturesL() ); |
707 TRAP( err, LoadFeaturesL() ); |
706 if (err == KErrNone) |
708 if( err == KErrNone ) |
|
709 { |
707 { |
710 TRAP( err, HandleRestoredNotificationsL() ); |
708 TRAP(err, LoadFeaturesL() ); |
711 } |
709 } |
712 |
710 |
713 if( err != KErrNone ) |
711 if(err == KErrNone) |
714 { |
712 { |
715 // error condition |
713 TRAP(err, HandleRestoredNotificationsL() ); |
716 aNewState = EFeatMgrBURState_Error; |
|
717 } |
714 } |
718 else |
715 |
|
716 if(err == KErrNone) |
719 { |
717 { |
720 // Stop queuing |
718 // Stop queuing |
721 iPluginsReady = ETrue; |
719 iPluginsReady = ETrue; |
722 |
720 |
723 // commit the pending change requests |
721 // commit the pending change requests |
724 ServicePendingRequests(); |
722 ServicePendingRequests(); |
725 |
723 |
726 // Change state machine |
724 // Change state machine |
727 aNewState = EFeatMgrBURState_RestoreEnded; |
725 aNewState = EFeatMgrBURState_RestoreEnded; |
|
726 } |
|
727 else |
|
728 { |
|
729 // error condition |
|
730 aNewState = EFeatMgrBURState_Error; |
728 } |
731 } |
729 |
732 |
730 return aNewState; |
733 return aNewState; |
731 } |
734 } |
732 |
735 |
782 } |
785 } |
783 |
786 |
784 /** |
787 /** |
785 * This function will clear features from RAM |
788 * This function will clear features from RAM |
786 */ |
789 */ |
787 void CFeatMgrServer::ClearFeatures( void ) |
790 void CFeatMgrServer::ClearFeaturesL( void ) |
788 { |
791 { |
789 // Delete plugin handlers |
792 // Delete plugin handlers |
790 if ( !iPluginsDeleted ) |
793 if ( !iPluginsDeleted ) |
791 { |
794 { |
792 // Delete plugin handlers |
795 // Delete plugin handlers |