musichomescreen_multiview/musicplayeractionhandlerplugin/src/musicplayeractionhandler.cpp
changeset 2 b70d77332e66
parent 0 ff3acec5bc43
child 12 171e07ac910f
--- a/musichomescreen_multiview/musicplayeractionhandlerplugin/src/musicplayeractionhandler.cpp	Thu Jan 07 12:45:53 2010 +0200
+++ b/musichomescreen_multiview/musicplayeractionhandlerplugin/src/musicplayeractionhandler.cpp	Mon Jan 18 20:18:06 2010 +0200
@@ -67,7 +67,7 @@
     MPX_DEBUG1("-->CMusicPlayerActionHandler::ConstructL()");
     
     //iPlaybackUtility = MMPXPlaybackUtility::UtilityL( KPbModeActivePlayer );
-    iPlaybackUtility = MMPXPlaybackUtility::NewL( KMusicPlayerAppUid);
+    //iPlaybackUtility = MMPXPlaybackUtility::NewL( KMusicPlayerAppUid);
 
     MPX_DEBUG1("<--CMusicPlayerActionHandler::ConstructL()");
     }
@@ -122,6 +122,10 @@
     errCode = ExtractVariantL( aMap, variant, KCommand );
     if ( errCode == KErrNone )
         {
+        if ( !iPlaybackUtility ) // Ensure that the utility exists
+            {
+            iPlaybackUtility = MMPXPlaybackUtility::NewL( KMusicPlayerAppUid);
+            }	
         TMPXPlaybackCommand Command;
         Command = static_cast<TMPXPlaybackCommand>( variant.AsTInt32() );
         iPlaybackUtility->CommandL( Command );