connectionutilities/ConnectionDialogs/cconndlg/src/ConnDlgPlugin.cpp
branchRCL_3
changeset 26 0a9e01492035
parent 0 5a93021fdf25
child 55 fc7b30ed2058
equal deleted inserted replaced
24:c45d4fe2ff0a 26:0a9e01492035
    32 
    32 
    33 #include <eikenv.h>
    33 #include <eikenv.h>
    34 #include <bautils.h>
    34 #include <bautils.h>
    35 #include <e32property.h> 
    35 #include <e32property.h> 
    36 #include <rmpm.h>
    36 #include <rmpm.h>
       
    37 #include <startupdomainpskeys.h>
    37 
    38 
    38 #include <CConnDlgPlugin.rsg>
    39 #include <CConnDlgPlugin.rsg>
    39 #include <data_caging_path_literals.hrh>
    40 #include <data_caging_path_literals.hrh>
    40 
    41 
    41 using namespace CommsDat;
    42 using namespace CommsDat;
   157 // ---------------------------------------------------------
   158 // ---------------------------------------------------------
   158 //
   159 //
   159 
   160 
   160 void CConnDlgIapPlugin::StartL( const TDesC8& aBuffer, TInt aReplySlot,
   161 void CConnDlgIapPlugin::StartL( const TDesC8& aBuffer, TInt aReplySlot,
   161                                 const RMessagePtr2& aMessage )
   162                                 const RMessagePtr2& aMessage )
   162     {
   163     {    
       
   164     if ( ScreenSaverOn() || AutolockOn() )
       
   165         {
       
   166         // Screen saver or Autolock is active. Cancel the dialog. 
       
   167         CLOG_WRITE( "CConnDlgAuthenticationPlugin::StartL: Screen saver or Autolock is active." );
       
   168         aMessage.Complete( KErrCancel );
       
   169         return;
       
   170         }
       
   171 
   163     iPrefs.Copy( (TPtrC8) aBuffer );
   172     iPrefs.Copy( (TPtrC8) aBuffer );
   164 
   173 
   165     iCancelled = EFalse;
   174     iCancelled = EFalse;
   166     iReplySlot = aReplySlot;
   175     iReplySlot = aReplySlot;
   167     iMessage = aMessage;
   176     iMessage = aMessage;
   351                                            TInt aReplySlot,
   360                                            TInt aReplySlot,
   352                                            const RMessagePtr2& aMessage )
   361                                            const RMessagePtr2& aMessage )
   353     {
   362     {
   354     CLOG_ENTERFN( "CConnDlgAuthenticationPlugin::StartL" );
   363     CLOG_ENTERFN( "CConnDlgAuthenticationPlugin::StartL" );
   355 
   364 
       
   365     if ( ScreenSaverOn() || AutolockOn() )
       
   366         {
       
   367         // Screen saver or Autolock is active. Cancel the dialog. 
       
   368         CLOG_WRITE( "CConnDlgAuthenticationPlugin::StartL: Screen saver or Autolock is active." );
       
   369         aMessage.Complete( KErrCancel );
       
   370         return;
       
   371         }
       
   372 
   356     if ( aBuffer.Length() > iAuthPairBuff.Length() )
   373     if ( aBuffer.Length() > iAuthPairBuff.Length() )
   357         {
   374         {
   358         CLOG_WRITE( "User::Panic, EConnDlgIllegalRequest" );
   375         CLOG_WRITE( "User::Panic, EConnDlgIllegalRequest" );
   359         User::Panic( KConnDlgPluginPanic, EConnDlgIllegalRequest );
   376         User::Panic( KConnDlgPluginPanic, EConnDlgIllegalRequest );
   360         }
   377         }
   781 
   798 
   782 void CConnDlgSelectConnectionPlugin::StartL( const TDesC8& aBuffer, 
   799 void CConnDlgSelectConnectionPlugin::StartL( const TDesC8& aBuffer, 
   783                                              TInt aReplySlot,
   800                                              TInt aReplySlot,
   784                                              const RMessagePtr2& aMessage )
   801                                              const RMessagePtr2& aMessage )
   785     {
   802     {
       
   803      CLOG_ENTERFN( "CConnDlgSelectConnectionPlugin::StartL" );      	
       
   804     	
   786     if ( iActivePlugin )
   805     if ( iActivePlugin )
   787         {
   806         {
   788         aMessage.Complete( KErrServerBusy );
   807         aMessage.Complete( KErrServerBusy );
   789         return;
   808         return;
   790         }
   809         }
   791         
   810      
       
   811     TInt iStartUpPhaseValue( EStartupUiPhaseUninitialized );
       
   812     RProperty::Get( KPSUidStartup, KPSStartupUiPhase, iStartUpPhaseValue );
       
   813     CLOG_WRITEF( _L( "CConnDlgSelectConnectionPlugin::Phone start up phase: %d" ), 
       
   814     									iStartUpPhaseValue );           
       
   815     // Don't show the dialog if phone boot up isn't complete or screen saver or Autolock is on.
       
   816     if ( iStartUpPhaseValue != EStartupUiPhaseAllDone || ScreenSaverOn() || AutolockOn() )
       
   817         { 
       
   818         CLOG_WRITE( "CConnDlgSelectConnectionPlugin::StartL: Screen saver or Autolock is active or start up phase not completed yet." );
       
   819         aMessage.Complete( KErrCancel );
       
   820         return;
       
   821         }
       
   822 
   792     iPrefs.Copy( ( TPtrC8 ) aBuffer );
   823     iPrefs.Copy( ( TPtrC8 ) aBuffer );
   793 
   824 
   794     iCancelled = ETrue; // This method could leave before displaying the dialog.
   825     iCancelled = ETrue; // This method could leave before displaying the dialog.
   795     iReplySlot = aReplySlot;
   826     iReplySlot = aReplySlot;
   796     iMessage = aMessage;
   827     iMessage = aMessage;