mpxmusicplayer/app/src/mpxappui.cpp
branchRCL_3
changeset 21 a1247965635c
parent 18 c54d95799c80
child 28 56b11cf8addb
equal deleted inserted replaced
18:c54d95799c80 21:a1247965635c
   257 
   257 
   258     //check memory
   258     //check memory
   259 #ifdef FF_OOM_MONITOR2_COMPONENT
   259 #ifdef FF_OOM_MONITOR2_COMPONENT
   260     CheckAvailableMemoryByOomL( KLowestMemoryNeeded );
   260     CheckAvailableMemoryByOomL( KLowestMemoryNeeded );
   261 #else
   261 #else
   262     CheckAvailableMemory( KLowestMemoryNeeded );
   262     CheckAvailableMemoryL( KLowestMemoryNeeded );
   263 #endif    //FF_OOM_MONITOR2_COMPONENT
   263 #endif    //FF_OOM_MONITOR2_COMPONENT
   264 
   264 
   265     if ( !IsEmbedded() )
   265     if ( !IsEmbedded() )
   266         {
   266         {
   267         // Do we support podcasting in music player?
   267         // Do we support podcasting in music player?
   381 //
   381 //
   382 CMPXAppUi::~CMPXAppUi()
   382 CMPXAppUi::~CMPXAppUi()
   383     {
   383     {
   384     MPX_DEBUG1( "-->CMPXAppUi::~CMPXAppUi()" );
   384     MPX_DEBUG1( "-->CMPXAppUi::~CMPXAppUi()" );
   385 #ifdef FF_OOM_MONITOR2_COMPONENT
   385 #ifdef FF_OOM_MONITOR2_COMPONENT
   386     SetMpxOomPriorityL( ROomMonitorSession::EOomPriorityNormal );
   386     TRAP_IGNORE( SetMpxOomPriorityL( ROomMonitorSession::EOomPriorityNormal ) );
   387 #endif //FF_OOM_MONITOR2_COMPONENT
   387 #endif //FF_OOM_MONITOR2_COMPONENT
   388 
   388 
   389     if ( !IsEmbedded() )
   389     if ( !IsEmbedded() )
   390         {
   390         {
   391         CMPXCommonUiHelper::SetStandAloneModePId( 0 );
   391         CMPXCommonUiHelper::SetStandAloneModePId( 0 );
   747 
   747 
   748     switch ( aCommand )
   748     switch ( aCommand )
   749         {
   749         {
   750         case EPbCmdSetVolume:
   750         case EPbCmdSetVolume:
   751             {
   751             {
       
   752             TRAP_IGNORE(
   752             TMPXPlaybackState playerState( EPbStateNotInitialised );
   753             TMPXPlaybackState playerState( EPbStateNotInitialised );
   753             playerState = iPlaybackUtility->StateL();
   754             playerState = iPlaybackUtility->StateL();
   754             if ( !MPXUser::IsCallOngoing( KMPXCallTypeGenericVoice ) ||
   755             if ( !MPXUser::IsCallOngoing( KMPXCallTypeGenericVoice ) ||
   755                 ( playerState == EPbStatePlaying ) ||
   756                 ( playerState == EPbStatePlaying ) ||
   756                 ( playerState == EPbStateSeekingForward ) ||
   757                 ( playerState == EPbStateSeekingForward ) ||
   767                 // or if we're actively playing during call
   768                 // or if we're actively playing during call
   768                 if ( IsForeground() || EPbStatePlaying == playerState || EPbStatePlaying == pdPlayerState )
   769                 if ( IsForeground() || EPbStatePlaying == playerState || EPbStatePlaying == pdPlayerState )
   769                     {
   770                     {
   770 					if ( aData != iCurrentVolume )
   771 					if ( aData != iCurrentVolume )
   771                         {
   772                         {
   772                         SetVolume( aData );
   773                         SetVolumeL( aData );
   773                         }
   774                         }
   774                     // popup volume control even if volume didn't change
   775                     // popup volume control even if volume didn't change
   775                     HandlePopupL( EPbCmdSetVolume );
   776                     HandlePopupL( EPbCmdSetVolume );
   776                     }
   777                     }
   777                 }
   778                 }
       
   779             );
   778             break;
   780             break;
   779             }
   781             }
   780         case EPbCmdMuteVolume:
   782         case EPbCmdMuteVolume:
   781             {
   783             {
       
   784             TRAP_IGNORE(
   782             TMPXPlaybackState playerState( EPbStateNotInitialised );
   785             TMPXPlaybackState playerState( EPbStateNotInitialised );
   783             playerState = iPlaybackUtility->StateL();
   786             playerState = iPlaybackUtility->StateL();
   784             if ( !MPXUser::IsCallOngoing( KMPXCallTypeGenericVoice ) ||
   787             if ( !MPXUser::IsCallOngoing( KMPXCallTypeGenericVoice ) ||
   785                 ( playerState == EPbStatePlaying ) ||
   788                 ( playerState == EPbStatePlaying ) ||
   786                 ( playerState == EPbStateSeekingForward ) ||
   789                 ( playerState == EPbStateSeekingForward ) ||
   794                     }
   797                     }
   795                 // only process command if there no call ongoing
   798                 // only process command if there no call ongoing
   796                 // or if we're actively playing during call
   799                 // or if we're actively playing during call
   797                 if ( IsForeground() || EPbStatePlaying == playerState || EPbStatePlaying == pdPlayerState )
   800                 if ( IsForeground() || EPbStatePlaying == playerState || EPbStatePlaying == pdPlayerState )
   798                     {
   801                     {
   799                     MuteVolume();
   802                     MuteVolumeL();
   800                     HandlePopupL( EPbCmdMuteVolume );
   803                     HandlePopupL( EPbCmdMuteVolume );
   801                     }
   804                     }
   802                 }
   805                 }
       
   806             );
   803             break;
   807             break;
   804             }
   808             }
   805         case EPbCmdUnMuteVolume:
   809         case EPbCmdUnMuteVolume:
   806             {
   810             {
       
   811             TRAP_IGNORE(
   807             TMPXPlaybackState playerState( EPbStateNotInitialised );
   812             TMPXPlaybackState playerState( EPbStateNotInitialised );
   808             playerState = iPlaybackUtility->StateL();
   813             playerState = iPlaybackUtility->StateL();
   809             if ( !MPXUser::IsCallOngoing( KMPXCallTypeGenericVoice ) ||
   814             if ( !MPXUser::IsCallOngoing( KMPXCallTypeGenericVoice ) ||
   810                 ( playerState == EPbStatePlaying ) ||
   815                 ( playerState == EPbStatePlaying ) ||
   811                 ( playerState == EPbStateSeekingForward ) ||
   816                 ( playerState == EPbStateSeekingForward ) ||
   819                     {
   824                     {
   820                     pdPlayerState = iPdParameterHandler->PdStateL();
   825                     pdPlayerState = iPdParameterHandler->PdStateL();
   821                     }
   826                     }
   822                 if ( IsForeground() || EPbStatePlaying == playerState || EPbStatePlaying == pdPlayerState )
   827                 if ( IsForeground() || EPbStatePlaying == playerState || EPbStatePlaying == pdPlayerState )
   823                     {
   828                     {
   824                     UnMuteVolume();
   829                     UnMuteVolumeL();
   825                     HandlePopupL( EPbCmdUnMuteVolume );
   830                     HandlePopupL( EPbCmdUnMuteVolume );
   826                     }
   831                     }
   827                 }
   832                 }
       
   833             );
   828             break;
   834             break;
   829             }
   835             }
   830         default:
   836         default:
   831             {
   837             {
   832             // Dispatches all other commands
   838             // Dispatches all other commands
   836                 {
   842                 {
   837                 // Forward the command to view to handle when
   843                 // Forward the command to view to handle when
   838                 // music is foreground app and not displaying
   844                 // music is foreground app and not displaying
   839                 // dialogs or the options menu
   845                 // dialogs or the options menu
   840                 if ( iView )
   846                 if ( iView )
   841                     {
   847                     {                    
   842                     MPX_DEBUG2( "CMPXAppUi::HandleMediaKeyCommand sending command %d to view", MPXCmdForPbCmd(aCommand) );
   848                     MPX_TRAPD( err, iView->HandleCommandL( MPXCmdForPbCmd(aCommand) ) );
   843                     iView->HandleCommandL( MPXCmdForPbCmd(aCommand) );
   849                     MPX_DEBUG3( "CMPXAppUi::HandleMediaKeyCommand sending command %d to view err%d", MPXCmdForPbCmd(aCommand), err );
   844                     }
   850                     }
   845                 }
   851                 }
   846             else
   852             else
   847                 {
   853                 {
   848                 TMPXPlaybackState playerState( EPbStateNotInitialised );
   854                 TMPXPlaybackState playerState( EPbStateNotInitialised );
   849                 playerState = iPlaybackUtility->StateL();
   855                 MPX_TRAPD( err, playerState = iPlaybackUtility->StateL() );
   850                 if ( foregroundApp && IsDisplayingDialog() )
   856                 if ( foregroundApp && IsDisplayingDialog() )
   851                     {
   857                     {
   852                     // displaying dialog in the foreground
   858                     // displaying dialog in the foreground
   853                     if ( EPbStatePlaying == playerState ||
   859                     if ( EPbStatePlaying == playerState ||
   854                          EPbStatePaused == playerState ||
   860                          EPbStatePaused == playerState ||
   857                          aCommand == EPbCmdPlay ||
   863                          aCommand == EPbCmdPlay ||
   858                          aCommand == EPbCmdPlayPause  )
   864                          aCommand == EPbCmdPlayPause  )
   859                         {
   865                         {
   860                         // In playing/paused state, all media keys are active.
   866                         // In playing/paused state, all media keys are active.
   861                         // Now playing view is not bring to foreground.
   867                         // Now playing view is not bring to foreground.
   862                         // Seeking forward/backwards is also "playing"
   868                         // Seeking forward/backwards is also "playing"                       
   863                         MPX_DEBUG2( "CMPXAppUi::HandleMediaKeyCommand Dialog displaying, sending command %d to DoHandleMediaKeyCommandL", aCommand );
   869                         MPX_TRAP( err, DoHandleMediaKeyCommandL( aCommand ) );
   864                         DoHandleMediaKeyCommandL( aCommand );
   870                         MPX_DEBUG3( "CMPXAppUi::HandleMediaKeyCommand Dialog displaying, sending command %d to DoHandleMediaKeyCommandL err%d", aCommand, err );
   865                         }
   871                         }
   866                     else
   872                     else
   867                         {
   873                         {
   868                         MPX_DEBUG2( "CMPXAppUi::HandleMediaKeyCommand Dialog displaying, inactive state, command %d ignored", aCommand );
   874                         MPX_DEBUG3( "CMPXAppUi::HandleMediaKeyCommand Dialog displaying, inactive state, command %d, err%d ignored", aCommand , err );
   869                         }
   875                         }
   870                     }
   876                     }
   871                 else
   877                 else
   872                     {
   878                     {
   873                     // displaying menu/not foreground, pass to view to handle only play command
   879                     // displaying menu/not foreground, pass to view to handle only play command
   874                     if ( EPbStatePlaying == playerState ||
   880                     if ( EPbStatePlaying == playerState ||
   875                         EPbStatePaused == playerState ||
   881                         EPbStatePaused == playerState ||
   876                         EPbStateSeekingForward == playerState ||
   882                         EPbStateSeekingForward == playerState ||
   877                         EPbStateSeekingBackward == playerState )
   883                         EPbStateSeekingBackward == playerState )
   878                         {
   884                         {
   879                         MPX_DEBUG2( "CMPXAppUi::HandleMediaKeyCommand Menu displaying/not foreground, sending command %d to DoHandleMediaKeyCommandL", aCommand );
   885                         MPX_TRAP( err, DoHandleMediaKeyCommandL( aCommand ) );
   880                         DoHandleMediaKeyCommandL( aCommand );
   886                         MPX_DEBUG3( "CMPXAppUi::HandleMediaKeyCommand Menu displaying/not foreground, sending command %d to DoHandleMediaKeyCommandL err%d", aCommand, err );
   881                         }
   887                         }
   882                     else if ( ( aCommand == EPbCmdPlay || aCommand == EPbCmdPlayPause ) && iView )
   888                     else if ( ( aCommand == EPbCmdPlay || aCommand == EPbCmdPlayPause ) && iView )
   883                         {
   889                         {
   884                         if ( !foregroundApp )
   890                         if ( !foregroundApp )
   885                             {
   891                             {                
   886                             MPX_DEBUG2( "CMPXAppUi::HandleMediaKeyCommand Menu displaying/not foreground, active idle foreground, sending command %d to DoHandleMediaKeyCommandL", aCommand );
       
   887                             // not foreground, play without loading playback view
   892                             // not foreground, play without loading playback view
   888                             DoHandleMediaKeyCommandL( aCommand );
   893                             MPX_TRAP( err, DoHandleMediaKeyCommandL( aCommand ) );
       
   894                             MPX_DEBUG3( "CMPXAppUi::HandleMediaKeyCommand Menu displaying/not foreground, active idle foreground, sending command %d to DoHandleMediaKeyCommandL err%d", aCommand, err );
   889                             }
   895                             }
   890                         else
   896                         else
   891                             {
   897                             {                           
   892                             MPX_DEBUG2( "CMPXAppUi::HandleMediaKeyCommand Menu displaying/not foreground, sending command %d to view", aCommand );
   898                             MPX_TRAP( err, iView->HandleCommandL( MPXCmdForPbCmd(aCommand) ) );
   893                             iView->HandleCommandL( MPXCmdForPbCmd(aCommand) );
   899                             MPX_DEBUG3( "CMPXAppUi::HandleMediaKeyCommand Menu displaying/not foreground, sending command %d to view err%d", aCommand, err );
   894                             }
   900                             }
   895                         }
   901                         }
   896                     else if ( aCommand == EPbCmdPlay || aCommand == EPbCmdPlayPause )
   902                     else if ( aCommand == EPbCmdPlay || aCommand == EPbCmdPlayPause )
   897                         {
   903                         {
   898                         // play command without a view, this case
   904                         // play command without a view, this case
  2010                 }
  2016                 }
  2011 
  2017 
  2012         }
  2018         }
  2013     else if ( op == EMcMsgDiskRemoved )
  2019     else if ( op == EMcMsgDiskRemoved )
  2014         {
  2020         {
  2015         if ( !IsEmbedded() )
  2021         TBool usbDiskRemovalEvent( EFalse );
  2016             {
  2022         if ( (op == EMcMsgDiskRemoved) && iIsUsbOnGoing )
  2017             TBool usbDiskRemovalEvent(EFalse);
  2023             {
  2018             if ( (op == EMcMsgDiskRemoved) && iIsUsbOnGoing )
  2024             usbDiskRemovalEvent = ETrue;
  2019                 {
  2025             }
  2020                 usbDiskRemovalEvent = ETrue;
  2026         else
  2021                 }
  2027             {
  2022             else
  2028             MPX_DEBUG1( "CMPXAppUi::HandleBroadcastMessageL. MMC ejected and the application needs to close." );
  2023                 {
  2029             RunAppShutter();
  2024                 MPX_DEBUG1( "CMPXAppUi::HandleBroadcastMessageL. MMC ejected and the application needs to close." );
  2030             return;
  2025                 RunAppShutter();
  2031             }
  2026 				return;
       
  2027                 }
       
  2028 
  2032 
  2029             CMPXCollectionPath* cPath = iCollectionUtility->Collection().PathL ( );
  2033             CMPXCollectionPath* cPath = iCollectionUtility->Collection().PathL ( );
  2030             CleanupStack::PushL ( cPath );
  2034             CleanupStack::PushL ( cPath );
  2031             if ( cPath->Levels ( )> 1 && !iFormattingOnGoing && !usbDiskRemovalEvent &&
  2035             if ( cPath->Levels ( )> 1 && !iFormattingOnGoing && !usbDiskRemovalEvent &&
  2032                  iCurrentViewType.iUid != KMPXPluginTypePlaybackUid )
  2036                  iCurrentViewType.iUid != KMPXPluginTypePlaybackUid )
  2033                 {
  2037                 {
  2034 
  2038             cPath->Back();
  2035                     cPath->Back ( );
  2039             iCollectionUtility->Collection().OpenL( *cPath );
  2036                     iCollectionUtility->Collection().OpenL ( *cPath );
  2040 
  2037                     
  2041             }
  2038                 }
  2042         CleanupStack::PopAndDestroy( cPath );
  2039             CleanupStack::PopAndDestroy ( cPath );
       
  2040             }
       
  2041         }
  2043         }
  2042     // Re-open the collection view after a refresh
  2044     // Re-open the collection view after a refresh
  2043     // and after album art or metadata dialog or add songs editor dialog closes
  2045     // and after album art or metadata dialog or add songs editor dialog closes
  2044     if (((op == EMcMsgRefreshEnd ) || (op == EMcMsgUSBMassStorageEnd))
  2046     if (((op == EMcMsgRefreshEnd ) || (op == EMcMsgUSBMassStorageEnd))
  2045             && (IsActiveView(KMPXPluginTypeAlbumArtEditorUid)
  2047             && (IsActiveView(KMPXPluginTypeAlbumArtEditorUid)
  3937     else if ( aMessageUid == KNullUid )
  3939     else if ( aMessageUid == KNullUid )
  3938         {
  3940         {
  3939         ASSERT(!IsEmbedded());////browser should not send messages to music player if it is not RootApp.
  3941         ASSERT(!IsEmbedded());////browser should not send messages to music player if it is not RootApp.
  3940         if ( aMessageParameters.Length() )
  3942         if ( aMessageParameters.Length() )
  3941             {
  3943             {
  3942             if ( IsBrowserClosed(aMessageParameters) )
  3944             if ( IsBrowserClosedL(aMessageParameters) )
  3943                 {
  3945                 {
  3944                 if ( iAppStartedByBrowser )
  3946                 if ( iAppStartedByBrowser )
  3945                     {
  3947                     {
  3946                     RunAppShutter();
  3948                     RunAppShutter();
  3947                     return EMessageHandled;
  3949                     return EMessageHandled;
  4014                 iAppStartedByBrowser = ETrue;
  4016                 iAppStartedByBrowser = ETrue;
  4015                 iPdPbvStartedByBrowser = ETrue;
  4017                 iPdPbvStartedByBrowser = ETrue;
  4016                 // Convert param to 8-bit.
  4018                 // Convert param to 8-bit.
  4017                 HBufC8* param8 = HBufC8::NewLC( param.Length() );
  4019                 HBufC8* param8 = HBufC8::NewLC( param.Length() );
  4018                 param8->Des().Copy( param );
  4020                 param8->Des().Copy( param );
  4019                 if ( IsBrowserClosed(*param8) )
  4021                 if ( IsBrowserClosedL(*param8) )
  4020                     {
  4022                     {
  4021                     Exit();
  4023                     Exit();
  4022                     }
  4024                     }
  4023                 else
  4025                 else
  4024                     {
  4026                     {
  4282     {
  4284     {
  4283         RunAppShutter();
  4285         RunAppShutter();
  4284     }
  4286     }
  4285 #ifdef RD_BROWSER_PROGRESSIVE_DOWNLOAD
  4287 #ifdef RD_BROWSER_PROGRESSIVE_DOWNLOAD
  4286 // -----------------------------------------------------------------------------
  4288 // -----------------------------------------------------------------------------
  4287 // CMPXAppUi::IsBrowserClosed
  4289 // CMPXAppUi::IsBrowserClosedL
  4288 // -----------------------------------------------------------------------------
  4290 // -----------------------------------------------------------------------------
  4289 //
  4291 //
  4290 TBool CMPXAppUi::IsBrowserClosed(
  4292 TBool CMPXAppUi::IsBrowserClosedL(
  4291     const TDesC8& aParams )
  4293     const TDesC8& aParams )
  4292     {
  4294     {
  4293     TBool ret(EFalse);
  4295     TBool ret(EFalse);
  4294     CBufFlat* paramBuf = CBufFlat::NewL( /*anExpandSize*/1 );
  4296     CBufFlat* paramBuf = CBufFlat::NewL( /*anExpandSize*/1 );
  4295     CleanupStack::PushL( paramBuf );
  4297     CleanupStack::PushL( paramBuf );
  4351             return ( iStandAlone );
  4353             return ( iStandAlone );
  4352 #endif
  4354 #endif
  4353     }
  4355     }
  4354 
  4356 
  4355 // -----------------------------------------------------------------------------
  4357 // -----------------------------------------------------------------------------
  4356 // CMPXAppUi::SetVolume
  4358 // CMPXAppUi::SetVolumeL
  4357 // -----------------------------------------------------------------------------
  4359 // -----------------------------------------------------------------------------
  4358 //
  4360 //
  4359 void CMPXAppUi::SetVolume( const TInt aVolume )
  4361 void CMPXAppUi::SetVolumeL( const TInt aVolume )
  4360     {
  4362     {
  4361     CMPXCommand* cmd( CMPXCommand::NewL() );
  4363     CMPXCommand* cmd( CMPXCommand::NewL() );
  4362     CleanupStack::PushL( cmd );
  4364     CleanupStack::PushL( cmd );
  4363     cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral );
  4365     cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral );
  4364     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  4366     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  4373     
  4375     
  4374     CleanupStack::PopAndDestroy( cmd );
  4376     CleanupStack::PopAndDestroy( cmd );
  4375     }
  4377     }
  4376 
  4378 
  4377 // -----------------------------------------------------------------------------
  4379 // -----------------------------------------------------------------------------
  4378 // CMPXAppUi::MuteVolume
  4380 // CMPXAppUi::MuteVolumeL
  4379 // -----------------------------------------------------------------------------
  4381 // -----------------------------------------------------------------------------
  4380 //
  4382 //
  4381 void CMPXAppUi::MuteVolume()
  4383 void CMPXAppUi::MuteVolumeL()
  4382     {
  4384     {
  4383     CMPXCommand* cmd( CMPXCommand::NewL() );
  4385     CMPXCommand* cmd( CMPXCommand::NewL() );
  4384     CleanupStack::PushL( cmd );
  4386     CleanupStack::PushL( cmd );
  4385     cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral );
  4387     cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral );
  4386     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  4388     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  4394     
  4396     
  4395     CleanupStack::PopAndDestroy( cmd );
  4397     CleanupStack::PopAndDestroy( cmd );
  4396     }
  4398     }
  4397 
  4399 
  4398 // -----------------------------------------------------------------------------
  4400 // -----------------------------------------------------------------------------
  4399 // CMPXAppUi::UnMuteVolume
  4401 // CMPXAppUi::UnMuteVolumeL
  4400 // -----------------------------------------------------------------------------
  4402 // -----------------------------------------------------------------------------
  4401 //
  4403 //
  4402 void CMPXAppUi::UnMuteVolume()
  4404 void CMPXAppUi::UnMuteVolumeL()
  4403     {
  4405     {
  4404     CMPXCommand* cmd( CMPXCommand::NewL() );
  4406     CMPXCommand* cmd( CMPXCommand::NewL() );
  4405     CleanupStack::PushL( cmd );
  4407     CleanupStack::PushL( cmd );
  4406     cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral );
  4408     cmd->SetTObjectValueL<TInt>( KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral );
  4407     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  4409     cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
  4480         }
  4482         }
  4481     return cmd;
  4483     return cmd;
  4482     }
  4484     }
  4483 
  4485 
  4484 // -----------------------------------------------------------------------------
  4486 // -----------------------------------------------------------------------------
  4485 // CMPXAppUi::CheckAvailableMemory
  4487 // CMPXAppUi::CheckAvailableMemoryL
  4486 // -----------------------------------------------------------------------------
  4488 // -----------------------------------------------------------------------------
  4487 //
  4489 //
  4488 void CMPXAppUi::CheckAvailableMemory( TInt aNeedMemory )
  4490 void CMPXAppUi::CheckAvailableMemoryL( TInt aNeedMemory )
  4489     {
  4491     {
  4490     TMemoryInfoV1Buf info;
  4492     TMemoryInfoV1Buf info;
  4491     UserHal::MemoryInfo(info);
  4493     UserHal::MemoryInfo(info);
  4492     if( info().iFreeRamInBytes < aNeedMemory )
  4494     if( info().iFreeRamInBytes < aNeedMemory )
  4493         {
  4495         {