# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277310039 -10800 # Node ID f45583a6968690f8af0bdf0bb0a7b06499421458 # Parent 218231f2b3b31c9f2341a5b684d4547389faa80b Revision: 201023 Kit: 2010125 diff -r 218231f2b3b3 -r f45583a69686 usbengines/usbotgwatcher/group/usbotgwatcher.mmp --- a/usbengines/usbotgwatcher/group/usbotgwatcher.mmp Fri Jun 11 14:38:00 2010 +0300 +++ b/usbengines/usbotgwatcher/group/usbotgwatcher.mmp Wed Jun 23 19:20:39 2010 +0300 @@ -68,6 +68,6 @@ LIBRARY usbdescriptors.lib LIBRARY usbdi_utils.lib #endif -LIBRARY aknnotify.lib +LIBRARY hbcore.lib DEBUGLIBRARY flogger.lib diff -r 218231f2b3b3 -r f45583a69686 usbengines/usbotgwatcher/inc/cusbindicatornotifier.h --- a/usbengines/usbotgwatcher/inc/cusbindicatornotifier.h Fri Jun 11 14:38:00 2010 +0300 +++ b/usbengines/usbotgwatcher/inc/cusbindicatornotifier.h Wed Jun 23 19:20:39 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2009-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" @@ -19,14 +19,23 @@ #define C_USBINDICATORNOTIFIER_H #include -#include // SAknSmallIndicatorParams -#include // SAknNotifierPackage -#include // EAknIndicatorUSBConnection #include "cusbnotifier.h" #include "cusbvbusobserver.h" #include "cusbotgwatcher.h" +class CHbIndicatorSymbian; + +_LIT(KUsbConnectingIndicator, "com.nokia.hb.indicator.usb.device.inprogress/1.0"); + +// indicator states +enum + { + EIndicatorStateOff, + EIndicatorStateOn, + EIndicatorConnecting + }; + /** * Class implements functionality of showing/blinking usb indicator * Class does not provide method to get response from the user @@ -98,7 +107,7 @@ * Set USB indicator On or Off * @param aState Indicator states */ - void SetIndicatorStateL(const TInt aState); + void SetIndicatorState(const TInt aState); /** * Show/hide static icon of the indicator. @@ -106,17 +115,17 @@ * form of the indicator. * @param aVisible ETrue - Show the indicator, EFalse - Hide the indicator */ - void ShowStaticL(TBool aVisible); + void ShowStatic(TBool aVisible); /** * Blinks indicator */ - void BlinkL(); + void Blink(); /** * Sets indicator accordingly */ - void SetIndicatorL(); + void SetIndicator(); private: // data @@ -127,11 +136,17 @@ */ CUsbOtgWatcher& iOtgWatcher; - /** - * Current indicator state - */ - TInt iIndicatorState; + /** + * Pointer to a class for using Orbit indicator framework + * Owned + */ + CHbIndicatorSymbian* iUsbConnectingIndicator; + + /** + * Whether we have activated the connecting indicator + */ + TBool iConnectingIndicatorOn; }; #endif // C_USBINDICATORNOTIFIER_H diff -r 218231f2b3b3 -r f45583a69686 usbengines/usbotgwatcher/src/cusbindicatornotifier.cpp --- a/usbengines/usbotgwatcher/src/cusbindicatornotifier.cpp Fri Jun 11 14:38:00 2010 +0300 +++ b/usbengines/usbotgwatcher/src/cusbindicatornotifier.cpp Wed Jun 23 19:20:39 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2009-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" @@ -15,9 +15,8 @@ * */ -#include -#include #include +#include #include "cusbindicatornotifier.h" #include "cusbstate.h" @@ -62,6 +61,8 @@ // Unsubscribe from otg watcher states change notifications TRAP_IGNORE(iOtgWatcher.UnsubscribeL(*this)); + + delete iUsbConnectingIndicator; } // --------------------------------------------------------------------------- @@ -74,10 +75,7 @@ aOtgWatcher) { LOG_FUNC - - //To be changed to EAknIndicatorStateAnimate and remove iIconBlinkingTimer - //when AVKON implements animation form of usb indicator. - iIndicatorState = EAknIndicatorStateOn; + } // --------------------------------------------------------------------------- @@ -88,6 +86,8 @@ { LOG_FUNC + iUsbConnectingIndicator = CHbIndicatorSymbian::NewL(); + // Subscribe for VBus change notifications iOtgWatcher.VBusObserver()->SubscribeL(*this); @@ -95,7 +95,7 @@ iOtgWatcher.SubscribeL(*this); // check here for condition to set usb indicator - SetIndicatorL(); + SetIndicator(); } // --------------------------------------------------------------------------- @@ -104,26 +104,26 @@ // form of the indicator. // --------------------------------------------------------------------------- // -void CUsbIndicatorNotifier::ShowStaticL(TBool aVisible) +void CUsbIndicatorNotifier::ShowStatic(TBool aVisible) { LOG_FUNC LOG1("aVisible = %d" , aVisible); - SetIndicatorStateL(aVisible - ? EAknIndicatorStateOn - : EAknIndicatorStateOff); + SetIndicatorState(aVisible + ? EIndicatorStateOn + : EIndicatorStateOff); } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // -void CUsbIndicatorNotifier::BlinkL() +void CUsbIndicatorNotifier::Blink() { LOG_FUNC - SetIndicatorStateL( EAknIndicatorStateAnimate ); + SetIndicatorState( EIndicatorConnecting ); } // --------------------------------------------------------------------------- @@ -134,7 +134,7 @@ { LOG_FUNC - ShowStaticL(ETrue); + ShowStatic(ETrue); } // --------------------------------------------------------------------------- @@ -145,31 +145,55 @@ { LOG_FUNC - TRAP_IGNORE( ShowStaticL(EFalse) ); + ShowStatic(EFalse); } // --------------------------------------------------------------------------- // Set USB indicator On or Off // --------------------------------------------------------------------------- // -void CUsbIndicatorNotifier::SetIndicatorStateL(const TInt aState) +void CUsbIndicatorNotifier::SetIndicatorState(const TInt aState) { - LOG1( "USB indicator State = %d" , aState); - - CAknSmallIndicator* indicator = CAknSmallIndicator::NewLC(TUid::Uid( - EAknIndicatorUSBConnection)); - indicator->SetIndicatorStateL(aState); - CleanupStack::PopAndDestroy(indicator); //indicator + + TBool success = ETrue; + + if ((aState == EIndicatorConnecting) && !iConnectingIndicatorOn) + { + success = iUsbConnectingIndicator->Activate(KUsbConnectingIndicator); + LOG1( "calling CHbIndicatorSymbian::Activate(), returned %d", success); + if (success) + { + iConnectingIndicatorOn = ETrue; + } + + } + + if ((aState != EIndicatorConnecting) && iConnectingIndicatorOn) + { + success = iUsbConnectingIndicator->Deactivate(KUsbConnectingIndicator); + if (success) + { + iConnectingIndicatorOn = EFalse; + } + LOG1( "calling CHbIndicatorSymbian::Deactivate(), returned %d", success); + } + + // if success became false loading the indicator failed, log the error + if (!success) + { + TInt error = iUsbConnectingIndicator->Error(); + LOG1( "indicator error is %d", error); + } } - + // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // void CUsbIndicatorNotifier::OtgWatcherStateChangedL(TUsbStateIds aState) { - SetIndicatorL(); + SetIndicator(); } // --------------------------------------------------------------------------- @@ -178,7 +202,7 @@ // void CUsbIndicatorNotifier::VBusDownL() { - SetIndicatorL(); + SetIndicator(); } // --------------------------------------------------------------------------- @@ -187,7 +211,7 @@ // void CUsbIndicatorNotifier::VBusUpL() { - SetIndicatorL(); + SetIndicator(); } // --------------------------------------------------------------------------- @@ -203,7 +227,7 @@ // // --------------------------------------------------------------------------- // -void CUsbIndicatorNotifier::SetIndicatorL() +void CUsbIndicatorNotifier::SetIndicator() { if (!(iOtgWatcher.IsDeviceA()) || iOtgWatcher.CurrentHostState()->Id() == EUsbStateHostAPeripheral) { @@ -216,18 +240,18 @@ if ((iOtgWatcher.VBusObserver()->VBus() == CUsbVBusObserver::EVBusUp) && (iOtgWatcher.CurrentHostState()->Id() == EUsbStateHostAHost)) { - ShowStaticL(ETrue); + ShowStatic(ETrue); } // if VBus up and we are not host -> Blink indicator else if ((iOtgWatcher.VBusObserver()->VBus() == CUsbVBusObserver::EVBusUp) && (iOtgWatcher.CurrentHostState()->Id() != EUsbStateHostAHost)) { - BlinkL(); + Blink(); } else // Otherwise do not show indicator { - ShowStaticL(EFalse); + ShowStatic(EFalse); } } diff -r 218231f2b3b3 -r f45583a69686 usbengines/usbwatcher/rom/mtp_symbian_temp.iby --- a/usbengines/usbwatcher/rom/mtp_symbian_temp.iby Fri Jun 11 14:38:00 2010 +0300 +++ b/usbengines/usbwatcher/rom/mtp_symbian_temp.iby Wed Jun 23 19:20:39 2010 +0300 @@ -22,7 +22,7 @@ // mtp_framework.iby #ifndef MTP_FRAMEWORK_IBY #define MTP_FRAMEWORK_IBY -#if !defined(SYMBIAN_EXCLUDE_MTP) +#if defined(__MTP_PROTOCOL_SUPPORT) // MTP Framework cenrep file (temporary until this can be described in ConfML) //data=ZPRIVATE\10202be9\10282fcc.cre private\10202be9\10282fcc.cre // MTP Data Types Library @@ -53,31 +53,31 @@ data=EPOCROOT##epoc32\data\Z\private\102827a2\backup_registration.xml private\102827a2\backup_registration.xml //MTP device icon property file data=EPOCROOT##epoc32\data\Z\private\102827a2\mtpdevice.ico private\102827a2\mtpdevice.ico -#endif // SYMBIAN_EXCLUDE_MTP +#endif // __MTP_PROTOCOL_SUPPORT #endif // MTP_FRAMEWORK_IBY // mtp_filedp.iby #ifndef MTP_FILEDP_IBY #define MTP_FILEDP_IBY -#if !defined(SYMBIAN_EXCLUDE_MTP) +#if defined(__MTP_PROTOCOL_SUPPORT) // MTP Data Provider API ECOM_PLUGIN(mtpfiledp.dll, mtpfiledp.rsc) // MTP plugin registration resource file data=EPOCROOT##epoc32\data\Z\resource\mtp\102827B0.rsc resource\mtp\102827B0.rsc -#endif // SYMBIAN_EXCLUDE_MTP +#endif // __MTP_PROTOCOL_SUPPORT #endif // MTP_FILEDP_IBY // mtp_usbsic.iby #ifndef MTP_USBSIC_IBY #define MTP_USBSIC_IBY -#if !defined (SYMBIAN_EXCLUDE_MTP) && !defined(SYMBIAN_EXCLUDE_USB) +#if defined(__MTP_PROTOCOL_SUPPORT) && defined(__USB) //MTP USB Data Types Library file=ABI_DIR\BUILD_DIR\mtpusbdatatypes.dll system\libs\mtpusbdatatypes.dll //MTP USB Still Image Class Controller ECOM_PLUGIN(mtpusbsiccc.dll, mtpusbsiccc.rsc) //MTP USB SIC transport plugin ECOM_PLUGIN(mtpusbsicimp.dll, mtpusbsicimp.rsc) -#endif // SYMBIAN_EXCLUDE_MTP +#endif // __MTP_PROTOCOL_SUPPORT #endif // MTP_USBSIC_IBY // mtppictbridgedp.iby @@ -106,94 +106,94 @@ // mtp_statusservice.iby #ifndef MTP_STATUSSERVICE_IBY #define MTP_STATUSSERVICE_IBY -#if !defined(SYMBIAN_EXCLUDE_MTP) +#if defined(__MTP_PROTOCOL_SUPPORT) // MTP Data Provider API ECOM_PLUGIN(mtpstatusservice.dll, mtpstatusservice.rsc) // MTP plugin registration resource file data=EPOCROOT##epoc32\data\Z\resource\mtp\2001a97f.rsc resource\mtp\2001a97f.rsc -#endif // SYMBIAN_EXCLUDE_MTP +#endif // __MTP_PROTOCOL_SUPPORT #endif // MTP_STATUSSERVICE_IBY // mtp_metadataservice.iby #ifndef MTP_METADATAERVICE_IBY #define MTP_METADATASERVICE_IBY -#if !defined(SYMBIAN_EXCLUDE_MTP) +#if defined(__MTP_PROTOCOL_SUPPORT) // MTP Data Provider API ECOM_PLUGIN(mtpmetadataservice.dll, mtpmetadataservice.rsc) // MTP plugin registration resource file data=EPOCROOT##epoc32\data\Z\resource\mtp\2001A9A3.rsc resource\mtp\2001A9A3.rsc -#endif // SYMBIAN_EXCLUDE_MTP +#endif // __MTP_PROTOCOL_SUPPORT #endif // MTP_METADATASERVICE_IBY // mtp_wmpextndp.iby #ifndef MTP_WMPEXTNDP_IBY #define MTP_WMPEXTNDP_IBY -#if !defined(SYMBIAN_EXCLUDE_MTP) +#if defined(__MTP_PROTOCOL_SUPPORT) // MTP Data Provider API ECOM_PLUGIN(mtpwmpextndp.dll, mtpwmpextndp.rsc) // MTP plugin registration resource file data=EPOCROOT##epoc32\data\Z\resource\mtp\1028716c.rsc resource\mtp\1028716c.rsc -#endif // SYMBIAN_EXCLUDE_MTP +#endif // __MTP_PROTOCOL_SUPPORT #endif // MTP_WMPEXTNDP_IBY // devicedp #ifndef MTP_DEVICEDP_IBY #define MTP_DEVICEDP_IBY -#if !defined(SYMBIAN_EXCLUDE_MTP) +#if defined(__MTP_PROTOCOL_SUPPORT) // MTP Device Data Provider ECOM_PLUGIN(mtpdevicedp.dll, mtpdevicedp.rsc) // MTP plugin registration resource file data=EPOCROOT##epoc32\data\Z\resource\mtp\102827AF.rsc resource\mtp\102827AF.rsc -#endif //SYMBIAN_EXCLUDE_MTP +#endif //__MTP_PROTOCOL_SUPPORT #endif //MTP_DEVICEDP_IBY // pimproxy #ifndef MTP_PIMPROXY_IBY #define MTP_PIMPROXY_IBY -#if !defined(SYMBIAN_EXCLUDE_MTP) +#if defined(__MTP_PROTOCOL_SUPPORT) // MTP PIM proxy file=ABI_DIR\BUILD_DIR\mtppimproxy.dll system\libs\mtppimproxy.dll -#endif // SYMBIAN_EXCLUDE_MTP +#endif // __MTP_PROTOCOL_SUPPORT #endif // MTP_PIMPROXY_IBY // calendardp #ifndef MTP_CALENDARDP_IBY #define MTP_CALENDARDP_IBY -#if !defined(SYMBIAN_EXCLUDE_MTP) +#if defined(__MTP_PROTOCOL_SUPPORT) // MTP Data Provider API ECOM_PLUGIN(mtpcalendardp.dll, mtpcalendardp.rsc) // MTP plugin registration resource file data=EPOCROOT##epoc32\data\Z\resource\mtp\102871B8.rsc resource\mtp\102871B8.rsc -#endif // SYMBIAN_EXCLUDE_MTP +#endif // __MTP_PROTOCOL_SUPPORT #endif // MTP_CALENDARDP_IBY // taskdp #ifndef MTP_TASKDP_IBY #define MTP_TASKDP_IBY -#if !defined(SYMBIAN_EXCLUDE_MTP) +#if defined(__MTP_PROTOCOL_SUPPORT) // MTP Data Provider API ECOM_PLUGIN(mtptaskdp.dll, mtptaskdp.rsc) // MTP plugin registration resource file data=EPOCROOT##epoc32\data\Z\resource\mtp\10287013.rsc resource\mtp\10287013.rsc -#endif // SYMBIAN_EXCLUDE_MTP +#endif // __MTP_PROTOCOL_SUPPORT #endif // MTP_TASKDP_IBY // bluetooth #ifndef MTP_BT_IBY #define MTP_BT_IBY -#if !defined (SYMBIAN_EXCLUDE_MTP) && !defined(SYMBIAN_EXCLUDE_USB) +#if defined(__MTP_PROTOCOL_SUPPORT) && defined(__USB) //MTP over Bluetooth Data Types Library file=ABI_DIR\BUILD_DIR\mtpbtdatatypes.dll system\libs\mtpbtdatatypes.dll //MTP over Bluetooth transport plugin ECOM_PLUGIN(mtpbt.dll, mtpbt.rsc) -#endif // SYMBIAN_EXCLUDE_MTP +#endif // __MTP_PROTOCOL_SUPPORT #endif// MTP_BT_IBY #ifndef MTP_CONTROLLER_IBY #define MTP_CONTROLLER_IBY -#if !defined (SYMBIAN_EXCLUDE_MTP) +#if defined(__MTP_PROTOCOL_SUPPORT) //MTP Controller LOCOD service plugin ECOM_PLUGIN(mtpcontroller.dll, mtpcontroller.rsc) -#endif// SYMBIAN_EXCLUDE_MTP +#endif// __MTP_PROTOCOL_SUPPORT #endif// MTP_CONTROLLER_IBY #endif // MTPSYMBIANTEMP_IBY__ diff -r 218231f2b3b3 -r f45583a69686 usbuis/group/bld.inf --- a/usbuis/group/bld.inf Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/group/bld.inf Wed Jun 23 19:20:39 2010 +0300 @@ -16,4 +16,8 @@ */ #include "../imageprintuiprovider/group/bld.inf" -#include "../imageprintui/group/bld.inf" \ No newline at end of file +#include "../imageprintui/group/bld.inf" + +PRJ_EXPORTS +../inc/msmmclient.h MW_LAYER_PLATFORM_EXPORT_PATH(usb/hostms/msmmclient.h) +../inc/msmmindicatorclient.h MW_LAYER_PLATFORM_EXPORT_PATH(usb/hostms/msmmindicatorclient.h) diff -r 218231f2b3b3 -r f45583a69686 usbuis/inc/msmmclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/inc/msmmclient.h Wed Jun 23 19:20:39 2010 +0300 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2008-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" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +/** + @file + @internalComponent +*/ + +#ifndef MSMMCLIENT_H +#define MSMMCLIENT_H + +#include +#include "msmm_pub_def.h" + +/** +RMsmmSession is the interface for MFDC to use the MSMM. +*/ +NONSHARABLE_CLASS(RMsmmSession) : public RSessionBase +{ +public: + // RMsmmSession Implementaion + IMPORT_C TInt Connect(); + IMPORT_C TInt Disconnect(); + IMPORT_C TVersion Version() const; + + /** Add USB Mass Storage Function to the MSMM synchronously. + @param aDevice Usb Mass Storage device description. + @param aInterfaceNumber The Usb Mass Storage interface number. + @param aInterfaceToken The Usb Mass Storage interface token. + @return Error code of IPC. + */ + IMPORT_C TInt AddFunction(const TUSBMSDeviceDescription& aDevice, + TUint8 aInterfaceNumber, + TUint32 aInterfaceToken); + + /** Remove USB Mass Storage device from the MSMM synchronously. + @param aDevice Usb Mass Storage device description. + @return Error code of IPC. + */ + IMPORT_C TInt RemoveDevice(TUint aDevice); + + // Support for server-side out-of-memory testing. In release, these just + // return KErrNone. + IMPORT_C TInt __DbgFailNext(TInt aCount); + IMPORT_C TInt __DbgAlloc(); + + +private: + // RMsmmSession data member + TPckgBuf iDevicePkg; + TUint8 iInterfaceNumber; + TUint32 iInterfaceToken; +}; + +#endif // MSMMCLIENT_H + +// End of file diff -r 218231f2b3b3 -r f45583a69686 usbuis/inc/msmmindicatorclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/inc/msmmindicatorclient.h Wed Jun 23 19:20:39 2010 +0300 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2008-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" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +/** + @file + @internalComponent +*/ + +#ifndef MSMMINDICATORCLIENT_H +#define MSMMINDICATORCLIENT_H + +#include + +/** +RHostMassStorage is the interface for Mass Storage Indicator UI to use the MSMM. +*/ +NONSHARABLE_CLASS(RHostMassStorage) : public RSessionBase +{ +public: + // RHostMassStorage Implementation API to add a session to the running MSMM server + IMPORT_C TInt Connect(); + IMPORT_C TInt Disconnect(); + IMPORT_C TVersion Version() const; + + /** Dismount USB drives from File System asynchronously. The function will return immediately to the UI with complete status + The result of dismounting USB drives will be notified to the MSMM Plugin via CMsmmPolicyPluginBase + @return Error code of IPC. + */ + IMPORT_C TInt EjectUsbDrives(); + +}; + +#endif // MSMMINDICATORCLIENT_H + +// End of file diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbindicatorplugin/inc/usbdebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/inc/usbdebug.h Wed Jun 23 19:20:39 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009-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" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef USBDEBUG_H +#define USBDEBUG_H + +#include + +#if defined(_DEBUG) + inline QDebug myDebug() + { + return qDebug(); + } +#else + inline QNoDebug myDebug() + { + return QNoDebug(); + } +#endif + + +#endif // USBDEBUG_H diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbindicatorplugin/inc/usbdisconnectingindicator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/inc/usbdisconnectingindicator.h Wed Jun 23 19:20:39 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 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" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef USBDISCONNECTINGINDICATOR_H +#define USBDISCONNECTINGINDICATOR_H + +#include +#include "usbindicatorplugin.h" + +/** + * USB indicator class. + * Handles client request and showing the indications. + */ +class USBDisconnectingIndicator : public HbIndicatorInterface +{ + friend class TestUsbIndicatorPlugin; + +public: + /** + * Constructor + */ + USBDisconnectingIndicator(const QString &indicatorType); + + /** + * Destructor + */ + ~USBDisconnectingIndicator(); + + /** + * @see HbIndicatorInterface + */ + QVariant indicatorData(int role) const; + + +protected: + /** + * @see HbIndicatorInterface + */ + bool handleClientRequest(RequestType type, const QVariant ¶meter); + + +}; + +#endif /* USBDISCONNECTINGINDICATOR_H */ + + + + diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbindicatorplugin/inc/usbindicatorplugin.h --- a/usbuis/usbindicatorplugin/inc/usbindicatorplugin.h Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbindicatorplugin/inc/usbindicatorplugin.h Wed Jun 23 19:20:39 2010 +0300 @@ -25,6 +25,8 @@ const QString ConnectedIndicator = ("com.nokia.hb.indicator.usb.device.connected/1.0"); const QString AddressedIndicator = ("com.nokia.hb.indicator.usb.device.inprogress/1.0" ); +const QString MassStorageIndicator = ("com.nokia.hb.indicator.usb.host.massstorage/1.0" ); +const QString UsbDisconnectingIndicator = ("com.nokia.hb.indicator.usb.host.disconnecting/1.0" ); _LIT(KUSBExe, "USBSettingsApp.exe"); const TInt KUSBUIUid = 0x2002E70C; diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbindicatorplugin/inc/usbmassstorageindicator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/inc/usbmassstorageindicator.h Wed Jun 23 19:20:39 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 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" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: USB Mass Storage Indicator Class +* +*/ + +#ifndef USBMASSSTORAGEINDICATOR_H +#define USBMASSSTORAGEINDICATOR_H + +#include +#include "usbindicatorplugin.h" + +/** + * USB mass storage indicator class. + * Handles client request and showing the indications. + */ +class UsbMassStorageIndicator : public HbIndicatorInterface +{ + friend class TestUsbIndicatorPlugin; + +public: + /** + * Constructor + */ + UsbMassStorageIndicator(const QString &indicatorType); + + /** + * Destructor + */ + ~UsbMassStorageIndicator(); + + /** + * @see HbIndicatorInterface + */ + bool handleInteraction(InteractionType type); + + /** + * @see HbIndicatorInterface + */ + QVariant indicatorData(int role) const; + +protected: + /** + * @see HbIndicatorInterface + */ + bool handleClientRequest(RequestType type, const QVariant ¶meter); + +private: + + QString mSecDisplayName; + + bool mEjectStarted; +}; + +#endif /* USBMASSSTORAGEINDICATOR_H */ diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbindicatorplugin/src/usbaddressedindicator.cpp --- a/usbuis/usbindicatorplugin/src/usbaddressedindicator.cpp Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbindicatorplugin/src/usbaddressedindicator.cpp Wed Jun 23 19:20:39 2010 +0300 @@ -15,12 +15,12 @@ * */ #include "usbaddressedindicator.h" -#include +#include #include #include -#include #include "usbindicatorplugin.h" #include "usbindicator.h" +#include "usbdebug.h" /*! @@ -30,27 +30,27 @@ HbIndicatorInterface(indicatorType, HbIndicatorInterface::ProgressCategory, InteractionActivated) - { - } +{ +} /*! UsbAddressedIndicator::~UsbAddressedIndicator */ UsbAddressedIndicator::~UsbAddressedIndicator() - { - } +{ +} /*! UsbAddressedIndicator::handleInteraction */ bool UsbAddressedIndicator::handleInteraction(InteractionType type) - { +{ + myDebug() << ">>> UsbAddressedIndicator::handleInteraction"; bool handled = false; TUidType uidtype(KExecutableImageUid, TUid::Uid(0x00), TUid::Uid(KUSBUIUid)); - if (type == InteractionActivated) - { + if (type == InteractionActivated) { RProcess usbUiProcess; TInt result = usbUiProcess.Create(KUSBExe(), KNullDesC, uidtype); if (result == KErrNone) { @@ -58,9 +58,10 @@ } usbUiProcess.Close(); handled = true; - } + } + myDebug() << "<<< UsbAddressedIndicator::handleInteraction"; return handled; - } +} /*! UsbAddressedIndicator::indicatorData @@ -68,21 +69,21 @@ */ QVariant UsbAddressedIndicator::indicatorData(int role) const { - switch(role) - { - case PrimaryTextRole: - { - QString text = QString(hbTrId("txt_usb_dblist_usb_connecting")); - return text; - } - case DecorationNameRole: - { - QString iconName(KUsbIconFile); - return iconName; - } - default: - return QVariant(); - } + myDebug() << ">>> UsbAddressedIndicator::indicatorData"; + switch (role) { + case PrimaryTextRole: + { + QString text = QString(hbTrId("txt_usb_dblist_usb_connecting")); + return text; + } + case DecorationNameRole: + { + QString iconName(KUsbIconFile); + return iconName; + } + default: + return QVariant(); + } } /*! @@ -92,19 +93,18 @@ bool UsbAddressedIndicator::handleClientRequest( RequestType type, const QVariant ¶meter) { + myDebug() << ">>> UsbAddressedIndicator::handleClientRequest"; switch (type) { - case RequestActivate: - { - emit dataChanged(); - } - - break; - default: - emit deactivate(); - break; + case RequestActivate: + emit dataChanged(); + break; + default: + emit deactivate(); + break; } - //request always handled - return true; + myDebug() << "<<< UsbAddressedIndicator::handleClientRequest"; + //request always handled + return true; } diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbindicatorplugin/src/usbdisconnectingindicator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/src/usbdisconnectingindicator.cpp Wed Jun 23 19:20:39 2010 +0300 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 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" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "usbdisconnectingindicator.h" +#include +#include "usbindicatorplugin.h" +#include "usbindicator.h" + + +/*! + UsbDisconnectingIndicator::UsbDisconnectingIndicator +*/ +USBDisconnectingIndicator::USBDisconnectingIndicator(const QString &indicatorType) : +HbIndicatorInterface(indicatorType, + HbIndicatorInterface::ProgressCategory, + NoInteraction) +{ +} + +/*! + USBDisconnectingIndicator::~USBDisconnectingIndicator +*/ +USBDisconnectingIndicator::~USBDisconnectingIndicator() +{ +} + + +/*! + USBDisconnectingIndicator::indicatorData + returns the data and icon that needs to be displayed in the universal pop up and indicator menu +*/ +QVariant USBDisconnectingIndicator::indicatorData(int role) const +{ + switch(role) { + case PrimaryTextRole: + { + QString text = QString(hbTrId("txt_usb_dblist_usb_disconnecting")); + return text; + } + case DecorationNameRole: + { + QString iconName(KUsbIconFile); + return iconName; + } + default: + return QVariant(); + } +} + +/*! + UsbDisconnectingIndicator::handleClientRequest + handles client's activate and deactivate request +*/ +bool USBDisconnectingIndicator::handleClientRequest( RequestType type, + const QVariant ¶meter) +{ + switch (type) { + case RequestActivate: + emit dataChanged(); + break; + default: + emit deactivate(); + break; + } + //request always handled + return true; +} + + diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbindicatorplugin/src/usbindicator.cpp --- a/usbuis/usbindicatorplugin/src/usbindicator.cpp Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbindicatorplugin/src/usbindicator.cpp Wed Jun 23 19:20:39 2010 +0300 @@ -15,10 +15,10 @@ * */ #include "usbindicator.h" -#include +#include #include #include - +#include "usbdebug.h" const QString TextIdPrefix = ("txt_usb_dblist_usb_connected_val_"); /*! @@ -44,6 +44,7 @@ */ bool USBIndicator::handleInteraction(InteractionType type) { + myDebug() << ">>> USBIndicator::handleInteraction"; bool handled = false; TUidType uidtype(KExecutableImageUid, TUid::Uid(0x00), TUid::Uid(KUSBUIUid)); @@ -56,6 +57,7 @@ usbUiProcess.Close(); handled = true; } + myDebug() << "<<< USBIndicator::handleInteraction"; return handled; } @@ -65,23 +67,24 @@ */ QVariant USBIndicator::indicatorData(int role) const { + myDebug() << ">>> USBIndicator::indicatorData, role is " << role; switch(role) { - case PrimaryTextRole: + case PrimaryTextRole: { - QString text = QString(hbTrId("txt_usb_dblist_usb_connected")); - return text; + QString text = QString(hbTrId("txt_usb_dblist_usb_connected")); + return text; } - case SecondaryTextRole: + case SecondaryTextRole: { - return mSecDisplayName; + return mSecDisplayName; } - case DecorationNameRole: + case DecorationNameRole: { - QString iconName(KUsbIconFile); - return iconName; + QString iconName(KUsbIconFile); + return iconName; } - default: - return QVariant(); + default: + return QVariant(); } } @@ -92,6 +95,7 @@ bool USBIndicator::handleClientRequest( RequestType type, const QVariant ¶meter) { + myDebug() << ">>> USBIndicator::handleClientRequest"; switch (type) { case RequestActivate: { @@ -108,5 +112,6 @@ break; } //request always handled + myDebug() << "<<< USBIndicator::handleClientRequest"; return true; } diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbindicatorplugin/src/usbindicatorplugin.cpp --- a/usbuis/usbindicatorplugin/src/usbindicatorplugin.cpp Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbindicatorplugin/src/usbindicatorplugin.cpp Wed Jun 23 19:20:39 2010 +0300 @@ -20,6 +20,9 @@ #include #include "usbindicator.h" #include "usbaddressedindicator.h" +#include "usbmassstorageindicator.h" +#include "usbdisconnectingindicator.h" +#include "usbdebug.h" Q_EXPORT_PLUGIN(UsbIndicatorPlugin) @@ -46,9 +49,12 @@ */ QStringList UsbIndicatorPlugin::indicatorTypes() const { + myDebug() << ">>> UsbIndicatorPlugin::indicatorTypes"; QStringList types; types << ConnectedIndicator; types << AddressedIndicator; + types << MassStorageIndicator; + types << UsbDisconnectingIndicator; return types; } @@ -60,6 +66,7 @@ */ HbIndicatorInterface* UsbIndicatorPlugin::createIndicator(const QString &indicatorType) { + myDebug() << ">>> UsbIndicatorPlugin::createIndicator"; if (!mTranslatorLoaded) { // add translator for application library QString locale = QLocale::system().name(); @@ -76,6 +83,13 @@ else if (indicatorType == AddressedIndicator) { indicator = new UsbAddressedIndicator(indicatorType); } + else if (indicatorType == MassStorageIndicator) { + indicator = new UsbMassStorageIndicator(indicatorType); + } + else if (indicatorType == UsbDisconnectingIndicator) { + indicator = new USBDisconnectingIndicator(indicatorType); + } + myDebug() << "<<< UsbIndicatorPlugin::createIndicator"; return indicator; } diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbindicatorplugin/src/usbmassstorageindicator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbindicatorplugin/src/usbmassstorageindicator.cpp Wed Jun 23 19:20:39 2010 +0300 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 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" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: USB Mass Storage indicator implementation +* +*/ + +#include "usbmassstorageindicator.h" +#include +#include +#include +#include +#include "usbdebug.h" + +// icon name for mass storage +const QString KUsbIconFile("qtg_large_usb_memory"); + +/*! + Constructor + @param indicatorType The indicator type name +*/ +UsbMassStorageIndicator::UsbMassStorageIndicator(const QString &indicatorType) : +HbIndicatorInterface(indicatorType, + HbIndicatorInterface::SettingCategory, + InteractionActivated), + mEjectStarted(false) +{ +} + +/*! + Destructor +*/ +UsbMassStorageIndicator::~UsbMassStorageIndicator() +{ + myDebug() << ">>> UsbMassStorageIndicator::~UsbMassStorageIndicator"; +} + + +/*! + Handle user interaction + Request eject for all USB drives. +*/ +bool UsbMassStorageIndicator::handleInteraction(InteractionType type) +{ + myDebug() << ">>> UsbMassStorageIndicator::handleInteraction"; + bool handled = false; + if (type == InteractionActivated) { + if (!mEjectStarted) { + mEjectStarted = true; + // dismount all drives without waiting for result + RHostMassStorage hostMassStorage; + myDebug() << " UsbMassStorageIndicator::handleInteraction hostMassStorage connecting"; + TInt err = hostMassStorage.Connect(); + myDebug() << " UsbMassStorageIndicator::handleInteraction hostMassStorage connected"; + if (err == KErrNone) { + hostMassStorage.EjectUsbDrives(); + myDebug() << ">>> UsbMassStorageIndicator::handleInteraction EjectUsbDrives called"; + if (err != KErrNone) { + myDebug() << " UsbMassStorageIndicator::handleInteraction " + <<"RHostMassStorage EjectUsbDrives fail " << err; + } + } + else { + myDebug() << " UsbMassStorageIndicator::handleInteraction " + <<"RHostMassStorage Connect fail " << err; + } + hostMassStorage.Disconnect(); + myDebug() << ">>> UsbMassStorageIndicator::handleInteraction disconnected"; + hostMassStorage.Close(); + myDebug() << ">>> UsbMassStorageIndicator::handleInteraction closed"; + } + handled = true; + } + myDebug() << "<<< UsbMassStorageIndicator::handleInteraction"; + return handled; +} + +/*! + Return the data and icon that needs to be displayed in the universal indicator menu +*/ +QVariant UsbMassStorageIndicator::indicatorData(int role) const +{ + myDebug() << ">>> UsbMassStorageIndicator::indicatorData"; + switch (role) { + case PrimaryTextRole: + return QString(hbTrId("txt_usb_dblist_usb_connected")); + case SecondaryTextRole: + return QString(hbTrId("txt_usb_dpinfo_click_to_eject"));; + case DecorationNameRole: + return KUsbIconFile; + default: + return QVariant(); //empty variant + } +} + +/*! + USBIndicator::handleClientRequest + handles client's activate and deactivate request +*/ +bool UsbMassStorageIndicator::handleClientRequest( RequestType type, + const QVariant ¶meter) +{ + myDebug() << ">>> UsbMassStorageIndicator::handleClientRequest"; + Q_UNUSED(parameter); + if (type == RequestDeactivate) { + myDebug() << " UsbMassStorageIndicator::handleClientRequest deactivate"; + mEjectStarted = false; + emit deactivate(); + } + myDebug() << "<<< UsbMassStorageIndicator::handleClientRequest"; + return true; +} diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbindicatorplugin/usbindicatorplugin.pro --- a/usbuis/usbindicatorplugin/usbindicatorplugin.pro Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbindicatorplugin/usbindicatorplugin.pro Wed Jun 23 19:20:39 2010 +0300 @@ -4,11 +4,19 @@ CONFIG += hb HEADERS += inc/usbindicatorplugin.h \ inc/usbindicator.h \ - inc/usbaddressedindicator.h + inc/usbaddressedindicator.h \ + inc/usbmassstorageindicator.h \ + inc/usbdisconnectingindicator.h SOURCES += src/usbindicatorplugin.cpp \ src/usbindicator.cpp \ - src/usbaddressedindicator.cpp + src/usbaddressedindicator.cpp \ + src/usbmassstorageindicator.cpp \ + src/usbdisconnectingindicator.cpp + +LIBS += -lmsmmindicatorsession + +SYMBIAN_PLATFORMS = ARMV5 TRANSLATIONS = usbindimenu.ts diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/BWINS/usbavkonnotifu.def --- a/usbuis/usbuinotif/BWINS/usbavkonnotifu.def Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/BWINS/usbavkonnotifu.def Wed Jun 23 19:20:39 2010 +0300 @@ -1,3 +1,3 @@ EXPORTS - ?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase2@@@@XZ @ 1 NONAME ; class CArrayPtr * NotifierArray(void) + ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/eabi/usbavkonnotifu.def --- a/usbuis/usbuinotif/eabi/usbavkonnotifu.def Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/eabi/usbavkonnotifu.def Wed Jun 23 19:20:39 2010 +0300 @@ -1,3 +1,3 @@ EXPORTS - _Z13NotifierArrayv @ 1 NONAME + _Z24ImplementationGroupProxyRi @ 1 NONAME diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/inc/usbuinotifmsmmerror.h --- a/usbuis/usbuinotif/inc/usbuinotifmsmmerror.h Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/inc/usbuinotifmsmmerror.h Wed Jun 23 19:20:39 2010 +0300 @@ -21,9 +21,9 @@ // INCLUDES #include +#include #include "usbnotifier.h" // Base class -#define KUsbUiNotifOtgGeneralQueryGranularity 3 // CLASS DECLARATION @@ -34,7 +34,8 @@ * @lib */ NONSHARABLE_CLASS(CUsbUiNotifMSMMError) : public CUSBUINotifierBase, - public MHbDeviceMessageBoxObserver + public MHbDeviceMessageBoxObserver, + public MHbDeviceNotificationDialogObserver { public: @@ -45,7 +46,9 @@ { EUsbMSMMGeneralError, EUsbMSMMUnknownFileSystem, - EUsbMSMMOutOfMemory + EUsbMSMMOutOfMemory, + EUsbMSMMSafeToRemove, + EUsbMSMMUnableToEject }; // Constructors and destructor @@ -110,11 +113,21 @@ CUsbUiNotifMSMMError(); private: - // New functions + // functions from MHbDeviceNotificationDialogObserver + /** + * Callback function which is called when the dialog is tapped + */ + void NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* aDialog); + /** + * Callback function which is called when the dialog is closed + */ + void NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* aDialog, + TInt aCompletionCode); private: // Data CHbDeviceMessageBoxSymbian* iQuery; + CHbDeviceNotificationDialogSymbian* iDiscreet; CDesCArrayFlat* iStringIds; }; #endif // USBUINOTIFMSMMERROR_H diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/inc/usbuinotifotgerror.h --- a/usbuis/usbuinotif/inc/usbuinotifotgerror.h Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/inc/usbuinotifotgerror.h Wed Jun 23 19:20:39 2010 +0300 @@ -24,7 +24,6 @@ #include "usbnotifier.h" // Base class -#define KUsbUiNotifOtgGeneralQueryGranularity 3 // CLASS DECLARATION /** diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/inc/usbuinotifotgwarning.h --- a/usbuis/usbuinotif/inc/usbuinotifotgwarning.h Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/inc/usbuinotifotgwarning.h Wed Jun 23 19:20:39 2010 +0300 @@ -25,7 +25,6 @@ #include #include "usbnotifier.h" // Base class -#define KUsbUiNotifOtgGeneralNoteGranularity 1 // CLASS DECLARATION /** diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/src/usbuincableconnectednotifier.cpp --- a/usbuis/usbuinotif/src/usbuincableconnectednotifier.cpp Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuincableconnectednotifier.cpp Wed Jun 23 19:20:39 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" @@ -98,7 +98,6 @@ // ---------------------------------------------------------------------------- // CUSBUICableConnectedNotifier::StartDialogL -// Jump to RunL as soon as possible. // ---------------------------------------------------------------------------- // void CUSBUICableConnectedNotifier::StartDialogL(const TDesC8& /*aBuffer*/, @@ -115,6 +114,12 @@ iMessage = aMessage; iNeedToCompleteMessage = ETrue; iReplySlot = aReplySlot; + if (iDialog) + { + FLOG(_L("[USBUINOTIF]\t CUSBUICableConnectedNotifier::StartDialogL() deleting previous dialog")); + delete iDialog; + iDialog = NULL; + } iDialog = CHbDeviceNotificationDialogSymbian::NewL(this); HBufC* header = NULL; @@ -154,7 +159,7 @@ // ----------------------------------------------------------------------------------------------------------- // CUSBUICableConnectedNotifier::GetPersonalityStringL -// Get the strings for ask on connection message query +// Get the strings for the discreet popup dialog // ----------------------------------------------------------------------------------------------------------- // void CUSBUICableConnectedNotifier::GetPersonalityStringLC( diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/src/usbuinotifmsmmerror.cpp --- a/usbuis/usbuinotif/src/usbuinotifmsmmerror.cpp Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/src/usbuinotifmsmmerror.cpp Wed Jun 23 19:20:39 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" @@ -18,6 +18,7 @@ // INCLUDE FILES #include // dialog +#include //discreet #include #include #include // pck @@ -27,8 +28,8 @@ // CONSTANTS /** granularity for allocating error strings */ -const TInt KUsbMsmmErrorGranularity = 3; - +const TInt KUsbMsmmErrorGranularity = 5; +_LIT(KUSBUIconFileName, "qtg_large_usb"); // ================= MEMBER FUNCTIONS ========================================= // ---------------------------------------------------------------------------- @@ -76,10 +77,14 @@ _LIT(KGeneralError,"txt_usb_info_error_in_usb_connection_disconnect_d"); _LIT(KUnknownFileSys, "txt_usb_info_unknown_file_system_disconnect_devic"); _LIT(KOutOfMemory, "txt_usb_info_disk_full_remove_some_files_and_try"); + _LIT(KSafeToRemove, "txt_usb_dpinfo_safe_to_remove"); + _LIT(KUnableToEject,"txt_usb_info_unable_to_eject_the_usb_device_some" ); iStringIds->AppendL(KGeneralError); iStringIds->AppendL(KUnknownFileSys); iStringIds->AppendL(KOutOfMemory); + iStringIds->AppendL(KSafeToRemove); + iStringIds->AppendL(KUnableToEject); } // ---------------------------------------------------------------------------- @@ -114,7 +119,7 @@ iMessage = aMessage; iNeedToCompleteMessage = ETrue; iReplySlot = aReplySlot; - + _LIT(KUsbDisconnected, "txt_usb_dpophead_usb_disconnected"); // Get parameters // THostMsErrData error; @@ -128,30 +133,61 @@ break; case EHostMsErrOutOfMemory: errorId = EUsbMSMMOutOfMemory; - break; + break; + case EHostMsErrNone: + errorId = EUsbMSMMSafeToRemove; + break; + case EHostMsErrInUse: + errorId = EUsbMSMMUnableToEject; + break; default: errorId = EUsbMSMMGeneralError; } - - //Delete the query in case the client didn't cancel the notifier - //or close the session after the previous query. - if (iQuery) + HBufC* stringHolder = HbTextResolverSymbian::LoadLC(iStringIds->MdcaPoint(errorId)); + + + if ( errorId == EUsbMSMMSafeToRemove) { - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::GetParamsL() deleting previous dialog")); - delete iQuery; - iQuery = NULL; + // "safe to remove" discreet popup + HBufC* header = HbTextResolverSymbian::LoadLC(KUsbDisconnected); + if (iDiscreet) + { + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::StartDialogL() deleting previous dialog")); + delete iDiscreet; + iDiscreet = NULL; + } + iDiscreet = CHbDeviceNotificationDialogSymbian::NewL(this); + iDiscreet->SetTitleL(*header); + iDiscreet->SetTextL(*stringHolder); + iDiscreet->SetIconNameL(KUSBUIconFileName ); + iDiscreet->ShowL(); + CleanupStack::PopAndDestroy( header ); } + else + { + //Delete the query in case the client didn't cancel the notifier + //or close the session after the previous query. + + if (iQuery) + { + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::StartDialogL() deleting previous dialog")); + delete iQuery; + iQuery = NULL; + } + + iQuery = CHbDeviceMessageBoxSymbian::NewL( + CHbDeviceMessageBoxSymbian::EWarning, this); + iQuery->SetTimeout(0); - iQuery = CHbDeviceMessageBoxSymbian::NewL( - CHbDeviceMessageBoxSymbian::EWarning, this); - iQuery->SetTimeout(0); - - HBufC* stringHolder = HbTextResolverSymbian::LoadLC(iStringIds->MdcaPoint(errorId)); - iQuery->SetTextL(*stringHolder); - iQuery->ShowL(); + + iQuery->SetTextL(*stringHolder); + iQuery->ShowL(); + } + CleanupStack::PopAndDestroy( stringHolder ); + - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::GetParamsL() completed")); + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::StartDialogL() completed")); } // ---------------------------------------------------------------------------- @@ -171,6 +207,12 @@ FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::Cancel iQuery deleted")); iQuery = NULL; } + if (iDiscreet) + { + iDiscreet->Close(); + delete iDiscreet; + iDiscreet = NULL; + } CUSBUINotifierBase::Cancel(); FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::Cancel() completed")); } @@ -203,4 +245,17 @@ FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed completed")); } +void CUsbUiNotifMSMMError::NotificationDialogActivated( + const CHbDeviceNotificationDialogSymbian* /*aDialog*/) + { + + } + +void CUsbUiNotifMSMMError::NotificationDialogClosed( + const CHbDeviceNotificationDialogSymbian* /*aDialog*/, TInt /*aCompletionCode*/) + { + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::NotificationDialogClosed()")); + CompleteMessage( KErrCancel ); + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::NotificationDialogClosed() complete")); + } // End of File diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/tsrc/usbuinotifapitest/conf/ui_usbuinotifapitest.cfg --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/conf/ui_usbuinotifapitest.cfg Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/conf/ui_usbuinotifapitest.cfg Wed Jun 23 19:20:39 2010 +0300 @@ -332,6 +332,23 @@ delete tester [Endtest] +[Test] +title MSMM safe to remove (MSMM error Notifier Test) +create USBUiNotifApiTest tester +tester UsbMSMMNotifierTests EUsbMSMMSafeToRemove +tester FinishQuery CANCEL +delete tester +[Endtest] + +[Test] +title MSMM warning unable to eject (MSMM error Notifier Test) +create USBUiNotifApiTest tester +tester UsbMSMMNotifierTests EUsbMSMMUnableToEject +pause DISMISS_PAUSE +presskey global EKeyEnter +tester FinishQuery CANCEL +delete tester +[Endtest] //Test launching MSMM error without cancelling the previous. [Test] title MSMM error no cancel (MSMM error Notifier Test) diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/tsrc/usbuinotifapitest/group/build_sis.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/group/build_sis.bat Wed Jun 23 19:20:39 2010 +0300 @@ -0,0 +1,23 @@ +@rem +@rem Copyright (c) 2006 - 2010 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This material, including documentation and any related +@rem computer programs, is protected by copyright controlled by +@rem Nokia. All rights are reserved. Copying, including +@rem reproducing, storing, adapting or translating, any +@rem or all of this material requires the prior written consent of +@rem Nokia. This material also contains confidential +@rem information which may not be disclosed to others without the +@rem prior written consent of Nokia. +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +call abld test build armv5 +call makesis usbuinotifapitest.pkg +call signsis usbuinotifapitest.sis usbuinotifapitest.sisx rd.cer rd-key.pem diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/tsrc/usbuinotifapitest/group/build_sis_phone.bat --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/group/build_sis_phone.bat Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/group/build_sis_phone.bat Wed Jun 23 19:20:39 2010 +0300 @@ -1,24 +1,23 @@ @rem -@rem Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +@rem Copyright (c) 2006 - 2010 Nokia Corporation and/or its subsidiary(-ies). @rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem This material, including documentation and any related +@rem computer programs, is protected by copyright controlled by +@rem Nokia. All rights are reserved. Copying, including +@rem reproducing, storing, adapting or translating, any +@rem or all of this material requires the prior written consent of +@rem Nokia. This material also contains confidential +@rem information which may not be disclosed to others without the +@rem prior written consent of Nokia. @rem @rem Initial Contributors: @rem Nokia Corporation - initial contribution. @rem @rem Contributors: @rem -@rem Description: Test script config file -@rem +@rem Description: @rem -rd /q /s x:\epoc32\BUILD - -call bldmake bldfiles -call abld test build armv5 +call sbs -k -c armv5.test call makesis usbuinotifapitest_phone.pkg -call signsis usbuinotifapitest_phone.sis usbuinotifapitest_phone.sisx x:\rd.cer x:\rd-key.pem -call pause \ No newline at end of file +call signsis usbuinotifapitest_phone.sis usbuinotifapitest_phone.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/tsrc/usbuinotifapitest/inc/usbuinotifapitest.h --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/inc/usbuinotifapitest.h Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/inc/usbuinotifapitest.h Wed Jun 23 19:20:39 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-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" @@ -97,11 +97,6 @@ protected: // Functions from base classes - /** - * From ?base_class ?member_description - */ - //?type ?member_function(); - private: /** diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/tsrc/usbuinotifapitest/src/usbuinotifapitestblocks.cpp --- a/usbuis/usbuinotif/tsrc/usbuinotifapitest/src/usbuinotifapitestblocks.cpp Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/tsrc/usbuinotifapitest/src/usbuinotifapitestblocks.cpp Wed Jun 23 19:20:39 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-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" @@ -705,6 +705,16 @@ aQueryType = EHostMsErrOutOfMemory; iLog -> Log( _L("Query type: EUsbMSMMOutOfMemory") ); } + else if ( !aTypeString.Compare( _L( "EUsbMSMMSafeToRemove" ) ) ) + { + aQueryType = EHostMsErrNone; + iLog -> Log( _L("Query type: EUsbMSMMSafeToRemove") ); + } + else if ( !aTypeString.Compare( _L( "EUsbMSMMUnableToEject" ) ) ) + { + aQueryType = EHostMsErrInUse; + iLog -> Log( _L("Query type: EUsbMSMMUnableToEject") ); + } else { iLog -> Log( _L("Query type: not supported") ); diff -r 218231f2b3b3 -r f45583a69686 usbuis/usbuinotif/usbuinotif.pro --- a/usbuis/usbuinotif/usbuinotif.pro Fri Jun 11 14:38:00 2010 +0300 +++ b/usbuis/usbuinotif/usbuinotif.pro Wed Jun 23 19:20:39 2010 +0300 @@ -17,6 +17,16 @@ src/usbuinmain.cpp TRANSLATIONS = usbdialogs.ts +defBlock = \ + "$${LITERAL_HASH}if defined(EABI)" \ + "DEFFILE .\eabi/usbavkonnotif.def" \ + "$${LITERAL_HASH}else" \ + "DEFFILE .\BWINS/usbavkonnotif.def" \ + "$${LITERAL_HASH}endif" + +MMP_RULES += defBlock + + symbian*: { TARGET.UID2 = 0x10009D8D TARGET.UID3 = 0x102068DC @@ -41,6 +51,8 @@ -lcommonengine \ -lcentralrepository \ -lusbman \ - -lflogger + -lflogger \ + -lcone \ + -leiksrv }