usbclasses/usbmscpersonality/src/CUsbActiveMscHandlerMdrv.cpp
branchRCL_3
changeset 20 a15c582fbf97
parent 3 47c263f7e521
child 63 ef2686f7597e
child 89 3592750162a5
--- a/usbclasses/usbmscpersonality/src/CUsbActiveMscHandlerMdrv.cpp	Fri Feb 19 23:50:33 2010 +0200
+++ b/usbclasses/usbmscpersonality/src/CUsbActiveMscHandlerMdrv.cpp	Fri Mar 12 15:48:40 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2008 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"
@@ -47,7 +47,9 @@
 // ----------------------------------------------------------------------------
 //
 CUsbActiveMscHandler::CUsbActiveMscHandler(TUsbPersonalityParams& aPersonalityParams)
-    : CUsbPersonalityPlugin(aPersonalityParams), iMountChanged(EFalse)
+    : CUsbPersonalityPlugin(aPersonalityParams), 
+      iMountChanged(EFalse),
+      iIsQueryNoteShown(EFalse)
     {
     CActiveScheduler::Add( this );
     }
@@ -256,9 +258,13 @@
         
     RemoveMassStorageFileSystem();
 
-    // Remove all queries shown by this personality
-    iPersonalityParams.PersonalityNotifier().CancelQuery(KQueriesNotifier);
-
+    if (iIsQueryNoteShown)
+        {
+        // Remove all queries shown by this personality
+        iPersonalityParams.PersonalityNotifier().CancelQuery(KQueriesNotifier);
+        iIsQueryNoteShown = EFalse;
+        }
+        
     iMscState = EUsbMscStateIdle;
 
     iRequestStatus = &aStatus;
@@ -295,6 +301,7 @@
                     {
                     if ( GlobalSystemState() == EUsbGSStateCategoryNormal )
                         {
+                        iIsQueryNoteShown = ETrue;
                         // if the error is something abnormal, note still needs to be shown
                         iQueryParams().iQuery = EUSBStorageMediaFailure;
                         iPersonalityParams.PersonalityNotifier().ShowQuery(
@@ -491,6 +498,7 @@
         {
         FLOG( _L( "[USBWATCHER]\tCUsbActiveMscHandler::GetDrives: No removable drives found." ) );
 
+        iIsQueryNoteShown = ETrue;
         iQueryParams().iQuery = EUSBStorageMediaFailure;
         iPersonalityParams.PersonalityNotifier().ShowQuery(KQueriesNotifier, iQueryParams, iDummy);