commonuis/CommonDialogs/src/CAknMemorySelectionEventHandler.cpp
changeset 0 2f259fa3e83a
child 14 3320e4e6e8bb
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <AknQueryDialog.h>
       
    20 #include <aknnotewrappers.h>
       
    21 #include <commondialogs.rsg>
       
    22 #include <aknmemorycarddialog.h>
       
    23 #include <pathinfo.h> //PathInfo
       
    24 #include <e32property.h>
       
    25 #include <rsfwmountman.h>
       
    26 
       
    27 #include "CAknMemorySelectionEventHandler.h"
       
    28 #include "CAknMemorySelectionDialog.h"
       
    29 #include "MAknMemorySelectionObserver.h"
       
    30 #include "maknmemoryselectiondriveobserver.h"
       
    31 #include "maknmemoryselectionmodel.h"
       
    32 //#include "CAknMemorySelectionModel.h"
       
    33 #include "AknCFDUtility.h"
       
    34 
       
    35 // CActiveDriveMonitor for monitoring drive adding or removing.
       
    36 NONSHARABLE_CLASS(CActiveDriveMonitor) : public CActive,
       
    37                                          public MAknMemoryCardDialogObserver
       
    38     {
       
    39 
       
    40 public:
       
    41 
       
    42     /**
       
    43      * Implement this method to be notified when the memory card
       
    44      * unlock operation is complete. aResult contains the result
       
    45      * of the unlock operation:-
       
    46      *
       
    47      * - KErrNone on success
       
    48      * - KErrCancel if the dialog has been canceled
       
    49      * - Any other standard system error codes, see SDK for details
       
    50      */
       
    51     void UnlockComplete(TInt aResult)
       
    52         {
       
    53         iRet = aResult;
       
    54         if ( iWait.IsStarted() )
       
    55             {
       
    56             iWait.AsyncStop();
       
    57             }
       
    58         }
       
    59 
       
    60     void Start()
       
    61         {
       
    62         iRet = 0;
       
    63         iWait.Start();
       
    64         }
       
    65 
       
    66     CActiveDriveMonitor( MAknMemorySelectionModel* aModel );
       
    67 
       
    68     ~CActiveDriveMonitor()
       
    69         {
       
    70         Cancel();
       
    71         delete iDptr; // cancels request if still active
       
    72         CAknEnv::StopSchedulerWaitWithBusyMessage(iWait);
       
    73         }
       
    74 
       
    75     /**
       
    76      * Start ActiveObject to listen if a drive is added/removed.
       
    77      */
       
    78     void StartMonitoring(
       
    79         MAknMemorySelectionDriveObserver* aObserver );
       
    80 
       
    81     TBool IsStarted() const
       
    82         {
       
    83         return iWait.IsStarted();
       
    84         }
       
    85 
       
    86 private:
       
    87     
       
    88     /**
       
    89      * Sets file system event
       
    90      * @since s60 5.0
       
    91      */
       
    92     void Setup();
       
    93     
       
    94 protected:
       
    95 
       
    96 // from base class CActive
       
    97 
       
    98     /**
       
    99      * From CActive
       
   100      */
       
   101     void RunL();
       
   102 
       
   103     /**
       
   104      * From CActive
       
   105      */
       
   106     void DoCancel();
       
   107 
       
   108 public: // Data
       
   109 
       
   110     CAknMemoryCardDialog* iDptr;
       
   111     CActiveSchedulerWait iWait;
       
   112     TInt iRet;
       
   113 
       
   114     // Ref: Model
       
   115     MAknMemorySelectionModel* iModel;
       
   116 
       
   117     // Ref: object needed to be notified about drive insertion/deletion
       
   118     MAknMemorySelectionDriveObserver* iObserver; // not own
       
   119     };
       
   120 
       
   121 // CActiveRemotePropertySubscriber for listening if remote drive is connected.
       
   122 NONSHARABLE_CLASS(CActiveRemotePropertySubscriber) : public CActive
       
   123     {
       
   124 public:
       
   125 
       
   126     /**
       
   127      * NewL function
       
   128      */
       
   129     static CActiveRemotePropertySubscriber* NewL(
       
   130         MAknMemorySelectionModel* aModel );
       
   131 
       
   132     /**
       
   133      * Destructor
       
   134      */
       
   135     ~CActiveRemotePropertySubscriber()
       
   136         {
       
   137         Cancel();
       
   138         iProperty.Close();
       
   139         }
       
   140 
       
   141     /**
       
   142      * Start ActiveObject to listen if remote drive is connected.
       
   143      */
       
   144     void Subscribe( MAknMemorySelectionDriveObserver* aObserver );
       
   145     
       
   146     
       
   147 protected:
       
   148 
       
   149 // from base class CActive
       
   150 
       
   151     /**
       
   152      * From CActive
       
   153      */
       
   154     void RunL();
       
   155 
       
   156     /**
       
   157      * From CActive
       
   158      */
       
   159     void DoCancel();
       
   160 
       
   161 private:
       
   162     /**
       
   163      * C++ Constructor.
       
   164      */
       
   165     CActiveRemotePropertySubscriber( MAknMemorySelectionModel* aModel );
       
   166     
       
   167     /**
       
   168      * ConstructL function
       
   169      */
       
   170     void ConstructL();
       
   171     
       
   172     /**
       
   173      * Start ActiveObject
       
   174      */
       
   175     void Setup();
       
   176     
       
   177 private: // Data
       
   178 
       
   179     // Ref: Model
       
   180     MAknMemorySelectionModel* iModel;
       
   181 
       
   182     // Ref: object needed to be notified
       
   183     //      about remote drive connection/disconnection
       
   184     MAknMemorySelectionDriveObserver* iObserver; // not own
       
   185     
       
   186     // Own: PS handle
       
   187     RProperty iProperty;
       
   188     };
       
   189 
       
   190 // ============================ MEMBER FUNCTIONS ===============================
       
   191 // CActiveDriveMonitor
       
   192 
       
   193 // -----------------------------------------------------------------------------
       
   194 // C++ constructor
       
   195 // -----------------------------------------------------------------------------
       
   196 //
       
   197 CActiveDriveMonitor::CActiveDriveMonitor( MAknMemorySelectionModel* aModel )
       
   198     :CActive( EPriorityStandard ),
       
   199      iModel( aModel )
       
   200     {
       
   201     CActiveScheduler::Add( this );
       
   202     }
       
   203 
       
   204 // ---------------------------------------------------------------------------
       
   205 // CActiveDriveMonitor::StartMonitoring
       
   206 //
       
   207 // ---------------------------------------------------------------------------
       
   208 //
       
   209 void CActiveDriveMonitor::StartMonitoring(
       
   210         MAknMemorySelectionDriveObserver* aObserver )
       
   211     {
       
   212     iObserver = aObserver;
       
   213     
       
   214     Setup();
       
   215     }
       
   216 
       
   217 // ---------------------------------------------------------------------------
       
   218 // CActiveDriveMonitor::Setup
       
   219 //
       
   220 // ---------------------------------------------------------------------------
       
   221 //
       
   222 void CActiveDriveMonitor::Setup()
       
   223     {
       
   224     if ( !IsActive() )
       
   225         {
       
   226         CEikonEnv::Static()->FsSession().NotifyChange( ENotifyDisk, iStatus );
       
   227         SetActive();
       
   228         }
       
   229     }
       
   230 
       
   231 // ---------------------------------------------------------------------------
       
   232 // CActiveDriveMonitor::RunL
       
   233 //
       
   234 // -----------------------------------------------------------------------------
       
   235 //
       
   236 void CActiveDriveMonitor::RunL()
       
   237     {
       
   238     TInt status = iStatus.Int();
       
   239     Setup();
       
   240     
       
   241     if ( ( status == KErrNone ) && ( iObserver != NULL ) )
       
   242         {
       
   243         // Update data arrays in model
       
   244         iModel->UpdateDataArraysL();
       
   245         // Update memory names in model
       
   246         iModel->UpdateItemsL();
       
   247         // Notify observer memory card insertion
       
   248         iObserver->NotifyDrivesChangedL( iModel );
       
   249         }
       
   250     }
       
   251 
       
   252 // -----------------------------------------------------------------------------
       
   253 // CActiveDriveMonitor::DoCancel
       
   254 //
       
   255 // -----------------------------------------------------------------------------
       
   256 //
       
   257 void CActiveDriveMonitor::DoCancel()
       
   258     {
       
   259     CEikonEnv::Static()->FsSession().NotifyChangeCancel();
       
   260     iObserver = NULL;
       
   261     }
       
   262 
       
   263 
       
   264 // ============================ MEMBER FUNCTIONS ===============================
       
   265 // CActiveRemotePropertySubscriber
       
   266 
       
   267 // -----------------------------------------------------------------------------
       
   268 // CActiveRemotePropertySubscriber::NewL
       
   269 // -----------------------------------------------------------------------------
       
   270 //
       
   271 CActiveRemotePropertySubscriber* CActiveRemotePropertySubscriber::NewL(
       
   272     MAknMemorySelectionModel* aModel )
       
   273     {
       
   274     CActiveRemotePropertySubscriber* self =
       
   275         new ( ELeave ) CActiveRemotePropertySubscriber( aModel );
       
   276     CleanupStack::PushL( self );
       
   277     self->ConstructL();
       
   278     CleanupStack::Pop( self );
       
   279     return self;
       
   280     }
       
   281 
       
   282 // -----------------------------------------------------------------------------
       
   283 // CActiveRemotePropertySubscriber::Subscribe
       
   284 // -----------------------------------------------------------------------------
       
   285 //
       
   286 void CActiveRemotePropertySubscriber::Subscribe(
       
   287         MAknMemorySelectionDriveObserver* aObserver )
       
   288     {
       
   289     iObserver = aObserver;
       
   290     
       
   291     Setup();
       
   292     }
       
   293 
       
   294 // -----------------------------------------------------------------------------
       
   295 // CActiveRemotePropertySubscriber::Setup
       
   296 // -----------------------------------------------------------------------------
       
   297 //
       
   298 void CActiveRemotePropertySubscriber::Setup()
       
   299     {
       
   300     if ( !IsActive() )
       
   301         {
       
   302         iProperty.Subscribe( iStatus );
       
   303         
       
   304         SetActive();
       
   305         }
       
   306     }
       
   307 
       
   308 // -----------------------------------------------------------------------------
       
   309 // C++ constructor
       
   310 // -----------------------------------------------------------------------------
       
   311 //
       
   312 CActiveRemotePropertySubscriber::CActiveRemotePropertySubscriber(
       
   313     MAknMemorySelectionModel* aModel )
       
   314     :CActive( EPriorityStandard ),
       
   315      iModel( aModel )
       
   316     {
       
   317     }
       
   318 
       
   319 // -----------------------------------------------------------------------------
       
   320 // CActiveRemotePropertySubscriber::ConstructL
       
   321 // -----------------------------------------------------------------------------
       
   322 //
       
   323 void CActiveRemotePropertySubscriber::ConstructL()
       
   324     {
       
   325     CActiveScheduler::Add(this);
       
   326     User::LeaveIfError(
       
   327         iProperty.Attach( KRfeServerSecureUid, ERsfwPSKeyConnect ) );
       
   328     }
       
   329 
       
   330 // ---------------------------------------------------------------------------
       
   331 // CActiveRemotePropertySubscriber::RunL
       
   332 //
       
   333 // -----------------------------------------------------------------------------
       
   334 //
       
   335 void CActiveRemotePropertySubscriber::RunL()
       
   336     {
       
   337     TInt statusValue = iStatus.Int();
       
   338     Setup();
       
   339     
       
   340     if ( ( statusValue == KErrNone ) && ( iObserver != NULL ) )
       
   341         {
       
   342         // Update memory names in model
       
   343         iModel->UpdateItemsL();
       
   344         // Notify observer memory card insertion
       
   345         iObserver->NotifyDrivesChangedL( iModel );
       
   346         }
       
   347     }
       
   348 
       
   349 // -----------------------------------------------------------------------------
       
   350 // CActiveRemotePropertySubscriber::DoCancel
       
   351 //
       
   352 // -----------------------------------------------------------------------------
       
   353 //
       
   354 void CActiveRemotePropertySubscriber::DoCancel()
       
   355     {
       
   356     iProperty.Cancel();
       
   357     iObserver = NULL;
       
   358     }
       
   359 
       
   360 
       
   361 // ============================ MEMBER FUNCTIONS ===============================
       
   362 // CAknMemorySelectionEventHandler
       
   363 // -----------------------------------------------------------------------------
       
   364 // CAknMemorySelectionEventHandler::CAknMemorySelectionEventHandler
       
   365 //
       
   366 //
       
   367 // -----------------------------------------------------------------------------
       
   368 //
       
   369 CAknMemorySelectionEventHandler::CAknMemorySelectionEventHandler(
       
   370     CCoeEnv* aCoeEnv,
       
   371     MAknMemorySelectionModel* aModel,
       
   372     MAknMemorySelectionObserver* aObserver )
       
   373     :   iCoeEnv( aCoeEnv ),
       
   374         iModel( aModel ),
       
   375         iObserver( aObserver ),
       
   376         iCanceledAllActions( EFalse )
       
   377     {
       
   378     }
       
   379 
       
   380 // -----------------------------------------------------------------------------
       
   381 // CAknMemorySelectionEventHandler::ConstructL
       
   382 //
       
   383 // -----------------------------------------------------------------------------
       
   384 //
       
   385 void CAknMemorySelectionEventHandler::ConstructL()
       
   386     {
       
   387     iDriveMonitor = new ( ELeave ) CActiveDriveMonitor( iModel );
       
   388     iRemotePropertySubscriber = CActiveRemotePropertySubscriber::NewL( iModel );
       
   389     }
       
   390 
       
   391 // -----------------------------------------------------------------------------
       
   392 // CAknMemorySelectionEventHandler::NewL
       
   393 //
       
   394 // -----------------------------------------------------------------------------
       
   395 //
       
   396 CAknMemorySelectionEventHandler* CAknMemorySelectionEventHandler::NewL(
       
   397     CCoeEnv* aCoeEnv,
       
   398     MAknMemorySelectionModel* aModel,
       
   399     MAknMemorySelectionObserver* aObserver )
       
   400     {
       
   401     CAknMemorySelectionEventHandler* self =
       
   402         new( ELeave ) CAknMemorySelectionEventHandler(
       
   403             aCoeEnv, aModel, aObserver );
       
   404     CleanupStack::PushL( self );
       
   405     self->ConstructL();
       
   406     CleanupStack::Pop();
       
   407     return self;
       
   408     }
       
   409 
       
   410 // Destructor
       
   411 CAknMemorySelectionEventHandler::~CAknMemorySelectionEventHandler()
       
   412     {
       
   413     if( iDriveMonitor )
       
   414         {
       
   415         iDriveMonitor->Cancel();
       
   416         delete iDriveMonitor;
       
   417         iDriveMonitor = NULL;
       
   418         }
       
   419 
       
   420     if ( iRemotePropertySubscriber )
       
   421         {
       
   422         iRemotePropertySubscriber->Cancel();
       
   423         delete iRemotePropertySubscriber;
       
   424         iRemotePropertySubscriber = NULL;
       
   425         }
       
   426     }
       
   427 
       
   428 
       
   429 // -----------------------------------------------------------------------------
       
   430 // CAknMemorySelectionEventHandler::ShowSimplePwdQueryL
       
   431 //
       
   432 //
       
   433 // -----------------------------------------------------------------------------
       
   434 //
       
   435 TInt CAknMemorySelectionEventHandler::ShowSimplePwdQueryL( TDes& aPwd, TInt aResourceId ) const
       
   436     {
       
   437     HBufC* dlgText = iCoeEnv->AllocReadResourceLC( aResourceId );
       
   438     CAknTextQueryDialog* pwdDlg = CAknTextQueryDialog::NewL( aPwd );
       
   439     TInt ret( pwdDlg->ExecuteLD( R_CFD_PASSWORD_QUERY_DIALOG, *dlgText ) );
       
   440     CleanupStack::PopAndDestroy( ); // dlgText
       
   441     return ret;
       
   442     }
       
   443 
       
   444 // -----------------------------------------------------------------------------
       
   445 // CAknMemorySelectionEventHandler::ConvertCharsToPwd
       
   446 //
       
   447 //
       
   448 // -----------------------------------------------------------------------------
       
   449 //
       
   450 void CAknMemorySelectionEventHandler::ConvertCharsToPwd( TDesC& aWord, TDes8& aConverted ) const
       
   451     {
       
   452     // Make sure the target password is empty
       
   453     aConverted.FillZ( aConverted.MaxLength() );
       
   454     aConverted.Zero();
       
   455     if( aWord.Length() )
       
   456         {
       
   457         // Copy the pwd as raw data
       
   458         aConverted.Copy( ( TUint8* ) ( &aWord[ 0 ] ), aWord.Size() );
       
   459         }
       
   460     }
       
   461 
       
   462 // -----------------------------------------------------------------------------
       
   463 // CAknMemorySelectionEventHandler::UnlockMMC
       
   464 //
       
   465 //
       
   466 // -----------------------------------------------------------------------------
       
   467 //
       
   468 TBool CAknMemorySelectionEventHandler::UnlockMMC( TMediaPassword& aPswd ) const
       
   469     {
       
   470     // This functions is not used, so why put it here?
       
   471     RFs& fs = iCoeEnv->FsSession();
       
   472     return fs.UnlockDrive( EDriveE, aPswd, ETrue ) == KErrNone;
       
   473     }
       
   474 
       
   475 // -----------------------------------------------------------------------------
       
   476 // CAknMemorySelectionEventHandler::TryToUnlockDriveL
       
   477 //
       
   478 //
       
   479 // -----------------------------------------------------------------------------
       
   480 //
       
   481 TBool CAknMemorySelectionEventHandler::TryToUnlockDriveL(
       
   482     TDriveNumber aDrive )
       
   483     {
       
   484     iDriveMonitor->iDptr = CAknMemoryCardDialog::NewLC( iDriveMonitor );
       
   485     iDriveMonitor->iDptr->SetSelfPointer( &( iDriveMonitor->iDptr ) );
       
   486     iDriveMonitor->iDptr->UnlockCardLD( aDrive, ETrue );
       
   487     iDriveMonitor->Start();
       
   488 
       
   489     iDriveMonitor->iDptr = NULL;
       
   490     return (iDriveMonitor->iRet == KErrNone);
       
   491     }
       
   492 
       
   493 // -----------------------------------------------------------------------------
       
   494 // CAknMemorySelectionEventHandler::HandleEventL
       
   495 //
       
   496 //
       
   497 // -----------------------------------------------------------------------------
       
   498 //
       
   499 MAknCommonDialogsEventObserver::TAction
       
   500     CAknMemorySelectionEventHandler::HandleEventL(
       
   501         TEvent aEvent,
       
   502         TInt& aFocusedItemIndex,
       
   503         TInt& /* aTopItemIndex */,
       
   504         CEikButtonGroupContainer* aContainer )
       
   505     {
       
   506     if ( aEvent == ECancelAllActions )
       
   507         {
       
   508         iCanceledAllActions = ETrue;
       
   509         
       
   510         if ( iDriveMonitor->iDptr )
       
   511             {
       
   512             delete iDriveMonitor->iDptr; // eventually stops the activeschedulerwait
       
   513             iDriveMonitor->iDptr = NULL;
       
   514             return MAknCommonDialogsEventObserver::ECanceled;
       
   515             }
       
   516         else
       
   517             {
       
   518             return MAknCommonDialogsEventObserver::EDidNothing;
       
   519             }
       
   520         }
       
   521     // Check status of the highlighted drive
       
   522     TBuf<KMaxPath> selectedPath;
       
   523     iModel->GetDrive( aFocusedItemIndex, selectedPath );
       
   524     TDriveNumber driveNumber(
       
   525         TDriveNumber( AknCFDUtility::DriveNumber( selectedPath ) ) );
       
   526     TCFDDriveStatus driveStatus =
       
   527         AknCFDUtility::DriveStatusL( driveNumber );
       
   528 
       
   529     // Return do nothing by default
       
   530     MAknCommonDialogsEventObserver::TAction
       
   531         action( MAknCommonDialogsEventObserver::EDidNothing );
       
   532 
       
   533     switch( aEvent )
       
   534         {
       
   535         case ESelectionKeyPress:
       
   536         case ELeftSoftkeyPress:
       
   537         case EEventClicked:
       
   538             {
       
   539             /*
       
   540             if( aFocusedItemIndex == CAknMemorySelectionDialog::EPhoneMemory )
       
   541                 {
       
   542                 // Phone memory can be always selected
       
   543                 action = MAknCommonDialogsEventObserver::ETryingToExit;
       
   544                 }
       
   545             else // Current item is memory card
       
   546             */
       
   547             if ( driveStatus == EDriveOK )
       
   548                 {
       
   549                 // Drive can be selected
       
   550                 action = MAknCommonDialogsEventObserver::ETryingToExit;
       
   551                 }
       
   552             else if( driveStatus == EDriveNotReady )
       
   553                 {
       
   554                 if ( aContainer )
       
   555                     {
       
   556     	            aContainer->MakeCommandVisible(
       
   557 	                    aContainer->ButtonGroup()->CommandId( 0 ),
       
   558 	                    EFalse );
       
   559 	                aContainer->MakeCommandVisibleByPosition(
       
   560 	                    CEikButtonGroupContainer::EMiddleSoftkeyPosition,
       
   561 	                    EFalse );
       
   562                     }
       
   563                 break;
       
   564                 }
       
   565             else if( driveStatus == EDriveLocked )
       
   566                 {
       
   567                 // Memory card is locked because only MMC could be locked.
       
   568                 if ( !iDriveMonitor->IsStarted() )
       
   569                     {
       
   570                     if( TryToUnlockDriveL( driveNumber ) )
       
   571                         {
       
   572                         action = MAknCommonDialogsEventObserver::ETryingToExit;
       
   573                         }
       
   574                     else if( iCanceledAllActions )
       
   575                         {
       
   576                         action = MAknCommonDialogsEventObserver::ECanceled;
       
   577                         }                    
       
   578                     }
       
   579                 }
       
   580             break;
       
   581             }
       
   582         case ERightSoftkeyPress:
       
   583             {
       
   584             action = MAknCommonDialogsEventObserver::ETryingToExit;
       
   585             break;
       
   586             }
       
   587         case EFocusChange:
       
   588             {
       
   589             // Solve what left softkey should be
       
   590             TBool softkeyShouldBeVisible( ETrue );
       
   591             if( driveStatus == EDriveNotReady )
       
   592                 {
       
   593                 softkeyShouldBeVisible = EFalse;
       
   594                 }
       
   595             aContainer->MakeCommandVisible(
       
   596                 aContainer->ButtonGroup()->CommandId( 0 ),
       
   597                 softkeyShouldBeVisible );
       
   598             aContainer->MakeCommandVisibleByPosition(
       
   599                 CEikButtonGroupContainer::EMiddleSoftkeyPosition,
       
   600                 softkeyShouldBeVisible );
       
   601             break;
       
   602             }
       
   603         default:
       
   604             {
       
   605             break;
       
   606             }
       
   607         }
       
   608     // If the item is about to be selected
       
   609     if( action == MAknCommonDialogsEventObserver::ETryingToExit &&
       
   610         aEvent != MAknCommonDialogsEventObserver::ERightSoftkeyPress )
       
   611         {
       
   612         if( iObserver ) // If the memory selection observer is set
       
   613             {           // ask it's permission to leave from memory selection
       
   614             if( !iObserver->OkToExitL(
       
   615                 CAknMemorySelectionDialog::TMemory( aFocusedItemIndex ) ) )
       
   616                 {
       
   617                 action = MAknCommonDialogsEventObserver::EDidNothing;
       
   618                 }
       
   619             }
       
   620         }
       
   621     return action;
       
   622     }
       
   623 
       
   624 // -----------------------------------------------------------------------------
       
   625 // CAknMemorySelectionEventHandler::StartNotifyDisk
       
   626 //
       
   627 //
       
   628 // -----------------------------------------------------------------------------
       
   629 //
       
   630 void CAknMemorySelectionEventHandler::StartNotifyDisk(
       
   631         MAknMemorySelectionDriveObserver* aObserver, TBool aHasRemoteDrive )
       
   632     {
       
   633     iDriveMonitor->StartMonitoring( aObserver );
       
   634     if ( aHasRemoteDrive )
       
   635         {
       
   636         iRemotePropertySubscriber->Subscribe( aObserver );
       
   637         }
       
   638     }
       
   639 
       
   640 // -----------------------------------------------------------------------------
       
   641 // CAknMemorySelectionEventHandler::StopNotifyDisk
       
   642 //
       
   643 //
       
   644 // -----------------------------------------------------------------------------
       
   645 //
       
   646 void CAknMemorySelectionEventHandler::StopNotifyDisk()
       
   647     {
       
   648     iDriveMonitor->Cancel();
       
   649     iRemotePropertySubscriber->Cancel();
       
   650     }
       
   651 //End
       
   652