diff -r 703a2b94c06c -r dde4619868dc usbengines/usbwatcher/src/cusbwatchersession.cpp --- a/usbengines/usbwatcher/src/cusbwatchersession.cpp Wed Sep 15 13:20:24 2010 +0300 +++ b/usbengines/usbwatcher/src/cusbwatchersession.cpp Wed Oct 13 15:41:46 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2009 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" @@ -159,6 +159,9 @@ aComplete = EFalse; iSetPersonalityOutstanding = ETrue; + //Set force parameter to this session. + SetAskOnConnectionSuppression( aMessage.Int1() ); + iUsbWatcherServer->Watcher().SetPersonality( aMessage.Int0(), static_cast( aMessage.Int2() ) ); @@ -180,6 +183,7 @@ return KErrNone; } + SetAskOnConnectionSuppression( EFalse ); aComplete = EFalse; iCancelSetPersonalityMessage = aMessage; iCancelSetPersonalityOutstanding = ETrue; @@ -207,6 +211,7 @@ // Cancel all other pending requests iUsbWatcherServer->Watcher().Notify( KErrCancel ); + SetAskOnConnectionSuppression( EFalse ); iSetPreviousPersonalityOutstanding = ETrue; iSetPreviousPersonalityMessage = aMessage; aComplete = EFalse; @@ -234,6 +239,7 @@ // Cancel all other pending requests iUsbWatcherServer->Watcher().Notify( KErrCancel ); + SetAskOnConnectionSuppression( EFalse ); iUsbWatcherServer->Watcher().SetPreviousPersonality(); return KErrNone; @@ -271,6 +277,8 @@ { LOG_FUNC + //connected currently, so ask on connection can be enabled + SetAskOnConnectionSuppression( EFalse ); iUsbWatcherServer->Watcher().SetPreviousPersonalityOnDisconnect(); return KErrNone; @@ -315,4 +323,26 @@ } } +// ---------------------------------------------------------------------------- +// Set or clear AskOnConnection suppression +// ---------------------------------------------------------------------------- +// +void CUsbWatcherSession::SetAskOnConnectionSuppression( TBool aSuppress ) + { + LOG_FUNC + + iSuppressAskOnConnection = aSuppress; + } + +// ---------------------------------------------------------------------------- +// Check if AskOnConnection is suppressed +// ---------------------------------------------------------------------------- +// +TBool CUsbWatcherSession::IsAskOnConnectionSuppressed() + { + LOG_FUNC + + return iSuppressAskOnConnection; + } + // End of file