phoneclientserver/EnPolicy/Src/SosEnPolicy/CSosEnPolicySatRefresh.cpp
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
    18 
    18 
    19 
    19 
    20 
    20 
    21 // INCLUDE FILES
    21 // INCLUDE FILES
    22 #include  <e32std.h>
    22 #include  <e32std.h>
    23 #include "csosemergencynumberpolicyhandler.h" 
    23 #include "CSOSEmergencyNumberPolicyHandler.h"
    24 #include "csosenpolicysatrefresh.h" 
    24 #include "CSosEnPolicySatRefresh.h"
    25 
    25 
    26 #include <rsatrefresh.h> 
    26 #include <rsatrefresh.h>
    27 #include <rsatsession.h> 
    27 #include <rsatsession.h>
    28 
    28 
    29 #include  <startupdomainpskeys.h> // Property values
    29 #include  <startupdomainpskeys.h> // Property values
    30 
    30 
    31 // Constants
    31 // Constants
    32 _LIT( KENPolicyPanicCategory, "ENPolicyFault" );
    32 _LIT( KENPolicyPanicCategory, "ENPolicyFault" );
    38 // C++ default constructor can NOT contain any code, that
    38 // C++ default constructor can NOT contain any code, that
    39 // might leave.
    39 // might leave.
    40 // -----------------------------------------------------------------------------
    40 // -----------------------------------------------------------------------------
    41 //
    41 //
    42 CSosEnPolicySatRefresh::CSosEnPolicySatRefresh( CSosEmergencyNumberPolicyHandler& aCSosEmergencyNumberPolicyHandler ): 
    42 CSosEnPolicySatRefresh::CSosEnPolicySatRefresh( CSosEmergencyNumberPolicyHandler& aCSosEmergencyNumberPolicyHandler ): 
    43     CActive( EPriorityStandard ), iCSosEmergencyNumberPolicyHandler ( aCSosEmergencyNumberPolicyHandler )
    43 	CActive( EPriorityStandard ), iCSosEmergencyNumberPolicyHandler ( aCSosEmergencyNumberPolicyHandler )
    44     {
    44     {
    45     CActiveScheduler::Add( this );
    45     CActiveScheduler::Add( this );
    46     }
    46     }
    47 
    47 
    48 // -----------------------------------------------------------------------------
    48 // -----------------------------------------------------------------------------
    80 CSosEnPolicySatRefresh::~CSosEnPolicySatRefresh()
    80 CSosEnPolicySatRefresh::~CSosEnPolicySatRefresh()
    81     {
    81     {
    82     if ( iSatRefresh )
    82     if ( iSatRefresh )
    83         {
    83         {
    84         // Cancel notifications.
    84         // Cancel notifications.
    85         iSatRefresh->Cancel();  
    85         iSatRefresh->Cancel();	
    86         // Close SubSession.
    86         // Close SubSession.
    87         iSatRefresh->Close();
    87         iSatRefresh->Close();
    88         }
    88         }
    89     delete iSatRefresh;
    89 	delete iSatRefresh;
    90     
    90 	
    91     if ( iSatSession )
    91 	if ( iSatSession )
    92         {
    92 		{
    93         iSatSession->Close();
    93 		iSatSession->Close();
    94         }
    94 		}
    95       delete iSatSession;
    95 	  delete iSatSession;
    96 
    96 
    97     Cancel();
    97     Cancel();
    98     iProperty.Close();
    98     iProperty.Close();
    99     }
    99     }
   100 
   100 
   102 // CSosEnPolicySatRefresh::AllowRefresh
   102 // CSosEnPolicySatRefresh::AllowRefresh
   103 // Refresh query. Determines whether it allow the refresh to happen. 
   103 // Refresh query. Determines whether it allow the refresh to happen. 
   104 // -----------------------------------------------------------------------------
   104 // -----------------------------------------------------------------------------
   105 //
   105 //
   106 TBool CSosEnPolicySatRefresh::AllowRefresh( TSatRefreshType /*aType*/, const TSatRefreshFiles& /*aFiles*/ )
   106 TBool CSosEnPolicySatRefresh::AllowRefresh( TSatRefreshType /*aType*/, const TSatRefreshFiles& /*aFiles*/ )
   107     {
   107  	{
   108     // Refresh is always allowed
   108  	// Refresh is always allowed
   109     return ETrue;
   109 	return ETrue;
   110     }
   110     }
   111  
   111  
   112 // -----------------------------------------------------------------------------
   112 // -----------------------------------------------------------------------------
   113 // CSosEnPolicySatRefresh::Refresh
   113 // CSosEnPolicySatRefresh::Refresh
   114 // Notification of refresh. In this method the client should not close 
   114 // Notification of refresh. In this method the client should not close 
   115 // or cancel the RSatRefresh subsession. 
   115 // or cancel the RSatRefresh subsession. 
   116 // -----------------------------------------------------------------------------
   116 // -----------------------------------------------------------------------------
   117 //     
   117 //     
   118 void CSosEnPolicySatRefresh::Refresh( TSatRefreshType /*aType*/, const TSatRefreshFiles& /*aFiles*/ )
   118 void CSosEnPolicySatRefresh::Refresh( TSatRefreshType /*aType*/, const TSatRefreshFiles& /*aFiles*/ )
   119     {
   119 	{
   120     // Reload SIM Topics in case of refresh             
   120 	// Reload SIM Topics in case of refresh     		
   121     iCSosEmergencyNumberPolicyHandler.CpsssmHandleSimStatusEvent( CSosEmergencyNumberPolicyHandler::ESosEnPolicySimEmergencyNumberRead );
   121     iCSosEmergencyNumberPolicyHandler.CpsssmHandleSimStatusEvent( CSosEmergencyNumberPolicyHandler::ESosEnPolicySimEmergencyNumberRead );
   122     iSatRefresh->RefreshEFRead( EFalse );
   122     iSatRefresh->RefreshEFRead( EFalse );
   123     }
   123 	}
   124     
   124 	
   125     
   125     
   126 // -----------------------------------------------------------------------------
   126 // -----------------------------------------------------------------------------
   127 // CSosEnPolicySimStatusMonitor::IssueRequest
   127 // CSosEnPolicySimStatusMonitor::IssueRequest
   128 // 
   128 // 
   129 // Issue notify request to System agent.
   129 // Issue notify request to System agent.
   153             case KErrCancel:
   153             case KErrCancel:
   154                 return;
   154                 return;
   155             case KErrNone:
   155             case KErrNone:
   156                 {
   156                 {
   157                 iSatSession->ConnectL();
   157                 iSatSession->ConnectL();
   158                 iSatRefresh->OpenL( *iSatSession );     
   158                 iSatRefresh->OpenL( *iSatSession );   	
   159                 TSatRefreshFiles file;
   159                 TSatRefreshFiles file;
   160                 file.Append( KEccEf );
   160                 file.Append( KEccEf );
   161                 iSatRefresh->NotifyFileChangeL( file );
   161                 iSatRefresh->NotifyFileChangeL( file );
   162                 break;  
   162                 break;	
   163                 }
   163                 }
   164             default:
   164             default:
   165                 break;
   165                 break;
   166             }
   166             }
   167         }
   167         }
   168     else
   168     else
   169         {
   169         {
   170         IssueRequest(); 
   170         IssueRequest();	
   171         }
   171         }
   172     }
   172     }
   173 
   173 
   174 // -----------------------------------------------------------------------------
   174 // -----------------------------------------------------------------------------
   175 //CSosEnPolicySatRefresh::DoCancel
   175 //CSosEnPolicySatRefresh::DoCancel