bluetoothengine/bteng/btbearer/src/btpluginnotifier.cpp
changeset 70 f5508c13dfe0
parent 42 b72428996822
equal deleted inserted replaced
67:16e4b9007960 70:f5508c13dfe0
    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>
       
    29 
    27 
    30 // ======== MEMBER FUNCTIONS ========
    28 // ======== MEMBER FUNCTIONS ========
    31 
    29 
    32 // ---------------------------------------------------------------------------
    30 // ---------------------------------------------------------------------------
    33 // C++ default constructor
    31 // C++ default constructor
    60 	CRepository* repository = CRepository::NewL( KCRUidCoreApplicationUIs );
    58 	CRepository* repository = CRepository::NewL( KCRUidCoreApplicationUIs );
    61 	repository->Get(KCoreAppUIsNetworkConnectionAllowed, offlineModeOff );
    59 	repository->Get(KCoreAppUIsNetworkConnectionAllowed, offlineModeOff );
    62 	delete repository;
    60 	delete repository;
    63 	
    61 	
    64 	CBTEngSettings* settings = CBTEngSettings::NewL();
    62 	CBTEngSettings* settings = CBTEngSettings::NewL();
    65 	iBTIndicator = CHbIndicatorSymbian::NewL(); 
       
    66 	
    63 	
    67 	BluetoothFeatures::TEnterpriseEnablementMode mode = BluetoothFeatures::EnterpriseEnablementL();
    64 	BluetoothFeatures::TEnterpriseEnablementMode mode = BluetoothFeatures::EnterpriseEnablementL();
    68 	TRACE_INFO( ( _L( "mode = %d" ), mode) )
    65 	TRACE_INFO( ( _L( "mode = %d" ), mode) )
    69     if( power == EBTPowerOn && offlineModeOff == ECoreAppUIsNetworkConnectionAllowed && mode != BluetoothFeatures::EDisabled )
    66     if( power == EBTPowerOn && offlineModeOff == ECoreAppUIsNetworkConnectionAllowed && mode != BluetoothFeatures::EDisabled )
    70         {
    67         {
    79         }
    76         }
    80     else
    77     else
    81         {
    78         {
    82         TRACE_INFO( ( _L( "Turning BT off" ) ) )
    79         TRACE_INFO( ( _L( "Turning BT off" ) ) )
    83         (void) settings->SetPowerState( EBTPowerOff );	// Result is not important here
    80         (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             }
       
    92         }
    81         }
    93     delete settings;
    82     delete settings;
    94 	if ( mode != BluetoothFeatures::EDisabled ) // only subscribe if there's any point (NB changing Enterprise Disabling mode requires a reboot)
    83 	if ( mode != BluetoothFeatures::EDisabled ) // only subscribe if there's any point (NB changing Enterprise Disabling mode requires a reboot)
    95 		SubscribeL();
    84 		SubscribeL();
    96     TRACE_FUNC_EXIT
    85     TRACE_FUNC_EXIT
   121 CBTPluginNotifier::~CBTPluginNotifier()
   110 CBTPluginNotifier::~CBTPluginNotifier()
   122     {
   111     {
   123     TRACE_FUNC_ENTRY
   112     TRACE_FUNC_ENTRY
   124     Cancel();
   113     Cancel();
   125     delete iSession;
   114     delete iSession;
   126     delete iBTIndicator;
       
   127     }
   115     }
   128 
   116 
   129 
   117 
   130 // ---------------------------------------------------------------------------
   118 // ---------------------------------------------------------------------------
   131 // CBTPluginNotifier::SubscribeL
   119 // CBTPluginNotifier::SubscribeL