bluetoothengine/bteng/src/btengserver.cpp
changeset 66 b3d605f76ff8
parent 41 0b2439c3e397
--- a/bluetoothengine/bteng/src/btengserver.cpp	Fri Sep 17 08:30:56 2010 +0300
+++ b/bluetoothengine/bteng/src/btengserver.cpp	Mon Oct 04 00:29:19 2010 +0300
@@ -568,11 +568,17 @@
 //
 TInt CBTEngServer::DebugModeTimerCallBack( TAny* aPtr )
     {
+    TRACE_FUNC_ENTRY
     __ASSERT_ALWAYS(aPtr, PanicServer(EBTEngPanicArgumentIsNull) );
-    // Set our internal debug mode key to off. Ignore error, not critical here.
-    (void) RProperty::Set( KPSUidBluetoothTestingMode, KBTSspDebugmode, EFalse );
     CBTEngServer* server = (CBTEngServer*) aPtr;
-    TRAP_IGNORE( server->SettingsManager()->CheckSspDebugModeL( EFalse ) );
+    server->RemoveTimer( ESspDebugModeTimer );
+    if( server->KeyWatcher()->GetSspDebugModeKeyValue() )
+        {
+        // Set our internal debug mode key to off. Ignore error, not critical here.
+        (void) RProperty::Set( KPSUidBluetoothTestingMode, KBTSspDebugmode, EFalse );
+        }
+    TRAP_IGNORE( server->SettingsManager()->CheckSspDebugModeL( EFalse ) );    
+    TRACE_FUNC_EXIT
     return KErrNone;
     }