bluetoothengine/bteng/src/btengserver.cpp
changeset 65 001a94c71129
parent 42 b72428996822
--- a/bluetoothengine/bteng/src/btengserver.cpp	Fri Sep 03 16:17:59 2010 +0300
+++ b/bluetoothengine/bteng/src/btengserver.cpp	Wed Sep 29 13:09:05 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;
     }