coreapplicationuis/SysAp/Src/sysapremconobserver.cpp
branchRCL_3
changeset 63 c2c61fdca848
parent 62 924385140d98
child 82 4610cd70c542
--- a/coreapplicationuis/SysAp/Src/sysapremconobserver.cpp	Tue Aug 31 15:24:25 2010 +0300
+++ b/coreapplicationuis/SysAp/Src/sysapremconobserver.cpp	Wed Sep 01 12:24:48 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007-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"
@@ -19,7 +19,7 @@
 // INCLUDE FILES
 #include <remconcoreapitarget.h>
 #include <remconinterfaceselector.h>
-//#include <aknconsts.h>
+#include <aknconsts.h>
 #include "sysapremconobserver.h"
 #include "SysApAppUi.h"
 
@@ -47,12 +47,6 @@
 void CSysApRemConObserver::ConstructL()
     {
     TRACES( RDebug::Print( _L("CSysApRemConObserver::ConstructL") ) );  
-    
-    iInterfaceSelector = CRemConInterfaceSelector::NewL();
-    
-    iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
-    
-    iInterfaceSelector->OpenTargetL();
     }
 
 // -----------------------------------------------------------------------------
@@ -81,7 +75,6 @@
 CSysApRemConObserver::~CSysApRemConObserver()
     {
     TRACES( RDebug::Print( _L("CSysApRemConObserver::~CSysApRemConObserver") ) );
-    delete iInterfaceSelector; // Internally deletes iCoreTarget 
     }
     
 // -----------------------------------------------------------------------------
@@ -112,4 +105,31 @@
 	    }
 	}
 
+/**
+ * Reserve the volume keys
+ */
+void CSysApRemConObserver::StartRemconInterfaceL()
+    {
+    TRACES( RDebug::Print( _L("CSysApRemConObserver::BlockKeys")));
+    if(!iInterfaceSelector)
+        {
+        iInterfaceSelector = CRemConInterfaceSelector::NewL();
+        iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
+        iInterfaceSelector->OpenTargetL();
+        }
+    }
+
+/**
+ * Release the volume keys for other application like phone app during call
+ */
+void CSysApRemConObserver::StopRemconInterface()
+    {
+    TRACES( RDebug::Print( _L("CSysApRemConObserver::UnBlockKeys")));
+    if(iInterfaceSelector)
+        {
+        delete iInterfaceSelector;
+        iInterfaceSelector = NULL;
+        }
+    }
+
 //  End of File