coreapplicationuis/SysAp/Src/BtSap/SysApBtSapControllerImpl.cpp
branchRCL_3
changeset 19 924385140d98
parent 17 5e7d68cc22e0
child 20 c2c61fdca848
equal deleted inserted replaced
18:0818dd463d41 19:924385140d98
     1 /*
     1 /*
     2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    24 #include <BTSapDomainPSKeys.h>
    24 #include <BTSapDomainPSKeys.h>
    25 #include <btengdevman.h>
    25 #include <btengdevman.h>
    26 #include <btengconnman.h>
    26 #include <btengconnman.h>
    27 #include <StringLoader.h>
    27 #include <StringLoader.h>
    28 #include <coemain.h>
    28 #include <coemain.h>
    29 #include <SysAp.rsg>
    29 //#include <SysAp.rsg>
    30 #include <startupdomainpskeys.h>
       
    31 
    30 
    32 
    31 
    33 MSysApBtSapController* CreateSysApBtSapControllerL( CSysApAppUi& aSysApAppUi )
    32 MSysApBtSapController* CreateSysApBtSapControllerL( CSysApAppUi& aSysApAppUi )
    34     {
    33     {
    35     return CSysApBtSapController::NewL( aSysApAppUi );
    34     return CSysApBtSapController::NewL( aSysApAppUi );
   161         {
   160         {
   162         iFinalizeDisconnectNeeded = ETrue;
   161         iFinalizeDisconnectNeeded = ETrue;
   163         
   162         
   164         // No RF available so signal bars should be same as in offline mode.
   163         // No RF available so signal bars should be same as in offline mode.
   165         iSysApAppUi.IgnoreZeroNetworkBarNotifications(ETrue);
   164         iSysApAppUi.IgnoreZeroNetworkBarNotifications(ETrue);
   166         TRAP( err, iSysApAppUi.UpdateSignalBarsL( KAknSignalOffLineMode ) );
   165 //        TRAP( err, iSysApAppUi.UpdateSignalBarsL( KAknSignalOffLineMode ) );
   167 
   166 
   168         iSysApAppUi.SetNetworkConnectionAllowed( ECoreAppUIsNetworkConnectionNotAllowed );
   167         iSysApAppUi.SetNetworkConnectionAllowed( ECoreAppUIsNetworkConnectionNotAllowed );
   169 
   168 
   170         // The SAP connection is accepted via P&S key
   169         // The SAP connection is accepted via P&S key
   171         RProperty::Set( KPSUidBluetoothSapConnectionState, KBTSapConnectionState, EBTSapAccepted );
   170         RProperty::Set( KPSUidBluetoothSapConnectionState, KBTSapConnectionState, EBTSapAccepted );
   182     TRACES( RDebug::Print( _L("CSysApBtSapController::FinalizeDisconnect(): iSwitchingToOffline=%d"), iSwitchingToOffline ) );
   181     TRACES( RDebug::Print( _L("CSysApBtSapController::FinalizeDisconnect(): iSwitchingToOffline=%d"), iSwitchingToOffline ) );
   183     TInt err ( 0 );
   182     TInt err ( 0 );
   184     iFinalizeDisconnectNeeded = EFalse;
   183     iFinalizeDisconnectNeeded = EFalse;
   185     iSysApAppUi.IgnoreZeroNetworkBarNotifications(EFalse);
   184     iSysApAppUi.IgnoreZeroNetworkBarNotifications(EFalse);
   186 
   185 
   187     if ( iSysApAppUi.ActiveProfileId() == KOfflineModeProfileId )
   186 //    if ( iSysApAppUi.ActiveProfileId() == KOfflineModeProfileId )
       
   187       if(0)
   188         {
   188         {
   189         if ( iSwitchingToOffline )
   189         if ( iSwitchingToOffline )
   190             {
   190             {
   191             TRAP( err, iSysApAppUi.SwitchFromOnlineToOfflineModeL() );
   191             TRAP( err, iSysApAppUi.SwitchFromOnlineToOfflineModeL() );
   192             TRACES( RDebug::Print( _L("SwitchFromOnlineToOfflineModeL() leaves with err=%d"), err ) );
   192             TRACES( RDebug::Print( _L("SwitchFromOnlineToOfflineModeL() leaves with err=%d"), err ) );
   214 // ----------------------------------------------------------------------------
   214 // ----------------------------------------------------------------------------
   215 // CSysApBtSapController::HandlePropertyChangedL()
   215 // CSysApBtSapController::HandlePropertyChangedL()
   216 // ----------------------------------------------------------------------------
   216 // ----------------------------------------------------------------------------
   217 void CSysApBtSapController::HandlePropertyChangedL( const TUid& aCategory, const TUint aKey )
   217 void CSysApBtSapController::HandlePropertyChangedL( const TUid& aCategory, const TUint aKey )
   218     {
   218     {
   219     TInt simStatus = ESimStatusUninitialized;
       
   220     if ( aCategory == KPSUidBluetoothSapConnectionState && aKey == KBTSapConnectionState )
   219     if ( aCategory == KPSUidBluetoothSapConnectionState && aKey == KBTSapConnectionState )
   221         {
   220         {
   222         TInt value( 0 );
   221         TInt value( 0 );
   223         RProperty::Get( aCategory, aKey, value );
   222         RProperty::Get( aCategory, aKey, value );
   224         switch ( value )
   223         switch ( value )
   231                     }
   230                     }
   232                 iBtSapEnabled = EFalse;
   231                 iBtSapEnabled = EFalse;
   233                 break;
   232                 break;
   234             case EBTSapConnecting:
   233             case EBTSapConnecting:
   235                 TRACES( RDebug::Print( _L("CSysApBtSapController::HandlePropertyChangedL: EBTSapConnecting, iBtSapEnabled=%d"), iBtSapEnabled ) );
   234                 TRACES( RDebug::Print( _L("CSysApBtSapController::HandlePropertyChangedL: EBTSapConnecting, iBtSapEnabled=%d"), iBtSapEnabled ) );
   236                 //Ensure SIM is present
   235                 if ( !iBtSapEnabled )
   237                 simStatus = iSysApAppUi.StateOfProperty( KPSUidStartup, KPSSimStatus );
       
   238                 if ( !iBtSapEnabled && !(simStatus == ESimNotPresent || simStatus == ESimNotSupported))
       
   239                     {
   236                     {
   240                     iSysApAppUi.InitCloseSimApplicationsL();
   237                     iSysApAppUi.InitCloseSimApplicationsL();
   241                     }
   238                     }
   242                 break;
   239                 break;
   243             case EBTSapConnected:
   240             case EBTSapConnected: