# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1274784466 -10800 # Node ID d895b6d953c9b833ced0400d971d3ee134bfda12 # Parent f6533aee8b2b261d307594abc06a5f82070bbae6 Revision: 200919 Kit: 2010121 diff -r f6533aee8b2b -r d895b6d953c9 usbengines/usbotgwatcher/src/cusbnotenotifier.cpp --- a/usbengines/usbotgwatcher/src/cusbnotenotifier.cpp Tue Apr 27 17:41:29 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbnotenotifier.cpp Tue May 25 13:47:46 2010 +0300 @@ -130,14 +130,15 @@ LOG1( "iStatus = %d" , iStatus.Int()); - // if error occured, deal with it in RunError - LEAVEIFERROR(iStatus.Int()); + // if iStatus contains some other than KErrNone code + // do not perform any special actions, + // just forward the error code to caller iNotifier.CancelNotifier(iUsbNoteNotifier.iCat); // report to owner that show is over iUsbNoteNotifier.iNotifManager.NotifierShowCompletedL(iUsbNoteNotifier, - KErrNone, iRes()); + iStatus.Int(), iRes()); } // --------------------------------------------------------------------------- @@ -159,8 +160,6 @@ LOG1("aError = %d" , aError); - iNotifier.CancelNotifier(iUsbNoteNotifier.iCat); - // try to continue return KErrNone; } diff -r f6533aee8b2b -r d895b6d953c9 usbuis/usbuinotif/group/usbavkonnotif.mmp --- a/usbuis/usbuinotif/group/usbavkonnotif.mmp Tue Apr 27 17:41:29 2010 +0300 +++ b/usbuis/usbuinotif/group/usbavkonnotif.mmp Tue May 25 13:47:46 2010 +0300 @@ -23,19 +23,20 @@ UID 0x101fdfae 0x102068DD TARGETPATH SHARED_LIB_DIR -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT SOURCEPATH ../src -SOURCE usbuincableconnectednotifier.cpp usbavkonmain.cpp +SOURCE usbuincableconnectednotifier.cpp +SOURCE usbavkonmain.cpp SOURCE usbnotifier.cpp USERINCLUDE ../inc -SYSTEMINCLUDE ../../inc ../../../inc MW_LAYER_PLATFORM_EXPORT_PATH(SecondaryDisplay/) //for internal and private API headers +MW_LAYER_SYSTEMINCLUDE -MW_LAYER_SYSTEMINCLUDE + LIBRARY ECOM.LIB // Symbian E-Com Plugin definitions and types LIBRARY euser.lib cone.lib // Symbian OS frameworklibraries LIBRARY avkon.lib // UI library @@ -54,7 +55,7 @@ LIBRARY egul.lib LIBRARY usbman.lib // for personality IDs and descriptions LIBRARY aknnotifierwrapper.lib // Avkon's notifier wrapper -LIBRARY apparc.lib +LIBRARY apparc.lib LIBRARY akncapserverclient.lib // for suppressing the application key DEBUGLIBRARY flogger.lib // File logging services diff -r f6533aee8b2b -r d895b6d953c9 usbuis/usbuinotif/group/usbuinotif.mmp --- a/usbuis/usbuinotif/group/usbuinotif.mmp Tue Apr 27 17:41:29 2010 +0300 +++ b/usbuis/usbuinotif/group/usbuinotif.mmp Tue May 25 13:47:46 2010 +0300 @@ -23,8 +23,8 @@ TARGETTYPE PLUGIN UID 0x10009D8D 0x102068DC -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT SOURCEPATH ../src SOURCE usbuinmain.cpp @@ -51,12 +51,10 @@ USERINCLUDE ../inc -SYSTEMINCLUDE ../../inc ../../../inc MW_LAYER_PLATFORM_EXPORT_PATH(SecondaryDisplay/) //for internal and private API headers SYSTEMINCLUDE /epoc32/include/ecom MW_LAYER_SYSTEMINCLUDE - LIBRARY ECOM.LIB // Symbian E-Com Plugin definitions and types LIBRARY euser.lib cone.lib // Symbian OS frameworklibraries LIBRARY avkon.lib // UI library @@ -75,7 +73,7 @@ LIBRARY egul.lib LIBRARY usbman.lib // for personality IDs and descriptions LIBRARY aknnotifierwrapper.lib // Avkon's notifier wrapper -LIBRARY apparc.lib +LIBRARY apparc.lib LIBRARY akncapserverclient.lib // for suppressing the application key LIBRARY viewcli.lib LIBRARY featmgr.lib diff -r f6533aee8b2b -r d895b6d953c9 usbuis/usbuinotif/inc/usbuincableconnectednotifier.h --- a/usbuis/usbuinotif/inc/usbuincableconnectednotifier.h Tue Apr 27 17:41:29 2010 +0300 +++ b/usbuis/usbuinotif/inc/usbuincableconnectednotifier.h Tue May 25 13:47:46 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2005-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" @@ -96,6 +96,7 @@ * @param aCurrentPersonality current personality id */ void GetCurrentIdL(TInt& aCurrentPersonality); + /** * Get the mode name and header for current personality * @param aDescription The returned current personality string. @@ -107,7 +108,6 @@ * Runs the connected discreet note */ void RunQueryL(); - /** * creates the USB UI setting view @@ -115,6 +115,7 @@ * @param TUidType */ void CreateChosenViewL(const TDesC & aProcessName,const TUidType & aUidType) const; + private: /** * C++ default constructor. @@ -127,9 +128,15 @@ CActiveSchedulerWait iNoteWaiter; /** - * Note visible - */ + * Note visible + */ TBool iNoteVisible; + /** + * Note tapped + */ + TBool iNoteTapped; + }; + #endif // USBUINCABLECONNECTEDNOTIFIER_H diff -r f6533aee8b2b -r d895b6d953c9 usbuis/usbuinotif/src/usbnotifier.cpp --- a/usbuis/usbuinotif/src/usbnotifier.cpp Tue Apr 27 17:41:29 2010 +0300 +++ b/usbuis/usbuinotif/src/usbnotifier.cpp Tue May 25 13:47:46 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2005-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" @@ -99,9 +99,8 @@ // Activate apps -key again (if not previously activated yet) SuppressAppSwitching( EFalse ); - // Restore the keylock if not restored before (caused by Leave). - // If the Keylock is restored already, the function does nothing. - RestoreKeylock(); + //Don't call RestoreKeylock here. It's up to specific note notfier logic. + //If failed to RestoreKeylock there, it doesn't matter to leave keylock open. FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::Destructor completed")); } diff -r f6533aee8b2b -r d895b6d953c9 usbuis/usbuinotif/src/usbuincableconnectednotifier.cpp --- a/usbuis/usbuinotif/src/usbuincableconnectednotifier.cpp Tue Apr 27 17:41:29 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuincableconnectednotifier.cpp Tue May 25 13:47:46 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2005-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" @@ -33,10 +33,11 @@ #include //for cover display support #include -#include // Dialog index for cover UI +#include // Dialog index for cover UI #include #include // KExecutableImageUid #include + #include "usbuincableconnectednotifier.h" // Own class definition #include "usbuinotifdebug.h" // Debugging macros #include "UsbWatcherInternalCRKeys.h" @@ -47,8 +48,6 @@ _LIT(KUSBExe, "usbclasschangeui.exe"); const TInt KUSBUIUid = 0x102068E2; -_LIT(KFileDrive,"z:"); -_LIT(KUSBUIconFileName, "usbui.mif"); // ================= MEMBER FUNCTIONS ========================================= @@ -76,7 +75,8 @@ // ---------------------------------------------------------------------------- // CUSBUICableConnectedNotifier::CUSBUICableConnectedNotifier(): - iNoteVisible(EFalse) + iNoteVisible(EFalse), + iNoteTapped(EFalse) { FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::default constructor")); } @@ -150,8 +150,6 @@ DisableKeylock(); SuppressAppSwitching(ETrue); RunQueryL(); - SuppressAppSwitching(EFalse); - RestoreKeylock(); FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::RunL() completed")); } @@ -176,10 +174,10 @@ FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::Cancel() completed")); } -// ----------------------------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // CUSBUICableConnectedNotifier::GetPersonalityStringL // Get the strings for ask on connection message query -// ----------------------------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // void CUSBUICableConnectedNotifier::GetPersonalityStringL( HBufC*& aHeader,HBufC*& aDescription ) @@ -199,28 +197,33 @@ FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::GetPersonalityStringL completed")); } -// ----------------------------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // CUSBUICableConnectedNotifier::RunQueryL // Run the ask on connection message query -// ----------------------------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // void CUSBUICableConnectedNotifier::RunQueryL() { FLOG( _L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::RunQueryL()")); - HBufC* header = NULL; - HBufC* description =NULL; - GetPersonalityStringL(header, description); + HBufC* header = NULL; + HBufC* description =NULL; + GetPersonalityStringL(header, description); - CleanupStack::PushL(header); - CleanupStack::PushL(description); + CleanupStack::PushL(header); + CleanupStack::PushL(description); - TFileName usbUiIconFilename( KFileDrive ); - usbUiIconFilename += KDC_APP_BITMAP_DIR; - usbUiIconFilename += KUSBUIconFileName; - iNoteVisible = ETrue; - CAknDiscreetPopup::ShowGlobalPopupL(*header,*description, KAknsIIDQgnPropUsb, AknIconUtils::AvkonIconFileName(), - EMbmAvkonQgn_prop_usb, EMbmAvkonQgn_prop_usb_mask,KAknDiscreetPopupDurationLong, EUSBUICmdDiscreetTapped,( MEikCommandObserver* ) this); + iNoteVisible = ETrue; + CAknDiscreetPopup::ShowGlobalPopupL( + *header, + *description, + KAknsIIDQgnPropUsb, + AknIconUtils::AvkonIconFileName(), + EMbmAvkonQgn_prop_usb, + EMbmAvkonQgn_prop_usb_mask, + KAknDiscreetPopupDurationLong, + EUSBUICmdDiscreetTapped, + (MEikCommandObserver*) this); CleanupStack::PopAndDestroy(description); CleanupStack::PopAndDestroy(header); @@ -251,39 +254,54 @@ // void CUSBUICableConnectedNotifier::ProcessCommandL(TInt aCommandId) { + FTRACE(FPrint(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::ProcessCommandL: %d"), + aCommandId)); + SuppressAppSwitching(EFalse); + switch ( aCommandId ) - { + { case EUSBUICmdDiscreetTapped: { - TUidType uidtype(KExecutableImageUid, TUid::Uid(0x00),TUid::Uid(KUSBUIUid)); - CreateChosenViewL(KUSBExe(),uidtype); + TUidType uidtype(KExecutableImageUid, TUid::Null(), TUid::Uid(KUSBUIUid)); + CreateChosenViewL(KUSBExe(),uidtype); + iNoteTapped = ETrue; } - case EAknDiscreetPopupCmdClose: + //fall through + case EAknDiscreetPopupCmdClose: if ( iNoteWaiter.IsStarted() ) { iNoteWaiter.AsyncStop(); } - iNoteVisible = EFalse; - CompleteMessage( KErrCancel ); + iNoteVisible = EFalse; + CompleteMessage( KErrCancel ); break; default: - - break; - } + break; + } + + if (!iNoteTapped) + { + FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::ProcessCommandL() restore keylock")); + RestoreKeylock(); + } + + FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::ProcessCommandL() completed")); } + // --------------------------------------------------------------------------- // CUSBUICableConnectedNotifier::CreateChosenViewL() // creates the USB UI setting view // --------------------------------------------------------------------------- // - void CUSBUICableConnectedNotifier::CreateChosenViewL(const TDesC & aProcessName,const TUidType & aUidType) const +void CUSBUICableConnectedNotifier::CreateChosenViewL( + const TDesC & aProcessName, const TUidType & aUidType) const { FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::CreateDesiredViewL() ")); - RProcess usbUiProcess; - User::LeaveIfError(usbUiProcess.Create(aProcessName, KNullDesC, aUidType)); - usbUiProcess.Resume(); - usbUiProcess.Close(); - FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::CreateDesiredViewL() ")); - + RProcess usbUiProcess; + User::LeaveIfError(usbUiProcess.Create(aProcessName, KNullDesC, aUidType)); + usbUiProcess.Resume(); + usbUiProcess.Close(); + FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::CreateDesiredViewL() ")); } + // End of File diff -r f6533aee8b2b -r d895b6d953c9 usbuis/usbuinotif/src/usbuinotifmsmmerror.cpp --- a/usbuis/usbuinotif/src/usbuinotifmsmmerror.cpp Tue Apr 27 17:41:29 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuinotifmsmmerror.cpp Tue May 25 13:47:46 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007, 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-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" @@ -28,9 +28,12 @@ #include // pck #include // Own resources -#include "usbuinotifmsmmerror.h" // Own class definition +#include // Dialog index for cover UI + +#include "usbuinotifmsmmerror.h" // Own class definition #include "usbuinotifdebug.h" // Debugging macros -#include "usbuinotifsecondarydisplay.h" // Dialog index for cover UI + + // ================= MEMBER FUNCTIONS ========================================= // ---------------------------------------------------------------------------- diff -r f6533aee8b2b -r d895b6d953c9 usbuis/usbuinotif/src/usbuinotifotgerror.cpp --- a/usbuis/usbuinotif/src/usbuinotifotgerror.cpp Tue Apr 27 17:41:29 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuinotifotgerror.cpp Tue May 25 13:47:46 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007, 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-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" @@ -27,9 +27,12 @@ #include // pck #include // Own resources +#include // Dialog index for cover UI + #include "usbuinotifotgerror.h" // Own class definition #include "usbuinotifdebug.h" // Debugging macros -#include "usbuinotifsecondarydisplay.h" // Dialog index for cover UI + + // ================= MEMBER FUNCTIONS ========================================= // ---------------------------------------------------------------------------- diff -r f6533aee8b2b -r d895b6d953c9 usbuis/usbuinotif/src/usbuinotifotgwarning.cpp --- a/usbuis/usbuinotif/src/usbuinotifotgwarning.cpp Tue Apr 27 17:41:29 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuinotifotgwarning.cpp Tue May 25 13:47:46 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007, 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-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" @@ -23,9 +23,12 @@ #include // Localisation stringloader #include // for cover display support #include // Own resources +#include // Dialog index for cover UI + #include "usbuinotifotgwarning.h" // Own class definition -#include "usbuinotifdebug.h" // Debugging macros -#include "usbuinotifsecondarydisplay.h" // Dialog index for cover UI +#include "usbuinotifdebug.h" // Debugging macros + + // ================= MEMBER FUNCTIONS ========================================= // ---------------------------------------------------------------------------- diff -r f6533aee8b2b -r d895b6d953c9 usbuis/usbuinotif/src/usbuinqueriesnotifiermdrv.cpp --- a/usbuis/usbuinotif/src/usbuinqueriesnotifiermdrv.cpp Tue Apr 27 17:41:29 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuinqueriesnotifiermdrv.cpp Tue May 25 13:47:46 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2005-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" @@ -25,9 +25,10 @@ #include // pck #include // Own resources +#include // Dialog index for cover UI + #include "usbuinqueriesnotifiermdrv.h" // Own class definition #include "usbuinotifdebug.h" // Debugging macros -#include // Dialog index for cover UI // ================= MEMBER FUNCTIONS =========================================