bluetoothengine/bteng/btbearer/src/btpluginnotifier.cpp
changeset 41 0b2439c3e397
parent 19 43824b19ee35
child 70 f5508c13dfe0
equal deleted inserted replaced
40:997690c3397a 41:0b2439c3e397
    22 #include <CoreApplicationUIsSDKCRKeys.h>
    22 #include <CoreApplicationUIsSDKCRKeys.h>
    23 #include "btpluginnotifier.h"
    23 #include "btpluginnotifier.h"
    24 #include "debug.h"
    24 #include "debug.h"
    25 #include <btfeaturescfg.h>
    25 #include <btfeaturescfg.h>
    26 #include <btnotifclient.h>
    26 #include <btnotifclient.h>
       
    27 #include "btindicatorconstants.h"
       
    28 #include <hbsymbianvariant.h>
    27 
    29 
    28 // ======== MEMBER FUNCTIONS ========
    30 // ======== MEMBER FUNCTIONS ========
    29 
    31 
    30 // ---------------------------------------------------------------------------
    32 // ---------------------------------------------------------------------------
    31 // C++ default constructor
    33 // C++ default constructor
    58 	CRepository* repository = CRepository::NewL( KCRUidCoreApplicationUIs );
    60 	CRepository* repository = CRepository::NewL( KCRUidCoreApplicationUIs );
    59 	repository->Get(KCoreAppUIsNetworkConnectionAllowed, offlineModeOff );
    61 	repository->Get(KCoreAppUIsNetworkConnectionAllowed, offlineModeOff );
    60 	delete repository;
    62 	delete repository;
    61 	
    63 	
    62 	CBTEngSettings* settings = CBTEngSettings::NewL();
    64 	CBTEngSettings* settings = CBTEngSettings::NewL();
       
    65 	iBTIndicator = CHbIndicatorSymbian::NewL(); 
    63 	
    66 	
    64 	BluetoothFeatures::TEnterpriseEnablementMode mode = BluetoothFeatures::EnterpriseEnablementL();
    67 	BluetoothFeatures::TEnterpriseEnablementMode mode = BluetoothFeatures::EnterpriseEnablementL();
    65 	TRACE_INFO( ( _L( "mode = %d" ), mode) )
    68 	TRACE_INFO( ( _L( "mode = %d" ), mode) )
    66     if( power == EBTPowerOn && offlineModeOff == ECoreAppUIsNetworkConnectionAllowed && mode != BluetoothFeatures::EDisabled )
    69     if( power == EBTPowerOn && offlineModeOff == ECoreAppUIsNetworkConnectionAllowed && mode != BluetoothFeatures::EDisabled )
    67         {
    70         {
    76         }
    79         }
    77     else
    80     else
    78         {
    81         {
    79         TRACE_INFO( ( _L( "Turning BT off" ) ) )
    82         TRACE_INFO( ( _L( "Turning BT off" ) ) )
    80         (void) settings->SetPowerState( EBTPowerOff );	// Result is not important here
    83         (void) settings->SetPowerState( EBTPowerOff );	// Result is not important here
       
    84         TInt state =  EBTIndicatorOff;
       
    85         CHbSymbianVariant* parameters = CHbSymbianVariant::NewL(&state,CHbSymbianVariant::EInt );
       
    86         TBool success = iBTIndicator->Activate(KIndicatorType(),parameters); 
       
    87         delete parameters;
       
    88         if(!success)
       
    89             {
       
    90             User::Leave(iBTIndicator->Error());
       
    91             }
    81         }
    92         }
    82     delete settings;
    93     delete settings;
    83 	if ( mode != BluetoothFeatures::EDisabled ) // only subscribe if there's any point (NB changing Enterprise Disabling mode requires a reboot)
    94 	if ( mode != BluetoothFeatures::EDisabled ) // only subscribe if there's any point (NB changing Enterprise Disabling mode requires a reboot)
    84 		SubscribeL();
    95 		SubscribeL();
    85     TRACE_FUNC_EXIT
    96     TRACE_FUNC_EXIT
   110 CBTPluginNotifier::~CBTPluginNotifier()
   121 CBTPluginNotifier::~CBTPluginNotifier()
   111     {
   122     {
   112     TRACE_FUNC_ENTRY
   123     TRACE_FUNC_ENTRY
   113     Cancel();
   124     Cancel();
   114     delete iSession;
   125     delete iSession;
       
   126     delete iBTIndicator;
   115     }
   127     }
   116 
   128 
   117 
   129 
   118 // ---------------------------------------------------------------------------
   130 // ---------------------------------------------------------------------------
   119 // CBTPluginNotifier::SubscribeL
   131 // CBTPluginNotifier::SubscribeL