201017
authorhgs
Sun, 02 May 2010 21:30:11 +0300
changeset 28 7e2761e776bd
parent 27 6c10323ce807
child 29 48ae3789ce00
201017
bluetoothengine/bteng/btbearer/inc/btpluginnotifier.h
bluetoothengine/bteng/btbearer/src/btpluginnotifier.cpp
bluetoothengine/bteng/btengconnman/inc/btengconnhandler.h
bluetoothengine/bteng/btengconnman/src/btengconnhandler.cpp
bluetoothengine/bteng/btengconnman/src/btengconnman.cpp
bluetoothengine/bteng/btengdiscovery/inc/btengdevicesearch.h
bluetoothengine/bteng/btengdiscovery/src/btengdevicesearch.cpp
bluetoothengine/bteng/btengsettings/inc/btengsettingsnotify.h
bluetoothengine/bteng/btengsettings/src/btengsettingsnotify.cpp
bluetoothengine/bteng/bttoggle/src/bttoggle.cpp
bluetoothengine/bteng/group/bld.inf
bluetoothengine/bteng/group/btbearer.mmp
bluetoothengine/bteng/group/bteng.mmp
bluetoothengine/bteng/group/btengconnman.mmp
bluetoothengine/bteng/inc/btengactive.h
bluetoothengine/bteng/inc/btengactive.inl
bluetoothengine/bteng/inc/btengclient.h
bluetoothengine/bteng/inc/btengclientserver.h
bluetoothengine/bteng/inc/btengserver.h
bluetoothengine/bteng/inc/btengsrvbbconnectionmgr.h
bluetoothengine/bteng/inc/btengsrvkeywatcher.h
bluetoothengine/bteng/inc/btengsrvsettingsmgr.h
bluetoothengine/bteng/src/btengclient.cpp
bluetoothengine/bteng/src/btengserver.cpp
bluetoothengine/bteng/src/btengsrvbbconnectionmgr.cpp
bluetoothengine/bteng/src/btengsrvkeywatcher.cpp
bluetoothengine/bteng/src/btengsrvpluginmgr.cpp
bluetoothengine/bteng/src/btengsrvsession.cpp
bluetoothengine/bteng/src/btengsrvsettingsmgr.cpp
bluetoothengine/bteng/src/btengsrvstate.cpp
bluetoothengine/bthid/bthidkbdsettings/group/bld.inf
bluetoothengine/bthid/rom/btkeyboard.iby
bluetoothengine/bthid/rom/btkeyboard_resources.iby
bluetoothengine/btmac/group/BTMonoCmdHandler.mmp
bluetoothengine/btmac/inc/atcodec/ATCodecDefs.h
bluetoothengine/btmac/src/BTMonoCmdHandler/btmcprotocol.cpp
bluetoothengine/btnotif/group/bld.inf
bluetoothengine/btnotif/rom/Btnotif.iby
bluetoothengine/btui/rom/btui.iby
bluetoothengine/group/bld.inf
btservices_plat/bluetooth_engine_connection_management_api/inc/btengconnman.h
btservices_plat/bluetooth_secondary_display_notification_api/group/bld.inf
cbsatplugin/atmisccmdplugin/rom/atmisccmdplugin.iby
layers.sysdef.xml
package_definition.xml
--- a/bluetoothengine/bteng/btbearer/inc/btpluginnotifier.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/btbearer/inc/btpluginnotifier.h	Sun May 02 21:30:11 2010 +0300
@@ -89,6 +89,11 @@
      * @since S60 v3.2
      */
     void SubscribeL();
+    
+    /**
+     * Handles service load/unload when BT power changes.
+     */
+    void HandleBtPowerChanged( TBTPowerStateValue aPower );
 
 // from base class CActive
 
--- a/bluetoothengine/bteng/btbearer/src/btpluginnotifier.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/btbearer/src/btpluginnotifier.cpp	Sun May 02 21:30:11 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -23,6 +23,7 @@
 #include "btpluginnotifier.h"
 #include "debug.h"
 #include <btfeaturescfg.h>
+#include <btnotifclient.h>
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -68,9 +69,9 @@
         TRACE_INFO( ( _L( "Turning BT on" ) ) )
         TInt err = settings->SetPowerState( EBTPowerOn );
         TRACE_INFO( ( _L( "SetPowerState returned %d" ), err ) )
-        if( !err )
+        if ( !err )
             {
-            iHandler.NotifyBearerStatus( ELocodBearerBT, power );
+            HandleBtPowerChanged( EBTPowerOn );
             }
         }
     else
@@ -129,6 +130,30 @@
     SetActive();
     }
 
+// ---------------------------------------------------------------------------
+// Handles power state change. Inform Locod. In addition, if BT is on, start
+// btnotifier server.
+// ---------------------------------------------------------------------------
+//
+void CBTPluginNotifier::HandleBtPowerChanged( TBTPowerStateValue aPower )
+    {
+    TRACE_FUNC_ARG( ( _L( " to %d" ), aPower ) )
+    TInt err (KErrNone );
+    if ( aPower == EBTPowerOn )
+        {
+        // Start BT notifier server by creating a session with it:
+        RBTNotifier btnotif;
+        err = btnotif.Connect();
+        TRACE_INFO( ( _L( "start bt notifier server %d" ), err ) )
+        // btnotif server manages its lifecycle. no need
+        // to keep this session:
+        btnotif.Close();
+        }
+    if ( !err )
+        {
+        iHandler.NotifyBearerStatus( ELocodBearerBT, aPower );
+        }
+    }
 
 // ---------------------------------------------------------------------------
 // From class CActive.
@@ -162,9 +187,12 @@
         case EKeyInt:
             {
             TRACE_INFO( ( _L( "[CBTPluginNotifier::RunL2 %d]" ), status ) )
-            TInt newValue = 1;
-            iSession->Get( iId, newValue );
-            iHandler.NotifyBearerStatus( ELocodBearerBT, newValue );
+            TInt newValue = EBTPowerOff;
+            TInt err = iSession->Get( iId, newValue );
+            if ( !err )
+                {
+                HandleBtPowerChanged( static_cast<TBTPowerStateValue>( newValue ) );
+                }
             }
             break;
         default:
--- a/bluetoothengine/bteng/btengconnman/inc/btengconnhandler.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/btengconnman/inc/btengconnhandler.h	Sun May 02 21:30:11 2010 +0300
@@ -146,18 +146,7 @@
      * @since S60 v3.2
      * @return ?description
      */
-    TInt CancelNotifyConnectionEvents();
-
-    /**
-     * Set a pairing observer in BTEngine.
-     *
-     * @since S60 v3.2
-     * @param aAddr The address of the remote device that is being paired.
-     * @param aActivate If ETrue, the observer will be activated, otherwise
-     *                  the observer will be removed.
-     * @return KErrNone on success, otherwise a system-wide error code.
-     */
-    static TInt SetPairingObserver( const TBTDevAddr& aAddr, TBool aActivate );
+    void CancelNotifyConnectionEvents();
 
     /**
      * ?description
@@ -166,22 +155,6 @@
      * @return ?description
      */
     inline TInt PrepareDiscovery();
-
-
-    /**
-     * Pair a device
-     *
-     * @since S60 v5.1
-     * @param aAddr the address of the device to pair with
-     * @param aDeviceClass the device class of the device to pair with
-     * @return KErrNone if this request has been accepted; an error situation otherwise.
-     */
-    TInt StartPairing( const TBTDevAddr& aAddr, const TBTDeviceClass& aDeviceClass );
-
-    /**
-     * cancel the outstanding pairing request.
-     */
-    void CancelPairing();
     
 private:
 // from base class MBTEngActiveObserver
@@ -192,15 +165,22 @@
      *
      * @since S60 v3.2
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, TInt aStatus );
+    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aStatus );
 
     /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
+    /**
      * From MBTEngActiveObserver.
      * Handles an error during processing of connection status event.
      *
      * @since S60 v3.2
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
+    virtual void HandleError( CBTEngActive* aActive, TInt aError );
 
 private:
 
@@ -222,16 +202,6 @@
      * Client-server package to which the event result is copied.
      */
     TBTEngEventPkg iEventPkg;
-
-    /**
-     * Address of the remote device to pair with.
-     */
-    TBTDevAddrPckgBuf iPairAddr;
-    
-    /**
-     * The CoD of the remote device to pair with.
-     */
-    TUint32 iPairDevCod;
     
     /**
      * Session with BTEng server side.
@@ -243,12 +213,6 @@
      * Own.
      */
     CBTEngActive* iConnEventActive;
-
-    /**
-     * The actual active object for pairing a device.
-     * Own.
-     */
-    CBTEngActive* iPairActive;
     
     /**
      * Reference to receiver of connection events.
--- a/bluetoothengine/bteng/btengconnman/src/btengconnhandler.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/btengconnman/src/btengconnhandler.cpp	Sun May 02 21:30:11 2010 +0300
@@ -83,7 +83,6 @@
     {
     TRACE_FUNC_ENTRY
     CancelNotifyConnectionEvents();
-    CancelPairing();
     iBTEng.Close();
     }
 
@@ -146,128 +145,52 @@
 // ?implementation_description
 // ---------------------------------------------------------------------------
 //
-TInt CBTEngConnHandler::CancelNotifyConnectionEvents()
-    {
-    TRACE_FUNC_ENTRY
-    TInt err = KErrNone;
-    if( iConnEventActive && iConnEventActive->IsActive() )
-        {
-        err = iBTEng.CancelNotifyConnectionEvents();
-        iConnEventActive->CancelRequest();
-        }
-    delete iConnEventActive;
-    iConnEventActive = NULL;
-    return err;
-    }
-
-// -----------------------------------------------------------------------------
-// Request server side to activate/deactivate a pair observer
-// -----------------------------------------------------------------------------
-//
-TInt CBTEngConnHandler::SetPairingObserver( const TBTDevAddr& aAddr, 
-    TBool aActivate )
-    {
-    RBTEng bteng;
-    TInt err = bteng.Connect();
-    if ( !err )
-        {
-        err = bteng.SetPairingObserver( aAddr, aActivate );
-        }
-    bteng.Close();
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Request BTEng to pair the device
-// ---------------------------------------------------------------------------
-//
-TInt CBTEngConnHandler::StartPairing( const TBTDevAddr& aAddr, 
-    const TBTDeviceClass& aDeviceClass )
+void CBTEngConnHandler::CancelNotifyConnectionEvents()
     {
     TRACE_FUNC_ENTRY
-    TInt err( KErrNone );
-    if( iPairActive && iPairActive->IsActive() )
-        {
-        err = KErrServerBusy;
-        }
-    
-    if( !iPairActive )
-        {
-            // Use a higher prioritty than normal, because we want 
-            // to be notified fast (e.g. to update the UI).
-        TRAP( err, iPairActive = CBTEngActive::NewL( *this, EPairDeviceId, 
-                                                  CActive::EPriorityUserInput ) );
-        }
-    if ( !err )
-        {
-        iPairAddr() = aAddr;
-        iPairDevCod = aDeviceClass.DeviceClass();
-        iBTEng.PairDevice( iPairAddr, iPairDevCod, iPairActive->RequestStatus() );
-        iPairActive->GoActive();
-        }
-    TRACE_FUNC_EXIT
-    return err;
+    delete iConnEventActive;
+    iConnEventActive = NULL;
     }
 
 // ---------------------------------------------------------------------------
-// Cancel any outstanding operation, free resources.
-// ---------------------------------------------------------------------------
-//
-void CBTEngConnHandler::CancelPairing()
-    {
-    TRACE_FUNC_ENTRY
-    if( iPairActive && iPairActive->IsActive() )
-        {
-        iBTEng.CancelPairDevice();
-        }
-    delete iPairActive;
-    iPairActive = NULL;
-    TRACE_FUNC_EXIT
-    }
-
-
-// ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
 // Called by the active object when a change in connection status has occured.
 // ---------------------------------------------------------------------------
 //
-void CBTEngConnHandler::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+void CBTEngConnHandler::RequestCompletedL( CBTEngActive* aActive, 
     TInt aStatus )
     {
-    TRACE_FUNC_ARG( ( _L( "ID: %d status: %d" ), aId, aStatus ) )
-
+    TRACE_FUNC_ARG( ( _L( "ID: %d status: %d" ), aActive->RequestId(), aStatus ) )
     (void) aActive;
-    switch ( aId )
-        {
-        case EConnectionEventId:
-            {
-            HandleConnectionEvent( aStatus );
-            break;
-            }
-        case EPairDeviceId:
-            {
-            if ( iObserver )
-                {
-                iObserver->PairingComplete( iPairAddr(), aStatus );
-                }
-            }
-        }
-
+    ASSERT( aActive->RequestId() == EConnectionEventId );
+    HandleConnectionEvent( aStatus );
     TRACE_FUNC_EXIT
     }
 
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngConnHandler::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) )
+    ASSERT( aRequestId == EConnectionEventId );
+    ( void ) aRequestId;
+    iBTEng.CancelNotifyConnectionEvents();
+    TRACE_FUNC_EXIT 
+    }
 
 // ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
 // Called when RequestCompletedL/RunL leaves.
 // ---------------------------------------------------------------------------
 //
-void CBTEngConnHandler::HandleError( CBTEngActive* aActive, TInt aId, TInt aError )
+void CBTEngConnHandler::HandleError( CBTEngActive* aActive, TInt aError )
     {
     TRACE_FUNC_ARG( ( _L( "error: %d" ), aError ) )
         // Should any info be passed to the client??
     (void) aActive;
-    (void) aId;
     (void) aError;
     }
 
--- a/bluetoothengine/bteng/btengconnman/src/btengconnman.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/btengconnman/src/btengconnman.cpp	Sun May 02 21:30:11 2010 +0300
@@ -23,6 +23,7 @@
 
 #include "btengconnman.h"
 #include "btengconnhandler.h"
+#include "btengpairinghandler.h"
 #include "debug.h"
 
 // ======== MEMBER FUNCTIONS ========
@@ -92,6 +93,7 @@
     {
     TRACE_FUNC_ENTRY
     delete iConnHandler;
+    delete iPairingHandler;
     }
 
 
@@ -224,10 +226,21 @@
 EXPORT_C TInt CBTEngConnMan::PairDevice( const TBTDevAddr& aAddr, TBTDeviceClass aDeviceClass )
     {
     TRACE_FUNC_ENTRY
-    return  iConnHandler->StartPairing( aAddr, aDeviceClass );
+    TInt err = KErrNone;
+    if( !iPairingHandler )
+        {
+        TRAP( err, iPairingHandler = CBTEngPairingHandler::NewL( iObserver, this ) );
+        }
+    if( !err )
+        {
+        iPairingHandler->CancelPairing();
+
+        TRAP( err, iPairingHandler->StartPairingL( aAddr, aDeviceClass ) );
+        }
+    TRACE_FUNC_RES( ( _L( "result: %d" ), err ) )
+    return err;
     }
 
-
 // ---------------------------------------------------------------------------
 // Cancels an ongoing pairing.
 // ---------------------------------------------------------------------------
@@ -235,21 +248,25 @@
 EXPORT_C void CBTEngConnMan::CancelPairDevice()
     {
     TRACE_FUNC_ENTRY
-    if( iConnHandler )
+    if( iPairingHandler )
         {
-        iConnHandler->CancelPairing();
+        iPairingHandler->CancelPairing();
+        delete iPairingHandler;
+        iPairingHandler = NULL;
         }
     }
 
 
 // ---------------------------------------------------------------------------
 // Tell BTEng to start observing the status of an ongoing pairing.
+// Deprecated since Symbian^4.
 // ---------------------------------------------------------------------------
 //
 EXPORT_C TInt CBTEngConnMan::StartPairingObserver( const TBTDevAddr& aAddr )
     {
     TRACE_FUNC_ENTRY
-    return CBTEngConnHandler::SetPairingObserver( aAddr, ETrue );
+    (void) aAddr;
+    return KErrNone;
     }
 
 
@@ -264,13 +281,14 @@
     }
 
 // ---------------------------------------------------------------------------
-// ?implementation_description
+// Deprecated since Symbian^4.
 // ---------------------------------------------------------------------------
 //
 EXPORT_C TInt CBTEngConnMan::StopPairingObserver( const TBTDevAddr& aAddr )
     {
     TRACE_FUNC_ENTRY
-    return CBTEngConnHandler::SetPairingObserver( aAddr, EFalse );
+    (void) aAddr;
+    return KErrNone;
     }
 
 // ---------------------------------------------------------------------------
--- a/bluetoothengine/bteng/btengdiscovery/inc/btengdevicesearch.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/btengdiscovery/inc/btengdevicesearch.h	Sun May 02 21:30:11 2010 +0300
@@ -89,16 +89,23 @@
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+    virtual void RequestCompletedL( CBTEngActive* aActive, 
                                      TInt aStatus );
-
+    
+    /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
     /**
      * Callback to notify that an error has occurred in RunL.
      *
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
+    virtual void HandleError( CBTEngActive* aActive, TInt aError );
 
 private:
 
--- a/bluetoothengine/bteng/btengdiscovery/src/btengdevicesearch.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/btengdiscovery/src/btengdevicesearch.cpp	Sun May 02 21:30:11 2010 +0300
@@ -72,11 +72,6 @@
 //
 CBTEngDeviceSearch::~CBTEngDeviceSearch()
     {
-    if( iNotifier.Handle()&& iActive->IsActive())
-       {
-       iNotifier.CancelNotifier( KDeviceSelectionNotifierUid );
-       iActive->CancelRequest();
-       }
     delete iActive;
     iNotifier.Close();
     iHostResolver.Close();
@@ -132,20 +127,17 @@
     TRACE_FUNC_ENTRY
     if( iActive->IsActive() && iClientReq == EDeviceSearch)
         {
+        iActive->Cancel();
         if (iActive->RequestId() == KDevSearchAoReqId)
             {
-            iNotifier.CancelNotifier( KDeviceSelectionNotifierUid );
-            iActive->CancelRequest();
             iNotifier.Close();
             NotifyClient(KErrAbort);
             }
         else if (iActive->RequestId() == KDevEirServiceListAoReqId)
             {
-            iHostResolver.Cancel();
             iHostResolver.Close();
             }
         }
-    
     TRACE_FUNC_EXIT
     }
 
@@ -182,7 +174,7 @@
     TRACE_FUNC_ENTRY
     if( iActive->IsActive() && iClientReq == EGetDeviceEir)
         {
-        iHostResolver.Cancel();
+        iActive->Cancel();
         iHostResolver.Close();
         }
     TRACE_FUNC_EXIT
@@ -193,16 +185,16 @@
 // Callback to notify that an outstanding request has completed.
 // ---------------------------------------------------------------------------
 //
-void CBTEngDeviceSearch::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+void CBTEngDeviceSearch::RequestCompletedL( CBTEngActive* aActive, 
     TInt aStatus )
     {
     TRACE_FUNC_ARG( ( _L( "status: %d") , aStatus ) )
     (void) aActive;
-    if ( aId == KDevSearchAoReqId )
+    if ( aActive->RequestId() == KDevSearchAoReqId )
         {
         HandleDeviceSelectionResultL(aStatus);
         }
-    else if (aId == KDevEirServiceListAoReqId)
+    else if ( aActive->RequestId() == KDevEirServiceListAoReqId )
         {
         HandleDeviceEirDataResult( aStatus );
         }
@@ -211,15 +203,33 @@
 
 // ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngDeviceSearch::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) )
+    if ( aRequestId == KDevSearchAoReqId )
+        {
+        iNotifier.CancelNotifier( KDeviceSelectionNotifierUid );
+        }
+    else if ( aRequestId == KDevEirServiceListAoReqId )
+        {
+        iHostResolver.Cancel();
+        }
+    TRACE_FUNC_EXIT 
+    }
+
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
 // Callback to notify that an error has occurred in RunL.
 // ---------------------------------------------------------------------------
 //
-void CBTEngDeviceSearch::HandleError( CBTEngActive* aActive, TInt aId, 
+void CBTEngDeviceSearch::HandleError( CBTEngActive* aActive, 
     TInt aError )
     {
     TRACE_FUNC_ARG( ( _L( "error: %d") , aError ) )
     (void) aActive;
-    (void) aId;
     iNotifier.Close();
     iHostResolver.Close();
     NotifyClient(aError);
--- a/bluetoothengine/bteng/btengsettings/inc/btengsettingsnotify.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/btengsettings/inc/btengsettingsnotify.h	Sun May 02 21:30:11 2010 +0300
@@ -78,17 +78,24 @@
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+    virtual void RequestCompletedL( CBTEngActive* aActive, 
                                      TInt aStatus );
 
     /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
+    /**
      * From MBTEngActiveObserver.
      * Handle an error in the setting change handling.
      *
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
+    virtual void HandleError( CBTEngActive* aActive, TInt aError );
 
 private:
 
--- a/bluetoothengine/bteng/btengsettings/src/btengsettingsnotify.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/btengsettings/src/btengsettingsnotify.cpp	Sun May 02 21:30:11 2010 +0300
@@ -90,22 +90,11 @@
 //
 CBTEngSettingsNotify::~CBTEngSettingsNotify()
     {
-    if ( iPowerKeyCenRep )
-        {
-        iPowerKeyCenRep->NotifyCancel( KBTPowerState );
-        }
-    delete iPowerKeyWatcher;     // Will call Cancel()
+    delete iPowerKeyWatcher;
     delete iPowerKeyCenRep;
-    if ( iVisiKeyCenRep )
-        {
-   	    iVisiKeyCenRep->NotifyCancel( KBTDiscoverable );
-   	    }
-    delete iVisiKeyWatcher;   // Will call Cancel()
+    delete iVisiKeyWatcher;
     delete iVisiKeyCenRep;
-    if( iBTeng.Handle() )
-        {
-        iBTeng.Close();
-        }
+    iBTeng.Close();
     }
 
 	
@@ -138,12 +127,12 @@
 // Handles notification of a setting change, and informs our observer.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSettingsNotify::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+void CBTEngSettingsNotify::RequestCompletedL( CBTEngActive* aActive, 
     TInt aStatus )
     {
-    TRACE_FUNC_ARG( ( _L( "Id(%d), status(%d)" ), aId, aStatus ) )
+    TRACE_FUNC_ARG( ( _L( "Id(%d), status(%d)" ), aActive->RequestId(), aStatus ) )
 
-    if( aId == KPowerKeyReqId && aStatus == KBTPowerState )
+    if( aActive->RequestId() == KPowerKeyReqId && aStatus == KBTPowerState )
         {
         iPowerKeyCenRep->NotifyRequest( KBTPowerState, 
                                          iPowerKeyWatcher->RequestStatus() );
@@ -155,7 +144,7 @@
             iObserver->PowerStateChanged( (TBTPowerStateValue) value );
             }
         }
-    else if( aId == KVisibilityKeyReqId && aStatus == KBTDiscoverable )
+    else if( aActive->RequestId() == KVisibilityKeyReqId && aStatus == KBTDiscoverable )
         {
         iVisiKeyCenRep->NotifyRequest( KBTDiscoverable, 
                                         iVisiKeyWatcher->RequestStatus() );
@@ -172,23 +161,42 @@
             // Coudl be a repository-wide reset (KInvalidNotificationId),
             // or an invalid key ID. Anyway we know the ID of the active
             // object, so we can just reset the watcher.
-        HandleError( aActive, aId, aStatus );
+        HandleError( aActive, aStatus );
         }
     TRACE_FUNC_EXIT
     }
 
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngSettingsNotify::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) )
+
+    if( aRequestId == KPowerKeyReqId )
+        {
+        iPowerKeyCenRep->NotifyCancel( KBTPowerState );
+        }
+    else if( aRequestId == KVisibilityKeyReqId )
+        {
+        iVisiKeyCenRep->NotifyCancel( KBTDiscoverable );
+        }
+    TRACE_FUNC_EXIT 
+    }
 
 // ---------------------------------------------------------------------------
 // From class MBTEngCenRepNotify.
 // Handles error situation by just re-ordering notification from CenRep.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSettingsNotify::HandleError( CBTEngActive* aActive, TInt aId, 
+void CBTEngSettingsNotify::HandleError( CBTEngActive* aActive,
     TInt aError )
     {
-    TRACE_FUNC_ARG( ( _L( "Id(%d), status(%d)" ), aId, aError ) )
+    TRACE_FUNC_ARG( ( _L( "Id(%d), status(%d)" ), aActive->RequestId(), aError ) )
     (void) aError;
-    if( aId == KPowerKeyReqId )
+    if( aActive->RequestId() == KPowerKeyReqId )
         {
         delete iPowerKeyCenRep;
         iPowerKeyCenRep = NULL;
@@ -201,7 +209,7 @@
             aActive->GoActive();
             }
         }
-    else if( aId == KVisibilityKeyReqId )
+    else if( aActive->RequestId() == KVisibilityKeyReqId )
         {
         delete iVisiKeyCenRep;
         iVisiKeyCenRep = NULL;
--- a/bluetoothengine/bteng/bttoggle/src/bttoggle.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/bttoggle/src/bttoggle.cpp	Sun May 02 21:30:11 2010 +0300
@@ -360,7 +360,8 @@
 //
 TInt CBTToggle::RunError(TInt aError)
     {	  
-    TRACE_INFO((_L("[BTENG][BTTOGGLE] RunError %d"), aError ))	
+    TRACE_INFO((_L("[BTENG][BTTOGGLE] RunError %d"), aError ))
+    (void) aError;
     iActiveNotifier = ENoneQuery;
     CActiveScheduler::Stop();
     return KErrNone;
--- a/bluetoothengine/bteng/group/bld.inf	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/group/bld.inf	Sun May 02 21:30:11 2010 +0300
@@ -26,8 +26,8 @@
 PRJ_EXPORTS
 ../inc/btengprivatecrkeys.h                 |../../inc/btengprivatecrkeys.h
 ../inc/btengprivatepskeys.h                 |../../inc/btengprivatepskeys.h
-../inc/btotgpairpub.inl                     |../../inc/btotgpairpub.inl
 ../inc/btengutil.h                          |../../inc/btengutil.h
+
 ../rom/bteng.iby                            CORE_MW_LAYER_IBY_EXPORT_PATH(bteng.iby)
 ../data/10204DA9.xml                        z:/private/2000B187/10204DA9.xml
 
--- a/bluetoothengine/bteng/group/btbearer.mmp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/group/btbearer.mmp	Sun May 02 21:30:11 2010 +0300
@@ -37,7 +37,7 @@
 TARGET                  btbearer.rsc
 END // RESOURCE
 
-USERINCLUDE             ../inc
+USERINCLUDE             ../inc ../../inc
 USERINCLUDE             ../btbearer/inc
 
 MW_LAYER_SYSTEMINCLUDE
@@ -49,4 +49,5 @@
 LIBRARY                 centralrepository.lib
 LIBRARY                 btengsettings.lib
 LIBRARY                 btfeatures.lib
+LIBRARY                 btnotifclient.lib
 DEBUGLIBRARY            flogger.lib             // File logging services
--- a/bluetoothengine/bteng/group/bteng.mmp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/group/bteng.mmp	Sun May 02 21:30:11 2010 +0300
@@ -35,10 +35,6 @@
 SOURCE                  btengsrvbbconnectionmgr.cpp
 SOURCE                  btengsdpdbhandler.cpp
 SOURCE                  btengsrvkeywatcher.cpp
-SOURCE                  btengpairman.cpp
-SOURCE                  btengpairbase.cpp
-SOURCE                  btengincpair.cpp 
-SOURCE                  btengotgpair.cpp
 SOURCE                  btengsrvsettingsmgr.cpp
 START RESOURCE          ../data/btengsdp.rss
 HEADER
--- a/bluetoothengine/bteng/group/btengconnman.mmp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/group/btengconnman.mmp	Sun May 02 21:30:11 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -29,17 +29,19 @@
 SOURCEPATH              ../btengconnman/src
 SOURCE                  btengconnman.cpp
 SOURCE                  btengconnhandler.cpp
+SOURCE                  btengpairinghandler.cpp
 SOURCEPATH              ../src
 SOURCE                  btengclient.cpp
 
 USERINCLUDE             ../inc
 USERINCLUDE             ../btengconnman/inc
+SYSTEMINCLUDE           ../../inc
 MW_LAYER_SYSTEMINCLUDE
 
 LIBRARY                 euser.lib
 LIBRARY                 btdevice.lib
 LIBRARY                 bluetooth.lib
-LIBRARY                 esock.lib
+LIBRARY                 btnotifclient.lib
 LIBRARY                 featmgr.lib
 LIBRARY                 centralrepository.lib               // Central Repository
 DEBUGLIBRARY            flogger.lib
--- a/bluetoothengine/bteng/inc/btengactive.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengactive.h	Sun May 02 21:30:11 2010 +0300
@@ -40,7 +40,6 @@
  */
 class MBTEngActiveObserver
     {
-
 public:
 
     /**
@@ -48,25 +47,27 @@
      *
      * @since S60 v3.2
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
      * @param aStatus The status of the completed request.
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, 
-                                    TInt aStatus ) = 0;
+    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aStatus ) = 0;
+
+    /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @since Symbian^4
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId ) = 0;
 
     /**
      * Callback to notify that an error has occurred in RunL.
      *
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
-     * @param aStatus The status of the completed request.
+     * @param aError The error occurred in RunL.
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, 
-                                    TInt aError ) = 0;
-
+    virtual void HandleError( CBTEngActive* aActive, TInt aError ) = 0;
     };
 
-
 /**
  *  Class CBTEngActive
  *
@@ -122,13 +123,6 @@
     inline void GoActive();
 
     /**
-     * Cancel an outstanding request.
-     *
-     * @since S60 v3.2
-     */
-    inline void CancelRequest();
-
-    /**
      * Get a reference to the active object request status.
      *
      * @since S60 v3.2
@@ -136,6 +130,7 @@
      */
     TRequestStatus& RequestStatus();
 
+private:
 // from base class CActive
 
     /**
--- a/bluetoothengine/bteng/inc/btengactive.inl	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengactive.inl	Sun May 02 21:30:11 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -73,10 +73,9 @@
 //
 inline void CBTEngActive::DoCancel()
     {
+    iObserver.CancelRequest( iRequestId );
     }
 
-
-
 // -----------------------------------------------------------------------------
 // Get the identifier of this instance.
 // -----------------------------------------------------------------------------
@@ -106,17 +105,6 @@
     SetActive();
     }
 
-
-// -----------------------------------------------------------------------------
-// Cancel an outstanding request.
-// -----------------------------------------------------------------------------
-//
-inline void CBTEngActive::CancelRequest()
-    {
-    Cancel();
-    }
-
-
 // -----------------------------------------------------------------------------
 // Get a reference to the active object request status.
 // -----------------------------------------------------------------------------
@@ -126,7 +114,6 @@
     return iStatus;
     }
 
-
 // ---------------------------------------------------------------------------
 // From class CActive.
 // Called by the active scheduler when the request has been completed.
@@ -134,7 +121,7 @@
 //
 inline void CBTEngActive::RunL()
     {
-    iObserver.RequestCompletedL( this, iRequestId, iStatus.Int() );
+    iObserver.RequestCompletedL( this, iStatus.Int() );
     }
 
 
@@ -145,6 +132,6 @@
 //
 inline TInt CBTEngActive::RunError( TInt aError )
     {
-    iObserver.HandleError( this, iRequestId, aError );
+    iObserver.HandleError( this, aError );
     return KErrNone;
     }
--- a/bluetoothengine/bteng/inc/btengclient.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengclient.h	Sun May 02 21:30:11 2010 +0300
@@ -158,17 +158,6 @@
      * @return ?description
      */
     TInt CancelNotifyConnectionEvents();
-    
-    /**
-     * Set a pairing observer in BTEngine.
-     *
-     * @since S60 v3.2
-     * @param aAddr The address of the remote device that is being paired.
-     * @param aActivate If ETrue, the observer will be activated, otherwise
-     *                  the observer will be removed.
-     * @return KErrNone on success, otherwise a system-wide error code.
-     */
-    TInt SetPairingObserver( const TBTDevAddr& aAddr, TBool aActivate );
 
     /**
      * ?description
@@ -178,21 +167,6 @@
      */
     TInt PrepareDiscovery();
     
-    /**
-     * Pair a device.
-     * @param aAddr The address of the remote device to be paired.
-     * @param aDeviceClass the CoD of the device to be paired.
-     * @param aStatus contains the pair result at request completion.
-     */
-    void PairDevice( const TBTDevAddrPckgBuf& aAddr, 
-                     const TUint32& aDeviceClass, 
-                     TRequestStatus& aStatus  );
-    
-    /**
-     * Cancels an outstanding pair request
-     */
-    void CancelPairDevice();
-    
     };
 
 
--- a/bluetoothengine/bteng/inc/btengclientserver.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengclientserver.h	Sun May 02 21:30:11 2010 +0300
@@ -55,9 +55,6 @@
     EBTEngNotifyConnectionEvents,       // 41
     EBTEngCancelEventNotifier,          // 42
     EBTEngPrepareDiscovery,             // 43
-    EBTEngSetPairingObserver,           // 44
-    EBTEngPairDevice,                   // 45
-    EBTEngCancelPairDevice,             // 46
     };
 
 /**  TBTDevAddr class size */
--- a/bluetoothengine/bteng/inc/btengserver.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengserver.h	Sun May 02 21:30:11 2010 +0300
@@ -32,7 +32,6 @@
 class CBTEngSrvBBConnMgr;
 class CBTEngSrvKeyWatcher;
 class CBTEngSdpDbHandler;
-class CBTEngPairMan;
 class CPolicyServer;
 class TEComResolverParams;
 class CImplementationInformation;
@@ -150,14 +149,6 @@
     inline CBTEngSrvBBConnMgr* BasebandConnectionManager() const
             { return iBBConnMgr; }
 
-    /**
-     * Getter for pairing manager. Ownership is not transferred.
-     *
-     * @since Symbian^3
-     * @return Pointer to instance of baseband connection manager.
-     */
-    inline CBTEngPairMan* PairManager() const
-            { return iPairMan; }
 
     /**
      * Getter for socket server session.
@@ -170,16 +161,6 @@
             { return  iSocketServ; }
 
     /**
-     * Getter for registry server session.
-     * This handle can be used for creating subsessions.
-     *
-     * @since Symbian^3
-     * @return Reference to session with the registry server.
-     */
-    inline RBTRegServ& RegistrServer()
-            { return iBTRegServ; }
-
-    /**
      * Set Bluetooth on or off
      *
      * @since S60 v3.2
@@ -405,11 +386,6 @@
      * Callback for expiry of Simple Pairing debug mode.
      */
     TDeltaTimerEntry iDebugModeCallBack;
-
-    /**
-     * Pairing manager.
-     */
-    CBTEngPairMan* iPairMan;
     
     /**
     * Socket Server instance for this and other classes to access Bluetooth socket APIs.
@@ -417,11 +393,6 @@
     RSocketServ iSocketServ;
 
     /**
-    * Registry Server instance for bteng to access Bluetooth registry APIs.
-    */      
-    RBTRegServ iBTRegServ;
-
-    /**
      * Our state machine for handling power on/off.
      * Own.
      */
--- a/bluetoothengine/bteng/inc/btengsrvbbconnectionmgr.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengsrvbbconnectionmgr.h	Sun May 02 21:30:11 2010 +0300
@@ -149,22 +149,27 @@
      *
      * @since S60 v3.2
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
      * @param aStatus The status of the completed request.
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+    virtual void RequestCompletedL( CBTEngActive* aActive,
                                      TInt aStatus );
 
     /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
+    /**
      * From MBTEngActiveObserver.
      * Callback to notify that an error has occurred in RunL.
      *
      * @since S60 v3.2
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
      * @param aStatus The status of the completed request.
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, 
+    virtual void HandleError( CBTEngActive* aActive,
                                TInt aError );
 
 private:
--- a/bluetoothengine/bteng/inc/btengsrvkeywatcher.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengsrvkeywatcher.h	Sun May 02 21:30:11 2010 +0300
@@ -60,17 +60,24 @@
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+    virtual void RequestCompletedL( CBTEngActive* aActive, 
                                      TInt aStatus );
 
     /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
+    /**
      * From MBTEngActiveObserver.
      * Notification that a key value has changed.
      *
      * @since S60 v3.2
      * @param ?arg1 ?description
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
+    virtual void HandleError( CBTEngActive* aActive, TInt aError );
 
 private:
 
@@ -142,11 +149,6 @@
     RProperty iSspDebugModeKey;
     
     /**
-     * Property containing the BT registry change monitoring key
-     */
-    RProperty iBtRegistryKey;
-    
-    /**
      * Session with the central repository for BT SAP mode setting.
      * We load/unload BT SAP plugin.
      * Own.
@@ -208,12 +210,6 @@
     CBTEngActive* iSspDebugModeWatcher;
 
     /**
-     * Active object for subscribing to BT registry property changes.
-     * Own.
-     */
-    CBTEngActive* iBtRegistryWatcher;
-
-    /**
      * Pointer to our parent.
      * Not own.
      */
--- a/bluetoothengine/bteng/inc/btengsrvsettingsmgr.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/inc/btengsrvsettingsmgr.h	Sun May 02 21:30:11 2010 +0300
@@ -112,12 +112,13 @@
     void StopBTStackL();
 
     /**
-     * Update the central repository key for Bluetooth power state.
+     * Handles a power event that HW power is going to turn off or
+     * has been changed turned on.
      *
-     * @since Symbian^3
-     * @param aValue The new Bluetooth power state.
+     * @since Symbian^4
+     * @param aValue The new Bluetooth HW power state.
      */
-    void UpdateCenRepPowerKeyL( TBTPowerState aValue );
+    void HandleHwPowerChangeL( TBTPowerState aValue );
 
     /**
     * ?description
@@ -199,21 +200,26 @@
      *
      * @since Symbian^3
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
      * @param aStatus The status of the completed request.
      */
-    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aId, TInt aStatus );
-
+    virtual void RequestCompletedL( CBTEngActive* aActive, TInt aStatus );
+    
+    /**
+     * Callback for handling cancelation of an outstanding request.
+     *
+     * @param aId The ID that identifies the outstanding request.
+     */
+    virtual void CancelRequest( TInt aRequestId );
+    
     /**
      * From MBTEngActiveObserver.
      * Callback to notify that an error has occurred in RunL.
      *
      * @since Symbian^3
      * @param aActive Pointer to the active object that completed.
-     * @param aId The ID that identifies the outstanding request.
      * @param aStatus The status of the completed request.
      */
-    virtual void HandleError( CBTEngActive* aActive, TInt aId, TInt aError );
+    virtual void HandleError( CBTEngActive* aActive, TInt aError );
 
 private:
 
@@ -245,7 +251,7 @@
      * @param aTemporary Indicates if this is about a tempororary state change.
      */
     void CheckTemporaryPowerStateL( TBTPowerState& aCurrentState,
-                                     TBTPowerState aNewState, TBool aTemporary );
+                                     TBTPowerState aNewState, TBool aTemporary );  
 
 private: // data
 
--- a/bluetoothengine/bteng/src/btengclient.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/src/btengclient.cpp	Sun May 02 21:30:11 2010 +0300
@@ -255,17 +255,6 @@
 
 
 // ---------------------------------------------------------------------------
-// Set a pairing observer in BTEngine.
-// ---------------------------------------------------------------------------
-//
-TInt RBTEng::SetPairingObserver( const TBTDevAddr& aAddr, TBool aActivate )
-    {
-    TBTDevAddrPckgBuf addrPkg( aAddr );
-    return SendReceive( EBTEngSetPairingObserver, TIpcArgs( &addrPkg, aActivate ) );
-    }
-
-
-// ---------------------------------------------------------------------------
 // ?implementation_description
 // ---------------------------------------------------------------------------
 //
@@ -273,22 +262,3 @@
     {
     return SendReceive( EBTEngPrepareDiscovery, TIpcArgs() );
     }
-
-// ---------------------------------------------------------------------------
-// Start to pair a device in BTEngine.
-// ---------------------------------------------------------------------------
-//
-void RBTEng::PairDevice( const TBTDevAddrPckgBuf& aAddr, 
-        const TUint32& aDeviceClass, TRequestStatus& aStatus  )
-    {
-    SendReceive( EBTEngPairDevice, TIpcArgs( &aAddr, aDeviceClass ), aStatus );    
-    }
-
-// ---------------------------------------------------------------------------
-// cancel pairing request
-// ---------------------------------------------------------------------------
-//
-void RBTEng::CancelPairDevice( )
-    {
-    (void) SendReceive( EBTEngCancelPairDevice);        
-    }
--- a/bluetoothengine/bteng/src/btengserver.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/src/btengserver.cpp	Sun May 02 21:30:11 2010 +0300
@@ -37,7 +37,6 @@
 #include "btengsecpolicy.h"
 #include "btengprivatepskeys.h"
 #include "btengplugin.h"
-#include "btengpairman.h"
 #include "debug.h"
 
 /**  Bluetooth Engine server thread name */
@@ -167,8 +166,6 @@
     iPluginMgr = CBTEngSrvPluginMgr::NewL( this );
     iBBConnMgr = CBTEngSrvBBConnMgr::NewL( this, iSocketServ );
 
-    User::LeaveIfError( iBTRegServ.Connect() );
-    iPairMan = CBTEngPairMan::NewL( *this );
 
     TCallBack idleCb( IdleTimerCallBack, this );
     iIdleCallBack.Set( idleCb );
@@ -225,9 +222,7 @@
     delete iPluginMgr;
     delete iBBConnMgr;
     delete iServerState;
-    delete iPairMan;
     iSocketServ.Close();
-    iBTRegServ.Close();
     }
 
 // ---------------------------------------------------------------------------
@@ -315,7 +310,6 @@
 	TRACE_INFO( ( _L( "[CBTEngServer]\t iSessionCount %d"), iSessionCount ))
     iSessionCount--;
 	iSettingsMgr->SessionClosed( aSession );
-	iPairMan->SessionClosed( aSession );
     if( aAutoOff )
         {
         TRAP_IGNORE( SetPowerStateL( EBTOff, ETrue ) );
--- a/bluetoothengine/bteng/src/btengsrvbbconnectionmgr.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvbbconnectionmgr.cpp	Sun May 02 21:30:11 2010 +0300
@@ -92,15 +92,13 @@
 //
 CBTEngSrvBBConnMgr::~CBTEngSrvBBConnMgr()
     {
-    Unsubscribe();
+	delete iLinkCountWatcher;
+	delete iWlanWatcher;    
 	iLinkCountProperty.Close();
     iWlanStatusProperty.Close();
-	delete iLinkCountWatcher;
-	delete iWlanWatcher;
 	delete iPhyLinks;
     }
 
-
 // ---------------------------------------------------------------------------
 // Start listening to the relevant properties.
 // ---------------------------------------------------------------------------
@@ -126,19 +124,10 @@
 //
 void CBTEngSrvBBConnMgr::Unsubscribe()
     {
-    if( iLinkCountWatcher->IsActive() )
-        {
-        iLinkCountProperty.Cancel();
-        iLinkCountWatcher->CancelRequest();
-        }
-	if( iWlanWatcher && iWlanWatcher->IsActive() )
-	    {
-	    iWlanStatusProperty.Cancel();
-	    iWlanWatcher->CancelRequest();
-	    }
+    iLinkCountWatcher->Cancel();
+    iWlanWatcher->Cancel();
     }
 
-
 // ---------------------------------------------------------------------------
 // ?implementation_description
 // ---------------------------------------------------------------------------
@@ -364,22 +353,20 @@
 // ?implementation_description
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvBBConnMgr::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+void CBTEngSrvBBConnMgr::RequestCompletedL( CBTEngActive* aActive,
     TInt aStatus )
     {
-    TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aId, aStatus ) )
-    ASSERT( aId == KBTEngSrvBBConnId || aId == KBTEngSrvWlanStatusId );
-    (void) aActive;
-    (void) aId;
+    TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aActive->RequestId(), aStatus ) )
+    ASSERT( aActive->RequestId() == KBTEngSrvBBConnId || aActive->RequestId() == KBTEngSrvWlanStatusId );
     if( aStatus != KErrPermissionDenied )
         {
-            // Ignore any other errors.
-            // First subscribe again, so that we don't miss any updates.
-            Subscribe();
+        // Ignore any other errors.
+        // First subscribe again, so that we don't miss any updates.
+        Subscribe();
         }
     (void) ManageTopology( EFalse );    // Ignore result; nothing to do 
                                         // about it here.
-    if( aId == KBTEngSrvBBConnId )
+    if( aActive->RequestId() == KBTEngSrvBBConnId )
         {
         TRACE_INFO( ( _L( "[BTENG] PHY count key changed, update UI connection status" ) ) )
         iServer->SettingsManager()->SetUiIndicatorsL();
@@ -387,6 +374,24 @@
     TRACE_FUNC_EXIT
     }
 
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngSrvBBConnMgr::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) );
+    if ( aRequestId == KBTEngSrvBBConnId )
+        {
+        iLinkCountProperty.Cancel();
+        }
+    else if ( aRequestId == KBTEngSrvWlanStatusId )
+        {
+        iWlanStatusProperty.Cancel();
+        }
+    TRACE_FUNC_EXIT
+    }
 
 // ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
@@ -394,12 +399,11 @@
 // RunL cannot actually leave.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvBBConnMgr::HandleError( CBTEngActive* aActive, TInt aId, 
+void CBTEngSrvBBConnMgr::HandleError( CBTEngActive* aActive,  
     TInt aError )
     {
-    TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aId, aError ) )
+    TRACE_FUNC_ARG( ( _L( "id: %d; status: %d" ), aActive->RequestId(), aError ) )
     (void) aActive;
-    (void) aId;
     (void) aError;
     }
 
--- a/bluetoothengine/bteng/src/btengsrvkeywatcher.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvkeywatcher.cpp	Sun May 02 21:30:11 2010 +0300
@@ -27,7 +27,6 @@
 #include "btengserver.h"
 #include "btengsrvpluginmgr.h"
 #include "btengsrvsettingsmgr.h"
-#include "btengpairman.h"
 #include "btengprivatepskeys.h"
 #include "btengprivatecrkeys.h"
 #include "debug.h"
@@ -48,8 +47,7 @@
 const TInt KBTEngSapWatcher = 22;
 /**  Identification for active object */
 const TInt KBTEngAddrWatcher = 23;
-/**  Identification for active object */
-const TInt KBTEngRegistryWatcher = 24;
+
 /**  Identification for active object */
 const TInt KBTEngSspDebugWatcher = 25;
 /**  Buffer size for BT device address as stored in CenRep */
@@ -129,16 +127,6 @@
         iEmergencyCallKey.Subscribe( iEmergencyCallWatcher->RequestStatus() );
         iEmergencyCallWatcher->GoActive();
         }
-
-    err = iBtRegistryKey.Attach( KPropertyUidBluetoothCategory, KPropertyKeyBluetoothGetRegistryTableChange );
-    if( !err )
-        {
-        iBtRegistryWatcher = CBTEngActive::NewL( *this, KBTEngRegistryWatcher, 
-                                                 CActive::EPriorityStandard );
-        iBtRegistryKey.Subscribe( iBtRegistryWatcher->RequestStatus() );
-        iBtRegistryWatcher->GoActive();
-        }
-
     err = iSspDebugModeKey.Attach( KPSUidBluetoothTestingMode, KBTSspDebugmode );
     if( !err )
         {
@@ -192,75 +180,32 @@
 //
 CBTEngSrvKeyWatcher::~CBTEngSrvKeyWatcher()
     {
-    if( iDutModeKey.Handle() )
-        {
-        iDutModeKey.Cancel();
-        }
     delete iDutModeWatcher;
     iDutModeKey.Close();
 
 #ifdef RD_REMOTELOCK
-    if( iPhoneLockKey.Handle() )
-        {
-        iPhoneLockKey.Cancel();
-        }
     delete iPhoneLockWatcher;
     iPhoneLockKey.Close();
 #endif  //RD_REMOTELOCK
 
-    if( iSystemStateKey.Handle() )
-        {
-        iSystemStateKey.Cancel();
-        }
     delete iSystemStateWatcher;
-    iSystemStateKey.Close();    
-     
-    if( iBtConnectionKey.Handle() )
-        {
-        iBtConnectionKey.Cancel();
-        }
+    iSystemStateKey.Close();
+
     delete iBtConnectionWatcher;
     iBtConnectionKey.Close();
-    
-    if( iBtScanningKey.Handle() )
-        {
-        iBtScanningKey.Cancel();
-        }
+
     delete iBtScanningWatcher;
     iBtScanningKey.Close();
 
-    if( iEmergencyCallKey.Handle() )
-        {
-        iEmergencyCallKey.Cancel();
-        }
     delete iEmergencyCallWatcher;
     iEmergencyCallKey.Close();
-    
-    if( iSspDebugModeKey.Handle() )
-        {
-        iSspDebugModeKey.Cancel();
-        }
+
     delete iSspDebugModeWatcher;
     iSspDebugModeKey.Close();
 
-    if( iBtRegistryKey.Handle() )
-    	{
-    	iBtRegistryKey.Cancel();
-    	}
-    delete iBtRegistryWatcher;
-    iBtRegistryKey.Close();
-
-    if( iSapKeyCenRep )
-        {
-        iSapKeyCenRep->NotifyCancel( KBTSapEnabled );
-        }
     delete iSapModeWatcher;
     delete iSapKeyCenRep;
 
-    if( iBdaddrKey.Handle() )
-        {
-        iBdaddrKey.Cancel();
-        }
     delete iBdaddrWatcher;
     iBdaddrKey.Close();
     }
@@ -271,13 +216,13 @@
 // Processes a changed key value.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvKeyWatcher::RequestCompletedL( CBTEngActive* aActive, TInt aId, 
+void CBTEngSrvKeyWatcher::RequestCompletedL( CBTEngActive* aActive, 
     TInt aStatus )
     {
     TRACE_FUNC_ARG( ( _L( "status %d" ), aStatus ) )
     ASSERT( aStatus != KErrPermissionDenied );
     TInt val = 0;
-    switch( aId )
+    switch( aActive->RequestId() )
         {
         case KBTEngDutWatcher:
             {
@@ -360,22 +305,6 @@
                 }
             break;
             }
-        case KBTEngRegistryWatcher:
-        	{
-            TRACE_INFO( ( _L( "BT Registry key changed" ) ) )
-            TInt myChangedTable;
-
-			iBtRegistryKey.Subscribe( aActive->RequestStatus() );
-			aActive->GoActive();
-
-            TInt err = iBtRegistryKey.Get( myChangedTable );
-            if( !err && myChangedTable == KRegistryChangeRemoteTable )
-            	{
-            	TRACE_INFO( ( _L("BT Remote registry key changed") ) )
-            	iServer->PairManager()->RemoteRegistryChangeDetected();
-            	}
-        	break;
-        	}    
         case KBTEngSapWatcher:
             {
             TRACE_INFO( ( _L( "SAP mode key changed" ) ) )
@@ -428,7 +357,7 @@
             break;
         default:
             {
-            TRACE_INFO( ( _L( "[BTENG]\t wrong key notification! id=%d" ), aId ) )
+            TRACE_INFO( ( _L( "[BTENG]\t wrong key notification! id=%d" ), aActive->RequestId() ) )
             }
             break;
 
@@ -436,6 +365,73 @@
     TRACE_FUNC_EXIT
     }
 
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngSrvKeyWatcher::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) )
+    switch( aRequestId )
+        {
+        case KBTEngDutWatcher:
+            {
+            iDutModeKey.Cancel();
+            break;
+            }
+        case KBTEngLockWatcher:
+            {
+            iPhoneLockKey.Cancel();
+            break;
+            }
+        case KBTEngSysWatcher:
+            {
+            iSystemStateKey.Cancel();
+            break;
+            }
+        case KBTEngBtConnectionWatcher:
+            {
+            iBtConnectionKey.Cancel();
+            break;
+            }
+                    
+        case KBTEngScanningWatcher:
+            {
+            iBtScanningKey.Cancel();
+            break;
+            }
+            
+        case KBTEngEmergencyWatcher:
+            {
+            iEmergencyCallKey.Cancel();
+            break;
+            }
+            
+        case KBTEngSspDebugWatcher:
+            {
+            iSspDebugModeKey.Cancel();
+            break;
+            }   
+        case KBTEngSapWatcher:
+            {
+            iSapKeyCenRep->NotifyCancel( KBTSapEnabled );
+            break;
+            }
+            
+        case KBTEngAddrWatcher:
+            {
+            iBdaddrKey.Cancel();
+            break;
+            }
+        default:
+            {
+            TRACE_INFO( ( _L( "[BTENG]\t wrong key notification! id=%d" ), aRequestId ) )
+            break;
+            }
+        }
+    TRACE_FUNC_EXIT 
+    }
 
 // ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
@@ -443,14 +439,14 @@
 // the subscriptions are active.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvKeyWatcher::HandleError( CBTEngActive* aActive, TInt aId, 
+void CBTEngSrvKeyWatcher::HandleError( CBTEngActive* aActive, 
     TInt aError )
     {
     TRACE_FUNC_ARG( ( _L( "status %d" ), aError ) )
     (void) aError;
     if( !aActive->IsActive() )
         {
-        switch( aId )
+        switch( aActive->RequestId() )
             {
             case KBTEngDutWatcher:
                 {
@@ -483,7 +479,7 @@
                 break;
             default:
                 {
-                TRACE_INFO( ( _L( "[BTENG]\t wrong key notification! id=%d" ), aId ) )
+                TRACE_INFO( ( _L( "[BTENG]\t wrong key notification! id=%d" ), aActive->RequestId() ) )
                 }
                 return; // we don't want to go active without subscribing
             }
--- a/bluetoothengine/bteng/src/btengsrvpluginmgr.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvpluginmgr.cpp	Sun May 02 21:30:11 2010 +0300
@@ -83,6 +83,7 @@
     {
     iPluginInfoArray.Close();
     iPluginArray.ResetAndDestroy();
+    REComSession::FinalClose();
     }
 
 
--- a/bluetoothengine/bteng/src/btengsrvsession.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvsession.cpp	Sun May 02 21:30:11 2010 +0300
@@ -21,7 +21,6 @@
 #include "btengsrvsession.h"
 #include "btengserver.h"
 #include "btengsrvbbconnectionmgr.h"
-#include "btengpairman.h"
 #include "btengsrvsettingsmgr.h"
 #include "btengclientserver.h"
 #include "debug.h"
@@ -158,7 +157,6 @@
     if( !aMessage.IsNull() &&
         ( err || 
           ( aMessage.Function() != EBTEngNotifyConnectionEvents && 
-            aMessage.Function() != EBTEngPairDevice &&
             aMessage.Function() != EBTEngSetPowerState ) ) )
         {
             // Return the error code to the client.
@@ -258,25 +256,6 @@
             Server()->BasebandConnectionManager()->ManageTopology( ETrue );
             }
             break;
-        case EBTEngSetPairingObserver:
-            {
-            CheckPowerOnL();
-            // Simply forward it to the pairing manager
-            Server()->PairManager()->ProcessCommandL( aMessage );
-            break;
-            }
-        case EBTEngPairDevice:
-            {
-            CheckPowerOnL();
-            // Simply forward it to the pairing manager
-            Server()->PairManager()->ProcessCommandL( aMessage );
-            break;
-            }
-        case EBTEngCancelPairDevice:
-            {
-            Server()->PairManager()->ProcessCommandL( aMessage );
-            break;
-            }
         default:
             {
             TRACE_INFO( ( _L( "[BTENG]\t DispatchMessageL: bad request (%d)" ), aMessage.Function() ) )
--- a/bluetoothengine/bteng/src/btengsrvsettingsmgr.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvsettingsmgr.cpp	Sun May 02 21:30:11 2010 +0300
@@ -23,8 +23,7 @@
 #include <centralrepository.h>
 #include <featmgr.h>
 #include <AknSmallIndicator.h>
-#include <avkon.hrh>
-
+//#include <avkon.hrh>
 #include "btengserver.h"
 #include "btengsrvpluginmgr.h"
 #include "btengsrvbbconnectionmgr.h"
@@ -93,11 +92,6 @@
 //
 CBTEngSrvSettingsMgr::~CBTEngSrvSettingsMgr()
     {
-    if( iActive && iActive->IsActive() )
-        {
-        // Cancel the outstanding request.
-        iPowerMgr.Cancel();
-        }
     delete iActive;  
     iPowerMgr.Close();
     }
@@ -184,11 +178,11 @@
         if ( currentState == aState )
             {
             // Make sure that the CenRep key is in sync.
-            // During boot-up, the pwoer is set from the CenRep key, so we could 
+            // During boot-up, the power is set from the CenRep key, so we could 
             // end up out-of-sync.
             TRACE_INFO( ( _L( "SetPowerStateL: currentState == aState" ) ) )
-            UpdateCenRepPowerKeyL( aState );
-            } 
+            HandleHwPowerChangeL( aState );
+            }
         return;
         }
     if ( aState == EBTOn )
@@ -318,21 +312,20 @@
 
 
 // ---------------------------------------------------------------------------
-// Update the power state CenRep key.
+// Update the power state CenRep key, and start BTNotif server if BT is on.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvSettingsMgr::UpdateCenRepPowerKeyL( TBTPowerState aState )
+void CBTEngSrvSettingsMgr::HandleHwPowerChangeL( TBTPowerState aState )
     {
     TRACE_FUNC_ENTRY
     CRepository* cenrep = CRepository::NewLC( KCRUidBluetoothPowerState );
     // TBTPowerState power state type is inverted from TBTPowerStateValue...
-    TBTPowerStateValue power = (TBTPowerStateValue) !aState;
+    TBTPowerStateValue power = ( aState == EBTOn ) ? EBTPowerOn : EBTPowerOff;
     User::LeaveIfError( cenrep->Set( KBTPowerState, (TInt) power ) );
     CleanupStack::PopAndDestroy( cenrep );
     TRACE_FUNC_EXIT
     }
 
-
 // ---------------------------------------------------------------------------
 // ?implementation_description
 // ---------------------------------------------------------------------------
@@ -654,9 +647,9 @@
 // Callback to notify that an outstanding request has completed.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvSettingsMgr::RequestCompletedL( CBTEngActive* aActive, TInt aId, TInt aStatus )
+void CBTEngSrvSettingsMgr::RequestCompletedL( CBTEngActive* aActive, TInt aStatus )
     {
-    __ASSERT_ALWAYS( aId == KBTEngSettingsActive, PanicServer( EBTEngPanicCorrupt ) );
+    __ASSERT_ALWAYS( aActive->RequestId() == KBTEngSettingsActive, PanicServer( EBTEngPanicCorrupt ) );
     TRACE_FUNC_ENTRY
     (void) aActive;
     if ( aStatus != KErrNone && aStatus != KErrAlreadyExists && aStatus != KErrCancel )
@@ -664,7 +657,6 @@
         // Something went wrong, so we turn BT off again.
         SetPowerStateL( EBTOff, EFalse );
         }
-    
     if ( !iMessage.IsNull())
         {
         iMessage.Complete( aStatus );
@@ -672,16 +664,29 @@
     TRACE_FUNC_EXIT
     }
 
+// ---------------------------------------------------------------------------
+// From class MBTEngActiveObserver.
+// Handles cancelation of an outstanding request
+// ---------------------------------------------------------------------------
+//
+void CBTEngSrvSettingsMgr::CancelRequest( TInt aRequestId )
+    {
+    TRACE_FUNC_ARG( ( _L( "reqID %d" ), aRequestId ) );
+    if ( aRequestId == KBTEngSettingsActive )
+        {
+        iPowerMgr.Cancel();
+        }
+    TRACE_FUNC_EXIT 
+    }
 
 // ---------------------------------------------------------------------------
 // From class MBTEngActiveObserver.
 // Callback to notify that an error has occurred in RunL.
 // ---------------------------------------------------------------------------
 //
-void CBTEngSrvSettingsMgr::HandleError( CBTEngActive* aActive, TInt aId, TInt aError )
+void CBTEngSrvSettingsMgr::HandleError( CBTEngActive* aActive, TInt aError )
     {
     (void) aActive;
-    (void) aId;
     if ( !iMessage.IsNull())
         {
         iMessage.Complete( aError );
@@ -729,10 +734,11 @@
     
     if( powerState == EBTPowerOff )
         {
-        SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
-        SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
-        SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
-        SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
+        // To be migrated
+        //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
+        //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
+        //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
+        //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
         }
     else
         {
@@ -748,56 +754,59 @@
             {
              if ( connecting ) // BT connecting and hidden
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
-                SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateAnimate );
+                // To be migrated to QT
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateAnimate );
                 }
             else if ( phys > 0 ) // BT connection active and hidden     
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
-                SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOn );
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOn );
                 }
             else  // BT connection not active and hidden
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOn );
-                SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOn );
+                //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
                 }
-            SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
-            SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
+            //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
+            //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
             }           
         else if( visibilityMode == EBTVisibilityModeGeneral || visibilityMode == EBTVisibilityModeTemporary )
             {     
             if ( connecting ) // BT connecting and visible
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
-                SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateAnimate );
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateAnimate );
                 }
             else if ( phys > 0 ) // BT connection active and visible 
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
-                SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOn );
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOn );
                 }
             else  // BT connection not active and visible
                 {
-                SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOn );
-                SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
+                //SetIndicatorStateL( EAknIndicatorBluetoothModuleOnVisible, EAknIndicatorStateOn );
+                //SetIndicatorStateL( EAknIndicatorBluetoothVisible, EAknIndicatorStateOff );
                 }
-            SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
-            SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
+            //SetIndicatorStateL( EAknIndicatorBluetoothModuleOn, EAknIndicatorStateOff );
+            //SetIndicatorStateL( EAknIndicatorBluetooth, EAknIndicatorStateOff );
             }
         }
     TRACE_FUNC_EXIT
     }
 
-
 // ---------------------------------------------------------------------------
 // ?implementation_description
 // ---------------------------------------------------------------------------
 //
 void CBTEngSrvSettingsMgr::SetIndicatorStateL( const TInt aIndicator, const TInt aState )
     {
-    CAknSmallIndicator* indicator = CAknSmallIndicator::NewLC( TUid::Uid( aIndicator ) );
-    indicator->SetIndicatorStateL( aState );
-    CleanupStack::PopAndDestroy( indicator ); //indicator
+    // To be migrated to QT
+    (void) aIndicator;
+    (void) aState;
+    //CAknSmallIndicator* indicator = CAknSmallIndicator::NewLC( TUid::Uid( aIndicator ) );
+    //indicator->SetIndicatorStateL( aState );
+    //CleanupStack::PopAndDestroy( indicator ); //indicator
     }
 
 
@@ -886,3 +895,4 @@
         }
     TRACE_FUNC_EXIT 
     }
+
--- a/bluetoothengine/bteng/src/btengsrvstate.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bteng/src/btengsrvstate.cpp	Sun May 02 21:30:11 2010 +0300
@@ -108,7 +108,7 @@
         // Power off, starting state is to disconnect the plug-ins
         iState = EDisconnectPlugins;
         iOperation = EPowerOff;
-        iServer->SettingsManager()->UpdateCenRepPowerKeyL( EBTOff );
+        iServer->SettingsManager()->HandleHwPowerChangeL( EBTOff );
         iServer->SettingsManager()->SetUiIndicatorsL();
         }
     ChangeState();
@@ -212,7 +212,7 @@
             {
             if( iOperation == EPowerOn )
                 {
-                iServer->SettingsManager()->UpdateCenRepPowerKeyL( EBTOn );
+                iServer->SettingsManager()->HandleHwPowerChangeL( EBTOn );
                 iServer->SettingsManager()->SetUiIndicatorsL();
                 }
             iOperation = ESrvOpIdle;
--- a/bluetoothengine/bthid/bthidkbdsettings/group/bld.inf	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bthid/bthidkbdsettings/group/bld.inf	Sun May 02 21:30:11 2010 +0300
@@ -21,17 +21,7 @@
 
 PRJ_EXPORTS
 
-PRJ_EXTENSIONS
-START EXTENSION s60/mifconv
-OPTION TARGETFILE btkeyboard.mif
-OPTION TARGETFILE btkeyboard_aif.mif
-OPTION HEADERFILE btkeyboard.mbg
-OPTION SOURCEDIR ../aif
-OPTION SOURCES -c8,8 qgn_wka_cxt
-END
-
 PRJ_MMPFILES
 bthidsettings.mmp
-bthidkbdsettings.mmp
 
 
--- a/bluetoothengine/bthid/rom/btkeyboard.iby	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bthid/rom/btkeyboard.iby	Sun May 02 21:30:11 2010 +0300
@@ -38,7 +38,6 @@
 ECOM_PLUGIN(hidkeyboard.dll, hidkeyboard.rsc)
 ECOM_PLUGIN(hidmouse.dll, hidmouse.rsc)
 ECOM_PLUGIN(kbdlayout.dll, kbdlayout.rsc)
-ECOM_PLUGIN(bthidkbdsettings.dll, bthidkbdsettings.rsc)
 ECOM_PLUGIN(bthidengplugin.dll, bthidengplugin.rsc)
 
 data=DATAZ_\APP_BITMAP_DIR\BTMouseBitMaps.mbm     APP_BITMAP_DIR\BTMouseBitMaps.mbm
--- a/bluetoothengine/bthid/rom/btkeyboard_resources.iby	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/bthid/rom/btkeyboard_resources.iby	Sun May 02 21:30:11 2010 +0300
@@ -20,7 +20,6 @@
 #ifndef BTKEYBOARD_RESOURCES_IBY
 #define BTKEYBOARD_RESOURCES_IBY
 
-data=DATAZ_\RESOURCE_FILES_DIR\BthidResource.rsc	RESOURCE_FILES_DIR\BthidResource.rsc
 data=DATAZ_\APP_RESOURCE_DIR\PaintCursor.rsc	    APP_RESOURCE_DIR\PaintCursor.rsc
 #endif //BTKEYBOARD_RESOURCES_IBY
 
--- a/bluetoothengine/btmac/group/BTMonoCmdHandler.mmp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/btmac/group/BTMonoCmdHandler.mmp	Sun May 02 21:30:11 2010 +0300
@@ -69,6 +69,7 @@
 LIBRARY	customapi.lib
 LIBRARY bluetooth.lib
 LIBRARY atextclient.lib
+LIBRARY charconv.lib
 
 LIBRARY mmfdevsound.lib 
 LIBRARY telephonyservice.lib
--- a/bluetoothengine/btmac/inc/atcodec/ATCodecDefs.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/btmac/inc/atcodec/ATCodecDefs.h	Sun May 02 21:30:11 2010 +0300
@@ -141,14 +141,14 @@
     {EATCIEV,   EATUnsolicitedResult, 2, KIntList2},
     {EATCREG, EATReadResult,          2, KIntList2},
     {EATCREG, EATUnsolicitedResult,   2, KIntList1},
-    {EATCGSN, EATReadResult,          1, KStrList1},
-    {EATCSQ, EATReadResult,						2, KIntList2},
-    {EATCIMI, EATReadResult,					1, KStrList1},
-    {EATCGMI, EATReadResult,					1, KStrList1},
-    {EATCGMM, EATReadResult,					1, KStrList1},
-    {EATCGMR, EATReadResult,					1, KStrList1},
-    {EATCOLP, EATReadResult,					1, KIntList1},
-    {EATCOLP, EATUnsolicitedResult,		2, KDQStrIntList2},    
+    {EATCGSN, EATActionResult,        1, KStrList1},
+    {EATCSQ,  EATActionResult,	      2, KIntList2},
+    {EATCIMI, EATActionResult,        1, KStrList1},
+    {EATCGMI, EATActionResult,        1, KStrList1},
+    {EATCGMM, EATActionResult,        1, KStrList1},
+    {EATCGMR, EATActionResult,        1, KStrList1},
+    {EATCOLP, EATReadResult,          1, KIntList1},
+    {EATCOLP, EATUnsolicitedResult,   2, KDQStrIntList2},    
     };
 
 const TInt KResultCodeParamTableSize = (sizeof(KResultCodeParamTable) / sizeof(SResultCodeParamDef));
--- a/bluetoothengine/btmac/src/BTMonoCmdHandler/btmcprotocol.cpp	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/btmac/src/BTMonoCmdHandler/btmcprotocol.cpp	Sun May 02 21:30:11 2010 +0300
@@ -290,7 +290,7 @@
        		{
        		TBuf8<RMobilePhone::KIMSISize> buf;
        		buf.Copy(iId);
-            CATResult* cimi = CATResult::NewLC(EATCIMI, EATReadResult, TATParam(buf));
+            CATResult* cimi = CATResult::NewLC(EATCIMI, EATActionResult, TATParam(buf));
             SendResponseL(*cimi);
 	        CleanupStack::PopAndDestroy(cimi);
 	        CATResult* ok = CATResult::NewLC(EATOK);
@@ -789,56 +789,7 @@
                     break;  
                 };
             break;  
-            }
-        case EATCSQ:
-            {
-            TRACE_INFO(_L("Requesting Signal strength"));
-            LEAVE_IF_ERROR(params.Append(TATParam(iPhoneStatus->GetRssiStrength())))
-            LEAVE_IF_ERROR(params.Append(TATParam(KBerUnknown)))
-            code = CATResult::NewL(EATCSQ, EATReadResult, &params);
-            TRACE_INFO(_L("done"));
-            break;
-            }
-
-        case EATCGSN:
-            {
-            TBuf8<RMobilePhone::KPhoneSerialNumberSize> buf;
-            buf.Copy(iIdentity.iSerialNumber);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGSN, EATReadResult, &params);
-            break;
-            }
-        case EATCGMI:
-            {
-            TBuf8<RMobilePhone::KPhoneManufacturerIdSize> buf;
-            buf.Copy(iIdentity.iManufacturer);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGMI, EATReadResult, &params);
-            break;
-            }
-        case EATCGMM:
-            {
-            TBuf8<RMobilePhone::KPhoneModelIdSize> buf;
-            buf.Copy(iIdentity.iModel);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGMM, EATReadResult, &params);
-            break;      
-            }
-        case EATCGMR:
-            {
-            TBuf8<RMobilePhone::KPhoneRevisionIdSize> buf;
-            buf.Copy(iIdentity.iRevision);
-            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
-            code = CATResult::NewL(EATCGMR, EATReadResult, &params);
-            break;      
-            }
-        case EATCIMI:
-            {
-            iEtelQuery->SetServiceId(KQueryIMSI);
-            iPhone.GetSubscriberId(iEtelQuery->iStatus, iId);
-            iEtelQuery->GoActive();
-            break;
-            }
+            }        
         case EATCOLP:
             {
             LEAVE_IF_ERROR(params.Append(TATParam(TInt(iProtocolStatus->iOutgoingCallNotif))))
@@ -1040,7 +991,11 @@
 void CBtmcProtocol::HandleActionCommandL(const CATCommand& aCmd)
     {
     TRACE_FUNC
-    
+    RATResultPtrArray resarr;
+    ATObjArrayCleanupResetAndDestroyPushL(resarr);    
+    CATResult* code = NULL;
+    RATParamArray params;
+    CleanupClosePushL(params);
     switch (aCmd.Id())
         {
         case EATCNUM:
@@ -1054,33 +1009,71 @@
             iCallStatus->HandleClccL();
             break;
             }
+        case EATCSQ:
+            {
+            TRACE_INFO(_L("Requesting Signal strength"));
+            LEAVE_IF_ERROR(params.Append(TATParam(iPhoneStatus->GetRssiStrength())))
+            LEAVE_IF_ERROR(params.Append(TATParam(KBerUnknown)))
+            code = CATResult::NewL(EATCSQ, EATActionResult, &params);
+            TRACE_INFO(_L("done"));
+            break;
+            }
+        case EATCGMI:
+            {
+            TBuf8<RMobilePhone::KPhoneManufacturerIdSize> buf;
+            buf.Copy(iIdentity.iManufacturer);
+            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
+            code = CATResult::NewL(EATCGMI, EATActionResult, &params);
+            break;
+            }
+        case EATCGMM:
+            {
+            TBuf8<RMobilePhone::KPhoneModelIdSize> buf;
+            buf.Copy(iIdentity.iModel);
+            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
+            code = CATResult::NewL(EATCGMM, EATActionResult, &params);
+            break;      
+            }
+        case EATCGMR:
+            {
+            TBuf8<RMobilePhone::KPhoneRevisionIdSize> buf;
+            buf.Copy(iIdentity.iRevision);
+            LEAVE_IF_ERROR(params.Append(TATParam(buf)))
+            code = CATResult::NewL(EATCGMR, EATActionResult, &params);
+            break;      
+            }
+        case EATCIMI:
+            {
+            iEtelQuery->SetServiceId(KQueryIMSI);
+            iPhone.GetSubscriberId(iEtelQuery->iStatus, iId);
+            iEtelQuery->GoActive();
+            break;
+            }
         case EATCGSN:
             {
-            CATResult* code = NULL;
-            RATResultPtrArray resarr;
-            ATObjArrayCleanupResetAndDestroyPushL(resarr);              
-            RATParamArray params;
-            CleanupClosePushL(params);
             TBuf8<RMobilePhone::KPhoneSerialNumberSize> buf;
             buf.Copy(iIdentity.iSerialNumber);
             LEAVE_IF_ERROR(params.Append(TATParam(buf)))
             code = CATResult::NewL(EATCGSN, EATActionResult, &params);
-            CleanupStack::PopAndDestroy(&params);
-            CleanupStack::PushL(code);
-            resarr.AppendL(code);
-            CleanupStack::Pop(code);
-            CATResult* ok = CATResult::NewL(EATOK);
-            CleanupStack::PushL(ok);
-            resarr.AppendL(ok);
-            CleanupStack::Pop(ok);
-            SendResponseL(resarr);
-            CleanupStack::PopAndDestroy(&resarr);
-            CmdHandlingCompletedL();
             break;
             }
         default:
             LEAVE(KErrNotSupported);
+        }    
+    CleanupStack::PopAndDestroy(&params);
+    if (code)
+        {
+        CleanupStack::PushL(code);
+        resarr.AppendL(code);
+        CleanupStack::Pop(code);
+        CATResult* ok = CATResult::NewL(EATOK);
+        CleanupStack::PushL(ok);
+        resarr.AppendL(ok);
+        CleanupStack::Pop(ok);
+        SendResponseL(resarr);
+        CmdHandlingCompletedL();
         }
+    CleanupStack::PopAndDestroy(&resarr);
     }
 
 void CBtmcProtocol::DoSendProtocolDataL()
--- a/bluetoothengine/btnotif/group/bld.inf	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/btnotif/group/bld.inf	Sun May 02 21:30:11 2010 +0300
@@ -19,33 +19,20 @@
 #include <platform_paths.hrh>
 
 PRJ_PLATFORMS
-//DEFAULT
+DEFAULT
 
 PRJ_EXPORTS
-../loc/btnotif.loc        MW_LAYER_LOC_EXPORT_PATH(btnotif.loc)
-../rom/Btnotif.iby        CORE_MW_LAYER_IBY_EXPORT_PATH(Btnotif.iby)
-../rom/BtnotifResources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(BtnotifResources.iby)
-../inc/devui_const.h |../../inc/devui_const.h
 
-PRJ_EXTENSIONS
-
-START EXTENSION s60/mifconv
-OPTION TARGETFILE btnotif.mif
-OPTION HEADERFILE btnotif.mbg
-OPTION SOURCES -c8,8 qgn_note_bt_popup -c8,8 qgn_note_bt_popup_2 \
-		           -c8,8 qgn_note_bt_popup_3 -c8,8 qgn_indi_bt_blocked \
-		           -c8,8 qgn_indi_bt_signal_good_add \
-		           -c8,8 qgn_indi_bt_signal_low_add \
-		           -c8,8 qgn_indi_bt_signal_med_add
-END
-
+../rom/btnotif.iby  CORE_MW_LAYER_IBY_EXPORT_PATH(btnotif.iby)
 PRJ_MMPFILES
 
-// gnumakefile btnotif_icons_dc.mk
-
-../group/BTNotif.mmp
-../ecom/BtnotifWrapper.mmp
+btnotifsrv.mmp
+btnotifwrapper.mmp
 
 PRJ_TESTMMPFILES
 
-// End of File
+//../btnotifsrv/tsrc/btnotifsrvtest/group/btnotifsrvtest.mmp
+../btnotifsrv/tsrc/btnotifsrvtest/group/btnotifserversessiontest.mmp
+../btnotifwrapper/tsrc/btnotifwrappertest/group/btnotifwrappertest.mmp
+
+PRJ_TESTEXPORTS
--- a/bluetoothengine/btnotif/rom/Btnotif.iby	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/btnotif/rom/Btnotif.iby	Sun May 02 21:30:11 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -11,18 +11,21 @@
 *
 * Contributors:
 *
-* Description:
+* Description:  Image description file for project btnotif
 *
 */
 
-#ifndef __BTNOTIF_IBY__
-#define __BTNOTIF_IBY__
 
-REM Bluetooth notifiers library
+#ifndef BTNOTIF_IBY
+#define BTNOTIF_IBY
+
+#include <data_caging_paths_for_iby.hrh>
 
-file=ABI_DIR\BUILD_DIR\btnotif.dll                                      SHARED_LIB_DIR\btnotif.dll
-SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,btnotif)
+#ifdef __BT
 
-ECOM_PLUGIN(btnotifwrapper.dll,101FD68F.rsc)
+file=ABI_DIR/BUILD_DIR/btnotifsrv.exe    SHARED_LIB_DIR/btnotifsrv.exe
+ECOM_PLUGIN( btnotifwrapper.dll, btnotifwrapper.rsc )
 
-#endif
+#endif // __BT
+
+#endif // BTNOTIF_IBY
--- a/bluetoothengine/btui/rom/btui.iby	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/btui/rom/btui.iby	Sun May 02 21:30:11 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -11,26 +11,23 @@
 *
 * Contributors:
 *
-* Description:
+* Description: 
 *
 */
-#ifndef __BTUI_IBY__
-#define __BTUI_IBY__
+#ifndef __BTCPPLUGIN_IBY__
+#define __BTCPPLUGIN_IBY__
 
+#include <data_caging_paths_for_iby.hrh>
+#include <bldvariant.hrh>
 #ifdef __BT
 
-// BTUI Application(EXE)
-//S60_APP_EXE(BtUi)
-//SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,BtUi)
-//S60_APP_AIF_ICONS(BtUi)
-//S60_APP_AIF_RSC(BtUi)
+file=ABI_DIR/BUILD_DIR/btuimodel.dll SHARED_LIB_DIR/btuimodel.dll
+file=ABI_DIR/BUILD_DIR/btuidelegate.dll SHARED_LIB_DIR/btuidelegate.dll
 
-// BTUI Model(DLL)
-//file=ABI_DIR\BUILD_DIR\btdevmodel.dll          SHARED_LIB_DIR\btdevmodel.dll
-
-//ECOM plugin(Ecom DLL)
-// CP plugin API removed. Do not export ECOM_PLUGIN( BtuiPlugin.dll, BtuiPlugin.rsc )
+file=ABI_DIR/BUILD_DIR/btcpplugin.dll SHARED_LIB_DIR/btcpplugin.dll
+data=/epoc32/data/c/resource/qt/plugins/controlpanel/btcpplugin.qtplugin resource/qt/plugins/controlpanel/btcpplugin.qtplugin
 
 #endif //__BT
 
-#endif //__BTUI_IBY__
+#endif  // __BTCPPLUGIN_IBY__
+
--- a/bluetoothengine/group/bld.inf	Wed Apr 28 08:52:24 2010 +0300
+++ b/bluetoothengine/group/bld.inf	Sun May 02 21:30:11 2010 +0300
@@ -19,15 +19,18 @@
 PRJ_PLATFORMS
 DEFAULT
 
+// This is to break cyclic building dependency between these logical components.
+// A better source structure will be implemented in future.
 
+#include "../btnotif/btnotifclient/group/bld.inf"
 #include "../bteng/group/bld.inf"
+#include "../btserviceutil/group/bld.inf"
 #include "../btnotif/group/bld.inf"
 #include "../btaudioman/group/bld.inf"
 #include "../btmac/group/bld.inf"
 #include "../btsac/group/bld.inf"
 #include "../btaudiostreamer/group/bld.inf"
 #include "../btsap/group/bld.inf"
-#include "../btui/group/bld.inf"
 #include "../btpbap/group/bld.inf"
 #include "../bthid/group/bld.inf"
 #include "../btctrldcmoadapter/group/bld.inf"
--- a/btservices_plat/bluetooth_engine_connection_management_api/inc/btengconnman.h	Wed Apr 28 08:52:24 2010 +0300
+++ b/btservices_plat/bluetooth_engine_connection_management_api/inc/btengconnman.h	Sun May 02 21:30:11 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -23,6 +23,7 @@
 #include <btengconstants.h>
 
 class CBTEngConnHandler;
+class CBTEngPairingHandler;
 
 /**
  *  Class MBTEngConnObserver
@@ -449,10 +450,10 @@
     CBTEngConnHandler* iConnHandler;
 
     /**
-     * This field is NOT used. Reserved for future extension.
+     * For handling pairing requests
      * Own.
      */
-    TAny* iReserved;
+    CBTEngPairingHandler* iPairingHandler;
 
     /**
      * Reference to receiver of connection events.
--- a/btservices_plat/bluetooth_secondary_display_notification_api/group/bld.inf	Wed Apr 28 08:52:24 2010 +0300
+++ b/btservices_plat/bluetooth_secondary_display_notification_api/group/bld.inf	Sun May 02 21:30:11 2010 +0300
@@ -24,5 +24,5 @@
 
 PRJ_EXPORTS
 
-../inc/secondarydisplay/BTnotifSecondaryDisplayAPI.h     MW_LAYER_PLATFORM_EXPORT_PATH(secondarydisplay/BTnotifSecondaryDisplayAPI.h)
-../inc/secondarydisplay/BtuiSecondaryDisplayAPI.h     MW_LAYER_PLATFORM_EXPORT_PATH(secondarydisplay/BtuiSecondaryDisplayAPI.h)
+../inc/secondarydisplay/BTnotifSecondaryDisplayAPI.h     MW_LAYER_PLATFORM_EXPORT_PATH(SecondaryDisplay/BTnotifSecondaryDisplayAPI.h)
+../inc/secondarydisplay/BtuiSecondaryDisplayAPI.h     MW_LAYER_PLATFORM_EXPORT_PATH(SecondaryDisplay/BtuiSecondaryDisplayAPI.h)
--- a/cbsatplugin/atmisccmdplugin/rom/atmisccmdplugin.iby	Wed Apr 28 08:52:24 2010 +0300
+++ b/cbsatplugin/atmisccmdplugin/rom/atmisccmdplugin.iby	Sun May 02 21:30:11 2010 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
  * All rights reserved.
  * This component and the accompanying materials are made available
  * under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,6 @@
 #define ATMISCCMDPLUGIN_IBY
 
 ECOM_PLUGIN(atmisccmdplugin.dll, atmisccmdplugin.rsc)
-S60_APP_RESOURCE(atmisccmdpluginresource)
 
 #endif // ATMISCCMDPLUGIN_IBY
 
--- a/layers.sysdef.xml	Wed Apr 28 08:52:24 2010 +0300
+++ b/layers.sysdef.xml	Sun May 02 21:30:11 2010 +0300
@@ -1,14 +1,20 @@
 <?xml version="1.0"?>
-<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_5_1.dtd" [
   <!ENTITY layer_real_source_path "sf/mw/btservices" >
 ]>
 
-<SystemDefinition name="btservices" schema="1.4.0">
+<SystemDefinition name="btservices" schema="1.5.1">
   <systemModel>
     <layer name="mw_layer">
       <module name="btservices">
         <unit unitID="lcdo.btservices" mrp="" bldFile="&layer_real_source_path;/group" name="btservices" />
       </module>
+      <module name="btcpplugin">
+        <unit unitID="lcdo.btservices.btcpplugin" mrp="" bldFile="&layer_real_source_path;/bluetoothengine/btui" name="bluetooth_setting_plugin" proFile="btui.pro" qmakeArgs="" />
+      </module>
+      <module name="btdialog">
+        <unit unitID="lcdo.btservices.btdialog" mrp="" bldFile="&layer_real_source_path;/bluetoothengine/btnotif/btdevicedialogplugin" name="bluetooth_dialogs" proFile="btdevicedialogplugin.pro" qmakeArgs="" />
+      </module>
     </layer>
     <layer name="api_test_layer">
       <module name="btservices_test">
--- a/package_definition.xml	Wed Apr 28 08:52:24 2010 +0300
+++ b/package_definition.xml	Sun May 02 21:30:11 2010 +0300
@@ -5,7 +5,12 @@
       <component id="bteng" filter="s60" name="Bluetooth Engine">
         <unit bldFile="bluetoothengine/bteng/group"/>
       </component>
+      <component id="btserviceutil" filter="s60" name="Bluetooth Service Utility">
+        <unit bldFile="bluetoothengine/btserviceutil/group"/>
+      </component>
       <component id="btnotif" filter="s60" name="Bluetooth Notifier">
+      	<!-- client is separated for breaking cyclic compiling dependencies -->
+        <unit bldFile="bluetoothengine/btnotif/btnotifclient/group"/>
         <unit bldFile="bluetoothengine/btnotif/group"/>
           <!-- is this test needed as unit? -->
         <!-- <unit bldFile="bluetoothengine/btnotif/tsrc/btnotifapitest/group"/> -->