# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1278415411 -10800 # Node ID ae54820ef82c2005af8ac59f90fa210c966cd457 # Parent 92f864ef0288fe5e55fb32718037268c16048e6b Revision: 201025 Kit: 2010127 diff -r 92f864ef0288 -r ae54820ef82c appinstall.pro --- a/appinstall.pro Wed Jun 23 18:20:02 2010 +0300 +++ b/appinstall.pro Tue Jul 06 14:23:31 2010 +0300 @@ -17,5 +17,6 @@ TEMPLATE = subdirs SUBDIRS += appinstaller/appinstaller.pro \ - iaupdate/iaupdate.pro + iaupdate/iaupdate.pro \ + ncdengine/ncdengine.pro diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/api/iaupdateapi.pro --- a/iaupdate/IAD/api/iaupdateapi.pro Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/api/iaupdateapi.pro Tue Jul 06 14:23:31 2010 +0300 @@ -23,6 +23,14 @@ TARGET.CAPABILITY = CAP_GENERAL_DLL TARGET.EPOCALLOWDLLDATA=1 MMP_RULES += "OPTION ARMCC --export_all_vtbl" + + defBlock = \ + "$${LITERAL_HASH}if defined(EABI)" \ + "DEFFILE ../eabi/iaupdateapi.def" \ + "$${LITERAL_HASH}else" \ + "DEFFILE ../bwins/iaupdateapi.def" \ + "$${LITERAL_HASH}endif" + MMP_RULES += defBlock } DEPENDPATH += . diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/backgroundchecker/group/bld.inf --- a/iaupdate/IAD/backgroundchecker/group/bld.inf Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/backgroundchecker/group/bld.inf Tue Jul 06 14:23:31 2010 +0300 @@ -22,13 +22,8 @@ PRJ_PLATFORMS DEFAULT - PRJ_EXPORTS -/epoc32/s60/icons/qgn_note_swupdate_notification.svg /epoc32/release/winscw/udeb/z/private/200211f4/qgn_note_swupdate_notification.svg -/epoc32/s60/icons/qgn_note_swupdate_notification.svg /epoc32/release/winscw/urel/z/private/200211f4/qgn_note_swupdate_notification.svg -/epoc32/s60/icons/qgn_note_swupdate_notification.svg /epoc32/data/z/private/200211f4/qgn_note_swupdate_notification.svg - PRJ_MMPFILES ./iaupdatebg.mmp diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/backgroundchecker/group/iaupdatebg.mmp --- a/iaupdate/IAD/backgroundchecker/group/iaupdatebg.mmp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/backgroundchecker/group/iaupdatebg.mmp Tue Jul 06 14:23:31 2010 +0300 @@ -41,14 +41,13 @@ SOURCEPATH ../src SOURCE iaupdatebgmain.cpp SOURCE iaupdatebgrefreshtimer.cpp -SOURCE iaupdatebgremindertimer.cpp +//SOURCE iaupdatebgremindertimer.cpp SOURCE iaupdatebgcontrollerfile.cpp SOURCE iaupdatebgfirsttimehandler.cpp SOURCE iaupdatebginternalfilehandler.cpp SOURCE iaupdatebgsoftnotification.cpp - LIBRARY euser.lib LIBRARY centralrepository.lib LIBRARY iaupdateapi.lib @@ -66,9 +65,8 @@ LIBRARY sysversioninfo.lib LIBRARY FeatMgr.lib -// HLa -LIBRARY hbcore.lib -LIBRARY hbwidgets.lib +LIBRARY hbcore.lib +LIBRARY hbwidgets.lib DEBUGLIBRARY flogger.lib diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/backgroundchecker/inc/iaupdatebgfirsttimehandler.h --- a/iaupdate/IAD/backgroundchecker/inc/iaupdatebgfirsttimehandler.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/backgroundchecker/inc/iaupdatebgfirsttimehandler.h Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 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" @@ -61,12 +61,7 @@ * Set Nokia agreement as accepted by an user */ void SetAgreementAcceptedL(); - - /** - * Set Nokia agreement as asked (prompted) to an user - */ - void SetAgreementAskedL(); - + /** * Set automatic update checks as asked (prompted) to an user */ @@ -79,13 +74,7 @@ */ TBool AgreementAcceptedL(); - /** - * Is Nokia agreement of Application Update already asked - * - * @return True value if agreement already asked - */ - TBool AgreementAskedL(); - + /** * Is activation for automatic update cheks from network already asked * @@ -121,8 +110,6 @@ TBool iAgreementAccepted; - TBool iAgreementAsked; - TBool iAutomaticUpdateChecksAsked; }; diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/backgroundchecker/inc/iaupdatebginternalfilehandler.h --- a/iaupdate/IAD/backgroundchecker/inc/iaupdatebginternalfilehandler.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/backgroundchecker/inc/iaupdatebginternalfilehandler.h Tue Jul 06 14:23:31 2010 +0300 @@ -52,22 +52,10 @@ void SetLastTimeShowNewFeatureDialog( TInt64 aTime ); - //void SetCurrentRefreshTime(); - TBool UserRejectNewFeatureDialog() const; void SetUserRejectNewFeatureDialog( TBool aUserDecision ); - TBool ReminderOn(); - - void SetReminder( TBool aOn ); - - TTime NextRemindTime(); - - void SetNextRemindTime( TTime aNextRemindTime ); - - void SetNextRemindTime( TInt64 aNextRemindTime ); - void SetMode( TIAUpdateBGMode aMode ); TIAUpdateBGMode Mode(); @@ -113,14 +101,9 @@ // Time when the content was refreshed. TTime iLastTimeShowNewFeatureDialog; - TBool iUserRejectNewFeatureDialog; - TTime iNextRemindTime; - - TBool iIsReminderOn; - TIAUpdateBGMode iMode; HBufC* iFwVersion; diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/backgroundchecker/inc/iaupdatebgrefreshtimer.h --- a/iaupdate/IAD/backgroundchecker/inc/iaupdatebgrefreshtimer.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/backgroundchecker/inc/iaupdatebgrefreshtimer.h Tue Jul 06 14:23:31 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" @@ -26,7 +26,8 @@ #include #include -#include "iaupdatebgremindertimer.h" + +#include "iaupdatebginternalfilehandler.h" #include "iaupdatebgcontrollerfile.h" #include "iaupdatebgsoftnotification.h" #include "iaupdatebgcheckermode.h" @@ -34,7 +35,6 @@ // FORWARD DECLARATIONS class CIAUpdate; class CIAUpdateParameters; -// class CAknSoftNotifier; class CInternalFileHandler; class CIdleObserver; @@ -49,8 +49,7 @@ class CIAUpdateBGTimer : public CTimer, public MIAUpdateObserver, public MCenRepNotifyHandlerCallback, - public MIAUpdateBGSoftNotificationCallBack, - public MIAUpdateBGReminderTimerCallBack + public MIAUpdateBGSoftNotificationCallBack { public: @@ -121,9 +120,7 @@ TTimeIntervalMinutes TimeIntervalFromNextShowOfNewFeatureDialogL(); TBool IsAgreementAcceptedL(); - - TBool IsAskedAlreadyL(); - + void HandlerFirstTimeL(); TTime GetLastTimeShowNewFeatureDialogL(); @@ -134,14 +131,6 @@ TInt SetUserDecisionL( TBool aDecision ); - TBool ReminderOnL(); - - TInt SetReminderL( TBool aOn ); - - TTime NextRemindTimeL(); - - TInt SetNextRemindTimeL( TTime aTime ); - TIAUpdateBGMode ModeL(); TInt SetModeL( TIAUpdateBGMode aMode ); @@ -150,12 +139,8 @@ TInt SetRetryTimesL( TInt aRetry ); - // HBufC* ReadResourceLC( TInt aResourceId ); - void StartIaupdateL() const; - // void LaunchSoftNotificationL( const TInt& aResourceId, const TInt& SK1, const TInt& SK2 ); - void LaunchNotificationL( const int aNrOfUpdates ); TBool IsAutoUpdateDisabledL(); @@ -170,18 +155,8 @@ void DoSoftNotificationCallBackL( TBool aIsAccepted ); - void DoReminderTimerCallBackL(); - void StartUpdatesCheckingL(); - // HBufC8* LoadFileLC(const TDesC& aFile); - - TInt GetPrivatePathL( TFileName& aPath ); - - TInt SetSessionPrivatePathL( RFs& aFs, const TDesC& aPath ) const; - - void SetPrivateDriveL( RFs& aFs, const TDesC& aFileName ) const; - TBool IAUpdateEnabledL() const; void Shutdown(); @@ -190,7 +165,6 @@ // Data CIAUpdate* iUpdate; CIAUpdateParameters* iParameters; - CIAUpdateBGReminderTimer* iReminderTimer; CRepository* iIAUpdateCRSession; CCenRepNotifyHandler* iNotifyHandler; TInt iRuns; @@ -199,8 +173,6 @@ CIAUpdateBGInternalFileHandler* iInternalFile; TIAUpdateBGMode iMode; CIAUpdateBGSoftNotification* iSoftNotification; - // RResourceFile iResourceFile; - RFs iFs; }; #endif //IAUPDATEBGREFRESHTIMER_H diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/backgroundchecker/inc/iaupdatebgsoftnotification.h --- a/iaupdate/IAD/backgroundchecker/inc/iaupdatebgsoftnotification.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/backgroundchecker/inc/iaupdatebgsoftnotification.h Tue Jul 06 14:23:31 2010 +0300 @@ -61,22 +61,16 @@ /** * Shows notification and indicator. - * - * @param aNrOfUpdates number of updates */ void ShowNotificationL(); /** * Shows indicator. - * - * @param aMode indicator mode (EFirstTimeMode / ENormalMode) */ void ShowIndicatorL(); /** * Removes indicator. - * - * @param aNrOfUpdates number of updates */ void RemoveIndicatorL(); @@ -87,13 +81,6 @@ * @param aText text for soft notification */ void SetTextL( const TDesC& aTitle, const TDesC& aText ); - - /** - * Set an image path for a soft notification. - * - * @param aImage image path for soft notification - */ - void SetImagePathL( const TDesC& aImage ); /** * Set number of updates a soft notification. @@ -152,39 +139,28 @@ /** * Get indicator enablation state * - * @return aEnabled ETrue-enabled, EFalse-disabled + * @return ETrue-enabled, EFalse-disabled */ TBool IsIndicatorEnabled(); - /** - * Set number of updates - * - * @param aNrOfUpdates number of updates - */ - // void SetNrOfUpdates( const int aNrOfUpdates ); - - /** - * Get number of updates - * - * @return number of updates - */ int GetNrOfUpdates(); private: // Data // Note title HBufC* iTitle; + // Note text HBufC* iText; - /// Image data byte array - HBufC8* iImageData; + // Notification callback MIAUpdateBGSoftNotificationCallBack* iCallback; - // Image path - HBufC* iImagePath; + // Number of updates int iNrOfUpdates; + // Indictor activation state TBool iActivateIndicator; + //Notification dialog CHbDeviceNotificationDialogSymbian* iNotificationDialog; diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/backgroundchecker/src/iaupdatebgfirsttimehandler.cpp --- a/iaupdate/IAD/backgroundchecker/src/iaupdatebgfirsttimehandler.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/backgroundchecker/src/iaupdatebgfirsttimehandler.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 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" @@ -98,19 +98,7 @@ iAgreementAccepted = ETrue; WriteDataL(); } - -// --------------------------------------------------------------------------- -// CIAUpdateBGFirstTimeHandler::SetAgreementAskedL -// Set Nokia agreement as asked (prompted) to an user -// --------------------------------------------------------------------------- -// -void CIAUpdateBGFirstTimeHandler::SetAgreementAskedL() - { - ReadDataL(); - iAgreementAsked = ETrue; - WriteDataL(); - } - + // --------------------------------------------------------------------------- // CIAUpdateBGFirstTimeHandler::SetAutomaticUpdatesAskedL // Set automatic update checks as prompted to an use @@ -136,17 +124,6 @@ // --------------------------------------------------------------------------- -// CIAUpdateBGFirstTimeHandler::AgreementAskedL -// Is Nokia agreement of Application Update already asked -// --------------------------------------------------------------------------- -// -TBool CIAUpdateBGFirstTimeHandler::AgreementAskedL() - { - ReadDataL(); - return iAgreementAsked; - } - -// --------------------------------------------------------------------------- // CIAUpdateBGFirstTimeHandler::AutomaticUpdateChecksAskedL // Is activation for automatic update cheks from network already asked // --------------------------------------------------------------------------- @@ -170,7 +147,6 @@ if ( err == KErrNotFound ) { iAgreementAccepted = EFalse; - iAgreementAsked = EFalse; iAutomaticUpdateChecksAsked = EFalse; } else @@ -216,7 +192,6 @@ void CIAUpdateBGFirstTimeHandler::InternalizeL( RReadStream& aStream ) { iAgreementAccepted = aStream.ReadInt32L(); - iAgreementAsked = aStream.ReadInt32L(); iAutomaticUpdateChecksAsked = aStream.ReadInt32L(); } @@ -229,7 +204,6 @@ void CIAUpdateBGFirstTimeHandler::ExternalizeL( RWriteStream& aStream ) { aStream.WriteInt32L( iAgreementAccepted ); - aStream.WriteInt32L( iAgreementAsked ); aStream.WriteInt32L( iAutomaticUpdateChecksAsked ); } diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/backgroundchecker/src/iaupdatebginternalfilehandler.cpp --- a/iaupdate/IAD/backgroundchecker/src/iaupdatebginternalfilehandler.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/backgroundchecker/src/iaupdatebginternalfilehandler.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -15,9 +15,6 @@ * */ - - - #include #include #include @@ -67,7 +64,7 @@ // CIAUpdateBGInternalFileHandler::CIAUpdateBGInternalFileHandler() : iLastTimeShowNewFeatureDialog( 0 ), iUserRejectNewFeatureDialog( EFalse ), - iNextRemindTime(0), iIsReminderOn( EFalse ), iMode( EFirstTimeMode ), iFwVersion( NULL ), + iMode( EFirstTimeMode ), iFwVersion( NULL ), iSNID(0), iRetryTimes(0) { } @@ -215,62 +212,6 @@ iUserRejectNewFeatureDialog = aUserDecision; } - -// ----------------------------------------------------------------------------- -// CIAUpdateBGInternalFileHandler::ReminderOn -// -// ----------------------------------------------------------------------------- -// -TBool CIAUpdateBGInternalFileHandler::ReminderOn() - { - return iIsReminderOn; - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateBGInternalFileHandler::SetReminder -// -// ----------------------------------------------------------------------------- -// -void CIAUpdateBGInternalFileHandler::SetReminder( TBool aOn ) - { - iIsReminderOn = aOn; - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateBGInternalFileHandler::NextRemindTime -// -// ----------------------------------------------------------------------------- -// -TTime CIAUpdateBGInternalFileHandler::NextRemindTime() - { - return iNextRemindTime; - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateBGInternalFileHandler::SetNextRemindTime -// -// ----------------------------------------------------------------------------- -// -void CIAUpdateBGInternalFileHandler::SetNextRemindTime( TTime aNextRemindTime ) - { - iNextRemindTime = aNextRemindTime; - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateBGInternalFileHandler::SetNextRemindTime -// -// ----------------------------------------------------------------------------- -// -void CIAUpdateBGInternalFileHandler::SetNextRemindTime( TInt64 aNextRemindTime ) - { - iNextRemindTime = aNextRemindTime; - } - - // ----------------------------------------------------------------------------- // CIAUpdateBGInternalFileHandler::SetMode // @@ -382,6 +323,7 @@ // Static casting is safe to do here because enum and TInt are the same. SetUserRejectNewFeatureDialog( static_cast< TBool >( userDecision ) ); + /* TInt64 nextRemindTime( 0 ); aStream >> nextRemindTime; SetNextRemindTime( nextRemindTime ); @@ -389,6 +331,7 @@ TInt remindOn( aStream.ReadUint8L() ); // Static casting is safe to do here because enum and TInt are the same. SetReminder( static_cast< TBool >( remindOn ) ); + */ TInt mode( aStream.ReadUint8L() ); SetMode( static_cast (mode) ); @@ -424,11 +367,13 @@ TInt userDecision ( UserRejectNewFeatureDialog() ); aStream.WriteUint8L( userDecision ); + /* TInt64 nextRemindTime( NextRemindTime().Int64() ); aStream << nextRemindTime; TInt remindOn ( ReminderOn() ); aStream.WriteUint8L( remindOn ); + */ TInt mode( Mode() ); aStream.WriteUint8L( mode ); diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/backgroundchecker/src/iaupdatebgrefreshtimer.cpp --- a/iaupdate/IAD/backgroundchecker/src/iaupdatebgrefreshtimer.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/backgroundchecker/src/iaupdatebgrefreshtimer.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -25,10 +25,6 @@ #include #include #include -// #include -//#include -//#include -//#include #include #include #include //sysversioninfo @@ -46,13 +42,9 @@ //MACROS _LIT8( KRefreshFromNetworkDenied, "1" ); -// _LIT(KIAUpdateResourceFile, "iaupdate.rsc"); _LIT(KIAUpdateLauncherExe, "iaupdatelauncher.exe" ); -_LIT(KImageFile, "qgn_note_swupdate_notification.svg"); _LIT8( KFirstTimeCase, "0" ); - - //CONSTANTS const TUint KIADUpdateLauncherUid( 0x2001FE2F ); @@ -77,7 +69,6 @@ CTimer::ConstructL(); CActiveScheduler::Add( this ); - iReminderTimer = CIAUpdateBGReminderTimer::NewL( this ); iUpdate = NULL; iParameters = NULL; @@ -88,28 +79,18 @@ iInternalFile = CIAUpdateBGInternalFileHandler::NewL(); - iSoftNotification = CIAUpdateBGSoftNotification::NewL( this ); //, iInternalFile ); - // HLa: iSoftNotification->StartObservingIfNeededL(); - - // Get resource file path - /* HLa - TFileName fileName; - fileName.Copy(TParsePtrC(RProcess().FileName()).Drive()); - fileName.Append(KDC_APP_RESOURCE_DIR); - fileName.Append(KIAUpdateResourceFile); - */ + iSoftNotification = CIAUpdateBGSoftNotification::NewL( this ); - User::LeaveIfError(iFs.Connect()); - - // Get language of resource file - //BaflUtils::NearestLanguageFile( iFs, fileName ); - - // Open resource file - //iResourceFile.OpenL( iFs, fileName ); - //iResourceFile.ConfirmSignatureL(); + // loc: initialize localisation text loader + /* + TBool res = HbTextResolverSymbian::Init(KLocFile, KLocFilePath); + if ( res != KErrNone ) + { + // nothing to do + } + */ } - // ---------------------------------------------------------- // CIAUpdateBGTimer::~CIAUpdateBGTimer() // ---------------------------------------------------------- @@ -118,7 +99,6 @@ Cancel(); delete iUpdate; delete iParameters; - delete iReminderTimer; if ( iNotifyHandler ) { @@ -131,11 +111,8 @@ delete iInternalFile; delete iSoftNotification; - // iResourceFile.Close(); - iFs.Close(); } - // ---------------------------------------------------------- // CIAUpdateBGTimer::StartProcessL() // ---------------------------------------------------------- @@ -145,27 +122,20 @@ iMode = ModeL(); - //HLa - TBool test1 = IsAgreementAcceptedL(); - TBool test2 = ReminderOnL(); - - int test = 0; switch ( iMode ) { case EFirstTimeMode: - - // while not released keep in sleep mode - //int test = 1; - if ( test == 0 ) { - ListenAutoUpdateSettingsL(); - iMode = ESleepMode; - SetModeL( iMode ); - return; - } + // while not released keep in sleep mode + int test = 0; + if ( test == 0 ) + { + ListenAutoUpdateSettingsL(); + iMode = ESleepMode; + SetModeL( iMode ); + return; + } - //case EFirstTimeRemindMode: - { if ( IsFirstTimeDialogDisabledL() ) { //this should only happen in testing @@ -193,9 +163,6 @@ FLOG("[bgchecker] StartProcessL EFirstTimeMode"); - - - //Wait for some days before activate the first time mode TTimeIntervalMinutes timetowait = TimeIntervalFromNextShowOfNewFeatureDialogL(); @@ -239,17 +206,10 @@ break; } -/* + case EFirstTimeMode2: { - FLOG("[bgchecker] StartProcessL EFirstTimeMode2"); - RunL(); - break; - } -*/ - case EFirstTimeMode2: - { - FLOG("[bgchecker] StartProcessL EFirstTimeMode 3"); + FLOG("[bgchecker] StartProcessL EFirstTimeMode 2"); //if user accepted the disclaimer already and reboot the phone, //this mode could go to network immediately after boot //We put one min delay here to wait for network ready. @@ -294,6 +254,10 @@ case ENormalMode: case ERetryMode: { + + // Check if indicator should be shown + + StartUpdatesCheckingL(); break; } @@ -321,19 +285,6 @@ // ---------------------------------------------------------- -// CIAUpdateBGTimer::IsAskedAlreadyL() -// ---------------------------------------------------------- -TBool CIAUpdateBGTimer::IsAskedAlreadyL() - { - CIAUpdateBGFirstTimeHandler* fthandler = CIAUpdateBGFirstTimeHandler::NewL(); - CleanupStack::PushL( fthandler ); - TBool result = fthandler->AgreementAskedL(); - CleanupStack::PopAndDestroy( fthandler ); - return result; - } - - -// ---------------------------------------------------------- // CIAUpdateBGTimer::StartUpdatesCheckingL() // ---------------------------------------------------------- void CIAUpdateBGTimer::StartUpdatesCheckingL() @@ -369,38 +320,7 @@ FLOG_NUM( "Start checking update after %d minutes", timetowait.Int()); StartL( timetowait ); - //start reminder timer also if user choose later before reboot - //check the value from private folder - - - if ( ReminderOnL() ) - { - TTime currenttime; - currenttime.UniversalTime(); - - FTIME( currenttime ); - - TTime nextremindtime = NextRemindTimeL(); - - FTIME( nextremindtime ); - - TTimeIntervalMinutes timetogo; - nextremindtime.MinutesFrom( currenttime, timetogo ); - - FLOG_NUM("time to go = %d", timetogo.Int() ); - - if ( timetogo.Int() <= 0 ) - { - //pop up the reminder directly - ReminderTimerCallBack(); - } - else - { - iReminderTimer->StartReminderTimerL( timetogo ); - } - } - - } + } } @@ -527,48 +447,6 @@ // ---------------------------------------------------------- -// CIAUpdateBGTimer::NextRemindTimeL() -// ---------------------------------------------------------- -TTime CIAUpdateBGTimer::NextRemindTimeL() - { - iInternalFile->ReadControllerDataL(); - return iInternalFile->NextRemindTime(); - } - - -// ---------------------------------------------------------- -// CIAUpdateBGTimer::SetNextRemindTimeL() -// ---------------------------------------------------------- -TInt CIAUpdateBGTimer::SetNextRemindTimeL( TTime aTime ) - { - iInternalFile->SetNextRemindTime( aTime ); - TRAPD( err,iInternalFile->WriteControllerDataL() ); - return err; - } - - -// ---------------------------------------------------------- -// CIAUpdateBGTimer::ReminderOnL() -// ---------------------------------------------------------- -TBool CIAUpdateBGTimer::ReminderOnL() - { - iInternalFile->ReadControllerDataL(); - return iInternalFile->ReminderOn(); - } - - -// ---------------------------------------------------------- -// CIAUpdateBGTimer::SetReminderL() -// ---------------------------------------------------------- -TInt CIAUpdateBGTimer::SetReminderL( TBool aOn ) - { - iInternalFile->SetReminder( aOn ); - TRAPD( err,iInternalFile->WriteControllerDataL() ); - return err; - } - - -// ---------------------------------------------------------- // CIAUpdateBGTimer::ModeL() // ---------------------------------------------------------- TIAUpdateBGMode CIAUpdateBGTimer::ModeL() @@ -625,17 +503,6 @@ void CIAUpdateBGTimer::DoUpdatesCheckingL( const TBool& aUpdateFromServer ) { FLOG( "DoUpdatesCheckingL update"); - //turn off the reminder, user will decide whether to turn if on or off - //The user's decision will be checked in soft notification callback function - - - if ( ReminderOnL()) - { - FLOG( "Do CheckUpdates 3"); - iReminderTimer->CancelReminderTimerL(); - SetReminderL( EFalse ); - } - if( !iUpdate ) { @@ -740,8 +607,6 @@ FLOG( "CheckUpdatesComplete 4"); LaunchNotificationL( aAvailableUpdates ); - //LaunchSoftNotificationL(R_IAUPDATE_UPDATE_AVAILABLE, - // R_TEXT_SOFTKEY_SHOW, R_TEXT_SOFTKEY_LATER ); } FLOG( "CheckUpdatesComplete 5"); @@ -788,19 +653,6 @@ StartL( interval ); SetLastRefreshTime(); } - else - { - //don't show soft notification and restart the timer. - TTimeIntervalMinutes oneweek( UpdateAvailableReminderIntervalInMinutesL() ); - TTime currenttime; - currenttime.UniversalTime(); - TTime nextRemindTime = currenttime + oneweek; - - SetReminderL( ETrue ); - SetNextRemindTimeL( nextRemindTime ); - - iReminderTimer->StartReminderTimerL( oneweek ); - } //clear the retry time SetRetryTimesL( 0 ); } @@ -945,7 +797,6 @@ break; case EFirstTimeMode: - //case EFirstTimeRemindMode: { FLOG("[bgchecker] runl EFirstTimeMode"); @@ -970,18 +821,10 @@ } } break; - /* + case EFirstTimeMode2: { - FLOG("[bgchecker] runl EFirstTimeMode2"); - LaunchNotificationL( 1 ); - //LaunchSoftNotificationL(R_IAUPDATE_REMIND_LATER, R_TEXT_SOFTKEY_YES, R_TEXT_SOFTKEY_NO ); - } - break; - */ - case EFirstTimeMode2: - { - FLOG("[bgchecker] runl EFirstTimeMode3"); + FLOG("[bgchecker] runl EFirstTimeMode2"); //disclaimer is not accepted if ( !IsAgreementAcceptedL() ) @@ -1012,146 +855,6 @@ } -/* -// ---------------------------------------------------------- -// CIAUpdateBGTimer::RunL() -// ---------------------------------------------------------- -void CIAUpdateBGTimer::RunL() - { - FLOG("[bgchecker]RunL() "); - if ( !IAUpdateEnabledL() ) - { - Shutdown(); - return; - } - User::LeaveIfError( iStatus.Int() ); - //Check the mode again, in case the mode is changed while waiting. - iMode = ModeL(); - - switch ( iMode ) - { - case ENormalMode: - case ERetryMode: - { - FLOG("[bgchecker]RunL() ENormalMode"); - //roaming case is checked in IAUpdate server side - if ( IsAutoUpdateDisabledL() ) - { - ListenAutoUpdateSettingsL(); - - iMode = ESleepMode; - SetModeL( iMode ); - - //the program is waked up when automatic checking is changed by user. - //cenrep call back will be used. - return; - } - - FLOG("[bgchecker]RunL() ENormalMode 1"); - - if(iRuns == 0) - { - FLOG("[bgchecker]RunL() ENormalMode 2"); - // if user did the refresh from server while waiting, restart the timer. - // the last refresh time is read from the private file of IAUpdate server. - TTimeIntervalMinutes timetowait = - TimeIntervalFromNextRefreshL(); - - if (timetowait.Int() <= 0 ) - { - DoUpdatesCheckingL( ETrue ); - } - else - { - StartL( timetowait ); - } - FLOG("[bgchecker]RunL() ENormalMode 3"); - } - else - { - FLOG("[bgchecker]RunL() ENormalMode 4"); - TTimeIntervalMinutes timetowait = TimeIntervalFromNextRefreshL(); - - if ( timetowait.Int() <= 0 ) - { - StartL( StartNow ); - } - else - { - StartL( timetowait ); - } - FLOG("[bgchecker]RunL() ENormalMode 5"); - } - } - break; - - case EFirstTimeMode: - case EFirstTimeRemindMode: - { - FLOG("[bgchecker] runl EFirstTimeMode"); - - if ( iRuns == 0 ) - { - FLOG("[bgchecker] runl run = 0"); - HandlerFirstTimeL(); - } - else - { - FLOG("[bgchecker] runl still wait"); - TTimeIntervalMinutes timetowait = TimeIntervalFromNextShowOfNewFeatureDialogL(); - - if ( timetowait.Int() <= 0 ) - { - StartL( StartNow ); - } - else - { - StartL( timetowait ); - } - } - } - break; - - case EFirstTimeMode2: - { - FLOG("[bgchecker] runl EFirstTimeMode2"); - LaunchNotificationL( 1 ); - //LaunchSoftNotificationL(R_IAUPDATE_REMIND_LATER, R_TEXT_SOFTKEY_YES, R_TEXT_SOFTKEY_NO ); - } - break; - - case EFirstTimeMode3: - { - FLOG("[bgchecker] runl EFirstTimeMode3"); - //disclaimer is not accepted - - if ( !IsAgreementAcceptedL() ) - { - FLOG("[bgchecker] runl EFirstTimeMode reject disclaimer"); - //user accepte the new feature dialog but user reject sthe disclaimer - //in sleep mode now - iMode = ESleepMode; - SetModeL( iMode ); - //subscribe to cenrep key for automatic checking for wake up from sleep mode - ListenAutoUpdateSettingsL(); - } - else - { - FLOG("[bgchecker] runl EFirstTimeMode go to normal mode"); - //Set to Normal mode - //check autochecksetting in Runl later - iMode = ENormalMode; - SetModeL( iMode ); - StartL( StartNow ); - } - } - break; - - default: - break; - }; - - }*/ // ---------------------------------------------------------- // CIAUpdateBGTimer::HandlerFirstTimeL() @@ -1178,8 +881,6 @@ //this is first time mode FLOG("[bgchecker]HandlerFirstTimeL 3 "); LaunchNotificationL( 0 ); - // LaunchSoftNotificationL( R_IAUPDATE_FEATURES_AVAILABLE, - // R_TEXT_SOFTKEY_OK, R_TEXT_SOFTKEY_CANCEL ); } } @@ -1446,12 +1147,6 @@ FLOG(" current mode is FirstTimeMode "); interval = FirstTimeDialogDelayInMinutesL(); } - /* - else if ( ModeL() == EFirstTimeRemindMode ) - { - FLOG(" current mode is FirstTimeRemindMode"); - interval = FirstTimeDialogReminderIntervalInMinutesL(); - }*/ else { //nothing @@ -1485,7 +1180,6 @@ switch ( iMode ) { case EFirstTimeMode: - // case EFirstTimeRemindMode: { FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode"); @@ -1499,12 +1193,6 @@ //subscribe to cenrep key for automatic checking for wake up from sleep mode ListenAutoUpdateSettingsL(); - /* - FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode not accepted"); - iMode = EFirstTimeMode2; - SetModeL( iMode ); - StartL( StartNow ); - */ } else { @@ -1524,60 +1212,13 @@ break; } - - /* - case EFirstTimeMode2: // reminder - { - FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode2 "); - if ( aIsAccepted ) // reminder accepted ? - { - FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode2, accepted"); - //user wants to be reminder so remind in 4 weeks - //set to first time remind mode - iMode = EFirstTimeRemindMode; - SetModeL( iMode ); - TTimeIntervalMinutes fourweeks( FirstTimeDialogReminderIntervalInMinutesL() ); - TTime currenttime; - currenttime.UniversalTime(); - - //save the next show new feature dialog time - //in case use switch off the device and restarted. - User::LeaveIfError( SetLastTimeShowNewFeatureDialogL( currenttime ) ); - - StartL( fourweeks ); - return; - } - else - { - FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode2, not accepted"); - //in sleep mode now - iMode = ESleepMode; - SetModeL( iMode ); - - //subscribe to cenrep key for automatic checking for wake up from sleep mode - ListenAutoUpdateSettingsL(); - } - break; - } - */ case ENormalMode: { FLOG("[bgchecker] SoftNotificationCallBack ENormalMode"); if ( !aIsAccepted ) { FLOG("[bgchecker] SoftNotificationCallBack ENormalMode not accpeted"); - //user wants to be reminded later - TTimeIntervalMinutes oneweek( UpdateAvailableReminderIntervalInMinutesL() ); - TTime currenttime; - currenttime.UniversalTime(); - TTime nextRemindTime = currenttime + oneweek; - - SetReminderL( ETrue ); - SetNextRemindTimeL( nextRemindTime ); - iReminderTimer->StartReminderTimerL( oneweek ); - - //the reminder call back function will be called when reminder timer expires. } else { @@ -1599,127 +1240,6 @@ } } -/* -// ---------------------------------------------------------- -// CIAUpdateBGTimer::DoSoftNotificationCallBackL() -// ---------------------------------------------------------- -void CIAUpdateBGTimer::DoSoftNotificationCallBackL( TBool aIsAccepted ) - { - FLOG("[bgchecker] SoftNotificationCallBack"); - if ( !IAUpdateEnabledL() ) - { - Shutdown(); - return; - } - iMode = ModeL(); - - switch ( iMode ) - { - case EFirstTimeMode: - case EFirstTimeRemindMode: - { - - FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode"); - if ( !aIsAccepted ) - { - FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode not accepted"); - iMode = EFirstTimeMode2; - SetModeL( iMode ); - StartL( StartNow ); - } - else - { - FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMod accepeted"); - StartIaupdateL(); - //iaupdate is launched - //check the disclaimer acceptance and automatic checking setting in 10mins - - StartL( KDelayForUserToAcceptDisclaimer ); - iMode = EFirstTimeMode3; - SetModeL( iMode ); - - - //Still in first time mode, - //check user's setting and disclamier after 10mins. - } - break; - } - - - - case EFirstTimeMode2: // reminder - { - FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode2 "); - if ( aIsAccepted ) // reminder accepted ? - { - FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode2, accepted"); - //user wants to be reminder so remind in 4 weeks - //set to first time remind mode - iMode = EFirstTimeRemindMode; - SetModeL( iMode ); - TTimeIntervalMinutes fourweeks( FirstTimeDialogReminderIntervalInMinutesL() ); - TTime currenttime; - currenttime.UniversalTime(); - - //save the next show new feature dialog time - //in case use switch off the device and restarted. - User::LeaveIfError( SetLastTimeShowNewFeatureDialogL( currenttime ) ); - - StartL( fourweeks ); - return; - } - else - { - FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode2, not accepted"); - //in sleep mode now - iMode = ESleepMode; - SetModeL( iMode ); - - //subscribe to cenrep key for automatic checking for wake up from sleep mode - ListenAutoUpdateSettingsL(); - } - break; - } - - case ENormalMode: - { - FLOG("[bgchecker] SoftNotificationCallBack ENormalMode"); - if ( !aIsAccepted ) - { - FLOG("[bgchecker] SoftNotificationCallBack ENormalMode not accpeted"); - //user wants to be reminded later - TTimeIntervalMinutes oneweek( UpdateAvailableReminderIntervalInMinutesL() ); - TTime currenttime; - currenttime.UniversalTime(); - TTime nextRemindTime = currenttime + oneweek; - - SetReminderL( ETrue ); - SetNextRemindTimeL( nextRemindTime ); - - iReminderTimer->StartReminderTimerL( oneweek ); - - //the reminder call back function will be called when reminder timer expires. - } - else - { - //accepted, launch iad - StartIaupdateL(); - } - break; - } - - case ESleepMode: - { - FLOG("[bgchecker] SoftNotificationCallBack ESleepMode"); - //donothing - break; - } - - default: - break; - } - } */ - // ---------------------------------------------------------- // CIAUpdateBGTimer::SoftNotificationCallBack() // ---------------------------------------------------------- @@ -1737,58 +1257,6 @@ return iMode; } - - -// ---------------------------------------------------------- -// CIAUpdateBGTimer::DoReminderTimerCallBack() -// ---------------------------------------------------------- -void CIAUpdateBGTimer::DoReminderTimerCallBackL() - { - FLOG("[bgchecker] ReminderTimerCallBack begin"); - if ( !IAUpdateEnabledL() ) - { - Shutdown(); - return; - } - //Check the automatic update setting, if it has been disabled, - //then go to sleep mode. - if ( IsAutoUpdateDisabledL() ) - { - FLOG("[bgchecker] ReminderTimerCallBack autoupdate is disabled, switch to sleep mode"); - ListenAutoUpdateSettingsL(); - iMode = ESleepMode; - SetModeL( iMode ); - return; - } - - TTimeIntervalMinutes timetowait = TimeIntervalFromNextRefreshL(); - - if ( timetowait.Int() <= KRefreshTimerReminderTimerGap ) - { - FLOG("[bgchecker] ReminderTimerCallBack refresh is about to come in one day. We don't show reminder then"); - return; - } - - //if reminder is still on which means the BGTimer is not expired - //and checkupdate() is not called yet, then go ahead to call DoupdatesChecking - //this is to avoid DoUpdateChecking being called at the same time. - - if ( ReminderOnL() ) - { - FLOG("[bgchecker] ReminderTimerCallBack Reminder is still ON"); - DoUpdatesCheckingL( EFalse ); - } - FLOG("[bgchecker] ReminderTimerCallBack end"); - } - -// ---------------------------------------------------------- -// CIAUpdateBGTimer::ReminderTimerCallBack() -// ---------------------------------------------------------- -void CIAUpdateBGTimer::ReminderTimerCallBack() - { - TRAP_IGNORE( DoReminderTimerCallBackL() ); - } - // ---------------------------------------------------------- // CIAUpdateBGTimer::LaunchNotificationL( const int aNrOfUpdates ) // ---------------------------------------------------------- @@ -1874,7 +1342,6 @@ // HBufC* secondText3 = HbTextResolverSymbian::LoadL(KTextSecond); // CleanupStack::PushL( titleText ); - //TBuf<256> iconPath; TBuf<128> titleText; TBuf<128> secondText; @@ -1893,6 +1360,7 @@ secondText.Append(KSecondText); // icon + /* HLa--> if ( iMode == ENormalMode ) { TFileName path; @@ -1906,7 +1374,7 @@ //CleanupStack::PopAndDestroy( image ); } } - + */ // loc: set image path // iSoftNotification->SetImagePathL( KIcon ); @@ -1922,211 +1390,10 @@ iSoftNotification->SetNrOfUpdates( aNrOfUpdates ); iSoftNotification->ShowNotificationL(); - FLOG("[bgchecker] LaunchSoftNotificationL 1"); - // CleanupStack::PopAndDestroy( 3 ); //text, sk1, sk2 + FLOG("[bgchecker] LaunchNotificationL 1"); return; } -// ---------------------------------------------------------- -// CIAUpdateBGTimer::LaunchSoftNotificationL() -// ---------------------------------------------------------- -/* HLa -void CIAUpdateBGTimer::LaunchSoftNotificationL( const TInt& aResourceId, const TInt& SK1, const TInt& SK2 ) - { - iInternalFile->ReadControllerDataL(); - TInt snid = iInternalFile->SoftNotificationID(); - if ( snid ) - { - //there is a soft notification buffered, remove it - iSoftNotification->RemoveSoftNotificationL( snid ); - } - - FLOG("[bgchecker] LaunchSoftNotificationL "); - HBufC* text = ReadResourceLC( aResourceId ); - HBufC* sk1 = ReadResourceLC( SK1 ); - HBufC* sk2 = ReadResourceLC( SK2 ); - - - iMode = ModeL(); - - if ( iMode == ENormalMode ) - { - TFileName path; - TInt err = GetPrivatePathL( path ); - - if ( err == KErrNone ) - { - HBufC8* image = LoadFileLC( path ); - iSoftNotification->SetImageL( *image ); - //iSoftNotification->SetImagePathL( *image ); - CleanupStack::PopAndDestroy( image ); - } - } - - - iSoftNotification->SetTextL( *text, *text ); - - iSoftNotification->ShowSoftNotificationL(); - FLOG("[bgchecker] LaunchSoftNotificationL 1"); - CleanupStack::PopAndDestroy( 3 ); //text, sk1, sk2 - } -*/ - - -// ---------------------------------------------------------- -// CIAUpdateBGTimer::GetPrivatePathL() -// ---------------------------------------------------------- -TInt CIAUpdateBGTimer::GetPrivatePathL( TFileName& aPath ) - { - RFs fsSession; - User::LeaveIfError( fsSession.Connect() ); - CleanupClosePushL( fsSession ); - - // This will set the correct drive and private path - // for the file server session. - TInt err = KErrNone; - TRAP( err, SetPrivateDriveL( fsSession, KImageFile ) ); - - if ( err != KErrNone ) - { - CleanupStack::PopAndDestroy( &fsSession ); - return err; - } - - err = fsSession.SessionPath( aPath ); - aPath.Append( KImageFile ); - - CleanupStack::PopAndDestroy( &fsSession ); - return err; - } - -/* -// ---------------------------------------------------------- -// CIAUpdateBGTimer::LoadFileLC() -// ---------------------------------------------------------- - HBufC8* CIAUpdateBGTimer::LoadFileLC(const TDesC& aFile) - { - RFs fs; - User::LeaveIfError( fs.Connect() ); - CleanupClosePushL( fs ); - RFile file; - User::LeaveIfError(file.Open(fs, aFile, EFileRead)); - CleanupClosePushL(file); - TInt size; - User::LeaveIfError(file.Size(size)); - HBufC8* imagebuf = HBufC8::NewL(size); - TPtr8 imageptr(imagebuf->Des()); - file.Read(imageptr); - CleanupStack::PopAndDestroy( &file ); - CleanupStack::PopAndDestroy( &fs ); - CleanupDeletePushL(imagebuf); - return imagebuf; - } -*/ - - // ---------------------------------------------------------- - // CIAUpdateBGTimer::SetPrivateDriveL() - // ---------------------------------------------------------- - void CIAUpdateBGTimer::SetPrivateDriveL( - RFs& aFs, - const TDesC& aFileName ) const - { - // First try to find the file from the private directory - // of the drive where the process exists. - RProcess process; - - // Set the session private path according to - // the process file name drive. - TInt driveNum( - SetSessionPrivatePathL( aFs, process.FileName() ) ); - - // Get the session path that was set above. - TFileName sessionPath; - User::LeaveIfError( aFs.SessionPath( sessionPath ) ); - - // Use the file finder to check if the file actually exists - // in the given drive path. If it does not, the file finder - // will automatically check from other drives. So, here we - // should always find the file if any exists. - TFindFile finder( aFs ); - User::LeaveIfError( finder.FindByDir( aFileName, sessionPath ) ); - - // The drive may have changed if the file was not found from - // the first suggested drive. So, be sure to have the correct - // private path. - driveNum = SetSessionPrivatePathL( aFs, finder.File() ); - - // Use the drive info to check if the drive is ROM drive. - // We prefer non ROM drives. But, accept ROM if nothing else is - // available. - TDriveInfo info; - User::LeaveIfError( aFs.Drive( info, driveNum ) ); - TBool isRomDrive( info.iDriveAtt & KDriveAttRom ); - if ( !isRomDrive ) - { - // The current file is not in ROM drive so use that. - return; - } - - // Because previous finding was ROM file, try to find a non ROM file. - TInt findErrorCode( finder.Find() ); - if ( findErrorCode == KErrNotFound ) - { - // Because no new file is found, use the current settings. - return; - } - User::LeaveIfError( findErrorCode ); - - // Update the session path for the correct file. - SetSessionPrivatePathL( aFs, finder.File() ); - } - - - // ---------------------------------------------------------- - // CIAUpdateBGTimer::SetSessionPrivatePathL() - // ---------------------------------------------------------- - TInt CIAUpdateBGTimer::SetSessionPrivatePathL( - RFs& aFs, - const TDesC& aPath ) const - { - // Use the parser to get the drive information from the path. - TParsePtrC parser( aPath ); - - if ( !parser.DrivePresent() ) - { - User::Leave( KErrArgument ); - } - - // Drive check was passed above. - // So, drive information is safe to use. - const TDesC& drive( parser.Drive() ); - const TChar driveChar( drive[ 0 ] ); - TInt driveNum( EDriveA ); - User::LeaveIfError( - RFs::CharToDrive( driveChar, driveNum ) ); - - // Set the file drive to be file session private path drive. - User::LeaveIfError( aFs.SetSessionToPrivate( driveNum ) ); - - return driveNum; - } - - -// ---------------------------------------------------------- -// CIAUpdateBGTimer::ReadResourceLC() -// ---------------------------------------------------------- - /* HLa -HBufC* CIAUpdateBGTimer::ReadResourceLC( TInt aResourceId ) - { - TResourceReader reader; - HBufC8* buff = iResourceFile.AllocReadLC( aResourceId ); - reader.SetBuffer( buff ); - HBufC* text = reader.ReadHBufCL(); - CleanupStack::PopAndDestroy( buff ); - CleanupStack::PushL( text ); - return text; - } */ - // ---------------------------------------------------------- // CIAUpdateBGTimer::IsAutoUpdateDisabledL() @@ -2255,8 +1522,8 @@ delete iUpdate; iUpdate = NULL; - delete iReminderTimer; - iReminderTimer = NULL; + //delete iReminderTimer; + //iReminderTimer = NULL; if ( iNotifyHandler ) { @@ -2267,7 +1534,6 @@ if ( iSoftNotification ) { - // TRAP_IGNORE( iSoftNotification->RemoveSoftNotificationL( iSoftNotification->Id() ) ); delete iSoftNotification; iSoftNotification = NULL; } @@ -2276,9 +1542,4 @@ FLOG("[bgchecker] Shutdown() end"); } - - - // End of file - - diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/backgroundchecker/src/iaupdatebgsoftnotification.cpp --- a/iaupdate/IAD/backgroundchecker/src/iaupdatebgsoftnotification.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/backgroundchecker/src/iaupdatebgsoftnotification.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -103,28 +103,19 @@ delete iTitle; delete iText; - - delete iImagePath; delete iNotificationDialog; } // ----------------------------------------------------------------------------- -// CIAUpdateBGSoftNotification::ShowSoftNotificationL +// CIAUpdateBGSoftNotification::ShowNotificationL // Displays notification // ----------------------------------------------------------------------------- // void CIAUpdateBGSoftNotification::ShowNotificationL() { - /* - _LIT( KIcon, "C:\\qgn_note_swupdate_notification.svg" ); - _LIT( KFirstTimeText, "Check for updates ?" ); - _LIT( KNormalText, "Check for updates ?" ); - _LIT( KTextRow2, "Tap to view" ); - */ - FLOG("[bgchecker] ShowNotificationL"); // crete dialog, id does not exist already @@ -133,11 +124,6 @@ iNotificationDialog = CHbDeviceNotificationDialogSymbian::NewL( this ); } - //CleanupStack::PushL( notificationDialog ); // --> memberiin - delete closessa/activaatiossa/destructorissa - // + leave kiinni + tuhoaminen - // save number of updates - //SetNrOfUpdates ( aNrOfUpdates ); - // enable indicator showing SetIndicatorEnabled( ETrue ); @@ -170,7 +156,7 @@ CHbSymbianVariant::EInt ); CleanupStack::PushL( varValue ); // Temporary removal - // ind->Activate( KIndicatorTypeBgc, varValue ); + ind->Activate( KIndicatorTypeBgc, varValue ); CleanupStack::PopAndDestroy( varValue ); CleanupStack::PopAndDestroy( ind ); @@ -191,7 +177,7 @@ CHbIndicatorSymbian *ind = CHbIndicatorSymbian::NewL(); CleanupStack::PushL( ind ); // Temporary removal - // ind->Deactivate( KIndicatorTypeBgc ); + ind->Deactivate( KIndicatorTypeBgc ); CleanupStack::PopAndDestroy(ind); return; @@ -216,19 +202,6 @@ } // ----------------------------------------------------------------------------- -// CIAUpdateBGSoftNotification::SetImagePathL -// Sets an image path for a soft notification -// ----------------------------------------------------------------------------- -// -void CIAUpdateBGSoftNotification::SetImagePathL( const TDesC& aImage ) - { - HBufC* txt = aImage.AllocL(); - delete iImagePath; - iImagePath = txt; - return; - } - -// ----------------------------------------------------------------------------- // CIAUpdateBGSoftNotification::SetNrOfUpdates // Sets an image path for a soft notification // ----------------------------------------------------------------------------- @@ -280,11 +253,6 @@ iNotificationDialog->SetTextL(iText->Des()); } - if ( iImagePath ) - { - iNotificationDialog->SetIconNameL(iImagePath->Des()); - } - // set wrapping, timeout and touch iNotificationDialog->SetTitleTextWrapping( CHbDeviceNotificationDialogSymbian::TextWordWrap); @@ -311,16 +279,6 @@ return iActivateIndicator; } -// ---------------------------------------------------------- -// CIAUpdateBGSoftNotification::SetNrOfUpdates( TIAUpdateBGMode aNrOfUpdates ) -// ---------------------------------------------------------- -/* -void CIAUpdateBGSoftNotification::SetNrOfUpdates( const int aNrOfUpdates ) - { - - iNrOfUpdates = aNrOfUpdates; - - }*/ // ---------------------------------------------------------- // CIAUpdateBGSoftNotification::GetNrOfUpdates() diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/bgcindicatorplugin/inc/bgcindicator.h --- a/iaupdate/IAD/bgcindicatorplugin/inc/bgcindicator.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/bgcindicatorplugin/inc/bgcindicator.h Tue Jul 06 14:23:31 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * - * Description: Message Indicator class + * Description: Backgroundchecker Indicator class * */ @@ -57,12 +57,8 @@ private: /** - * Prepares the display name from stream. - * @param dataStream data stream. + * Start the iaupdate client */ - //void prepareDisplayName(QDataStream& dataStream); - - //HLa void StartIaupdateL() const; private: diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/bgcindicatorplugin/inc/bgcindicatorplugin.h --- a/iaupdate/IAD/bgcindicatorplugin/inc/bgcindicatorplugin.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/bgcindicatorplugin/inc/bgcindicatorplugin.h Tue Jul 06 14:23:31 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * - * Description: Message Indicator Plugin Class + * Description: Backgroundchecker Indicator Plugin Class * */ @@ -26,8 +26,8 @@ #include /** - * Message indicator plugin class. - * Main class of message indicator plugin. + * Backgroundchecker indicator plugin class. + * Main class of backgroundchecker indicator plugin. */ class BgcIndicatorPlugin : public QObject, public HbIndicatorPluginInterface { diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/bgcindicatorplugin/resources/message.svg --- a/iaupdate/IAD/bgcindicatorplugin/resources/message.svg Wed Jun 23 18:20:02 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/bgcindicatorplugin/rom/bgcindicatorplugin.iby --- a/iaupdate/IAD/bgcindicatorplugin/rom/bgcindicatorplugin.iby Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/bgcindicatorplugin/rom/bgcindicatorplugin.iby Tue Jul 06 14:23:31 2010 +0300 @@ -20,5 +20,4 @@ REM DLL file=ABI_DIR\UREL\bgcindicatorplugin.dll SHARED_LIB_DIR\bgcindicatorplugin.dll UNPAGED data=\epoc32\data\z\resource\plugins\indicators\bgcindicatorplugin.qtplugin \resource\plugins\indicators\bgcindicatorplugin.qtplugin -data=\epoc32\s60\icons\qgn_note_swupdate_notification.svg \resource\iaupdate\qgn_note_swupdate_notification.svg #endif \ No newline at end of file diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/bgcindicatorplugin/src/bgcindicator.cpp --- a/iaupdate/IAD/bgcindicatorplugin/src/bgcindicator.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/bgcindicatorplugin/src/bgcindicator.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -131,9 +131,7 @@ case DecorationNameRole: case MonoDecorationNameRole: { - // QString iconName("z:/resource/messaging/message.svg"); - // HbIcon iconName1 ("c:/qgn_note_swupdate_notification.svg"); - QString iconName("z:/resource/iaupdate/qgn_note_swupdate_notification.svg"); + QString iconName(""); return iconName; } default: diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/engine/controller/src/iaupdateinstalloperation.cpp --- a/iaupdate/IAD/engine/controller/src/iaupdateinstalloperation.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/engine/controller/src/iaupdateinstalloperation.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -205,8 +205,10 @@ { // Install interface was available. // So, start installing with silent install operation. - SwiUI::TInstallOptions options( - IAUpdateUtils::SilentInstallOptionsL( Node() ) ); + // Get silent install parameters + Usif::COpaqueNamedParams * options = Usif::COpaqueNamedParams::NewLC(); + + IAUpdateUtils::UsifSilentInstallOptionsL ( options ); operation = install->SilentInstallL( *this, options ); @@ -216,7 +218,7 @@ IAUPDATE_TRACE("[IAUPDATE] ERROR Could not create the operation."); User::Leave( KErrGeneral ); } - + CleanupStack::Pop( options ); CleanupStack::PopAndDestroy( install ); } else diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/engine/controller/src/iaupdateloader.cpp --- a/iaupdate/IAD/engine/controller/src/iaupdateloader.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/engine/controller/src/iaupdateloader.cpp Tue Jul 06 14:23:31 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" @@ -504,18 +504,20 @@ IAUPDATE_TRACE_1("[IAUPDATE] Container child: %d", i); MNcdNode* node( aParentContainer.ChildL( i ) ); - CleanupReleasePushL( *node ); - - MNcdNodeContainer* container( - node->QueryInterfaceLC< MNcdNodeContainer >() ); - if ( container ) + if ( node ) { - IAUPDATE_TRACE("[IAUPDATE] Container child had container interface"); - LoadContainerL( *container ); - CleanupStack::PopAndDestroy( container ); + CleanupReleasePushL( *node ); + + MNcdNodeContainer* container( + node->QueryInterfaceLC< MNcdNodeContainer >() ); + if ( container ) + { + IAUPDATE_TRACE("[IAUPDATE] Container child had container interface"); + LoadContainerL( *container ); + CleanupStack::PopAndDestroy( container ); + } + CleanupStack::PopAndDestroy( node ); } - - CleanupStack::PopAndDestroy( node ); } IAUPDATE_TRACE("[IAUPDATE] CIAUpdateLoader::LoadChildContainersL() end"); @@ -636,55 +638,55 @@ for ( TInt i = 0; i < childCount; ++i ) { MNcdNode* node( aContainer.ChildL( i ) ); - CleanupReleasePushL( *node ); + if ( node ) + { + CleanupReleasePushL( *node ); - MNcdNodeContainer* container( - node->QueryInterfaceLC< MNcdNodeContainer >() ); - if ( container ) - { - IAUPDATE_TRACE_1("[IAUPDATE] Container child: %d had container interface", i); - - switch ( aPreviousOperationType ) + MNcdNodeContainer* container( + node->QueryInterfaceLC< MNcdNodeContainer >() ); + if ( container ) { - case TIAUpdateOperationInfo::ELoadRoot: - IAUPDATE_TRACE("[IAUPDATE] Load children of the root child"); - // When root is loaded, also its children are loaded - // and they have now their child count. So, no need to - // reload children of the root. Load their children - // directly now. - LoadChildrenL( *container ); - break; - - case TIAUpdateOperationInfo::ELoadChildren: - IAUPDATE_TRACE("[IAUPDATE] Load children of a container"); - // Notice, that now we need to first load the child count - // for the child containers. So, even if children were - // already updated by LoadChildrenL, a new request for - // containers needs . Otherwise, the child count - // will not be up-to-date. When the child containers are - // loaded, the flow will continue to load the children. - LoadContainerL( *container ); - break; + IAUPDATE_TRACE_1("[IAUPDATE] Container child: %d had container interface", i); + switch ( aPreviousOperationType ) + { + case TIAUpdateOperationInfo::ELoadRoot: + IAUPDATE_TRACE("[IAUPDATE] Load children of the root child"); + // When root is loaded, also its children are loaded + // and they have now their child count. So, no need to + // reload children of the root. Load their children + // directly now. + LoadChildrenL( *container ); + break; + + case TIAUpdateOperationInfo::ELoadChildren: + IAUPDATE_TRACE("[IAUPDATE] Load children of a container"); + // Notice, that now we need to first load the child count + // for the child containers. So, even if children were + // already updated by LoadChildrenL, a new request for + // containers needs . Otherwise, the child count + // will not be up-to-date. When the child containers are + // loaded, the flow will continue to load the children. + LoadContainerL( *container ); + break; - case TIAUpdateOperationInfo::ELoadAllChildren: - IAUPDATE_TRACE("[IAUPDATE] Load all children of a container"); - // Notice, here we will try to skip the loading of the child - // count of the container. So, all the children are tried to - // be loaded directly even if the child count may not be - // up-to-date. - LoadAllChildrenL( *container ); - break; - - default: - IAUPDATE_TRACE("[IAUPDATE] ERROR: Wrong operation type"); - User::Leave( KErrArgument ); - break; + case TIAUpdateOperationInfo::ELoadAllChildren: + IAUPDATE_TRACE("[IAUPDATE] Load all children of a container"); + // Notice, here we will try to skip the loading of the child + // count of the container. So, all the children are tried to + // be loaded directly even if the child count may not be + // up-to-date. + LoadAllChildrenL( *container ); + break; + + default: + IAUPDATE_TRACE("[IAUPDATE] ERROR: Wrong operation type"); + User::Leave( KErrArgument ); + break; + } + CleanupStack::PopAndDestroy( container ); } - - CleanupStack::PopAndDestroy( container ); + CleanupStack::PopAndDestroy( node ); } - - CleanupStack::PopAndDestroy( node ); } IAUPDATE_TRACE("[IAUPDATE] CIAUpdateLoader::LoadChildrenOfChildrenL() end"); diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/engine/controller/src/iaupdateutils.cpp --- a/iaupdate/IAD/engine/controller/src/iaupdateutils.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/engine/controller/src/iaupdateutils.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -509,124 +509,55 @@ // // --------------------------------------------------------------------------- -EXPORT_C void IAUpdateUtils::UsifSilentInstallOptionsL( +void IAUpdateUtils::UsifSilentInstallOptionsL( Usif::COpaqueNamedParams * aOptions ) { aOptions->AddIntL( Usif::KSifInParam_InstallSilently, ETrue ); // Upgrades are allowed - aOptions->AddIntL( Usif::KSifInParam_AllowUpgrade, ETrue ); + aOptions->AddIntL( Usif::KSifInParam_AllowUpgrade, Usif::EAllowed ); // Install all if optional packets exist. - aOptions->AddIntL( Usif::KSifInParam_InstallOptionalItems, ETrue ); + aOptions->AddIntL( Usif::KSifInParam_InstallOptionalItems, Usif::EAllowed ); // Prevent online cert revocation check. - aOptions->AddIntL( Usif::KSifInParam_PerformOCSP, EFalse ); + aOptions->AddIntL( Usif::KSifInParam_PerformOCSP, Usif::ENotAllowed ); // See iOCSP setting above - aOptions->AddIntL( Usif::KSifInParam_IgnoreOCSPWarnings, ETrue ); + aOptions->AddIntL( Usif::KSifInParam_IgnoreOCSPWarnings, Usif::EAllowed ); // Do not allow installation of uncertified packages. - aOptions->AddIntL( Usif::KSifInParam_AllowUntrusted, EFalse ); + aOptions->AddIntL( Usif::KSifInParam_AllowUntrusted, Usif::ENotAllowed ); // If filetexts are included in SIS package, show them. - aOptions->AddIntL( Usif::KSifInParam_PackageInfo, ETrue ); + aOptions->AddIntL( Usif::KSifInParam_PackageInfo, Usif::EAllowed ); // Automatically grant user capabilities. // See also KSifInParam_AllowUntrusted above. - aOptions->AddIntL( Usif::KSifInParam_GrantCapabilities, EFalse ); + aOptions->AddIntL( Usif::KSifInParam_GrantCapabilities, Usif::EAllowed ); // Open application will be closed. - aOptions->AddIntL( Usif::KSifInParam_AllowAppShutdown, ETrue ); + aOptions->AddIntL( Usif::KSifInParam_AllowAppShutdown, Usif::EAllowed ); // Files can be overwritten. - aOptions->AddIntL( Usif::KSifInParam_AllowOverwrite, ETrue ); + aOptions->AddIntL( Usif::KSifInParam_AllowOverwrite, Usif::EAllowed ); + + // Incompatible allowed + aOptions->AddIntL( Usif::KSifInParam_AllowIncompatible, Usif::EAllowed ); // This only affects Java applications. - aOptions->AddIntL( Usif::KSifInParam_AllowDownload, ETrue ); + aOptions->AddIntL( Usif::KSifInParam_AllowDownload, Usif::EAllowed ); // Where to save. - aOptions->AddIntL( Usif::KSifInParam_Drive, EDriveC ); + //aOptions->AddIntL( Usif::KSifInParam_Drive, EDriveC ); // Choose the phone language. TLanguage lang = User::Language(); - // aOptions->AddIntL( Usif::KSifInParam_Languages, lang ); // User::Language() ); + //aOptions->AddIntL( Usif::KSifInParam_Languages, lang ); // User::Language() ); //aOptions->AddIntL( Usif::KSifInParam_Drive, IAUpdateUtils::DriveToInstallL( aUid, aSize ) ); } -// --------------------------------------------------------------------------- -// IAUpdateUtils::SilentInstallOptionsL -// -// --------------------------------------------------------------------------- -// -SwiUI::TInstallOptions IAUpdateUtils::SilentInstallOptionsL( - const CIAUpdateBaseNode& aNode ) - { - IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::SilentInstallOptionsL() begin"); - SwiUI::TInstallOptions options; - - // Upgrades are allowed - options.iUpgrade = SwiUI::EPolicyAllowed; - - // Install all if optional packets exist. - options.iOptionalItems = SwiUI::EPolicyAllowed; - - // Prevent online cert revocation check. - options.iOCSP = SwiUI::EPolicyNotAllowed; - - // See iOCSP setting above - options.iIgnoreOCSPWarnings = SwiUI::EPolicyAllowed; - - // Do not allow installation of uncertified packages. - options.iUntrusted = SwiUI::EPolicyNotAllowed; - - // If filetexts are included in SIS package. Then, show them. - options.iPackageInfo = SwiUI::EPolicyUserConfirm; - - // Automatically grant user capabilities. - // See also iUntrusted above. - options.iCapabilities = SwiUI::EPolicyAllowed; - - // Open application will be closed. - options.iKillApp = SwiUI::EPolicyAllowed; - - // Files can be overwritten. - options.iOverwrite = SwiUI::EPolicyAllowed; - - // This only affects Java applications. - options.iDownload = SwiUI::EPolicyAllowed; - - // Where to save. - IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::SilentInstallOptionsL() before DriveToInstallL"); - TDriveUnit driveUnit; - if ( aNode.Mime().Compare( IAUpdateProtocolConsts::KMimeWidget ) == 0 ) - { - driveUnit = IAUpdateUtils::DriveToInstallWidgetL( aNode.Identifier() ); - } - else - { - driveUnit = IAUpdateUtils::DriveToInstallL( aNode.Uid(), aNode.OwnContentSizeL() ); - } - IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::SilentInstallOptionsL() after DriveToInstallL"); - - TDriveName driveName = driveUnit.Name(); - IAUPDATE_TRACE_1("[IAUPDATE] IAUpdateUtils::SilentInstallOptionsL() driveName: %S", &driveName ); - options.iDrive = driveName[0]; - - // Choose the phone language. - options.iLang = User::Language(); - - // If language is asked, then use the current phone language. - options.iUsePhoneLang = ETrue; - - // Does not affect SISX. This is for Java. - options.iUpgradeData = SwiUI::EPolicyAllowed; - IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::SilentInstallOptionsL() end"); - return options; - } - - // ----------------------------------------------------------------------------- // IAUpdateUtils::InstalledDriveL // diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/engine/group/iaupdateengine.mmp --- a/iaupdate/IAD/engine/group/iaupdateengine.mmp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/engine/group/iaupdateengine.mmp Tue Jul 06 14:23:31 2010 +0300 @@ -114,7 +114,7 @@ LIBRARY platformenv.lib LIBRARY platformver.lib // System version info LIBRARY etel3rdparty.lib -LIBRARY swinstcli.lib +//LIBRARY swinstcli.lib LIBRARY apmime.lib LIBRARY ecom.lib // For the NCD Engine ECOM session closing. LIBRARY sysversioninfo.lib diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/engine/inc/iaupdateutils.h --- a/iaupdate/IAD/engine/inc/iaupdateutils.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/engine/inc/iaupdateutils.h Tue Jul 06 14:23:31 2010 +0300 @@ -135,7 +135,7 @@ * * @param aOptions Silent install options */ -IMPORT_C void UsifSilentInstallOptionsL( Usif::COpaqueNamedParams * aOptions ); +void UsifSilentInstallOptionsL( Usif::COpaqueNamedParams * aOptions ); /** * Finds drive where a package is currently installed diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/firmwareupdate/inc/iaupdatefwfotamodel.h --- a/iaupdate/IAD/firmwareupdate/inc/iaupdatefwfotamodel.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/firmwareupdate/inc/iaupdatefwfotamodel.h Tue Jul 06 14:23:31 2010 +0300 @@ -23,6 +23,7 @@ // INCLUDES #include +#include // FORWARD DECLARATIONS @@ -51,16 +52,6 @@ public: // New functions /** - * Retrieves the human readable name of the profile. - * @since Series 60 3.1 - * @param aProfileId Profile identifier - * @param aProfileId Human readable name of the profile, or KNullDesC if not found. - * @return None - */ - void GetProfileNameL( const TInt aProfileId, - HBufC* aProfileName ) const; - - /** * Retrieves the default fota profile identifier from * the central repository. * @since Series 60 3.1 diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/firmwareupdate/inc/iaupdatefwsynchandler.h --- a/iaupdate/IAD/firmwareupdate/inc/iaupdatefwsynchandler.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/firmwareupdate/inc/iaupdatefwsynchandler.h Tue Jul 06 14:23:31 2010 +0300 @@ -23,7 +23,7 @@ // INCLUDES #include #include -#include +#include #include "iaupdatefwsyncutil.h" #include "iaupdatefwsyncprofile.h" @@ -272,8 +272,8 @@ private: TUint32 SelectConnectionMethodL(); - TUint32 GetBestIAPInInternetSNAPL( RCmManagerExt& aCmManagerExt ); - TUint32 GetBestIAPInThisSNAPL( RCmManagerExt& aCmManagerExt, TUint32 aSNAPID ); + TUint32 GetBestIAPInInternetSNAPL( RCmManager& aCmManager ); + TUint32 GetBestIAPInThisSNAPL( RCmManager& aCmManager, TUint32 aSNAPID ); private: // session with sync server diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/firmwareupdate/src/iaupdatefwfotamodel.cpp --- a/iaupdate/IAD/firmwareupdate/src/iaupdatefwfotamodel.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/firmwareupdate/src/iaupdatefwfotamodel.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -57,37 +57,6 @@ // ----------------------------------------------------------------------------- -// CIAUpdateFWFotaModel::GetProfileName -// Changes aProfileName to KNullDesC if the profile identifier is -// not found. -// ----------------------------------------------------------------------------- -// -void CIAUpdateFWFotaModel::GetProfileNameL( const TInt aProfileId, - HBufC* aProfileName ) const - { - FLOG( "[IAUPDATEFW] CIAUpdateFWFotaModel::GetProfileNameL() - not implemented" ); - -/*KNST - TInt index( 0 ); - aProfileName->Des().Copy( KNullDesC ); - - iDocument->RefreshProfileListL( ETrue ); // Include hidden profile - CArrayFixFlat* profileList = iDocument->ProfileList( index ); - - for ( index = 0; index < profileList->Count(); index++ ) - { - if ( ( *profileList )[index].iProfileId == aProfileId ) - { - aProfileName->Des().Copy( ( *profileList )[index].iProfileName ); - } - } -*/ - FTRACE( FPrint( _L( - "[IAUPDATEFW] CIAUpdateFWFotaModel::GetProfileNameL(): aProfileId = %d, ProfileName = \"%S\"" ), - aProfileId, aProfileName ) ); - } - -// ----------------------------------------------------------------------------- // CIAUpdateFWFotaModel::DefaultFotaProfileIdL // ----------------------------------------------------------------------------- // diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/firmwareupdate/src/iaupdatefwsynchandler.cpp --- a/iaupdate/IAD/firmwareupdate/src/iaupdatefwsynchandler.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/firmwareupdate/src/iaupdatefwsynchandler.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -28,13 +28,15 @@ #include #include -#include +#include #include #include -#include +#include #include +#include + #include "iaupdateconnectionmethod.h" #include "iaupdateprivatecrkeys.h" #include "iaupdatefwfotamodel.h" @@ -424,16 +426,16 @@ CleanupStack::PopAndDestroy( cenrep ); cenrep = NULL; - RCmManagerExt cmManagerExt; - cmManagerExt.OpenL(); - CleanupClosePushL( cmManagerExt ); + RCmManager cmManager; + cmManager.OpenL(); + CleanupClosePushL( cmManager ); if ( connMethodId == -1 ) { //check what is the default connection by users TCmDefConnValue DCSetting; - cmManagerExt.ReadDefConnL( DCSetting ); + cmManager.ReadDefConnL( DCSetting ); switch ( DCSetting.iType ) @@ -442,13 +444,13 @@ case ECmDefConnAskOnce: { //go with the best IAP under internet snap - connectionMethodId = GetBestIAPInInternetSNAPL( cmManagerExt ); + connectionMethodId = GetBestIAPInInternetSNAPL( cmManager ); break; } case ECmDefConnDestination: { //go with the best IAP under this snap - connectionMethodId = GetBestIAPInThisSNAPL( cmManagerExt, DCSetting.iId ); + connectionMethodId = GetBestIAPInThisSNAPL( cmManager, DCSetting.iId ); break; } case ECmDefConnConnectionMethod: @@ -462,16 +464,16 @@ else if ( connMethodId == 0 ) { //no choice from user, we go with the best IAP under Internent SNAP - connectionMethodId = GetBestIAPInInternetSNAPL( cmManagerExt ); + connectionMethodId = GetBestIAPInInternetSNAPL( cmManager ); } else { // It was some SNAP value - connectionMethodId = GetBestIAPInThisSNAPL( cmManagerExt, connMethodId ); + connectionMethodId = GetBestIAPInThisSNAPL( cmManager, connMethodId ); } - CleanupStack::PopAndDestroy( &cmManagerExt ); + CleanupStack::PopAndDestroy( &cmManager ); return connectionMethodId; @@ -482,15 +484,15 @@ // CIAUpdateFWSyncHandler::GetBestIAPInInternetSNAPL // ----------------------------------------------------------------------------- // -TUint32 CIAUpdateFWSyncHandler::GetBestIAPInInternetSNAPL( RCmManagerExt& aCmManagerExt ) +TUint32 CIAUpdateFWSyncHandler::GetBestIAPInInternetSNAPL( RCmManager& aCmManager ) { //select IAP from Internet SNAP RArray destIdArray; - aCmManagerExt.AllDestinationsL( destIdArray ); + aCmManager.AllDestinationsL( destIdArray ); TUint32 InternetSNAPID = 0; for ( TInt i = 0; i< destIdArray.Count(); i++ ) { - RCmDestinationExt dest = aCmManagerExt.DestinationL( destIdArray[i] ); + RCmDestination dest = aCmManager.DestinationL( destIdArray[i] ); CleanupClosePushL( dest ); if ( dest.MetadataL( CMManager::ESnapMetadataInternet ) ) @@ -503,7 +505,7 @@ } destIdArray.Reset(); - return GetBestIAPInThisSNAPL( aCmManagerExt, InternetSNAPID ); + return GetBestIAPInThisSNAPL( aCmManager, InternetSNAPID ); } @@ -512,7 +514,7 @@ // CIAUpdateFWSyncHandler::GetBestIAPInThisSNAPL // ----------------------------------------------------------------------------- // -TUint32 CIAUpdateFWSyncHandler::GetBestIAPInThisSNAPL( RCmManagerExt& aCmManagerExt, TUint32 aSNAPID ) +TUint32 CIAUpdateFWSyncHandler::GetBestIAPInThisSNAPL( RCmManager& aCmManager, TUint32 aSNAPID ) { //get all usable IAPs TConnMonIapInfoBuf iapInfo; @@ -528,13 +530,13 @@ CleanupStack::PopAndDestroy( &connMon ); - RCmDestinationExt dest = aCmManagerExt.DestinationL( aSNAPID ); + RCmDestination dest = aCmManager.DestinationL( aSNAPID ); CleanupClosePushL( dest ); // Check whether the SNAP contains any IAP. for (TInt i = 0; i < dest.ConnectionMethodCount(); i++ ) { - RCmConnectionMethodExt cm = dest.ConnectionMethodL( i ); + RCmConnectionMethod cm = dest.ConnectionMethodL( i ); CleanupClosePushL( cm ); TUint32 iapid= cm.GetIntAttributeL( CMManager::ECmIapId ); diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/firmwareupdate/src/iaupdatefwupdatehandler.cpp --- a/iaupdate/IAD/firmwareupdate/src/iaupdatefwupdatehandler.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/firmwareupdate/src/iaupdatefwupdatehandler.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -136,24 +136,7 @@ { case ENSU: { - /*HBufC* text1 = StringLoader::LoadLC( R_IAUPDATE_INFO_NSU_1 ); - HBufC* text2 = StringLoader::LoadLC( R_IAUPDATE_INFO_NSU_2 ); - - HBufC* text = HBufC::NewLC( text1->Length() + - text2->Length() ); - - text->Des() += *text1; - text->Des() += *text2; - - HBufC* heading = StringLoader::LoadLC( R_IAUPDATE_NEW_SW_TITLE ); - - ShowDialogL( *text, *heading ); - - CleanupStack::PopAndDestroy( heading ); //text, heading - CleanupStack::PopAndDestroy( text ); - CleanupStack::PopAndDestroy( text2 ); - CleanupStack::PopAndDestroy( text1 );*/ - + break; } case EFOTA: @@ -172,7 +155,7 @@ if ( ( fotamodelstate != RFotaEngineSession::EDownloadComplete ) && ( fotamodelstate != RFotaEngineSession::EStartingUpdate ) ) { //if download is suspended, try to resume it. - if ( fotamodelstate == RFotaEngineSession::EDownloadProgressingWithResume) + if ( fotamodelstate == RFotaEngineSession::EDownloadProgressing) { TInt result = iFotaModel->TryResumeFwUpdDownload(); FLOG_NUM( "[IAUPDATEFW] TryResumeFwUpdDownload result = %d", result ); @@ -229,14 +212,7 @@ // void CIAUpdateFWUpdateHandler::ShowDialogL(TDesC& /*aText*/, TDesC& /*aHeading*/ ) { - //CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL( aText ); - - //dlg->PrepareLC( R_IAUPDATE_MESSAGE_QUERY ); - - //CAknPopupHeadingPane* headingPane = dlg->Heading(); - //headingPane->SetTextL( aHeading ); - - //TInt ret = dlg->RunLD(); + } diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/iaupdate.pro --- a/iaupdate/IAD/ui/iaupdate.pro Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/iaupdate.pro Tue Jul 06 14:23:31 2010 +0300 @@ -49,7 +49,6 @@ iaupdateagreement.cpp \ iaupdateautomaticcheck.cpp \ iaupdatedeputils.cpp \ - iaupdatefirsttimedatefile.cpp \ iaupdatefirsttimeinfo.cpp \ iaupdategloballockhandler.cpp \ iaupdateinstallationlistener.cpp \ @@ -82,7 +81,6 @@ iaupdateautomaticcheck.h \ iaupdatedeputils.h \ iaupdatefileconsts.h \ - iaupdatefirsttimedatefile.h \ iaupdatefirsttimeinfo.h \ iaupdategloballockhandler.h \ iaupdateinstallationlistener.h \ diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/iaupdate_mainview.docml --- a/iaupdate/IAD/ui/iaupdate_mainview.docml Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/iaupdate_mainview.docml Tue Jul 06 14:23:31 2010 +0300 @@ -15,8 +15,8 @@ - - + + diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/inc/iaupdatedeputils.h --- a/iaupdate/IAD/ui/inc/iaupdatedeputils.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/inc/iaupdatedeputils.h Tue Jul 06 14:23:31 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" @@ -25,7 +25,6 @@ // FORWARD DECLARATIONS class MIAUpdateNode; -class MIAUpdateAnyNode; // CLASS DECLARATION /** @@ -43,7 +42,7 @@ * @param aDependencyNodes List of dependencies (to be marked). */ static void GetDependenciesL( const MIAUpdateNode& aNode, - const RPointerArray& aAllNodes, + const RPointerArray& aAllNodes, RPointerArray& aDependencyNodes ); /** @@ -54,7 +53,7 @@ * @param aDependencyNodes List of dependendants (to be unmarked). */ static void GetDependantsL( const MIAUpdateNode& aNode, - const RPointerArray& aAllNodes, + const RPointerArray& aAllNodes, RPointerArray& aDependantNodes ); }; diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/inc/iaupdateengine.h --- a/iaupdate/IAD/ui/inc/iaupdateengine.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/inc/iaupdateengine.h Tue Jul 06 14:23:31 2010 +0300 @@ -34,7 +34,7 @@ class MIAUpdateNode; class MIAUpdateFwNode; class CEikonEnv; -class RCmManagerExt; +class RCmManager; class CIdle; class HbAction; class IAUpdateResultsDialog; @@ -206,24 +206,24 @@ /** * Choose a usable IAP from all SNAPs * - * @param aCmManagerExt handle of connection manager + * @param aCmManager handle of connection manager */ - uint GetBestIAPInAllSNAPsL( RCmManagerExt& aCmManagerExt ); + uint GetBestIAPInAllSNAPsL( RCmManager& aCmManager ); /** * Choose a usable IAP from Internet SNAP * - * @param aCmManagerExt handle of connection manager + * @param aCmManager handle of connection manager */ - uint GetBestIAPInInternetSNAPL( RCmManagerExt& aCmManagerExt ); + uint GetBestIAPInInternetSNAPL( RCmManager& aCmManager ); /** * Choose the best IAP under the given SNAP * - * @param aCmManagerExt handle of connection manager + * @param aCmManager handle of connection manager * @param aSNAP SNAP ID */ - uint GetBestIAPInThisSNAPL( RCmManagerExt& aCmManagerExt, uint aSNAP = 0); + uint GetBestIAPInThisSNAPL( RCmManager& aCmManager, uint aSNAP = 0); /** * Shows update query dialog (now/later) diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/inc/iaupdatefirsttimedatefile.h --- a/iaupdate/IAD/ui/inc/iaupdatefirsttimedatefile.h Wed Jun 23 18:20:02 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2008 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: Header file of CIAUpdateFirstTimeDateFile class -* -*/ - - - - - - -#ifndef IA_UPDATE_FIRSTTIMEDATE_FILE_H -#define IA_UPDATE_FIRSTTIMEDATE_FILE_H - -#include -#include -#include -#include -#include - - -/** - * - */ -class CIAUpdateFirstTimeDateFile : public CBase - { - -public: - - static CIAUpdateFirstTimeDateFile* NewL( const TDesC& aFile ); - - static CIAUpdateFirstTimeDateFile* NewLC( const TDesC& aFile ); - - - ~CIAUpdateFirstTimeDateFile(); - - - TBool ReadDataL(); - - void WriteDataL(); - - const TTime& FirstTime() const; - - void SetCurrentFirstTime(); - - -private: - - // Prevent these if not implemented - CIAUpdateFirstTimeDateFile( const CIAUpdateFirstTimeDateFile& aObject ); - CIAUpdateFirstTimeDateFile& operator =( const CIAUpdateFirstTimeDateFile& aObject ); - - - CIAUpdateFirstTimeDateFile(); - - virtual void ConstructL( const TDesC& aFile ); - - - void InternalizeL( RReadStream& aStream ); - - void ExternalizeL( RWriteStream& aStream ); - - -private: // data - - // file server session - RFs iFsSession; - - // file path - TFileName iPath; - - - // Time when IAD started first time - TTime iFirstTime; - - }; - -#endif // IA_UPDATE_FIRSTTIMEDATE_FILE_H - diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/inc/iaupdatefirsttimeinfo.h --- a/iaupdate/IAD/ui/inc/iaupdatefirsttimeinfo.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/inc/iaupdatefirsttimeinfo.h Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 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" @@ -62,22 +62,12 @@ * Set Nokia agreement as accepted by an user */ void SetAgreementAcceptedL(); - - /** - * Set Nokia agreement as asked (prompted) to an user - */ - void SetAgreementAskedL(); - + /** * Set automatic update checks as asked (prompted) to an user */ void SetAutomaticUpdatesAskedL(); - - /** - * Time stamp of first check updates form application is stored - */ - void SetFirstTimeIfNotSetL(); - + /** * Is Nokia agreement of Application Update accepted by an user * @@ -86,27 +76,13 @@ TBool AgreementAcceptedL(); /** - * Is Nokia agreement of Application Update already asked - * - * @return True value if agreement already asked - */ - TBool AgreementAskedL(); - - /** * Is activation for automatic update cheks from network already asked * * @return True value if agreement already asked */ TBool AutomaticUpdateChecksAskedL(); - /** - * There is a delay (eg. 2 weeks) after first check updates request from an application - * when update check is not performed. This method checks is update check delayed. - * - * @return True value if agreement accepted - */ - TBool FirstTimeDelayL(); - + private: /** @@ -135,8 +111,6 @@ TBool iAgreementAccepted; - TBool iAgreementAsked; - TBool iAutomaticUpdateChecksAsked; }; diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/inc/iaupdatemainview.h --- a/iaupdate/IAD/ui/inc/iaupdatemainview.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/inc/iaupdatemainview.h Tue Jul 06 14:23:31 2010 +0300 @@ -30,6 +30,8 @@ class HbListWidget; class HbAction; class HbAbstractViewItem; +class HbGroupBox; +class HbDataForm; class IAUpdateEngine; class IAUpdateDialogUtil; class TIAUpdateVersion; @@ -56,27 +58,38 @@ void handleDisclaimer(); - void handleDetails( HbAbstractViewItem *, const QPointF & ); + void handleDetails(HbAbstractViewItem *, const QPointF &); + + void handleFotaDetails(HbAbstractViewItem *, const QPointF &); void handleSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); + void handleFwSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); + void dialogFinished(HbAction* action); private: - void getSelectedNodes(RPointerArray &selectedNodes) const; + bool fotaSelected() const; void markListItem(bool mark, int index); - bool getMandatoryNodes(RPointerArray &mandNodes) const; + void markFotaItem(bool mark); + bool getMandatoryNodes(RPointerArray &mandNodes) const; void showUpdateCannotOmitDialog(); void showDependenciesFoundDialog(QString &text); void updateSelectionsToNodeArray(MIAUpdateNode &node, bool mark); void updateSelectionsToList(); - MIAUpdateAnyNode* getNode(int index) const; + MIAUpdateNode* getApplicationNode(int index) const; void showDetails(MIAUpdateAnyNode& node); void constructDetailsText(MIAUpdateAnyNode &node, QString &text); void versionText(const TIAUpdateVersion &version, QString &versionText); void fileSizeText(int fileSize, QString &text); void setImportance(MIAUpdateAnyNode *node, QString &importanceDescription); + void removeCurrentContentLayout(); + void refreshFirmwareUpdates(const RPointerArray &fwNodes); + void refreshFotaUpdate(MIAUpdateFwNode& fwNode); + void refreshNsuUpdate(); + void refreshApplicationUpdates(const RPointerArray &nodes); + void updateSelectionInfoInDock(); private: enum DialogState @@ -89,13 +102,21 @@ IAUpdateEngine *mEngine; IAUpdateDialogUtil *mDialogUtil; + HbWidget *mContent; HbListWidget *mListView; - RPointerArray mAllNodes; + HbListWidget *mFwListView; + HbGroupBox *mApplicationUpdatesGroupBox; + HbGroupBox *mFwNSUGroupBox; + HbDataForm *mContentDataForm; + HbGroupBox *mSelections; + RPointerArray mNodes; + RPointerArray mFwNodes; DialogState mDialogState; HbAction *mPrimaryAction; MIAUpdateNode *mNode; bool mMark; bool mSelectionUpdate; + bool mSelectionConnect; }; diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/src/iaupdateapplication.cpp --- a/iaupdate/IAD/ui/src/iaupdateapplication.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdateapplication.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -43,5 +43,6 @@ } IAUpdateApplication::~IAUpdateApplication() - { - } +{ + delete mEngine; +} diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/src/iaupdatedeputils.cpp --- a/iaupdate/IAD/ui/src/iaupdatedeputils.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdatedeputils.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -21,7 +21,6 @@ // INCLUDES #include "iaupdatedeputils.h" #include "iaupdatebasenode.h" -#include "iaupdateanynode.h" #include "iaupdatenode.h" @@ -31,7 +30,7 @@ // --------------------------------------------------------------------------- // void IAUpdateDepUtils::GetDependenciesL( const MIAUpdateNode& aNode, - const RPointerArray& aAllNodes, + const RPointerArray& aAllNodes, RPointerArray& aDependencyNodes ) { RPointerArray dependencies; @@ -81,7 +80,7 @@ // --------------------------------------------------------------------------- // void IAUpdateDepUtils::GetDependantsL( const MIAUpdateNode& aNode, - const RPointerArray& aAllNodes, + const RPointerArray& aAllNodes, RPointerArray& aDependantNodes ) { RPointerArray dependants; diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/src/iaupdateengine.cpp --- a/iaupdate/IAD/ui/src/iaupdateengine.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdateengine.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -1,28 +1,28 @@ /* -* 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: This module contains the implementation of IAUpdateEngine -* class member functions. -* -*/ + * 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: This module contains the implementation of IAUpdateEngine + * class member functions. + * + */ #include #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -43,10 +43,9 @@ #include "iaupdateresultsdialog.h" #include "iaupdatedebug.h" - -IAUpdateEngine::IAUpdateEngine(QObject *parent) - : QObject(parent) -{ +IAUpdateEngine::IAUpdateEngine(QObject *parent) : + QObject(parent) + { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::IAUpdateEngine() begin"); iController = NULL; iFwUpdateHandler = NULL; @@ -64,17 +63,17 @@ mDialogState = NoDialog; mResultsDialog = NULL; mServiceProvider = NULL; - mServiceProvider = new IAUpdateServiceProvider( *this ); - connect(mServiceProvider, SIGNAL(clientDisconnected()), this, SLOT(handleAllClientsClosed())); + mServiceProvider = new IAUpdateServiceProvider(*this); + connect(mServiceProvider, SIGNAL(clientDisconnected()), this, + SLOT(handleAllClientsClosed())); TRAP_IGNORE( iController = CIAUpdateUiController::NewL( *this )); IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::IAUpdateEngine() end"); -} - + } IAUpdateEngine::~IAUpdateEngine() -{ + { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::~IAUpdateEngine() begin"); - InformRequestObserver( KErrCancel ); + InformRequestObserver(KErrCancel); if (iIdle) { delete iIdle; @@ -87,40 +86,39 @@ { delete iGlobalLockHandler; } - if ( iAutomaticCheck ) + if (iAutomaticCheck) { delete iAutomaticCheck; } - if ( iController ) + if (iController) { delete iController; } - if ( iFwUpdateHandler ) + if (iFwUpdateHandler) { delete iFwUpdateHandler; } - if ( mServiceProvider ) + if (mServiceProvider) { delete mServiceProvider; } IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::~IAUpdateEngine() end"); -} + } // ----------------------------------------------------------------------------- // IAUpdateEngine::StartedByLauncherL // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::StartedByLauncherL( bool aRefreshFromNetworkDenied ) +void IAUpdateEngine::StartedByLauncherL(bool aRefreshFromNetworkDenied) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartedByLauncherL() begin"); mRequestIssued = true; mRequestType = IAUpdateUiDefines::ENoRequest; - iController->SetRequestType( mRequestType ); - SetVisibleL( true ); + iController->SetRequestType(mRequestType); + SetVisibleL(true); CIAUpdateParameters* params = iController->ParamsReadAndRemoveFileL(); - iController->CheckUpdatesDeferredL( params, aRefreshFromNetworkDenied ); - IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartedByLauncherL() end"); + iController->CheckUpdatesDeferredL(params, aRefreshFromNetworkDenied); } // ----------------------------------------------------------------------------- @@ -128,33 +126,32 @@ // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::CheckUpdatesRequestL( int wgid, - CIAUpdateParameters* aFilterParams, - bool aForcedRefresh ) - +void IAUpdateEngine::CheckUpdatesRequestL(int wgid, + CIAUpdateParameters* aFilterParams, bool aForcedRefresh) + { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::CheckUpdatesRequestL() begin"); - SetClientWgId( wgid ); + SetClientWgId(wgid); mRequestIssued = true; - mStartedFromApplication = true; - CleanupStack::PushL( aFilterParams ); - if ( wgid > 0 ) + mStartedFromApplication = true; + CleanupStack::PushL(aFilterParams); + if (wgid > 0) { - HideApplicationInFSWL( true ); + HideApplicationInFSWL(true); } - CleanupStack::Pop( aFilterParams ); - - if ( !aFilterParams->ShowProgress() ) + CleanupStack::Pop(aFilterParams); + + if (!aFilterParams->ShowProgress()) { - iEikEnv->RootWin().SetOrdinalPosition( -1, ECoeWinPriorityNeverAtFront ); + iEikEnv->RootWin().SetOrdinalPosition(-1, ECoeWinPriorityNeverAtFront); } - - mRequestType = IAUpdateUiDefines::ECheckUpdates; - iController->SetRequestType( mRequestType ); - iController->SetForcedRefresh( aForcedRefresh ); - - iController->CheckUpdatesDeferredL( aFilterParams, false ); - + + mRequestType = IAUpdateUiDefines::ECheckUpdates; + iController->SetRequestType(mRequestType); + iController->SetForcedRefresh(aForcedRefresh); + + iController->CheckUpdatesDeferredL(aFilterParams, false); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::CheckUpdatesRequestL() end"); } @@ -163,46 +160,47 @@ // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::ShowUpdatesRequestL( int wgid, CIAUpdateParameters* aFilterParams ) +void IAUpdateEngine::ShowUpdatesRequestL(int wgid, + CIAUpdateParameters* aFilterParams) { - IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowUpdatesRequestL() begin"); - SetClientWgId( wgid ); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowUpdatesRequestL() begin"); + SetClientWgId(wgid); mRequestIssued = true; -// delete iBackgroundTimer; -// iBackgroundTimer = NULL; - mStartedFromApplication = true; - CleanupStack::PushL( aFilterParams ); - if ( wgid > 0 ) + // delete iBackgroundTimer; + // iBackgroundTimer = NULL; + mStartedFromApplication = true; + CleanupStack::PushL(aFilterParams); + if (wgid > 0) { - HideApplicationInFSWL( true ); + HideApplicationInFSWL(true); } - + //StatusPane()->MakeVisible( true ); - iEikEnv->RootWin().SetOrdinalPosition( 0, ECoeWinPriorityNormal ); - + iEikEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityNormal); + //iRequestObserver = &aObserver; mRequestType = IAUpdateUiDefines::EShowUpdates; - iController->SetRequestType( mRequestType ); - + iController->SetRequestType(mRequestType); //if ( !iMainView ) // { // iMainView = CIAUpdateMainView::NewL( ClientRect() ); // AddViewL( iMainView ); // } - - + + // by pushing object to cleanup stack its destructor is called if leave happens // so global lock issued by this instance can be released in destructor of CIAUpdateGlobalLockHandler - CIAUpdateGlobalLockHandler* globalLockHandler = CIAUpdateGlobalLockHandler::NewLC(); - if ( !globalLockHandler->InUseByAnotherInstanceL() ) + CIAUpdateGlobalLockHandler* globalLockHandler = + CIAUpdateGlobalLockHandler::NewLC(); + if (!globalLockHandler->InUseByAnotherInstanceL()) { - globalLockHandler->SetToInUseForAnotherInstancesL( true ); - CleanupStack::Pop( globalLockHandler ); - CleanupStack::Pop( aFilterParams ); - CleanupStack::PushL( globalLockHandler ); - iController->CheckUpdatesDeferredL( aFilterParams, false ); - CleanupStack::Pop( globalLockHandler ); + globalLockHandler->SetToInUseForAnotherInstancesL(true); + CleanupStack::Pop(globalLockHandler); + CleanupStack::Pop(aFilterParams); + CleanupStack::PushL(globalLockHandler); + iController->CheckUpdatesDeferredL(aFilterParams, false); + CleanupStack::Pop(globalLockHandler); delete iGlobalLockHandler; iGlobalLockHandler = globalLockHandler; //now possible deletion of iGlobalLockHandler in leave situation is handled @@ -210,40 +208,38 @@ } else { - CleanupStack::PopAndDestroy( globalLockHandler ); - CleanupStack::PopAndDestroy( aFilterParams ); + CleanupStack::PopAndDestroy(globalLockHandler); + CleanupStack::PopAndDestroy(aFilterParams); // locked by another IAD instance, nothing else to do than just complete client's request. - InformRequestObserver( KErrNone ); - } + InformRequestObserver(KErrNone); + } - IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowUpdatesRequestL() end"); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowUpdatesRequestL() end"); } - // ----------------------------------------------------------------------------- // IAUpdateEngine::ShowUpdateQueryRequestL // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::ShowUpdateQueryRequestL( int wgid, uint aUid ) +void IAUpdateEngine::ShowUpdateQueryRequestL(int wgid, uint aUid) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowUpdateQueryRequestL begin"); - SetClientWgId( wgid ); + SetClientWgId(wgid); mRequestIssued = true; - mStartedFromApplication = true; + mStartedFromApplication = true; mUpdatequeryUid = aUid; mUpdateNow = false; - if ( wgid > 0 ) + if (wgid > 0) { - HideApplicationInFSWL( true ); + HideApplicationInFSWL(true); } mRequestType = IAUpdateUiDefines::EUpdateQuery; - - + delete iIdle; iIdle = NULL; - iIdle = CIdle::NewL( CActive::EPriorityIdle ); - iIdle->Start( TCallBack( UpdateQueryCallbackL, this ) ); + iIdle = CIdle::NewL(CActive::EPriorityIdle); + iIdle->Start(TCallBack(UpdateQueryCallbackL, this)); IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowUpdateQueryRequestL end") } @@ -252,16 +248,16 @@ // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::StartUpdate( bool aFirmwareUpdate ) +void IAUpdateEngine::StartUpdate(bool aFirmwareUpdate) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartUpdate() begin"); - if ( aFirmwareUpdate ) + if (aFirmwareUpdate) { - if ( !iFwUpdateHandler ) + if (!iFwUpdateHandler) { TRAP_IGNORE( CIAUpdateFWUpdateHandler::NewL() ); } - if ( iFwUpdateHandler ) + if (iFwUpdateHandler) { iFwUpdateHandler->FirmWareUpdatewithFOTA(); } @@ -270,15 +266,16 @@ { // by pushing object to cleanup stack it's destructor is called if leave happens // so global lock issued by this instance can be released in destructor of CIAUpdateGlobalLockHandler - CIAUpdateGlobalLockHandler* globalLockHandler = CIAUpdateGlobalLockHandler::NewLC(); - if ( !globalLockHandler->InUseByAnotherInstanceL() ) + CIAUpdateGlobalLockHandler* globalLockHandler = + CIAUpdateGlobalLockHandler::NewLC(); + if (!globalLockHandler->InUseByAnotherInstanceL()) { - globalLockHandler->SetToInUseForAnotherInstancesL( true ); + globalLockHandler->SetToInUseForAnotherInstancesL(true); // No need to be totally silent since the updating is started // by user. - SetDefaultConnectionMethodL( false ); + SetDefaultConnectionMethodL(false); iController->StartUpdateL(); - CleanupStack::Pop( globalLockHandler ); + CleanupStack::Pop(globalLockHandler); delete iGlobalLockHandler; iGlobalLockHandler = globalLockHandler; //now possible deletion of iGlobalLockHandler in leave situation is handled @@ -286,39 +283,38 @@ } else { - CleanupStack::PopAndDestroy( globalLockHandler ); + CleanupStack::PopAndDestroy(globalLockHandler); } } IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartUpdate() end"); } - // ----------------------------------------------------------------------------- // IAUpdateEngine::SetVisibleL // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::SetVisibleL( bool aVisible ) +void IAUpdateEngine::SetVisibleL(bool /*aVisible*/) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetVisibleL() begin"); - IAUPDATE_TRACE_1("[IAUPDATE] visible: %d", aVisible ); + //IAUPDATE_TRACE_1("[IAUPDATE] visible: %d", aVisible ); /*if ( aVisible ) - { - if ( iEikonEnv->RootWin().OrdinalPosition() != 0 || iEikonEnv->RootWin().OrdinalPriority() != ECoeWinPriorityNormal ) - { - iEikonEnv->RootWin().SetOrdinalPosition( 0, ECoeWinPriorityNormal ); - } - - StatusPane()->MakeVisible( ETrue ); - iMainView = CIAUpdateMainView::NewL( ClientRect() ); - AddViewL( iMainView ); - ActivateLocalViewL( TUid::Uid( EIAUpdateMainViewId ) ); - } - else - { - iEikonEnv->RootWin().SetOrdinalPosition( -1, ECoeWinPriorityNeverAtFront ); - StatusPane()->MakeVisible( EFalse ); - }*/ + { + if ( iEikonEnv->RootWin().OrdinalPosition() != 0 || iEikonEnv->RootWin().OrdinalPriority() != ECoeWinPriorityNormal ) + { + iEikonEnv->RootWin().SetOrdinalPosition( 0, ECoeWinPriorityNormal ); + } + + StatusPane()->MakeVisible( ETrue ); + iMainView = CIAUpdateMainView::NewL( ClientRect() ); + AddViewL( iMainView ); + ActivateLocalViewL( TUid::Uid( EIAUpdateMainViewId ) ); + } + else + { + iEikonEnv->RootWin().SetOrdinalPosition( -1, ECoeWinPriorityNeverAtFront ); + StatusPane()->MakeVisible( EFalse ); + }*/ IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetVisibleL() end"); } @@ -327,7 +323,7 @@ // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::SetClientWgId( int aWgId ) +void IAUpdateEngine::SetClientWgId(int aWgId) { IAUPDATE_TRACE_1("[IAUPDATE] IAUpdateEngine::SetClientWgId() wgId %d", aWgId ); mWgId = aWgId; @@ -342,33 +338,31 @@ { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ClientInBackgroundL() begin"); bool inBackground = false; - if ( mWgId > 0 ) + if (mWgId > 0) { - CArrayFixFlat* wgArray = new( ELeave ) CArrayFixFlat(10); - CleanupStack::PushL( wgArray ); - User::LeaveIfError( iEikEnv->WsSession().WindowGroupList( 0, wgArray ) ); + CArrayFixFlat* wgArray = new (ELeave) CArrayFixFlat (10); + CleanupStack::PushL(wgArray); + User::LeaveIfError(iEikEnv->WsSession().WindowGroupList(0, wgArray)); int ownWgId = iEikEnv->RootWin().Identifier(); - if ( ( wgArray->At( 0 ) != ownWgId ) && ( wgArray->At( 0 ) != mWgId ) ) + if ((wgArray->At(0) != ownWgId) && (wgArray->At(0) != mWgId)) { inBackground = true; } - CleanupStack::PopAndDestroy( wgArray ); + CleanupStack::PopAndDestroy(wgArray); } IAUPDATE_TRACE_1("[IAUPDATE] IAUpdateEngine::ClientInBackgroundL() inBackground: %d", inBackground ); - return inBackground; + return inBackground; } - // ----------------------------------------------------------------------------- // IAUpdateEngine::handleAllClientsClosed() // // ----------------------------------------------------------------------------- // void IAUpdateEngine::handleAllClientsClosed() -{ - qApp->quit(); -} - + { + qApp->quit(); + } // ----------------------------------------------------------------------------- // IAUpdateEngine::dialogFinished @@ -379,12 +373,12 @@ { DialogState dialogState = mDialogState; mDialogState = NoDialog; - - switch ( dialogState ) + + switch (dialogState) { case Results: mUiRefreshAllowed = true; - if ( iController->ResultsInfo().iRebootAfterInstall ) + if (iController->ResultsInfo().iRebootAfterInstall) { ShowRebootDialogL(); } @@ -397,13 +391,13 @@ } } break; - case RebootQuery: - if (action == mPrimaryAction ) + case RebootQuery: + if (action == mPrimaryAction) { RStarterSession startersession; - if( startersession.Connect() == KErrNone ) + if (startersession.Connect() == KErrNone) { - startersession.Reset( RStarterSession::EUnknownReset ); + startersession.Reset(RStarterSession::EUnknownReset); startersession.Close(); } } @@ -416,7 +410,7 @@ } } break; - case ShowUpdateQuery: + case ShowUpdateQuery: if (action == mPrimaryAction) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::dialogFinished() Now"); @@ -425,46 +419,45 @@ else if (action == mSecondaryAction) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::dialogFinished() Later"); - CIAUpdateQueryHistory* updateQueryHistory = CIAUpdateQueryHistory::NewL(); - CleanupStack::PushL( updateQueryHistory ); - updateQueryHistory->SetTimeL( mUpdatequeryUid ); - CleanupStack::PopAndDestroy( updateQueryHistory ); + CIAUpdateQueryHistory* updateQueryHistory = + CIAUpdateQueryHistory::NewL(); + CleanupStack::PushL(updateQueryHistory); + updateQueryHistory->SetTimeL(mUpdatequeryUid); + CleanupStack::PopAndDestroy(updateQueryHistory); } - InformRequestObserver( KErrNone ); + InformRequestObserver(KErrNone); break; - default: + default: break; } } - - // ----------------------------------------------------------------------------- // IAUpdateEngine::StartupComplete // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::StartupComplete( TInt aError ) +void IAUpdateEngine::StartupComplete(TInt aError) { - IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartupComplete() begin"); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartupComplete() begin"); IAUPDATE_TRACE_1("[IAUPDATE] error code: %d", aError); - - if( aError != KErrNone ) - { - HandleLeaveErrorWithoutLeave( aError ); + + if (aError != KErrNone) + { + HandleLeaveErrorWithoutLeave(aError); } else { TRAPD( err, StartupCompleteL() ); - if( err != KErrNone ) - { - HandleLeaveErrorWithoutLeave( err ); - } + if (err != KErrNone) + { + HandleLeaveErrorWithoutLeave(err); + } } - - IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartupComplete() end"); + + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartupComplete() end"); } - + // ----------------------------------------------------------------------------- // IAUpdateEngine::StartupCompleteL // @@ -472,23 +465,23 @@ // void IAUpdateEngine::StartupCompleteL() { - IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartupCompleteL() begin"); - + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartupCompleteL() begin"); + delete iGlobalLockHandler; iGlobalLockHandler = NULL; iGlobalLockHandler = CIAUpdateGlobalLockHandler::NewL(); - if ( !iGlobalLockHandler->InUseByAnotherInstanceL() ) + if (!iGlobalLockHandler->InUseByAnotherInstanceL()) { bool totalSilent(false); - if ( mRequestType == IAUpdateUiDefines::ECheckUpdates ) + if (mRequestType == IAUpdateUiDefines::ECheckUpdates) { - if ( iController->Filter() ) + if (iController->Filter()) { - if ( iController->Filter()->FilterParams() ) + if (iController->Filter()->FilterParams()) { - if ( iController->Filter()->FilterParams()->Refresh() ) + if (iController->Filter()->FilterParams()->Refresh()) { - if ( !iController->ForcedRefresh() ) + if (!iController->ForcedRefresh()) { //from bgchecker, make it silent totalSilent = true; @@ -497,66 +490,61 @@ } } } - SetDefaultConnectionMethodL( totalSilent ); + SetDefaultConnectionMethodL(totalSilent); iGlobalLockHandler->SetToInUseForAnotherInstancesL(true); - iController->StartRefreshL(); + iController->StartRefreshL(); } else { - RefreshCompleteL( true, KErrServerBusy ); - } - - - - IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartupCompleteL() end"); + RefreshCompleteL(true, KErrServerBusy); + } + + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::StartupCompleteL() end"); } - // ----------------------------------------------------------------------------- // IAUpdateEngine::HandleLeaveErrorL // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::HandleLeaveErrorL( TInt aError ) +void IAUpdateEngine::HandleLeaveErrorL(TInt aError) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::HandleLeaveErrorL() begin"); //removal of iGlobalLockHandler releases possible global operation lock to other IAD instances delete iGlobalLockHandler; iGlobalLockHandler = NULL; // client request is completed before leave in case of leave error - if ( aError != KErrNone ) - { - InformRequestObserver( aError ); - User::Leave( aError ); + if (aError != KErrNone) + { + InformRequestObserver(aError); + User::Leave(aError); } - + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::HandleLeaveErrorL() end"); } - // ----------------------------------------------------------------------------- // IAUpdateEngine::HandleLeaveErrorWithoutLeave // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::HandleLeaveErrorWithoutLeave( TInt aError ) +void IAUpdateEngine::HandleLeaveErrorWithoutLeave(TInt aError) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::HandleLeaveErrorWithoutLeave() begin"); //removal of iGlobalLockHandler releases possible global operation lock to other IAD instances delete iGlobalLockHandler; iGlobalLockHandler = NULL; - if ( aError != KErrNone ) + if (aError != KErrNone) { - InformRequestObserver( aError ); + InformRequestObserver(aError); } - if ( aError == KErrDiskFull ) + if (aError == KErrDiskFull) { //TRAP_IGNORE( ShowGlobalErrorNoteL( aError ) ); } IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::HandleLeaveErrorWithoutLeave end"); } - // ----------------------------------------------------------------------------- // IAUpdateEngine::RefreshUI // @@ -564,83 +552,77 @@ // void IAUpdateEngine::RefreshUI() { - emit refresh( iController->Nodes(), iController->FwNodes(), KErrNone ); + emit refresh(iController->Nodes(), iController->FwNodes(), KErrNone); } - // ----------------------------------------------------------------------------- // IAUpdateEngine::RefreshCompleteL // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::RefreshCompleteL( TBool /*aWithViewActivation*/, TInt aError ) +void IAUpdateEngine::RefreshCompleteL(TBool /*aWithViewActivation*/, + TInt aError) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::RefreshCompleteL() begin"); IAUPDATE_TRACE_1("[IAUPDATE] error code: %d", aError ); //removal of iGlobalLockHandler releases possible global operation lock to other IAD instances delete iGlobalLockHandler; - iGlobalLockHandler = NULL; - - if ( mRequestType == IAUpdateUiDefines::ECheckUpdates ) + iGlobalLockHandler = NULL; + + if (mRequestType == IAUpdateUiDefines::ECheckUpdates) { - InformRequestObserver( aError ); + InformRequestObserver(aError); } - else - { - emit refresh( iController->Nodes(), iController->FwNodes(), aError ); + else + { + emit refresh(iController->Nodes(), iController->FwNodes(), aError); //if ( aWithViewActivation) - // { - // ActivateLocalViewL( TUid::Uid( EIAUpdateMainViewId ) ); - // } + // { + // ActivateLocalViewL( TUid::Uid( EIAUpdateMainViewId ) ); + // } CIAUpdateAgreement* agreement = CIAUpdateAgreement::NewLC(); bool agreementAccepted = agreement->AgreementAcceptedL(); - if ( iController->ForcedRefresh() ) + if (iController->ForcedRefresh()) { - if ( !agreementAccepted ) + if (!agreementAccepted) { agreement->SetAgreementAcceptedL(); } } - CleanupStack::PopAndDestroy( agreement ); + CleanupStack::PopAndDestroy(agreement); // By calling CIdle possible waiting dialog can be closed before // automatic check where a new dialog may be launched delete iIdleAutCheck; iIdleAutCheck = NULL; - iIdleAutCheck = CIdle::NewL( CActive::EPriorityIdle ); - iIdleAutCheck->Start( TCallBack( AutomaticCheckCallbackL, this ) ); - } - - - IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::RefreshCompleteL() end"); + iIdleAutCheck = CIdle::NewL(CActive::EPriorityIdle); + iIdleAutCheck->Start(TCallBack(AutomaticCheckCallbackL, this)); + } + + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::RefreshCompleteL() end"); } - - - // ----------------------------------------------------------------------------- // IAUpdateEngine::UpdateCompleteL // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::UpdateCompleteL( TInt aError ) +void IAUpdateEngine::UpdateCompleteL(TInt aError) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::UpdateCompleteL begin"); IAUPDATE_TRACE_1("[IAUPDATE] error code: %d", aError ); //removal of iGlobalLockHandler releases possible global operation lock to other IAD instances delete iGlobalLockHandler; - iGlobalLockHandler = NULL; - if ( mRequestType != IAUpdateUiDefines::ENoRequest ) + iGlobalLockHandler = NULL; + if (mRequestType != IAUpdateUiDefines::ENoRequest) { - InformRequestObserver( aError ); + InformRequestObserver(aError); } - + ShowResultsDialogL(); - + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::UpdateCompleteL end"); } - - // ----------------------------------------------------------------------------- // IAUpdateEngine::ShowResultsDialogL // @@ -648,16 +630,17 @@ // void IAUpdateEngine::ShowResultsDialogL() { - IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowResultsDialogL() begin"); - + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowResultsDialogL() begin"); + mUiRefreshAllowed = false; mResultsDialog = new IAUpdateResultsDialog(this); - mResultsDialog->showResults(iController->ResultsInfo(),this,SLOT(dialogFinished(HbAction*))); + mResultsDialog->showResults(iController->ResultsInfo(), this, + SLOT(dialogFinished(HbAction*))); mDialogState = Results; - + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowResultsDialogL() end"); } - + // ----------------------------------------------------------------------------- // IAUpdateEngine::ShowRebootDialogL // @@ -666,14 +649,15 @@ void IAUpdateEngine::ShowRebootDialogL() { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowRebootDialogL() begin"); - - HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion); + + HbMessageBox *messageBox = new HbMessageBox( + HbMessageBox::MessageTypeQuestion); messageBox->setText(QString("Phone restart needed. Restart now?")); int actionCount = messageBox->actions().count(); - for (int i=actionCount-1; i >= 0; i--) - { + for (int i = actionCount - 1; i >= 0; i--) + { messageBox->removeAction(messageBox->actions().at(i)); - } + } mPrimaryAction = NULL; mPrimaryAction = new HbAction("Ok"); HbAction *secondaryAction = NULL; @@ -685,87 +669,85 @@ messageBox->setAttribute(Qt::WA_DeleteOnClose); messageBox->open(this, SLOT(dialogFinished(HbAction*))); mDialogState = RebootQuery; - + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowRebootDialogL() end"); } - - - - - // ----------------------------------------------------------------------------- // IAUpdateEngine::InformRequestObserver // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::InformRequestObserver( int aError ) +void IAUpdateEngine::InformRequestObserver(int aError) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::InformRequestObserver() begin"); - + //if ( iRequestObserver ) - if ( mRequestIssued ) + if (mRequestIssued) { - if ( iController->ClosingAllowedByClient() ) + if (iController->ClosingAllowedByClient()) { - if ( mRequestType != IAUpdateUiDefines::ENoRequest ) + if (mRequestType != IAUpdateUiDefines::ENoRequest) { -// if ( iRequestType == IAUpdateUiDefines::EUpdateQuery && iUpdateNow ) -// { -// if ( !iBackgroundTimer ) -// { -// iBackgroundTimer = CIAUpdateUITimer::NewL( *this, CIAUpdateUITimer::EBackgroundDelay ); -// } -// if ( !iBackgroundTimer->IsActive() ) -// { -// iBackgroundTimer->After( 500000 ); -// } -// } -// else -// { - iEikEnv->RootWin().SetOrdinalPosition( -1, ECoeWinPriorityNeverAtFront ); -// } + // if ( iRequestType == IAUpdateUiDefines::EUpdateQuery && iUpdateNow ) + // { + // if ( !iBackgroundTimer ) + // { + // iBackgroundTimer = CIAUpdateUITimer::NewL( *this, CIAUpdateUITimer::EBackgroundDelay ); + // } + // if ( !iBackgroundTimer->IsActive() ) + // { + // iBackgroundTimer->After( 500000 ); + // } + // } + // else + // { + iEikEnv->RootWin().SetOrdinalPosition(-1, + ECoeWinPriorityNeverAtFront); + // } } } - - switch ( mRequestType ) + + switch (mRequestType) { case IAUpdateUiDefines::ENoRequest: { - mServiceProvider->completeLauncherLaunch( aError ); + mServiceProvider->completeLauncherLaunch(aError); break; } case IAUpdateUiDefines::ECheckUpdates: { - mServiceProvider->completeCheckUpdates( iController->CountOfAvailableUpdates(), aError ); + mServiceProvider->completeCheckUpdates( + iController->CountOfAvailableUpdates(), aError); break; } case IAUpdateUiDefines::EShowUpdates: { - CIAUpdateResult* result( NULL ); + CIAUpdateResult* result(NULL); TRAPD( error, result = CIAUpdateResult::NewL() ) - if ( result ) + if (result) { - TIAUpdateResultsInfo resultsInfo( iController->ResultsInfo() ); - IAUPDATE_TRACE_3("[IAUPDATE] IAUpdateEngine::InformRequestObserver succeed: %d failed: %d cancelled: %d", - resultsInfo.iCountSuccessfull, - resultsInfo.iCountFailed, - resultsInfo.iCountCancelled ); - result->SetSuccessCount( resultsInfo.iCountSuccessfull ); - result->SetFailCount( resultsInfo.iCountFailed ); - result->SetCancelCount( resultsInfo.iCountCancelled ); - mServiceProvider->completeShowUpdates( result, aError ); + TIAUpdateResultsInfo resultsInfo( + iController->ResultsInfo()); + IAUPDATE_TRACE_3("[IAUPDATE] IAUpdateEngine::InformRequestObserver succeed: %d failed: %d cancelled: %d", + resultsInfo.iCountSuccessfull, + resultsInfo.iCountFailed, + resultsInfo.iCountCancelled ); + result->SetSuccessCount(resultsInfo.iCountSuccessfull); + result->SetFailCount(resultsInfo.iCountFailed); + result->SetCancelCount(resultsInfo.iCountCancelled); + mServiceProvider->completeShowUpdates(result, aError); // Ownership of result is transferred here. } else { - mServiceProvider->completeShowUpdates( NULL, error ); + mServiceProvider->completeShowUpdates(NULL, error); } break; } case IAUpdateUiDefines::EUpdateQuery: { - mServiceProvider->completeUpdateQuery( mUpdateNow, aError ); + mServiceProvider->completeUpdateQuery(mUpdateNow, aError); break; } default: @@ -776,59 +758,58 @@ mRequestIssued = false; } - + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::InformRequestObserver() end"); } - // --------------------------------------------------------------------------- // IAUpdateEngine::SetDefaultConnectionMethodL // Sets the connection method for the update network connection. // --------------------------------------------------------------------------- // -void IAUpdateEngine::SetDefaultConnectionMethodL( bool aTotalSilent ) +void IAUpdateEngine::SetDefaultConnectionMethodL(bool aTotalSilent) { - if ( aTotalSilent ) + if (aTotalSilent) { // from back ground checker, choose the IAP to make the internet access silent IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetDefaultConnectionMethodL() begin"); - uint connectionMethodId( 0 ); - int connMethodId( 0 ); + uint connectionMethodId(0); + int connMethodId(0); // Let's first check whether cenrep contains SNAP id other than zero - CRepository* cenrep( CRepository::NewLC( KCRUidIAUpdateSettings ) ); - User::LeaveIfError( - cenrep->Get( KIAUpdateAccessPoint, connMethodId ) ); - CleanupStack::PopAndDestroy( cenrep ); + CRepository* cenrep(CRepository::NewLC(KCRUidIAUpdateSettings)); + User::LeaveIfError(cenrep->Get(KIAUpdateAccessPoint, connMethodId)); + CleanupStack::PopAndDestroy(cenrep); cenrep = NULL; - RCmManagerExt cmManagerExt; - cmManagerExt.OpenL(); - CleanupClosePushL( cmManagerExt ); - - if ( connMethodId == -1 ) + RCmManager cmManager; + cmManager.OpenL(); + CleanupClosePushL(cmManager); + + if (connMethodId == -1) { IAUPDATE_TRACE("[IAUPDATE] user chooses default connection, use IAP logic"); - + //check what is the default connection by users - + TCmDefConnValue DCSetting; - cmManagerExt.ReadDefConnL( DCSetting ); - - switch ( DCSetting.iType ) + cmManager.ReadDefConnL(DCSetting); + + switch (DCSetting.iType) { case ECmDefConnAlwaysAsk: case ECmDefConnAskOnce: { //go with the best IAP under internet snap - connectionMethodId = GetBestIAPInAllSNAPsL( cmManagerExt ); + connectionMethodId = GetBestIAPInAllSNAPsL(cmManager); break; } case ECmDefConnDestination: { //go with the best IAP under this snap - connectionMethodId = GetBestIAPInThisSNAPL( cmManagerExt, DCSetting.iId ); + connectionMethodId = GetBestIAPInThisSNAPL(cmManager, + DCSetting.iId); break; } case ECmDefConnConnectionMethod: @@ -839,34 +820,36 @@ } } } - else if ( connMethodId == 0 ) + else if (connMethodId == 0) { //no choice from user, we go with the best IAP under Internent SNAP - connectionMethodId = GetBestIAPInAllSNAPsL( cmManagerExt ); + connectionMethodId = GetBestIAPInAllSNAPsL(cmManager); } else { IAUPDATE_TRACE("[IAUPDATE] use chooses a snap"); // It was some SNAP value - connectionMethodId = GetBestIAPInThisSNAPL( cmManagerExt, connMethodId ); + connectionMethodId = GetBestIAPInThisSNAPL(cmManager, + connMethodId); } - CleanupStack::PopAndDestroy( &cmManagerExt ); - - if ( connectionMethodId != 0 ) + CleanupStack::PopAndDestroy(&cmManager); + + if (connectionMethodId != 0) { - TIAUpdateConnectionMethod connectionMethod( - connectionMethodId, - TIAUpdateConnectionMethod::EConnectionMethodTypeAccessPoint ); + TIAUpdateConnectionMethod + connectionMethod( + connectionMethodId, + TIAUpdateConnectionMethod::EConnectionMethodTypeAccessPoint); - iController->SetDefaultConnectionMethodL( connectionMethod ); + iController->SetDefaultConnectionMethodL(connectionMethod); } else { //In the totally silent case, if no usable IAP, we complete the check update with 0 updates. //the bgchecker will try again later after 1 month. //The LEAVE will be catched up later and complete the request from background checker. - User::LeaveIfError( KErrNotFound ); + User::LeaveIfError(KErrNotFound); } IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetDefaultConnectionMethodL() end"); } @@ -874,63 +857,64 @@ { // from grid, use the old logic IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetDefaultConnectionMethodL() begin"); - uint connectionMethodId( 0 ); - int connMethodId( 0 ); + uint connectionMethodId(0); + int connMethodId(0); // Set initial value to always ask - int connectionMethodType( TIAUpdateConnectionMethod::EConnectionMethodTypeAlwaysAsk ); + int connectionMethodType( + TIAUpdateConnectionMethod::EConnectionMethodTypeAlwaysAsk); bool needSaving(false); // Let's first check whether cenrep contains SNAP id other than zero - CRepository* cenrep( CRepository::NewLC( KCRUidIAUpdateSettings ) ); - User::LeaveIfError( - cenrep->Get( KIAUpdateAccessPoint, connMethodId ) ); - CleanupStack::PopAndDestroy( cenrep ); + CRepository* cenrep(CRepository::NewLC(KCRUidIAUpdateSettings)); + User::LeaveIfError(cenrep->Get(KIAUpdateAccessPoint, connMethodId)); + CleanupStack::PopAndDestroy(cenrep); cenrep = NULL; - - if ( connMethodId == -1 ) + + if (connMethodId == -1) { IAUPDATE_TRACE("[IAUPDATE] user chooses default connection, use IAP logic"); - + connectionMethodId = 0; - connectionMethodType = TIAUpdateConnectionMethod::EConnectionMethodTypeDefault; + connectionMethodType + = TIAUpdateConnectionMethod::EConnectionMethodTypeDefault; } - else if ( connMethodId == 0 ) + else if (connMethodId == 0) { IAUPDATE_TRACE("[IAUPDATE] use chooses nothing, use internal IAP logic"); //if nothing is set by user, use our new logic //SetDefaultConnectionMethod2L(); //return; // CenRep didn't contain any SNAP id. Let's try Internet SNAP then. - - RCmManagerExt cmManagerExt; - cmManagerExt.OpenL(); - CleanupClosePushL( cmManagerExt ); + + RCmManager cmManager; + cmManager.OpenL(); + CleanupClosePushL(cmManager); iDestIdArray.Reset(); - cmManagerExt.AllDestinationsL( iDestIdArray ); + cmManager.AllDestinationsL(iDestIdArray); - for ( int i = 0; i< iDestIdArray.Count(); i++ ) + for (int i = 0; i < iDestIdArray.Count(); i++) { - RCmDestinationExt dest = cmManagerExt.DestinationL( iDestIdArray[i] ); - CleanupClosePushL( dest ); - - if ( dest.MetadataL( CMManager::ESnapMetadataInternet ) ) + RCmDestination dest = cmManager.DestinationL(iDestIdArray[i]); + CleanupClosePushL(dest); + + if (dest.MetadataL(CMManager::ESnapMetadataInternet)) { // Check whether Internet SNAP contains any IAP. - if ( dest.ConnectionMethodCount() > 0 ) + if (dest.ConnectionMethodCount() > 0) { connectionMethodId = iDestIdArray[i]; needSaving = true; IAUPDATE_TRACE_1("[IAUPDATE] connectionMethodId: %d", connectionMethodId ); } - CleanupStack::PopAndDestroy( &dest ); + CleanupStack::PopAndDestroy(&dest); break; } - - CleanupStack::PopAndDestroy( &dest ); + + CleanupStack::PopAndDestroy(&dest); } iDestIdArray.Reset(); - CleanupStack::PopAndDestroy( &cmManagerExt ); + CleanupStack::PopAndDestroy(&cmManager); } else { @@ -938,151 +922,151 @@ // It was some SNAP value connectionMethodId = connMethodId; } - - if ( connectionMethodId > 0) + + if (connectionMethodId > 0) { // We have now some valid SNAP id, either from CenRep or Internet SNAP - connectionMethodType = TIAUpdateConnectionMethod::EConnectionMethodTypeDestination; + connectionMethodType + = TIAUpdateConnectionMethod::EConnectionMethodTypeDestination; // Save to cenrep if needed - if ( needSaving ) + if (needSaving) { - cenrep = CRepository::NewLC( KCRUidIAUpdateSettings ); - int err = cenrep->StartTransaction( CRepository::EReadWriteTransaction ); - User::LeaveIfError( err ); + cenrep = CRepository::NewLC(KCRUidIAUpdateSettings); + int err = cenrep->StartTransaction( + CRepository::EReadWriteTransaction); + User::LeaveIfError(err); cenrep->CleanupCancelTransactionPushL(); - - connMethodId = connectionMethodId; - err = cenrep->Set( KIAUpdateAccessPoint, connMethodId ); - User::LeaveIfError( err ); - TUint32 ignore = KErrNone; - User::LeaveIfError( cenrep->CommitTransaction( ignore ) ); - CleanupStack::PopAndDestroy(); // CleanupCancelTransactionPushL() - CleanupStack::PopAndDestroy( cenrep ); - } + + connMethodId = connectionMethodId; + err = cenrep->Set(KIAUpdateAccessPoint, connMethodId); + User::LeaveIfError(err); + TUint32 ignore = KErrNone; + User::LeaveIfError(cenrep->CommitTransaction(ignore)); + CleanupStack::PopAndDestroy(); // CleanupCancelTransactionPushL() + CleanupStack::PopAndDestroy(cenrep); + } } - TIAUpdateConnectionMethod connectionMethod( - connectionMethodId, - static_cast< TIAUpdateConnectionMethod::TConnectionMethodType >( connectionMethodType ) ); + TIAUpdateConnectionMethod + connectionMethod( + connectionMethodId, + static_cast (connectionMethodType)); - iController->SetDefaultConnectionMethodL( connectionMethod ); + iController->SetDefaultConnectionMethodL(connectionMethod); IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::SetDefaultConnectionMethodL() end"); } } - // --------------------------------------------------------------------------- // IAUpdateEngine::GetBestIAPInAllSNAPsL // Sets the best IAP from all snaps // --------------------------------------------------------------------------- // -uint IAUpdateEngine::GetBestIAPInAllSNAPsL( RCmManagerExt& aCmManagerExt ) - { +uint IAUpdateEngine::GetBestIAPInAllSNAPsL(RCmManager& aCmManager) + { //go with internet SNAP first. uint IAPID = 0; - IAPID = GetBestIAPInInternetSNAPL( aCmManagerExt ); - - if ( IAPID ) + IAPID = GetBestIAPInInternetSNAPL(aCmManager); + + if (IAPID) { return IAPID; } - + //select IAP from rest of the SNAPs iDestIdArray.Reset(); - aCmManagerExt.AllDestinationsL( iDestIdArray ); - - for ( int i = 0; i< iDestIdArray.Count(); i++ ) + aCmManager.AllDestinationsL(iDestIdArray); + + for (int i = 0; i < iDestIdArray.Count(); i++) { - uint SNAPID = iDestIdArray[i]; - IAPID = GetBestIAPInThisSNAPL( aCmManagerExt, SNAPID ); - if ( IAPID ) + uint SNAPID = iDestIdArray[i]; + IAPID = GetBestIAPInThisSNAPL(aCmManager, SNAPID); + if (IAPID) { break; } - } + } iDestIdArray.Reset(); return IAPID; } - - // --------------------------------------------------------------------------- // IAUpdateEngine::GetBestIAPInInternetSNAPL // Sets the best IAP from internet snap // --------------------------------------------------------------------------- // -uint IAUpdateEngine::GetBestIAPInInternetSNAPL( RCmManagerExt& aCmManagerExt ) +uint IAUpdateEngine::GetBestIAPInInternetSNAPL(RCmManager& aCmManager) { //select IAP from Internet SNAP iDestIdArray.Reset(); - aCmManagerExt.AllDestinationsL( iDestIdArray ); + aCmManager.AllDestinationsL(iDestIdArray); uint InternetSNAPID = 0; - for ( int i = 0; i< iDestIdArray.Count(); i++ ) + for (int i = 0; i < iDestIdArray.Count(); i++) { - RCmDestinationExt dest = aCmManagerExt.DestinationL( iDestIdArray[i] ); - CleanupClosePushL( dest ); - - if ( dest.MetadataL( CMManager::ESnapMetadataInternet ) ) + RCmDestination dest = aCmManager.DestinationL(iDestIdArray[i]); + CleanupClosePushL(dest); + + if (dest.MetadataL(CMManager::ESnapMetadataInternet)) { InternetSNAPID = iDestIdArray[i]; - CleanupStack::PopAndDestroy( &dest ); + CleanupStack::PopAndDestroy(&dest); break; - } - CleanupStack::PopAndDestroy( &dest ); - } + } + CleanupStack::PopAndDestroy(&dest); + } iDestIdArray.Reset(); - - return GetBestIAPInThisSNAPL( aCmManagerExt, InternetSNAPID ); + + return GetBestIAPInThisSNAPL(aCmManager, InternetSNAPID); } - - // --------------------------------------------------------------------------- // IAUpdateEngine::GetBestIAPInThisSNAPL // Sets the best IAP from the given snap // --------------------------------------------------------------------------- // -uint IAUpdateEngine::GetBestIAPInThisSNAPL( RCmManagerExt& aCmManagerExt, uint aSNAPID ) +uint IAUpdateEngine::GetBestIAPInThisSNAPL(RCmManager& aCmManager, + uint aSNAPID) { //get all usable IAPs TConnMonIapInfoBuf iapInfo; TRequestStatus status; - + RConnectionMonitor connMon; connMon.ConnectL(); - CleanupClosePushL( connMon ); - - connMon.GetPckgAttribute( EBearerIdAll, 0, KIapAvailability,iapInfo, status ); - User::WaitForRequest( status ); - User::LeaveIfError( status.Int() ); - - CleanupStack::PopAndDestroy( &connMon ); - - RCmDestinationExt dest = aCmManagerExt.DestinationL( aSNAPID ); - CleanupClosePushL( dest ); - + CleanupClosePushL(connMon); + + connMon.GetPckgAttribute(EBearerIdAll, 0, KIapAvailability, iapInfo, + status); + User::WaitForRequest(status); + User::LeaveIfError(status.Int()); + + CleanupStack::PopAndDestroy(&connMon); + + RCmDestination dest = aCmManager.DestinationL(aSNAPID); + CleanupClosePushL(dest); + // Check whether the SNAP contains any IAP. - for (int i = 0; i < dest.ConnectionMethodCount(); i++ ) + for (int i = 0; i < dest.ConnectionMethodCount(); i++) { - RCmConnectionMethodExt cm = dest.ConnectionMethodL( i ); - CleanupClosePushL( cm ); - - uint iapid= cm.GetIntAttributeL( CMManager::ECmIapId ); - - for ( int i = 0; i < iapInfo().iCount; i++ ) + RCmConnectionMethod cm = dest.ConnectionMethodL(i); + CleanupClosePushL(cm); + + uint iapid = cm.GetIntAttributeL(CMManager::ECmIapId); + + for (int i = 0; i < iapInfo().iCount; i++) { - if ( iapInfo().iIap[i].iIapId == iapid ) + if (iapInfo().iIap[i].iIapId == iapid) { - CleanupStack::PopAndDestroy( 2 ); //cm & dest; + CleanupStack::PopAndDestroy(2); //cm & dest; return iapid; } - } - - CleanupStack::PopAndDestroy( &cm ); + } + + CleanupStack::PopAndDestroy(&cm); } - - CleanupStack::PopAndDestroy( &dest ); + + CleanupStack::PopAndDestroy(&dest); return 0; } @@ -1097,28 +1081,31 @@ CIAUpdateQueryHistory* updateQueryHistory = CIAUpdateQueryHistory::NewL(); // Get the delay information from the controller that has read it from // the config file. - updateQueryHistory->SetDelay( iController->ConfigData().QueryHistoryDelayHours() ); - CleanupStack::PushL( updateQueryHistory ); - bool isDelayed( updateQueryHistory->IsDelayedL( mUpdatequeryUid ) ); - CleanupStack::PopAndDestroy( updateQueryHistory ); - if ( !isDelayed ) + updateQueryHistory->SetDelay( + iController->ConfigData().QueryHistoryDelayHours()); + CleanupStack::PushL(updateQueryHistory); + bool isDelayed(updateQueryHistory->IsDelayedL(mUpdatequeryUid)); + CleanupStack::PopAndDestroy(updateQueryHistory); + if (!isDelayed) { - if ( ClientInBackgroundL() ) + if (ClientInBackgroundL()) { - iEikEnv->RootWin().SetOrdinalPosition( -1, ECoeWinPriorityNormal ); + iEikEnv->RootWin().SetOrdinalPosition(-1, ECoeWinPriorityNormal); } else { - iEikEnv->RootWin().SetOrdinalPosition( 0, ECoeWinPriorityNormal ); + iEikEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityNormal); } - - HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion); - messageBox->setText(QString("Application update is available from Nokia. Update?")); + + HbMessageBox *messageBox = new HbMessageBox( + HbMessageBox::MessageTypeQuestion); + messageBox->setText(QString( + "Application update is available from Nokia. Update?")); int actionCount = messageBox->actions().count(); - for (int i=actionCount-1; i >= 0; i--) - { + for (int i = actionCount - 1; i >= 0; i--) + { messageBox->removeAction(messageBox->actions().at(i)); - } + } mPrimaryAction = NULL; mPrimaryAction = new HbAction("Now"); mSecondaryAction = NULL; @@ -1132,31 +1119,29 @@ } else { - InformRequestObserver( KErrNone ); + InformRequestObserver(KErrNone); } - + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::ShowUpdateQueryL() end"); } - - // ----------------------------------------------------------------------------- // IAUpdateEngine::HideApplicationInFSWL // // ----------------------------------------------------------------------------- // -void IAUpdateEngine::HideApplicationInFSWL( bool aHide ) const +void IAUpdateEngine::HideApplicationInFSWL(bool aHide) const { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::HideApplicationInFSW() begin"); IAUPDATE_TRACE_1("[IAUPDATE] hide: %d", aHide ); int id = iEikEnv->RootWin().Identifier(); - CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC( - iEikEnv->WsSession(), id ); - - wgName->SetHidden( aHide ); - wgName->SetWindowGroupName( iEikEnv->RootWin() ); - CleanupStack::PopAndDestroy( wgName ); + CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC( + iEikEnv->WsSession(), id); + + wgName->SetHidden(aHide); + wgName->SetWindowGroupName(iEikEnv->RootWin()); + CleanupStack::PopAndDestroy(wgName); IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::HideApplicationInFSW() end"); } @@ -1164,10 +1149,10 @@ // IAUpdateEngine::UpdateQueryCallbackL // --------------------------------------------------------------------------- // -TInt IAUpdateEngine::UpdateQueryCallbackL( TAny* aPtr ) +TInt IAUpdateEngine::UpdateQueryCallbackL(TAny* aPtr) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::UpdateQueryCallbackL() begin"); - IAUpdateEngine* engine = static_cast( aPtr ); + IAUpdateEngine* engine = static_cast (aPtr); //TRAPD( err, engine->ShowUpdateQueryL() ); TRAP_IGNORE( engine->ShowUpdateQueryL() ); //if ( err != KErrNone ) @@ -1176,36 +1161,36 @@ // } IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::UpdateQueryCallbackL() end"); return KErrNone; - } + } // --------------------------------------------------------------------------- // IAUpdateEngine::AutomaticCheckCallbackL // --------------------------------------------------------------------------- // - -TInt IAUpdateEngine::AutomaticCheckCallbackL( TAny* aPtr ) + +TInt IAUpdateEngine::AutomaticCheckCallbackL(TAny* aPtr) { IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::AutomaticCheckCallbackL() begin"); - IAUpdateEngine* engine= static_cast( aPtr ); - + IAUpdateEngine* engine = static_cast (aPtr); + int err = KErrNone; - if ( !engine->iAutomaticCheck ) + if (!engine->iAutomaticCheck) { - TRAP( err, engine->iAutomaticCheck = CIAUpdateAutomaticCheck::NewL() ); + TRAP( err, engine->iAutomaticCheck = CIAUpdateAutomaticCheck::NewL() ); } - if ( err != KErrNone ) + if (err != KErrNone) { - engine->HandleLeaveErrorL( err ); + engine->HandleLeaveErrorL(err); } else { TRAP( err, engine->iAutomaticCheck->AcceptAutomaticCheckL() ); - if ( err != KErrNone ) + if (err != KErrNone) { - engine->HandleLeaveErrorL( err ); - } - } - + engine->HandleLeaveErrorL(err); + } + } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateEngine::AutomaticCheckCallbackL() end"); return KErrNone; } @@ -1218,20 +1203,21 @@ { //exit from result view if there are no update left bool toBeClosed = false; - if ( iController->Nodes().Count() == 0 && iController->FwNodes().Count() == 0 ) - { - toBeClosed = true; - } - else if ( mStartedFromApplication && - iController->ResultsInfo().iCountCancelled == 0 && - iController->ResultsInfo().iCountFailed == 0 ) + if (iController->Nodes().Count() == 0 && iController->FwNodes().Count() + == 0) { toBeClosed = true; } - if ( toBeClosed ) + else if (mStartedFromApplication + && iController->ResultsInfo().iCountCancelled == 0 + && iController->ResultsInfo().iCountFailed == 0) + { + toBeClosed = true; + } + if (toBeClosed) { qApp->quit(); } return toBeClosed; } - + diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/src/iaupdatefirsttimedatefile.cpp --- a/iaupdate/IAD/ui/src/iaupdatefirsttimedatefile.cpp Wed Jun 23 18:20:02 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: This module contains the implementation of CIAUpdateFirstTimeDateFile -* class member functions. -* -*/ - - - - -#include -#include -#include - -#include "iaupdatefirsttimedatefile.h" - - -const TInt KDrive( EDriveC ); -const TInt KSizeOfFile( 8 ); - - -// ----------------------------------------------------------------------------- -// CIAUpdateFirstTimeDateFile::NewL -// -// ----------------------------------------------------------------------------- -// -CIAUpdateFirstTimeDateFile* CIAUpdateFirstTimeDateFile::NewL( - const TDesC& aFile ) - { - CIAUpdateFirstTimeDateFile* self = - CIAUpdateFirstTimeDateFile::NewLC( aFile ); - CleanupStack::Pop( self ); - return self; - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateFirstTimeDateFile::NewLC -// -// ----------------------------------------------------------------------------- -// -CIAUpdateFirstTimeDateFile* CIAUpdateFirstTimeDateFile::NewLC( - const TDesC& aFile ) - { - CIAUpdateFirstTimeDateFile* self = - new( ELeave) CIAUpdateFirstTimeDateFile(); - CleanupStack::PushL( self ); - self->ConstructL( aFile ); - return self; - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateFirstTimeDateFile::CIAUpdateFirstTimeDateFile -// -// ----------------------------------------------------------------------------- -// -CIAUpdateFirstTimeDateFile::CIAUpdateFirstTimeDateFile() -: CBase(), - iFirstTime( 0 ) - { - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateFirstTimeDateFile::ConstructL -// -// ----------------------------------------------------------------------------- -// -void CIAUpdateFirstTimeDateFile::ConstructL( const TDesC& aFile ) - { - User::LeaveIfError( iFsSession.Connect() ); - User::LeaveIfError( - iFsSession.SetSessionToPrivate( KDrive ) ); - - User::LeaveIfError( iFsSession.SessionPath( iPath ) ); - BaflUtils::EnsurePathExistsL( iFsSession, iPath ); - iPath.Append( aFile ); - - // Read data from the file if the file exists. - // Otherwise, let default values remain. - ReadDataL(); - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateFirstTimeDateFile::~CIAUpdateFirstTimeDateFile -// -// ----------------------------------------------------------------------------- -// -CIAUpdateFirstTimeDateFile::~CIAUpdateFirstTimeDateFile() - { - iFsSession.Close(); - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateFirstTimeDateFile::ReadDataL -// -// ----------------------------------------------------------------------------- -// -TBool CIAUpdateFirstTimeDateFile::ReadDataL() - { - RFile file; - TInt err = file.Open( iFsSession, iPath, EFileRead|EFileShareAny ); - if ( err == KErrNotFound ) - { - // File did not exist. - // So, nothing to do here anymore. - return EFalse; - } - User::LeaveIfError( err ); - - CleanupClosePushL( file ); - - RFileReadStream stream( file, 0 ); - CleanupClosePushL( stream ); - - InternalizeL( stream ); - - CleanupStack::PopAndDestroy( &stream ); - CleanupStack::PopAndDestroy( &file ); - - return ETrue; - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateFirstTimeDateFile::WriteDataL -// -// ----------------------------------------------------------------------------- -// -void CIAUpdateFirstTimeDateFile::WriteDataL() - { - TDriveUnit driveUnit( KDrive ); - if ( SysUtil::DiskSpaceBelowCriticalLevelL( - &iFsSession, KSizeOfFile, driveUnit ) ) - { - User::Leave( KErrDiskFull ); - } - - RFile file; - User::LeaveIfError( - file.Replace( iFsSession, iPath, EFileWrite|EFileShareAny ) ); - CleanupClosePushL( file ); - - RFileWriteStream stream( file, 0 ); - CleanupClosePushL( stream ); - - ExternalizeL( stream ); - - stream.CommitL(); - - CleanupStack::PopAndDestroy( &stream ); - CleanupStack::PopAndDestroy( &file ); - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateFirstTimeDateFile::FirstTime -// -// ----------------------------------------------------------------------------- -// -const TTime& CIAUpdateFirstTimeDateFile::FirstTime() const - { - return iFirstTime; - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateFirstTimeDateFile::SetCurrentFirstTime -// -// ----------------------------------------------------------------------------- -// -void CIAUpdateFirstTimeDateFile::SetCurrentFirstTime() - { - TTime universalTime; - universalTime.UniversalTime(); - iFirstTime = universalTime; - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateFirstTimeDateFile::InternalizeL -// -// ----------------------------------------------------------------------------- -// -void CIAUpdateFirstTimeDateFile::InternalizeL( RReadStream& aStream ) - { - // If you make changes here, - // remember to update ExternalizeL accordingly!!! - - TInt64 firstTime( 0 ); - aStream >> firstTime; - iFirstTime = firstTime; - } - - -// ----------------------------------------------------------------------------- -// CIAUpdateFirstTimeDateFile::ExternalizeL -// -// ----------------------------------------------------------------------------- -// -void CIAUpdateFirstTimeDateFile::ExternalizeL( RWriteStream& aStream ) - { - // If you make changes here, - // remember to update InternalizeL accordingly!!! - - TInt64 firstTime( FirstTime().Int64() ); - aStream << firstTime; - } diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/src/iaupdatefirsttimeinfo.cpp --- a/iaupdate/IAD/ui/src/iaupdatefirsttimeinfo.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdatefirsttimeinfo.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 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" @@ -20,7 +20,6 @@ //INCLUDES #include "iaupdatefirsttimeinfo.h" -#include "iaupdatefirsttimedatefile.h" #include // bafl.lib #include // estor.lib @@ -108,19 +107,8 @@ iAgreementAccepted = ETrue; WriteDataL(); } - -// --------------------------------------------------------------------------- -// CIAUpdateFirstTimeInfo::SetAgreementAskedL -// Set Nokia agreement as asked (prompted) to an user -// --------------------------------------------------------------------------- -// -void CIAUpdateFirstTimeInfo::SetAgreementAskedL() - { - ReadDataL(); - iAgreementAsked = ETrue; - WriteDataL(); - } - + + // --------------------------------------------------------------------------- // CIAUpdateFirstTimeInfo::SetAutomaticUpdatesAskedL // Set automatic update checks as prompted to an use @@ -132,26 +120,6 @@ iAutomaticUpdateChecksAsked = ETrue; WriteDataL(); } - -// --------------------------------------------------------------------------- -// CIAUpdateFirstTimeInfo::SetFirstTimeIfNotSetL -// -// --------------------------------------------------------------------------- -// -void CIAUpdateFirstTimeInfo::SetFirstTimeIfNotSetL() - { - if ( !AutomaticUpdateChecksAskedL() ) - { - CIAUpdateFirstTimeDateFile* firstTimeDateFile = - CIAUpdateFirstTimeDateFile::NewLC( KIAUpdateFirstTimeDateFile ); - if ( firstTimeDateFile->FirstTime().Int64() == 0 ) - { - firstTimeDateFile->SetCurrentFirstTime(); - firstTimeDateFile->WriteDataL(); - } - CleanupStack::PopAndDestroy( firstTimeDateFile ); - } - } // --------------------------------------------------------------------------- // CIAUpdateFirstTimeInfo::AgreementAcceptedL @@ -164,18 +132,6 @@ return iAgreementAccepted; } - -// --------------------------------------------------------------------------- -// CIAUpdateFirstTimeInfo::AgreementAskedL -// Is Nokia agreement of Application Update already asked -// --------------------------------------------------------------------------- -// -TBool CIAUpdateFirstTimeInfo::AgreementAskedL() - { - ReadDataL(); - return iAgreementAsked; - } - // --------------------------------------------------------------------------- // CIAUpdateFirstTimeInfo::AutomaticUpdateChecksAskedL // Is activation for automatic update cheks from network already asked @@ -187,37 +143,6 @@ return iAutomaticUpdateChecksAsked; } -// --------------------------------------------------------------------------- -// CIAUpdateFirstTimeInfo::FirstTimeDelayL -// -// --------------------------------------------------------------------------- -// -TBool CIAUpdateFirstTimeInfo::FirstTimeDelayL() - { - TBool firstTimeDelay = EFalse; - if ( !AutomaticUpdateChecksAskedL() ) - { - CIAUpdateFirstTimeDateFile* firstTimeDateFile = - CIAUpdateFirstTimeDateFile::NewL( KIAUpdateFirstTimeDateFile ); - - TTime firstTime( firstTimeDateFile->FirstTime() ); - - delete firstTimeDateFile; - - TTime expireTime( firstTime ); - - expireTime += KFirstTimeDelayInDays; - - TTime universalTime; - universalTime.UniversalTime(); - - if ( universalTime < expireTime && universalTime >= firstTime ) - { - firstTimeDelay = ETrue; - } - } - return firstTimeDelay; - } // ----------------------------------------------------------------------------- // CIAUpdateFirstTimeInfo::ReadDataL @@ -231,7 +156,6 @@ if ( err == KErrNotFound ) { iAgreementAccepted = EFalse; - iAgreementAsked = EFalse; iAutomaticUpdateChecksAsked = EFalse; } else @@ -282,7 +206,6 @@ void CIAUpdateFirstTimeInfo::InternalizeL( RReadStream& aStream ) { iAgreementAccepted = aStream.ReadInt32L(); - iAgreementAsked = aStream.ReadInt32L(); iAutomaticUpdateChecksAsked = aStream.ReadInt32L(); } @@ -295,7 +218,6 @@ void CIAUpdateFirstTimeInfo::ExternalizeL( RWriteStream& aStream ) { aStream.WriteInt32L( iAgreementAccepted ); - aStream.WriteInt32L( iAgreementAsked ); aStream.WriteInt32L( iAutomaticUpdateChecksAsked ); } diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/src/iaupdatemainview.cpp --- a/iaupdate/IAD/ui/src/iaupdatemainview.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdatemainview.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -17,8 +17,12 @@ */ #include -#include +#include +#include +#include +#include +#include #include #include #include @@ -28,6 +32,8 @@ #include #include #include +#include +#include #include "iaupdatemainview.h" #include "iaupdateengine.h" @@ -48,11 +54,17 @@ IAUpdateMainView::IAUpdateMainView(IAUpdateEngine *engine): mEngine(engine) { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::IAUpdateMainView() begin"); + mFwListView = NULL; + mApplicationUpdatesGroupBox = NULL;; + mFwNSUGroupBox = NULL; + mContentDataForm = NULL; mDialogUtil = NULL; mDialogState = NoDialog; mPrimaryAction = NULL; mNode = NULL; mSelectionUpdate = false; + mSelectionConnect = false; HbDocumentLoader loader; bool ok = false; @@ -62,15 +74,15 @@ Q_ASSERT_X(ok, "Software update", "Invalid docml file"); // Create the view from DocML - HbView* widget = qobject_cast(loader.findWidget("view")); - Q_ASSERT_X(widget != 0, "Software update", "View not found"); - QString viewTitle(widget->title()); + HbView* loadedWidget = qobject_cast(loader.findWidget("view")); + Q_ASSERT_X(loadedWidget != 0, "Software update", "View not found"); + QString viewTitle(loadedWidget->title()); // Set the IAUpdateMainView view to be the widget that was loaded from the xml - setWidget(widget); + setWidget(loadedWidget); setTitle(viewTitle); HbToolBar *toolBar = qobject_cast< HbToolBar*>( loader.findWidget("viewToolbar") ); - setToolBar(toolBar); + //setToolBar(toolBar); HbMenu *menu = qobject_cast< HbMenu*>( loader.findWidget("viewMenu") ); setMenu(menu); @@ -83,21 +95,45 @@ connect(action, SIGNAL(triggered()), this, SLOT(handleStartUpdate())); connect(action_1, SIGNAL(triggered()), this, SLOT(handleSettings())); connect(action_2, SIGNAL(triggered()), this, SLOT(handleDisclaimer())); - + + mContent = qobject_cast< HbWidget*>( loader.findWidget("content") ); + mListView = qobject_cast( loader.findWidget("listWidget") ); mListView->setSelectionMode( HbAbstractItemView::MultiSelection ); connect( mListView, SIGNAL( longPressed( HbAbstractViewItem *, const QPointF & ) ), this, SLOT( handleDetails( HbAbstractViewItem *, const QPointF & ) ) ); - + HbListViewItem *prototype = mListView->listItemPrototype(); prototype->setGraphicsSize(HbListViewItem::LargeIcon); + + HbDockWidget *dock = new HbDockWidget(this); + HbWidget *dockContainer = new HbWidget(dock); + QGraphicsLinearLayout *dockLayout = new QGraphicsLinearLayout(dockContainer); + dockLayout->setOrientation(Qt::Vertical); + dockContainer->setLayout(dockLayout); + + mSelections = new HbGroupBox(dockContainer); + mSelections->setHeading("Selected 0/0 (0 kB)"); + + dockLayout->addItem( mSelections); + + dockLayout->addItem(toolBar); + + dock->setWidget(dockContainer); + + setDockWidget(dock); + + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::IAUpdateMainView() end"); } IAUpdateMainView::~IAUpdateMainView() { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::~IAUpdateMainView() begin"); + + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::~IAUpdateMainView() end"); } // ----------------------------------------------------------------------------- @@ -105,130 +141,40 @@ // Refreshes update list // ----------------------------------------------------------------------------- // -void IAUpdateMainView::refresh( const RPointerArray &nodes, - const RPointerArray &fwNodes, - int /*error*/ ) +void IAUpdateMainView::refresh(const RPointerArray &nodes, + const RPointerArray &fwNodes, + int error) { - IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh begin"); - - mAllNodes.Reset(); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh() begin"); + removeCurrentContentLayout(); - if (fwNodes.Count() > 0) - { - IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh hard code importance"); - //hardcode the importance of firmware as Critical - for (int i = 0; i < fwNodes.Count(); i++) - { - fwNodes[i]->Base().SetImportance(MIAUpdateBaseNode::ECritical); - } - - //either NSU or FOTA available - if (fwNodes.Count() == 1) - { - IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh either NSU or FOTA available"); - MIAUpdateAnyNode *node = fwNodes[0]; - mAllNodes.Append(node); - } - - //both NSU and FOTA available, show only FOTA node - if (fwNodes.Count() == 2) + refreshFirmwareUpdates(fwNodes); + + refreshApplicationUpdates(nodes); + + if (nodes.Count() == 0 && fwNodes.Count() == 0 && + error != KErrCancel && error != KErrAbort) + { + if (!mContentDataForm) { - IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh both NSU and FOTA available"); - MIAUpdateAnyNode *node1 = fwNodes[0]; - MIAUpdateFwNode *fwnode = static_cast(node1); - if (fwnode->FwType() == MIAUpdateFwNode::EFotaDp2) - { - mAllNodes.Append(node1); - } - else - { - MIAUpdateAnyNode* node2 = fwNodes[1]; - mAllNodes.Append(node2); - } + mContentDataForm = new HbDataForm(mContent); } - } - - - for(int i = 0; i < nodes.Count(); ++i) - { - MIAUpdateAnyNode *node = nodes[i]; - mAllNodes.Append(node); - } + QGraphicsLinearLayout *linearLayout = (QGraphicsLinearLayout*) mContent->layout(); + linearLayout->addItem(mContentDataForm); + QString formText; - mListView->clear(); - QItemSelectionModel *selectionModel = mListView->selectionModel(); - selectionModel->clear(); - HbIcon icon(QString(":/icons/qgn_menu_swupdate")); - - for(int j = 0; j < mAllNodes.Count(); ++j) - { - MIAUpdateAnyNode *node = mAllNodes[j]; - - QString importanceDescription; - MIAUpdateNode::TUIUpdateState uiState = MIAUpdateNode::ENormal; - if (node->NodeType() == MIAUpdateAnyNode::ENodeTypeNormal) + if (error == KErrNone) { - MIAUpdateNode *updateNode = static_cast(node); - uiState = updateNode->UiState(); - } - if (uiState == MIAUpdateNode::ENormal) - { - setImportance(node, importanceDescription); + formText = QString("Applications are up to date"); } else { - if(uiState == MIAUpdateNode::EUpdated) - { - importanceDescription = "Updated"; - } - else if(uiState == MIAUpdateNode::EFailed) - { - importanceDescription = "Failed"; - } - else if(uiState == MIAUpdateNode::EDownloaded) - { - importanceDescription = "Downloaded"; - } + formText = QString("Refreshing failed. Try again later."); } - - - - HbListWidgetItem *item = new HbListWidgetItem(); - QString name; - if (node->NodeType() == MIAUpdateAnyNode::ENodeTypeNormal) - { - MIAUpdateNode *updateNode = static_cast(node); - if (updateNode->UiState() == MIAUpdateNode::EDownloading) - { - name = QString("Downloading "); - } - else if (updateNode->UiState() == MIAUpdateNode::EInstalling) - { - name = QString("Installing "); - } - } - name.append(XQConversions::s60DescToQString(node->Base().Name())); - if (node->NodeType() == MIAUpdateAnyNode::ENodeTypeFw) - { - name.append(" DEVICE SOFTWARE"); - } - item->setText(name); - item->setSecondaryText(importanceDescription); - item->setIcon(icon); - mListView->addItem(item); - - if (node->Base().IsSelected()) - { - int count = mListView->count(); - QModelIndex modelIndex = mListView->model()->index(count-1,0); - selectionModel->select(modelIndex, QItemSelectionModel::Select); - } - + mContentDataForm->setDescription(formText); } - connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), - this, SLOT(handleSelectionChanged(QItemSelection,QItemSelection))); - - IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh end"); + updateSelectionInfoInDock(); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refresh() end"); } @@ -237,31 +183,21 @@ void IAUpdateMainView::handleStartUpdate() { IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleStartUpdate() begin"); - bool firmwareUpdate = false; - RPointerArray selectedNodes; - getSelectedNodes(selectedNodes); - if (selectedNodes.Count() > 0) - { - if ( selectedNodes[0]->NodeType() == MIAUpdateAnyNode::ENodeTypeFw ) - { - //the marking logic will make sure firmware won't be marked with normal sis updates - //at the same time. - firmwareUpdate = true; - } - } - selectedNodes.Close(); - mEngine->StartUpdate(firmwareUpdate); + mEngine->StartUpdate(fotaSelected()); IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleStartUpdate() end"); } void IAUpdateMainView::handleSettings() { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleSettings() begin"); emit toSettingView(); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleSettings() end"); } void IAUpdateMainView::handleDisclaimer() { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleDisclaimer() begin"); if (!mDialogUtil) { mDialogUtil = new IAUpdateDialogUtil(this); @@ -271,22 +207,38 @@ HbAction *primaryAction = new HbAction("OK"); mDialogUtil->showAgreement(primaryAction); } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleDisclaimer() end"); } -void IAUpdateMainView::handleDetails( HbAbstractViewItem * item, const QPointF & ) +void IAUpdateMainView::handleDetails(HbAbstractViewItem * item, const QPointF &) { - - + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleDetails() begin"); int ind = item->modelIndex().row(); - if (getNode(ind) != NULL) + if (getApplicationNode(ind) != NULL) { - showDetails(*getNode(ind)); + showDetails(*getApplicationNode(ind)); } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleDetails() end"); +} + +void IAUpdateMainView::handleFotaDetails(HbAbstractViewItem *, const QPointF &) +{ + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleFotaDetails begin"); + //only one FOTA item in a list, just use it + for (int i = 0; i < mFwNodes.Count(); i++) + { + if (mFwNodes[i]->FwType() == MIAUpdateFwNode::EFotaDp2) + { + showDetails(*mFwNodes[i]); + } + } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleFotaDetails end"); } void IAUpdateMainView::handleSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleSelectionChanged begin"); if (!mSelectionUpdate) { bool changedItemFound = false; @@ -306,11 +258,38 @@ } } } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleSelectionChanged end"); +} + +void IAUpdateMainView::handleFwSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) +{ + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleFwSelectionChanged begin"); + if (!mSelectionUpdate) + { + bool changedItemFound = false; + QModelIndexList indexList = selected.indexes(); + for (int i = 0; !changedItemFound && i < indexList.count(); ++i) + { + changedItemFound = true; + markFotaItem(true); + } + if (!changedItemFound) + { + indexList = deselected.indexes(); + for (int i = 0; !changedItemFound && i < indexList.count(); ++i) + { + changedItemFound = true; + markFotaItem(false); + } + } + } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::handleFwSelectionChanged end"); } void IAUpdateMainView::dialogFinished(HbAction *action) { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::dialogFinished begin"); DialogState dialogState = mDialogState; mDialogState = NoDialog; @@ -322,6 +301,7 @@ updateSelectionsToNodeArray(*mNode,mMark); } updateSelectionsToList(); + updateSelectionInfoInDock(); break; case CannotOmit: break; @@ -330,225 +310,264 @@ default: break; } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::dialogFinished end"); +} + +bool IAUpdateMainView::fotaSelected() const +{ + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::fotaSelected() begin"); + bool selected = false; + for (int i = 0; i < mFwNodes.Count() && !selected; ++i) + { + if ( mFwNodes[i]->FwType() == MIAUpdateFwNode::EFotaDp2 && mFwNodes[i]->Base().IsSelected() ) + { + selected = true; + } + } + if (selected) + { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::fotaSelected() Fota item is selected"); + } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::fotaSelected() end"); + return selected; } -void IAUpdateMainView::getSelectedNodes(RPointerArray &selectedNodes) const -{ - for (int i = 0; i < mAllNodes.Count(); ++i) - { - if (mAllNodes[i]->Base().IsSelected()) - { - selectedNodes.Append(mAllNodes[i]); - } - } -} void IAUpdateMainView::markListItem(bool mark, int index) { + IAUPDATE_TRACE_2("[IAUPDATE] IAUpdateMainView::markListItem() begin mark: %d index %d", mark, index); if (mark) { //It's Mark Command - RPointerArray selectedNodes; - getSelectedNodes(selectedNodes); + if (fotaSelected()) + { + //FOTA item is selected, unmark FOTA item + //FOTA item and application update items can't be selected at the same time + markFotaItem(false); + } + } + + bool accepted = false; - //There are selected items already and type are different with the current one - if (selectedNodes.Count() > 0 && (mAllNodes[index]->NodeType() != selectedNodes[0]->NodeType())) - { - // firmware item and normal sis items can't be selected at the same time - // unmark the selected nodes. - for (int i = 0; i < selectedNodes.Count(); i++) - { - int index = mAllNodes.Find(selectedNodes[i]); - mAllNodes[index]->Base().SetSelected(false); + if(index > -1) + { + accepted = true; + MIAUpdateNode* node = mNodes[index]; + RPointerArray mands; + RPointerArray deps; + + if (mark) + { + TRAPD(err,IAUpdateDepUtils::GetDependenciesL(*node, mNodes, deps)); + if (err != KErrNone) + { + deps.Close(); + updateSelectionsToList(); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() return end"); + return; + } + if (!getMandatoryNodes(mands)) + { + // error when creating mandatory node list + mands.Close(); + updateSelectionsToList(); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() return end"); + return; + } + } + else + { + //mandatory item is not allowed to be unmarked + if (mNodes[index]->Base().Importance() == MIAUpdateBaseNode::EMandatory) + { + //show dialog + showUpdateCannotOmitDialog(); + updateSelectionsToList(); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() return end"); + return; + } + TRAPD(err,IAUpdateDepUtils::GetDependantsL(*node, mNodes, deps)); + if (err != KErrNone) + { + deps.Close(); + updateSelectionsToList(); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() return end"); + return; + } + // item is not allowed to be unmarked if its dependant is mandatory + bool mandatoryDependantFound = false; + for(int i = 0; i < deps.Count() && !mandatoryDependantFound; i++) + { + if (deps[i]->Base().Importance() == MIAUpdateBaseNode::EMandatory) + { + mandatoryDependantFound = true; + } + } + if (mandatoryDependantFound) + { + showUpdateCannotOmitDialog(); + deps.Close(); + updateSelectionsToList(); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() return end"); + return; } } - selectedNodes.Close(); - } - - //there is no selected items or the type is the same with the current one - - if (mAllNodes[index]->NodeType() == MIAUpdateAnyNode::ENodeTypeFw ) - { - mAllNodes[index]->Base().SetSelected(mark); - updateSelectionsToList(); - return; - } - - if (mAllNodes[index]->NodeType() == MIAUpdateAnyNode::ENodeTypeNormal ) - { - bool accepted = false; - - if(index > -1) + + int depCount = deps.Count(); + + if (depCount > 0) { - accepted = true; - - MIAUpdateNode* node = static_cast(mAllNodes[index]); - RPointerArray mands; - RPointerArray deps; - + QString text; + QString names; + MIAUpdateNode* depNode = NULL; + QString separator(","); + + for(int i = 0; i < depCount; i++) + { + depNode = deps[i]; + if (i > 0) + { + names.append(separator); + names.append(QString(" ")); + } + names.append(XQConversions::s60DescToQString(depNode->Base().Name())); + } + if (mark) { - TRAPD(err,IAUpdateDepUtils::GetDependenciesL(*node, mAllNodes, deps)); - if (err != KErrNone) + if (depCount > 1) { - deps.Close(); - updateSelectionsToList(); - return; + text.append("This update needs also updates "); + text.append(names); + text.append(" for working"); + } + else + { + text.append("This update needs also \""); + text.append(names); + text.append("\" for working"); + } } - if (!getMandatoryNodes(mands)) + else + { + if (depCount > 1) + { + text.append("Updates "); + text.append(names); + text.append(" need this update for working"); + } + else { - // error when creating mandatory node list - mands.Close(); - updateSelectionsToList(); - return; - } + text.append("Update \""); + text.append(names); + text.append("\" needs this update for working"); + } + } + + if (mark && mNodes[index]->Base().Importance() == MIAUpdateBaseNode::EMandatory) + { + // depencencies of mandatory update are also selected without showing dialog + accepted = true; } else { - //mandatory item is not allowed to be unmarked - if (mAllNodes[index]->Base().Importance() == MIAUpdateBaseNode::EMandatory) - { - //show dialog - showUpdateCannotOmitDialog(); - updateSelectionsToList(); - return; - } - - //CleanupClosePushL( deps ); - TRAPD(err,IAUpdateDepUtils::GetDependantsL(*node, mAllNodes, deps)); - if (err != KErrNone) - { - deps.Close(); - updateSelectionsToList(); - return; - } - // item is not allowed to be unmarked if its dependant is mandatory - bool mandatoryDependantFound = false; - for(int i = 0; i < deps.Count() && !mandatoryDependantFound; i++) - { - if (deps[i]->Base().Importance() == MIAUpdateBaseNode::EMandatory) - { - mandatoryDependantFound = true; - } - } - if (mandatoryDependantFound) - { - showUpdateCannotOmitDialog(); - deps.Close(); - updateSelectionsToList(); - return; - } - } - - int depCount = deps.Count(); - - if (depCount > 0) - { - QString text; - QString names; - MIAUpdateNode* depNode = NULL; - QString separator(","); - - for(int i = 0; i < depCount; i++) - { - depNode = deps[i]; - if (i > 0) - { - names.append(separator); - names.append(QString(" ")); - } - names.append(XQConversions::s60DescToQString(depNode->Base().Name())); - } - - - if (mark) - { - if (depCount > 1) - { - text.append("This update needs also updates "); - text.append(names); - text.append(" for working"); - //resourceId = R_IAUPDATE_DEPENDENCY_MARK_MANY; - } - else - { - text.append("This update needs also \""); - text.append(names); - text.append("\" for working"); - //resourceId = R_IAUPDATE_DEPENDENCY_MARK_ONE; - } - } - else - { - if (depCount > 1) - { - text.append("Updates "); - text.append(names); - text.append(" need this update for working"); - //resourceId = R_IAUPDATE_DEPENDENCY_UNMARK_MANY; - } - else - { - text.append("Update \""); - text.append(names); - text.append("\" needs this update for working"); - //resourceId = R_IAUPDATE_DEPENDENCY_UNMARK_ONE; - } - } - - if (mark && mAllNodes[index]->Base().Importance() == MIAUpdateBaseNode::EMandatory) - { - // depencencies of mandatory update are also selected without showing dialog - accepted = true; - } - else - { - mNode = node; - mMark = mark; - showDependenciesFoundDialog(text); - return; - } - } - if (accepted) - { - updateSelectionsToNodeArray(*node, mark); + mNode = node; + mMark = mark; + accepted = false; + showDependenciesFoundDialog(text); } } - + if (accepted) + { + updateSelectionsToNodeArray(*node, mark); + } } - updateSelectionsToList(); + if (accepted) + { + updateSelectionsToList(); + updateSelectionInfoInDock(); + } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markListItem() end"); } - + + +void IAUpdateMainView::markFotaItem(bool mark) +{ + IAUPDATE_TRACE_1("[IAUPDATE] IAUpdateMainView::markFotaItem() begin mark: %d", mark); + if (mark) + { + //It's Mark Command + + //if some of application update item(s) are selected, unmark them + //FOTA item and application update items can't be selected at the same time + bool deselected = false; + for (int i = 0; i < mNodes.Count(); ++i) + { + if (mNodes[i]->Base().IsSelected()) + { + mNodes[i]->Base().SetSelected(false); + } + } + if (deselected) + { + // umnmarked items to be updated also to UI + updateSelectionsToList(); + } + } + for (int j = 0; j < mFwNodes.Count(); ++j) + { + if (mFwNodes[j]->FwType() == MIAUpdateFwNode::EFotaDp2) + { + mFwNodes[j]->Base().SetSelected(mark); + if (mark) + { + mFwListView->selectionModel()->select(mFwListView->model()->index(0,0),QItemSelectionModel::Select); + } + else + { + mFwListView->selectionModel()->select(mFwListView->model()->index(0,0),QItemSelectionModel::Deselect); + } + } + } + updateSelectionInfoInDock(); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::markFotaItem() end"); +} + + + + + void IAUpdateMainView::updateSelectionsToNodeArray(MIAUpdateNode &node, bool mark) -{ +{ + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionsToNodeArray() begin"); RPointerArray deps; TInt err = KErrNone; if (mark) { - TRAP(err,IAUpdateDepUtils::GetDependenciesL(node, mAllNodes, deps)); + TRAP(err,IAUpdateDepUtils::GetDependenciesL(node, mNodes, deps)); } else { - TRAP(err,IAUpdateDepUtils::GetDependantsL(node, mAllNodes, deps)); + TRAP(err,IAUpdateDepUtils::GetDependantsL(node, mNodes, deps)); } if (err == KErrNone ) { int depCount = deps.Count(); for(int i = 0; i < depCount; i++) { - int depNodeInd = mAllNodes.Find(deps[i]); - mAllNodes[depNodeInd]->Base().SetSelected(mark); + int depNodeInd = mNodes.Find(deps[i]); + mNodes[depNodeInd]->Base().SetSelected(mark); } deps.Close(); - int nodeInd = mAllNodes.Find(&node); - mAllNodes[nodeInd]->Base().SetSelected(mark); + int nodeInd = mNodes.Find(&node); + mNodes[nodeInd]->Base().SetSelected(mark); } //mark all of the mandatory items if ( mark ) { - RPointerArray mands; + RPointerArray mands; if (getMandatoryNodes(mands)) { int mandCount = mands.Count(); @@ -556,14 +575,14 @@ { for(int i = 0; i < mandCount; i++) { - int mandNodeInd = mAllNodes.Find(mands[i]); - mAllNodes[mandNodeInd]->Base().SetSelected(mark); - if (mAllNodes[mandNodeInd]->NodeType() == MIAUpdateAnyNode::ENodeTypeNormal) + int mandNodeInd = mNodes.Find(mands[i]); + mNodes[mandNodeInd]->Base().SetSelected(mark); + if (mNodes[mandNodeInd]->NodeType() == MIAUpdateAnyNode::ENodeTypeNormal) { // mark also all dependencies of a mandatory item - MIAUpdateNode* dependencyNode = static_cast(mAllNodes[mandNodeInd]); + MIAUpdateNode* dependencyNode = mNodes[mandNodeInd]; RPointerArray dependencies; - TRAPD(err,IAUpdateDepUtils::GetDependenciesL(*dependencyNode, mAllNodes, dependencies)); + TRAPD(err,IAUpdateDepUtils::GetDependenciesL(*dependencyNode, mNodes, dependencies)); if (err) { dependencies.Close(); @@ -572,8 +591,8 @@ } for(int j = 0; j < dependencies.Count(); j++) { - int depNodeInd = mAllNodes.Find(dependencies[j]); - mAllNodes[depNodeInd]->Base().SetSelected(true); + int depNodeInd = mNodes.Find(dependencies[j]); + mNodes[depNodeInd]->Base().SetSelected(true); } dependencies.Close(); } @@ -581,28 +600,32 @@ } } mands.Close(); - } + } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionsToNodeArray() end"); } -bool IAUpdateMainView::getMandatoryNodes(RPointerArray &mandNodes) const +bool IAUpdateMainView::getMandatoryNodes(RPointerArray &mandNodes) const { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::getMandatoryNodes() begin"); bool ret = true; - for(int i = 0; i < mAllNodes.Count(); ++i) + for(int i = 0; i < mNodes.Count(); ++i) { - if (mAllNodes[i]->Base().Importance() == MIAUpdateBaseNode::EMandatory) + if (mNodes[i]->Base().Importance() == MIAUpdateBaseNode::EMandatory) { - if (mandNodes.Append(mAllNodes[i]) != KErrNone) + if (mandNodes.Append(mNodes[i]) != KErrNone) { ret = false; } } } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::getMandatoryNodes() end"); return ret; } void IAUpdateMainView::showUpdateCannotOmitDialog() { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showUpdateCannotOmitDialog() begin"); HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); messageBox->setText(QString("This required update cannot be omitted")); int actionCount = messageBox->actions().count(); @@ -617,10 +640,12 @@ messageBox->setAttribute(Qt::WA_DeleteOnClose); mDialogState = CannotOmit; messageBox->open(this, SLOT(dialogFinished(HbAction*))); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showUpdateCannotOmitDialog() end"); } void IAUpdateMainView::showDependenciesFoundDialog(QString &text) { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showDependenciesFoundDialog() begin"); HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion); HbLabel *label = new HbLabel(messageBox); label->setHtml(QString("Depencencies")); @@ -643,17 +668,19 @@ messageBox->setAttribute(Qt::WA_DeleteOnClose); mDialogState = Dependencies; messageBox->open(this, SLOT(dialogFinished(HbAction*))); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showDependenciesFoundDialog() end"); } void IAUpdateMainView::updateSelectionsToList() { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionsToList() begin"); mSelectionUpdate = true; - for(int i = 0; i < mAllNodes.Count(); ++i) + for(int i = 0; i < mNodes.Count(); ++i) { - if ( mAllNodes[i]->Base().IsSelected() != mListView->selectionModel()->isSelected(mListView->model()->index(i,0))) + if ( mNodes[i]->Base().IsSelected() != mListView->selectionModel()->isSelected(mListView->model()->index(i,0))) { QItemSelectionModel::SelectionFlag selectionFlag; - if ( mAllNodes[i]->Base().IsSelected()) + if ( mNodes[i]->Base().IsSelected()) { selectionFlag = QItemSelectionModel::Select; } @@ -665,22 +692,26 @@ } } mSelectionUpdate = false; + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionsToList() end"); } -MIAUpdateAnyNode* IAUpdateMainView::getNode(int index) const +MIAUpdateNode* IAUpdateMainView::getApplicationNode(int index) const { - MIAUpdateAnyNode *currentNode = NULL; + IAUPDATE_TRACE_1("[IAUPDATE] IAUpdateMainView::getApplicationNode() begin index: %d", index); + MIAUpdateNode *currentNode = NULL; - if (index >= 0 && index < mAllNodes.Count()) + if (index >= 0 && index < mNodes.Count()) { - currentNode = mAllNodes[index]; + currentNode = mNodes[index]; } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::getApplicationNode() end"); return currentNode; } void IAUpdateMainView::showDetails(MIAUpdateAnyNode& node) { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showDetails() begin"); HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); HbLabel *label = new HbLabel(messageBox); label->setHtml(QString("Details")); @@ -694,13 +725,14 @@ messageBox->setTimeout(HbPopup::NoTimeout); messageBox->setAttribute(Qt::WA_DeleteOnClose); mDialogState = Details; - messageBox->open(this, SLOT(dialogFinished(HbAction*))); + messageBox->open(this, SLOT(dialogFinished(HbAction*))); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::showDetails() end"); } void IAUpdateMainView::constructDetailsText(MIAUpdateAnyNode &node, QString &text) { - + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::constructDetailsText() begin"); text.append(QString("Name:")); text.append(QString("
")); QString name = XQConversions::s60DescToQString(node.Base().Name()); @@ -763,10 +795,12 @@ fileSizeText(contentSize, textFileSize); text.append(textFileSize); } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::constructDetailsText() end"); } void IAUpdateMainView::versionText(const TIAUpdateVersion &version, QString &versionText) { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::versionText() begin"); QString stringMajor; stringMajor.setNum(version.iMajor); versionText.append(stringMajor); @@ -779,10 +813,12 @@ stringBuild.setNum(version.iBuild); versionText.append(stringBuild); versionText.append(QString(")")); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::versionText() end"); } void IAUpdateMainView::fileSizeText(int fileSize, QString &text) { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::fileSizeText() begin"); int size = 0; QString stringUnit; @@ -806,10 +842,12 @@ } text.setNum(size); text.append(stringUnit); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::fileSizeText() end"); } void IAUpdateMainView::setImportance(MIAUpdateAnyNode *node, QString &importanceDescription) { + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::setImportance() begin"); int sizeInBytes = node->Base().ContentSizeL(); int size = 0; bool shownInMegabytes = false; @@ -915,5 +953,232 @@ break; } } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::setImportance() end"); } +void IAUpdateMainView::removeCurrentContentLayout() +{ + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::removeCurrentContentLayout() begin"); + int itemCount = mContent->layout()->count(); + for (int i = 0; i < itemCount; i++) + { + mContent->layout()->removeAt(i); + } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::removeCurrentContentLayout() end"); +} + +void IAUpdateMainView::refreshFirmwareUpdates(const RPointerArray &fwNodes) +{ + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshFirmwareUpdates() begin"); + mFwNodes.Reset(); + + for (int i = 0; i < fwNodes.Count(); i++) + { + MIAUpdateFwNode *fwnode = (fwNodes[i]); + mFwNodes.Append(fwnode); + fwnode->Base().SetImportance(MIAUpdateBaseNode::ECritical); + if (fwnode->FwType() == MIAUpdateFwNode::EFotaDp2) + { + refreshFotaUpdate(*fwnode ); + } + else if (fwNodes.Count() == 1 && fwnode->FwType() == MIAUpdateFwNode::EFotiNsu) + { + refreshNsuUpdate(); + } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshFirmwareUpdates() end"); + } +} + +void IAUpdateMainView::refreshFotaUpdate(MIAUpdateFwNode& fwNode) +{ + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshFotaUpdate() begin"); + if (!mFwListView) + { + mFwListView = new HbListWidget(mContent); + mFwListView->setSelectionMode( HbAbstractItemView::MultiSelection ); + connect( mFwListView, SIGNAL( longPressed( HbAbstractViewItem *, const QPointF & ) ), + this, SLOT( handleFotaDetails( HbAbstractViewItem *, const QPointF & ) ) ); + mFwListView->listItemPrototype()->setGraphicsSize(HbListViewItem::LargeIcon); + mFwListView->listItemPrototype()->setStretchingStyle(HbListViewItem::NoStretching); + connect(mFwListView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), + this, SLOT(handleFwSelectionChanged(QItemSelection,QItemSelection))); + } + QGraphicsLinearLayout *linearLayout = (QGraphicsLinearLayout*) mContent->layout(); + linearLayout->addItem(mFwListView); + mFwListView->clear(); + QItemSelectionModel *selectionModel = mFwListView->selectionModel(); + selectionModel->clear(); + HbListWidgetItem *fwItem = new HbListWidgetItem(); + QString name(XQConversions::s60DescToQString(fwNode.Base().Name())); + name.append(" DEVICE SOFTWARE"); + fwItem->setText(name); + QString importanceDescription; + setImportance(&fwNode, importanceDescription); + fwItem->setSecondaryText(importanceDescription); + HbIcon icon(QString(":/icons/qgn_menu_swupdate")); + fwItem->setIcon(icon); + if (fwNode.Base().IsSelected()) + { + QModelIndex modelIndex = mFwListView->model()->index(0,0); + selectionModel->select(modelIndex, QItemSelectionModel::Select); + } + mFwListView->addItem(fwItem); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshFotaUpdate() end"); +} + +void IAUpdateMainView::refreshNsuUpdate() +{ + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshNsuUpdate() begin"); + if (!mFwNSUGroupBox) + { + mFwNSUGroupBox = new HbGroupBox(mContent); + mFwNSUGroupBox->setHeading("Device software available"); + HbDataForm *dataForm = new HbDataForm(mFwNSUGroupBox); + mFwNSUGroupBox->setContentWidget(dataForm); + dataForm->setDescription("Use your PC to update the device software ([version %L]) from address www.nokia.com/softwareupdate"); + } + QGraphicsLinearLayout *linearLayout = (QGraphicsLinearLayout*) mContent->layout(); + linearLayout->addItem(mFwNSUGroupBox); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshNsuUpdate() end"); +} + +void IAUpdateMainView::refreshApplicationUpdates(const RPointerArray &nodes) +{ + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshApplicationUpdates() begin"); + if (nodes.Count() > 0) + { + if (!mApplicationUpdatesGroupBox) + { + mApplicationUpdatesGroupBox = new HbGroupBox(mContent); + mApplicationUpdatesGroupBox->setHeading("Application updates"); + } + QGraphicsLinearLayout *linearLayout = (QGraphicsLinearLayout*) mContent->layout(); + linearLayout->addItem(mApplicationUpdatesGroupBox); + linearLayout->addItem(mListView); + } + mListView->clear(); + QItemSelectionModel *selectionModel = mListView->selectionModel(); + selectionModel->clear(); + HbIcon icon(QString(":/icons/qgn_menu_swupdate")); + mNodes.Reset(); + for(int i = 0; i < nodes.Count(); ++i) + { + MIAUpdateNode *node = nodes[i]; + mNodes.Append(node); + QString importanceDescription; + MIAUpdateNode::TUIUpdateState uiState = node->UiState(); + if (uiState == MIAUpdateNode::ENormal) + { + setImportance(node, importanceDescription); + } + else if (uiState == MIAUpdateNode::EUpdated) + { + importanceDescription = "Updated"; + } + else if (uiState == MIAUpdateNode::EFailed) + { + importanceDescription = "Failed"; + } + else if (uiState == MIAUpdateNode::EDownloaded) + { + importanceDescription = "Downloaded"; + } + HbListWidgetItem *item = new HbListWidgetItem(); + QString name; + if (uiState == MIAUpdateNode::EDownloading) + { + name = QString("Downloading "); + } + else if (uiState == MIAUpdateNode::EInstalling) + { + name = QString("Installing "); + } + name.append(XQConversions::s60DescToQString(node->Base().Name())); + item->setText(name); + item->setSecondaryText(importanceDescription); + item->setIcon(icon); + mListView->addItem(item); + + if (node->Base().IsSelected()) + { + int count = mListView->count(); + QModelIndex modelIndex = mListView->model()->index(count-1,0); + selectionModel->select(modelIndex, QItemSelectionModel::Select); + } + } + if (!mSelectionConnect) + { + mSelectionConnect = connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), + this, SLOT(handleSelectionChanged(QItemSelection,QItemSelection))); + } + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::refreshApplicationUpdates() end"); +} + +void IAUpdateMainView::updateSelectionInfoInDock() +{ + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionInfoInDock() begin"); + int countOfSelectedItems = 0; + int countOfAllItems = 0; + int selectedSizeInBytes = 0; + for (int i = 0; i < mFwNodes.Count(); ++i) + { + if (mFwNodes[i]->FwType() == MIAUpdateFwNode::EFotaDp2) + { + countOfAllItems++; + if (mFwNodes[i]->Base().IsSelected()) + { + countOfSelectedItems++; + selectedSizeInBytes += mFwNodes[i]->Base().ContentSizeL(); + } + } + } + countOfAllItems += mNodes.Count(); + for (int j = 0; j < mNodes.Count(); ++j) + { + if (mNodes[j]->Base().IsSelected()) + { + countOfSelectedItems++; + selectedSizeInBytes += mNodes[j]->Base().ContentSizeL(); + } + } + + int selectedSize = 0; + QString unit; + if (selectedSizeInBytes >= KMaxShownInKiloBytes) + { + unit = "MB"; + selectedSize = selectedSizeInBytes / KMegaByte; + if (selectedSizeInBytes % KMegaByte != 0) + { + selectedSize++; + } + } + else + { + unit = "kB"; + selectedSize = selectedSizeInBytes / KKiloByte; + if (selectedSizeInBytes % KKiloByte != 0) + { + selectedSize++; + } + } + QString selectionString; + selectionString.append("Selected "); + QString numText; + numText.setNum(countOfSelectedItems); + selectionString.append(numText); + selectionString.append("/"); + numText.setNum(countOfAllItems); + selectionString.append(numText); + if (selectedSize > 0) + { + selectionString.append(" ("); + numText.setNum(selectedSize); + selectionString.append(numText); + selectionString.append(" "); + selectionString.append(unit); + selectionString.append(")"); + } + mSelections->setHeading(selectionString); + IAUPDATE_TRACE("[IAUPDATE] IAUpdateMainView::updateSelectionInfoInDock() end"); +} diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/src/iaupdatenodefilter.cpp --- a/iaupdate/IAD/ui/src/iaupdatenodefilter.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdatenodefilter.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -213,7 +213,14 @@ { for ( TInt i = 0; i < aFwNodes.Count(); ++i ) { - aFwNodes[i]->Base().SetSelected( ETrue ); + if ( aFwNodes[i]->FwType() == MIAUpdateFwNode::EFotiNsu ) + { + aFwNodes[i]->Base().SetSelected( EFalse ); + } + else + { + aFwNodes[i]->Base().SetSelected( ETrue ); + } } for ( TInt i = 0; i < aNodes.Count(); ++i ) { @@ -232,7 +239,14 @@ { for ( TInt i = 0; i < aFwNodes.Count(); ++i ) { - aFwNodes[i]->Base().SetSelected( ETrue ); + if ( aFwNodes[i]->FwType() == MIAUpdateFwNode::EFotiNsu ) + { + aFwNodes[i]->Base().SetSelected( EFalse ); + } + else + { + aFwNodes[i]->Base().SetSelected( ETrue ); + } } for ( TInt i = 0; i < aNodes.Count(); ++i ) { @@ -401,16 +415,9 @@ RPointerArray deps; CleanupClosePushL( deps ); - RPointerArray allNodes; - CleanupClosePushL( allNodes ); - for( TInt i = 0; i < aAllNodes.Count(); ++i ) - { - MIAUpdateAnyNode* node = aAllNodes[i]; - User::LeaveIfError( allNodes.Append( node ) ); - } - - IAUpdateDepUtils::GetDependenciesL( aNode, allNodes, deps ); - CleanupStack::PopAndDestroy( &allNodes ); + + IAUpdateDepUtils::GetDependenciesL( aNode, aAllNodes, deps ); + TInt depCount = deps.Count(); for( TInt i = 0; i < depCount; i++ ) { diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/src/iaupdatesettingdialog.cpp --- a/iaupdate/IAD/ui/src/iaupdatesettingdialog.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdatesettingdialog.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -26,8 +26,13 @@ #include "iaupdatesettingdialog.h" #include "iaupdateprivatecrkeys.h" +#include "iaupdate.hrh" +const TInt KAutoUpdateOn( 0 ); +const TInt KAutoUpdateOff( 1 ); +const TInt KAutoUpdateOnInHomeNetwork( 2 ); + /* Constructor. It creates a formwidget on the view. */ @@ -190,7 +195,24 @@ // Set auto update check value = mAutoUpdateItem->contentWidgetData(QString("currentIndex")).toInt(); + + // Convert ist index index to setting value + switch ( value ) + { + case KAutoUpdateOn: + value = EIAUpdateSettingValueDisableWhenRoaming; + break; + case KAutoUpdateOff: + value = EIAUpdateSettingValueDisable; + break; + case KAutoUpdateOnInHomeNetwork: + value = EIAUpdateSettingValueEnable; + break; + default: + break; + } err = cenrep->Set( KIAUpdateAutoUpdateCheck, value ); + User::LeaveIfError( err ); TUint32 ignore = KErrNone; @@ -238,6 +260,23 @@ // set auto update value int value = 0; User::LeaveIfError( cenrep->Get( KIAUpdateAutoUpdateCheck, value ) ); + + // map cenrep value to index + switch ( value ) + { + case EIAUpdateSettingValueEnable: + value = KAutoUpdateOn; // On + break; + case EIAUpdateSettingValueDisable: + value = KAutoUpdateOff; // Off + break; + case EIAUpdateSettingValueDisableWhenRoaming: + value = KAutoUpdateOnInHomeNetwork; // On in home network + break; + default: + break; + } + mAutoUpdateItem->setContentWidgetData("currentIndex", value); diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/ui/src/iaupdateuicontroller.cpp --- a/iaupdate/IAD/ui/src/iaupdateuicontroller.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/ui/src/iaupdateuicontroller.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -1644,10 +1644,10 @@ CleanupStack::Pop( nodeId ); } - - if ( iFwNodes.Count() > 0 ) + + for ( TInt j = 0; j < iFwNodes.Count(); ++j ) { - MIAUpdateFwNode* fwNode( iFwNodes[ 0 ] ); + MIAUpdateFwNode* fwNode( iFwNodes[ j ] ); CIAUpdateNodeId* nodeId = CIAUpdateNodeId::NewLC(); nodeId->SetIdL( fwNode->Base().MetaId() ); nodeId->SetNamespaceL( fwNode->Base().MetaNamespace() ); @@ -2043,9 +2043,12 @@ // completion or timer will call the callback later. But, that callback // will be ignored in CIAUpdateUiController::ServerReportSent because // iState is already then changed from ESendingReport to something else. - const TInt KServerReportMaxWaitTime( 10000000 ); - iController->FinishedUpdatesL( ETrue, KServerReportMaxWaitTime ); - iState = ESendingReport; + + //const TInt KServerReportMaxWaitTime( 10000000 ); //Commented TEMP + //iController->FinishedUpdatesL( ETrue, KServerReportMaxWaitTime ); //Commented TEMP + //iState = ESendingReport; //Commented temporarily + EndUpdateFlowL( KErrNone ); //TEMP + return; //TEMP } // When reports are sent, EndUpdateFlowL is called via the callback functions diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/updater/group/iaupdater.mmp --- a/iaupdate/IAD/updater/group/iaupdater.mmp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/updater/group/iaupdater.mmp Tue Jul 06 14:23:31 2010 +0300 @@ -34,6 +34,10 @@ MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/mw/hb +SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore +SYSTEMINCLUDE /epoc32/include/mw/hb/hbwidgets + USERINCLUDE ../inc USERINCLUDE ../updaterfiles/inc USERINCLUDE ../../loc @@ -55,12 +59,15 @@ LIBRARY apmime.lib LIBRARY apparc.lib LIBRARY sisregistryclient.lib -LIBRARY swinstcli.lib LIBRARY estor.lib LIBRARY commonengine.lib LIBRARY ws32.lib LIBRARY ecom.lib +LIBRARY sif.lib +LIBRARY hbcore.lib +LIBRARY hbwidgets.lib + // Updater files dll LIBRARY iaupdaterfiles.lib diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/updater/inc/iaupdaterdialog.h --- a/iaupdate/IAD/updater/inc/iaupdaterdialog.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/updater/inc/iaupdaterdialog.h Tue Jul 06 14:23:31 2010 +0300 @@ -25,30 +25,26 @@ #include #include +#include + // FORWARD DECLARATIONS class MIAUpdaterCancelObserver; - /** * Class for showing the global note dialog when installing self update. -* -* @code -* @endcode -* @lib -* @since S60 */ -class CIAUpdaterDialog : public CActive +class CIAUpdaterDialog : public CBase, + public MHbDeviceProgressDialogObserver { public: /** * Two-phased constructor. */ - static CIAUpdaterDialog* NewL( RFs& aFs, MIAUpdaterCancelObserver& aObserver ); - + static CIAUpdaterDialog* NewL( MIAUpdaterCancelObserver& aObserver ); /** * Two-phased constructor. */ - static CIAUpdaterDialog* NewLC( RFs& aFs, MIAUpdaterCancelObserver& aObserver ); + static CIAUpdaterDialog* NewLC( MIAUpdaterCancelObserver& aObserver ); /** @@ -73,60 +69,59 @@ */ void CancelWaitingNoteL(); + /** + * From base class MHbDeviceProgressDialogObserver + */ + void ProgressDialogCancelled( + const CHbDeviceProgressDialogSymbian* aProgressDialog); + + /** + * From base class MHbDeviceProgressDialogObserver + */ + void ProgressDialogClosed( + const CHbDeviceProgressDialogSymbian* aProgressDialog); + + private: /** * Constructor. */ - CIAUpdaterDialog( RFs& aFs, MIAUpdaterCancelObserver& aObserver ); + CIAUpdaterDialog( MIAUpdaterCancelObserver& aObserver ); /** * 2nd phase constructor. */ void ConstructL(); - - /** - * Read resource string. - * @since - * @param aResourceId Id of the resource. - * @return Resource buffer. - */ - HBufC* ReadResourceLC( TInt aResourceId ); - -private: // from CActive - + /** - * Cancels async request - * @see CActive::DoCancel - * + * Destroy wait note. */ - void DoCancel(); - - /** - * When the server side has finished operation, the CActive object will - * be informed about it, and as a result RunL will be called. This function - * well inform the observer that the operation has been completed. - * @see CActive::RunL - * - */ - void RunL(); + void CIAUpdaterDialog::DestroyGlobalWaitNote(); + private: // data - // Resource file. - //RResourceFile iResourceFile; - - // File server handle. - RFs& iFs; - - //CAknGlobalNote* iNote; + /** + * Not owned, install observer. + */ + MIAUpdaterCancelObserver* iObserver; + /** + * Own, Global wait note. + */ + CHbDeviceProgressDialogSymbian* iGlobalWaitNote; - // Dialog id for canceling dialog. - TInt iNoteId; - - MIAUpdaterCancelObserver* iObserver; //not owned + /** + * Own, resouce of global note. + */ + HBufC* iGlobalResource; + + /** + * Check Load Success .ts file successfully or not + */ + TBool iIsResolverSuccess; }; diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/updater/inc/iaupdatersilentlauncher.h --- a/iaupdate/IAD/updater/inc/iaupdatersilentlauncher.h Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/updater/inc/iaupdatersilentlauncher.h Tue Jul 06 14:23:31 2010 +0300 @@ -24,14 +24,12 @@ #include #include +#include + /** * Class that handles the launching of silent installation. * - * @code - * @endcode - * @lib - * @since S60 */ class CIAUpdaterSilentLauncher : public CBase { @@ -81,13 +79,13 @@ * @return SwiUI::TInstallOptions Options that are used for * silent installation. */ - SwiUI::TInstallOptions SilentInstallOptionsL() const; + void UsifSilentInstallOptionsL( Usif::COpaqueNamedParams * aOptions ); private: // Data - - SwiUI::RSWInstSilentLauncher iLauncher; - SwiUI::TInstallOptionsPckg iOptionsPckg; + Usif::RSoftwareInstall iLauncher; + Usif::COpaqueNamedParams* iOptionsPckg; + Usif::COpaqueNamedParams* iResults; RFs& iFs; diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/updater/src/iaupdaterdialog.cpp --- a/iaupdate/IAD/updater/src/iaupdaterdialog.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/updater/src/iaupdaterdialog.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -22,6 +22,12 @@ #include "iaupdatercancelobserver.h" #include "iaupdatedebug.h" +#include + + +_LIT(KFilename, "iaupdate.ts"); +_LIT(KPath, "z://data"); +_LIT(KInstalling, "txt_software_info_installing_1"); // ======== LOCAL FUNCTIONS ======== @@ -33,26 +39,23 @@ // C++ default constructor // ----------------------------------------------------------------------------- // -CIAUpdaterDialog::CIAUpdaterDialog( RFs& aFs, - MIAUpdaterCancelObserver& aObserver ) -: CActive( CActive::EPriorityStandard ), - iFs( aFs ), - iObserver ( &aObserver ) +CIAUpdaterDialog::CIAUpdaterDialog( MIAUpdaterCancelObserver& aObserver ) +: iObserver ( &aObserver ) { - CActiveScheduler::Add( this ); + } + // ----------------------------------------------------------------------------- // CIAUpdaterDialog::NewL // Two-phased constructor. // ----------------------------------------------------------------------------- // -CIAUpdaterDialog* CIAUpdaterDialog::NewL( RFs& aFs, - MIAUpdaterCancelObserver& aObserver ) +CIAUpdaterDialog* CIAUpdaterDialog::NewL( MIAUpdaterCancelObserver& aObserver ) { CIAUpdaterDialog* self = - CIAUpdaterDialog::NewLC( aFs, aObserver ); + CIAUpdaterDialog::NewLC( aObserver ); CleanupStack::Pop( self ); return self; } @@ -63,11 +66,10 @@ // Two-phased constructor. // ----------------------------------------------------------------------------- // -CIAUpdaterDialog* CIAUpdaterDialog::NewLC( RFs& aFs, - MIAUpdaterCancelObserver& aObserver ) +CIAUpdaterDialog* CIAUpdaterDialog::NewLC( MIAUpdaterCancelObserver& aObserver ) { CIAUpdaterDialog* self = - new( ELeave ) CIAUpdaterDialog( aFs, aObserver ); + new( ELeave ) CIAUpdaterDialog( aObserver ); CleanupStack::PushL( self ); self->ConstructL(); return self; @@ -84,18 +86,8 @@ IAUPDATE_TRACE("[IAUpdater] CIAUpdaterDialog::ConstructL begin"); // Get resource file path - /*TFileName fileName; - fileName.Copy( TParsePtrC( RProcess().FileName() ).Drive() ); - fileName.Append( KDC_APP_RESOURCE_DIR ); - fileName.Append( IAUpdaterDefs::KIAUpdaterResourceFile ); + iIsResolverSuccess = HbTextResolverSymbian::Init(KFilename, KPath); - // Get language of resource file - BaflUtils::NearestLanguageFile( iFs, fileName ); - - // Open resource file - iResourceFile.OpenL( iFs, fileName ); - iResourceFile.ConfirmSignatureL(); */ - IAUPDATE_TRACE("[IAUpdater] CIAUpdaterDialog::ConstructL end"); } @@ -107,9 +99,7 @@ // CIAUpdaterDialog::~CIAUpdaterDialog() { - Cancel(); - //delete iNote; - //iResourceFile.Close(); + DestroyGlobalWaitNote(); } @@ -118,54 +108,30 @@ // Show global waiting note during installing. // ----------------------------------------------------------------------------- // -void CIAUpdaterDialog::ShowWaitingNoteL( const TDesC& /*aName*/, TInt /*aIndex*/, TInt /*aTotalCount*/ ) +void CIAUpdaterDialog::ShowWaitingNoteL( const TDesC& aName, TInt /*aIndex*/, TInt /*aTotalCount*/ ) { IAUPDATE_TRACE("[IAUpdater] CIAUpdaterDialog::ShowWaitingNoteL begin"); - if ( iNoteId == 0 ) - { - IAUPDATE_TRACE("[IAUpdater] Creating global waiting note."); - // Get localiced string from resc. file. - //HBufC* string = ReadResourceLC( R_IAUPDATER_INSTALLING ); - - //HBufC* temp1 = HBufC::NewLC( string->Length() + aName.Length() ); - //TPtr temp1Ptr = temp1->Des(); - - // Add pkg's name to string (U0). - //StringLoader::Format( temp1Ptr, *string, 0, aName ); - - // Increase buffer length for the number. - //HBufC* temp2 = - // HBufC::NewLC( temp1->Length() + IAUpdaterDefs::KIAUpdaterParamLen ); - //TPtr temp2Ptr = temp2->Des(); - - // Add index number to string (N1) - //StringLoader::Format( temp2Ptr, *temp1, 1, aIndex ); - - // Increase buffer length for the number. - //HBufC* finalString = - // HBufC::NewLC( temp2->Length() + IAUpdaterDefs::KIAUpdaterParamLen ); - //TPtr finalPtr = finalString->Des(); - - // Add max count number to string (N2) - //StringLoader::Format( finalPtr, *temp2, 2, aTotalCount ); - - //AknTextUtils::DisplayTextLanguageSpecificNumberConversion( finalPtr ); - //if ( !iNote ) - // { - // iNote = CAknGlobalNote::NewL(); - // iNote->SetSoftkeys( R_AVKON_SOFTKEYS_CANCEL ); - // } - - // IAUPDATE_TRACE("[IAUpdater] Showing global waiting note."); - //iNoteId = iNote->ShowNoteL( iStatus, EAknGlobalWaitNote, *finalString ); - SetActive(); - - //CleanupStack::PopAndDestroy( finalString ); - //CleanupStack::PopAndDestroy( temp2 ); - //CleanupStack::PopAndDestroy( temp1 ); - //CleanupStack::PopAndDestroy( string ); - } + DestroyGlobalWaitNote(); + + iGlobalWaitNote = CHbDeviceProgressDialogSymbian::NewL( + CHbDeviceProgressDialogSymbian::EWaitDialog ); + + // loc: Load string + iGlobalResource = HbTextResolverSymbian::LoadL( KInstalling, aName ); + if ( iGlobalResource ) + iGlobalWaitNote->SetTextL( iGlobalResource->Des() ); + + // Icon ? + //iGlobalWaitNote->SetIconNameL(const TDesC& aIconName); + + // Button ? + iGlobalWaitNote->SetButton(ETrue); + + iGlobalWaitNote->SetObserver( this ); + iGlobalWaitNote->SetAutoClose(EFalse); + iGlobalWaitNote->ShowL(); + IAUPDATE_TRACE("[IAUpdater] CIAUpdaterDialog::ShowWaitingNoteL end"); } @@ -178,50 +144,39 @@ void CIAUpdaterDialog::CancelWaitingNoteL() { IAUPDATE_TRACE("[IAUpdater] CIAUpdaterDialog::CancelWaitingNoteL begin"); - - /*if ( iNoteId != 0 ) - { - IAUPDATE_TRACE("[IAUpdater] Cancel waiting note."); - iNote->CancelNoteL( iNoteId ); - iNoteId = 0; - }*/ - + + DestroyGlobalWaitNote(); + IAUPDATE_TRACE("[IAUpdater] CIAUpdaterDialog::CancelWaitingNoteL end"); } - - +void CIAUpdaterDialog::ProgressDialogCancelled( + const CHbDeviceProgressDialogSymbian* /*aProgressDialog*/ ) + { + iObserver->UserCancel(); -// --------------------------------------------------------------------------- -// CIAUpdaterDialog:::DoCancel -// -// --------------------------------------------------------------------------- -// -void CIAUpdaterDialog::DoCancel() + } + +void CIAUpdaterDialog::ProgressDialogClosed( + const CHbDeviceProgressDialogSymbian* /*aProgressDialog*/ ) { - TRAP_IGNORE( CancelWaitingNoteL() ); + } -// --------------------------------------------------------------------------- -// CIAUpdateNetworkRegistration::RunL() -// -// --------------------------------------------------------------------------- -// -void CIAUpdaterDialog::RunL() +// ----------------------------------------------------------------------------- +// CIAUpdaterDialog::DestroyGlobalWaitNote +// ----------------------------------------------------------------------------- +void CIAUpdaterDialog::DestroyGlobalWaitNote() { - IAUPDATE_TRACE_1("[IAUpdater] CIAUpdaterDialog::RunL() iStatus : %d", iStatus.Int() ); - iNoteId = 0; - /*if ( iStatus.Int() == EAknSoftkeyCancel ) + if ( iGlobalWaitNote ) { - iObserver->UserCancel(); + iGlobalWaitNote->Close(); + delete iGlobalWaitNote; + iGlobalWaitNote = NULL; + delete iGlobalResource; + iGlobalResource = NULL; } - else - { - iObserver->UserExit(); - }*/ } - -// ======== GLOBAL FUNCTIONS ======== - + // EOF diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/updater/src/iaupdatermngr.cpp --- a/iaupdate/IAD/updater/src/iaupdatermngr.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/updater/src/iaupdatermngr.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -166,7 +166,8 @@ TBool showing( EFalse ); User::LeaveIfError( iFs.Connect() ); User::LeaveIfError( iWsSession.Connect( iFs ) ); - CIAUpdaterDialog* dialogs( CIAUpdaterDialog::NewLC( iFs, *this ) ); + //CIAUpdaterDialog* dialogs( CIAUpdaterDialog::NewLC( iFs, *this ) ); + CIAUpdaterDialog* dialogs( CIAUpdaterDialog::NewLC( *this ) ); if ( count > 0 ) { TInt nameIndex( 0 ); diff -r 92f864ef0288 -r ae54820ef82c iaupdate/IAD/updater/src/iaupdatersilentlauncher.cpp --- a/iaupdate/IAD/updater/src/iaupdatersilentlauncher.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/iaupdate/IAD/updater/src/iaupdatersilentlauncher.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -43,7 +43,12 @@ // void CIAUpdaterSilentLauncher::ConstructL() { - iOptionsPckg = SilentInstallOptionsL(); + + iOptionsPckg = Usif::COpaqueNamedParams::NewL(); + iResults = Usif::COpaqueNamedParams::NewL(); + + UsifSilentInstallOptionsL( iOptionsPckg ); + } // ----------------------------------------------------------------------------- @@ -68,6 +73,10 @@ CIAUpdaterSilentLauncher::~CIAUpdaterSilentLauncher() { iLauncher.Close(); + + delete iOptionsPckg; + delete iResults; + } // ----------------------------------------------------------------------------- @@ -88,7 +97,7 @@ // Launch the installation IAUPDATE_TRACE("[IAUpdater] Launch silent install"); - iLauncher.SilentInstall( aStatus, aFile, iOptionsPckg ); + iLauncher.Install( aFile, *iOptionsPckg, *iResults, aStatus ); IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::InstallL() end"); } @@ -102,71 +111,64 @@ { IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::Cancel() begin"); - iLauncher.CancelAsyncRequest( SwiUI::ERequestSilentInstall ); + iLauncher.CancelOperation(); IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::Cancel() end"); } - // --------------------------------------------------------------------------- -// CIAUpdaterSilentLauncher::SilentInstallOptionsL +// IAUpdateUtils::UsifSilentInstallOptionsL // // --------------------------------------------------------------------------- -// -SwiUI::TInstallOptions CIAUpdaterSilentLauncher::SilentInstallOptionsL() const + +void CIAUpdaterSilentLauncher::UsifSilentInstallOptionsL( + Usif::COpaqueNamedParams * aOptions ) { - IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::SilentInstallOptionsL() begin"); - - SwiUI::TInstallOptions options; + + aOptions->AddIntL( Usif::KSifInParam_InstallSilently, ETrue ); - // Upgrades are allowed - options.iUpgrade = SwiUI::EPolicyAllowed; - + // Upgrades are allowed + aOptions->AddIntL( Usif::KSifInParam_AllowUpgrade, Usif::EAllowed ); + // Install all if optional packets exist. - options.iOptionalItems = SwiUI::EPolicyAllowed; - + aOptions->AddIntL( Usif::KSifInParam_InstallOptionalItems, Usif::EAllowed ); + // Prevent online cert revocation check. - options.iOCSP = SwiUI::EPolicyNotAllowed; + aOptions->AddIntL( Usif::KSifInParam_PerformOCSP, Usif::ENotAllowed ); // See iOCSP setting above - options.iIgnoreOCSPWarnings = SwiUI::EPolicyAllowed; - + aOptions->AddIntL( Usif::KSifInParam_IgnoreOCSPWarnings, Usif::EAllowed ); + // Do not allow installation of uncertified packages. - options.iUntrusted = SwiUI::EPolicyNotAllowed; - - // If filetexts are included in SIS package. Then, show them. - options.iPackageInfo = SwiUI::EPolicyUserConfirm; + aOptions->AddIntL( Usif::KSifInParam_AllowUntrusted, Usif::ENotAllowed ); + + // If filetexts are included in SIS package, show them. + aOptions->AddIntL( Usif::KSifInParam_PackageInfo, Usif::EAllowed ); // Automatically grant user capabilities. - // See also iUntrusted above. - options.iCapabilities = SwiUI::EPolicyAllowed; - + // See also KSifInParam_AllowUntrusted above. + aOptions->AddIntL( Usif::KSifInParam_GrantCapabilities, Usif::EAllowed ); + // Open application will be closed. - options.iKillApp = SwiUI::EPolicyAllowed; + aOptions->AddIntL( Usif::KSifInParam_AllowAppShutdown, Usif::EAllowed ); // Files can be overwritten. - options.iOverwrite = SwiUI::EPolicyAllowed; + aOptions->AddIntL( Usif::KSifInParam_AllowOverwrite, Usif::EAllowed ); + + // Incompatible allowed + aOptions->AddIntL( Usif::KSifInParam_AllowIncompatible, Usif::EAllowed ); // This only affects Java applications. - options.iDownload = SwiUI::EPolicyAllowed; - - // Notice! Here we use always the same drive for the IAD. - // So, this will not change automatically according to the disk spaces - // and when new memory cards are inserted into the phone. - options.iDrive = IAUpdaterDefs::KIAUpdaterDrive; + aOptions->AddIntL( Usif::KSifInParam_AllowDownload, Usif::EAllowed ); + + // Where to save. + //aOptions->AddIntL( Usif::KSifInParam_Drive, EDriveC ); // Choose the phone language. - options.iLang = User::Language(); - - // If language is asked, then use the current phone language. - options.iUsePhoneLang = ETrue; + TLanguage lang = User::Language(); + //aOptions->AddIntL( Usif::KSifInParam_Languages, lang ); // User::Language() ); - // Does not affect SISX. This is for Java. - options.iUpgradeData = SwiUI::EPolicyAllowed; - - IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::SilentInstallOptionsL() end"); - - return options; + //aOptions->AddIntL( Usif::KSifInParam_Drive, IAUpdateUtils::DriveToInstallL( aUid, aSize ) ); } diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/bwins/sisregistryclient_v2U.def --- a/installationservices/swi/bwins/sisregistryclient_v2U.def Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/bwins/sisregistryclient_v2U.def Tue Jul 06 14:23:31 2010 +0300 @@ -197,4 +197,5 @@ ?GetAppUidsForComponentL@RSisRegistrySession@Swi@@QAEXAAHAAV?$RArray@VTUid@@@@@Z @ 196 NONAME ; void Swi::RSisRegistrySession::GetAppUidsForComponentL(int &, class RArray &) ?GetComponentIdForPackageL@RSisRegistrySession@Swi@@QBEHABVTDesC16@@0@Z @ 197 NONAME ; int Swi::RSisRegistrySession::GetComponentIdForPackageL(class TDesC16 const &, class TDesC16 const &) const ?AddEntryL@RSisRegistryWritableSession@Swi@@QAEXABVCApplicationRegistrationData@Usif@@ABVCSisRegistryPackage@2@@Z @ 198 NONAME ; void Swi::RSisRegistryWritableSession::AddEntryL(class Usif::CApplicationRegistrationData const &, class Swi::CSisRegistryPackage const &) + ?SetComponentPresenceL@RSisRegistryWritableSession@Swi@@QAEXHH@Z @ 199 NONAME ; void Swi::RSisRegistryWritableSession::SetComponentPresenceL(int, int) diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/bwins/sisregistryclient_v2_legacyU.def --- a/installationservices/swi/bwins/sisregistryclient_v2_legacyU.def Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/bwins/sisregistryclient_v2_legacyU.def Tue Jul 06 14:23:31 2010 +0300 @@ -192,4 +192,10 @@ ?GetEquivalentLanguagesL@RSisRegistryHelper@Swi@@QAEXW4TLanguage@@AAV?$RArray@W4TLanguage@@@@@Z @ 191 NONAME ; void Swi::RSisRegistryHelper::GetEquivalentLanguagesL(enum TLanguage, class RArray &) ?GetMatchingSupportedLanguagesL@RSisRegistryWritableEntry@Swi@@QAEXAAV?$RArray@W4TLanguage@@@@@Z @ 192 NONAME ; void Swi::RSisRegistryWritableEntry::GetMatchingSupportedLanguagesL(class RArray &) ?RegistryFilesL@RSisRegistryEntry@Swi@@QAEXAAV?$RPointerArray@VHBufC16@@@@@Z @ 193 NONAME ; void Swi::RSisRegistryEntry::RegistryFilesL(class RPointerArray &) + ?GetComponentIdsForUidL@RSisRegistrySession@Swi@@QAEXAAVTUid@@AAV?$RArray@H@@@Z @ 194 NONAME ABSENT ; void Swi::RSisRegistrySession::GetComponentIdsForUidL(class TUid &, class RArray &) + ?UpdateEntryL@RSisRegistryWritableSession@Swi@@QAEXABVCApplication@2@ABVCApplicationRegistrationData@Usif@@ABVCSisRegistryPackage@2@@Z @ 195 NONAME ABSENT ; void Swi::RSisRegistryWritableSession::UpdateEntryL(class Swi::CApplication const &, class Usif::CApplicationRegistrationData const &, class Swi::CSisRegistryPackage const &) + ?GetAppUidsForComponentL@RSisRegistrySession@Swi@@QAEXAAHAAV?$RArray@VTUid@@@@@Z @ 196 NONAME ABSENT ; void Swi::RSisRegistrySession::GetAppUidsForComponentL(int &, class RArray &) + ?GetComponentIdForPackageL@RSisRegistrySession@Swi@@QBEHABVTDesC16@@0@Z @ 197 NONAME ABSENT ; int Swi::RSisRegistrySession::GetComponentIdForPackageL(class TDesC16 const &, class TDesC16 const &) const + ?AddEntryL@RSisRegistryWritableSession@Swi@@QAEXABVCApplicationRegistrationData@Usif@@ABVCSisRegistryPackage@2@@Z @ 198 NONAME ABSENT ; void Swi::RSisRegistryWritableSession::AddEntryL(class Usif::CApplicationRegistrationData const &, class Swi::CSisRegistryPackage const &) + ?SetComponentPresenceL@RSisRegistryWritableSession@Swi@@QAEXHH@Z @ 199 NONAME ABSENT ; void Swi::RSisRegistryWritableSession::SetComponentPresenceL(int, int) diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/eabi/sisregistryclient_v2U.def --- a/installationservices/swi/eabi/sisregistryclient_v2U.def Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/eabi/sisregistryclient_v2U.def Tue Jul 06 14:23:31 2010 +0300 @@ -220,4 +220,5 @@ _ZN3Swi27RSisRegistryWritableSession12UpdateEntryLERKNS_12CApplicationERKN4Usif28CApplicationRegistrationDataERKNS_19CSisRegistryPackageE @ 219 NONAME _ZN3Swi27RSisRegistryWritableSession9AddEntryLERKN4Usif28CApplicationRegistrationDataERKNS_19CSisRegistryPackageE @ 220 NONAME _ZNK3Swi19RSisRegistrySession25GetComponentIdForPackageLERK7TDesC16S3_ @ 221 NONAME + _ZN3Swi27RSisRegistryWritableSession21SetComponentPresenceLEii @ 222 NONAME diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/eabi/sisregistryclient_v2_legacyU.def --- a/installationservices/swi/eabi/sisregistryclient_v2_legacyU.def Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/eabi/sisregistryclient_v2_legacyU.def Tue Jul 06 14:23:31 2010 +0300 @@ -215,4 +215,10 @@ _ZN3Swi18RSisRegistryHelperC2Ev @ 214 NONAME _ZN3Swi25RSisRegistryWritableEntry30GetMatchingSupportedLanguagesLER6RArrayI9TLanguageE @ 215 NONAME _ZN3Swi17RSisRegistryEntry14RegistryFilesLER13RPointerArrayI7HBufC16E @ 216 NONAME + _ZN3Swi19RSisRegistrySession22GetComponentIdsForUidLER4TUidR6RArrayIiE @ 217 NONAME ABSENT + _ZN3Swi19RSisRegistrySession23GetAppUidsForComponentLERiR6RArrayI4TUidE @ 218 NONAME ABSENT + _ZN3Swi27RSisRegistryWritableSession12UpdateEntryLERKNS_12CApplicationERKN4Usif28CApplicationRegistrationDataERKNS_19CSisRegistryPackageE @ 219 NONAME ABSENT + _ZN3Swi27RSisRegistryWritableSession9AddEntryLERKN4Usif28CApplicationRegistrationDataERKNS_19CSisRegistryPackageE @ 220 NONAME ABSENT + _ZNK3Swi19RSisRegistrySession25GetComponentIdForPackageLERK7TDesC16S3_ @ 221 NONAME ABSENT + _ZN3Swi27RSisRegistryWritableSession21SetComponentPresenceLEii @ 222 NONAME ABSENT diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/inc/sisregistrywritablesession.h --- a/installationservices/swi/inc/sisregistrywritablesession.h Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/inc/sisregistrywritablesession.h Tue Jul 06 14:23:31 2010 +0300 @@ -180,6 +180,18 @@ * */ IMPORT_C void DeactivateComponentL(TComponentId aComponentId); + + /** + * Sets the component presence property for a given component id (If a package contains files + * installed to a removable media, the package is considered as not fully present if the same + * media is not present. This property will be used to filter out applications, that are not + * fully present, from being diaplayed in the AppLib Menu.). + * + * @param aComponentId Identifies a installed component + * @param aState True, if the component is fully present, else False. + * + */ + IMPORT_C void SetComponentPresenceL(TComponentId aComponentId, TBool aState); /** * Adds a registry entry representing a package containing a Layered Execution Environment diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/source/backuprestore/backupsession.cpp --- a/installationservices/swi/source/backuprestore/backupsession.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/source/backuprestore/backupsession.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -216,7 +216,7 @@ // Appending ELangNone at the end as marker for the end of the language IDs // as we also append the language ID's from other Augmentations - matchingSupportedLanguagesArray.Append(ELangNone); + matchingSupportedLanguagesArray.AppendL(ELangNone); CleanupStack::PopAndDestroy(2, &augmentation); } diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/source/sisregistry/client/sisregistrywritablesession.cpp --- a/installationservices/swi/source/sisregistry/client/sisregistrywritablesession.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/source/sisregistry/client/sisregistrywritablesession.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -395,4 +395,11 @@ TInt returnCode = SendReceive(ESetComponentState, TIpcArgs(&packageComponentId, &packageState)); User::LeaveIfError(returnCode); } + +EXPORT_C void RSisRegistryWritableSession::SetComponentPresenceL(TComponentId aComponentId, TBool aState) + { + TPckgC componentId(aComponentId); + TPckgC componentPresence(aState); + User::LeaveIfError(SendReceive(ESetComponentPresence, TIpcArgs(&componentId, &componentPresence))); + } #endif diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/source/sisregistry/common/sisregistryclientserver.h --- a/installationservices/swi/source/sisregistry/common/sisregistryclientserver.h Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/source/sisregistry/common/sisregistryclientserver.h Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -74,6 +74,8 @@ EAddDrive, #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK ERemoveDrive, +#else + ESetComponentPresence, #endif // all clients diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/source/sisregistry/server/scrhelperutil.cpp --- a/installationservices/swi/source/sisregistry/server/scrhelperutil.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/source/sisregistry/server/scrhelperutil.cpp Tue Jul 06 14:23:31 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 the License "Eclipse Public License v1.0" @@ -423,7 +423,7 @@ TPtrC fileTargetPtr(fileTarget); if (filenamesArray.SpecificFindInOrder(fileTargetPtr, descriptorsComparator, EArrayFindMode_First) != KErrNotFound) continue; // Skip duplicates - filenamesArray.InsertInOrder(fileTargetPtr, descriptorsComparator); + filenamesArray.InsertInOrderL(fileTargetPtr, descriptorsComparator); if (IsWildcardFile(fileTarget)) { diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/source/sisregistry/server/sisregistryserversession.cpp --- a/installationservices/swi/source/sisregistry/server/sisregistryserversession.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/source/sisregistry/server/sisregistryserversession.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -483,7 +483,10 @@ break; case ESetComponentState: SetComponentStateL(aMessage); - break; + break; + case ESetComponentPresence: + SetComponentPresenceL(aMessage); + break; case EIsFileRegistered: IsFileRegisteredL(aMessage); break; @@ -1061,6 +1064,41 @@ CleanupStack::PopAndDestroy(); } +TInt CSisRegistrySession::GetStubFilesL(const TDesC& aFileName, RPointerArray& aFileNames) + { + // Read the ROM stub controller + CFileSisDataProvider* fileProvider = CFileSisDataProvider::NewLC(iFs, aFileName); + Swi::Sis::CController* stubController = NULL; + TRAPD(errCode, stubController = Swi::Sis::CController::NewL(*fileProvider)); + if (errCode != KErrNone) + { + // Ignore the broken stub file under the ROM stub directory. + DEBUG_PRINTF2(_L8("Sis Registry Server - Failed to read the stub controller. Error code %d."), errCode); + CleanupStack::PopAndDestroy(fileProvider); + return errCode; + } + CleanupStack::PushL(stubController); + const RPointerArray& depArray = stubController->InstallBlock().FileDescriptions(); + // Get as many number of files as possible that can be accomodate in client allocated buffer. + TInt totalDepArrayCount = depArray.Count(); + // Populate the files in to a temporary array. + for(TInt fileCount = 0; fileCount < totalDepArrayCount; ++fileCount ) + { + // Only create a TPtrC when we know we have space available + HBufC* fileName = depArray[fileCount]->Target().Data().AllocL(); + // Adding drive letter of rom if not mentioned in stub sis file + TPtr a=fileName->Des(); + if (a[0] == '!') + a[0] = 'z'; + + CleanupStack::PushL(fileName); + aFileNames.AppendL(fileName); + CleanupStack::Pop(fileName); + } + CleanupStack::PopAndDestroy(2, fileProvider); + return KErrNone; + } + TInt CSisRegistrySession::GetStubFileInfoL(TUid aUid, TStubExtractionMode aMode, TInt aStartingFileNo, TInt& aFileCount, RPointerArray& aFileNames) { TBool stubNotFound(ETrue); @@ -1488,6 +1526,16 @@ aMessage.Complete(KErrNone); } +void CSisRegistrySession::SetComponentPresenceL(const RMessage2& aMessage) + { + TPckgBuf componentId; + TPckgBuf componentPresence; + aMessage.ReadL(EIpcArgument0, componentId, 0); + aMessage.ReadL(EIpcArgument1, componentPresence, 0); + iScrSession.SetIsComponentPresentL(componentId(), componentPresence()); + aMessage.Complete(KErrNone); + } + // Helper methods TBool CSisRegistrySession::IsRegisteredL(const TUid& aUid) @@ -1547,6 +1595,13 @@ return ScrHelperUtil::IsUidAndNamePresentL(iScrSession, aUid, aPackageName); } + +void CSisRegistrySession::RemoveEntryL(const TComponentId aCompId) + { + iScrSession.DeleteApplicationEntriesL(aCompId); + iScrSession.DeleteComponentL(aCompId); + } + void CSisRegistrySession::RemoveEntryL(const CSisRegistryPackage& aPackage) { DEBUG_PRINTF4(_L("Sis Registry Server - Removing the entry from Software Component Registry of package : UID: 0x%08x, Name: %S, Vendor: %S ."), @@ -1561,8 +1616,8 @@ aPackage.Uid().iUid, &aPackage.Name(), &aPackage.Vendor()); User::Leave(KErrNotFound); } - iScrSession.DeleteApplicationEntriesL(compId); - iScrSession.DeleteComponentL(compId); + + RemoveEntryL(compId); } void CSisRegistrySession::RemoveCleanupInfrastructureL(const CSisRegistryObject& aObject, RStsSession& aStsSession) @@ -1744,14 +1799,11 @@ return compId; } -void CSisRegistrySession::AddAppsFromStubL(TComponentId aCompId, TUid aUid) +void CSisRegistrySession::AddAppsFromStubL(TComponentId aCompId, const TDesC& aFileName) { - TInt startingFileNo = 0; - TInt fileCount = 0; RPointerArray romFiles; CleanupResetAndDestroy >::PushL(romFiles); - TInt ret = GetStubFileInfoL(aUid, EGetFiles, startingFileNo, fileCount, romFiles); - + TInt ret = GetStubFilesL(aFileName, romFiles); RPointerArray apparcRegFiles; CleanupResetAndDestroy >::PushL(apparcRegFiles); @@ -2552,16 +2604,9 @@ // If the component being removed has registered software types, unregister them now. // This operation deletes MIME types mapping from AppArc and therefore is not transactional. UnregisterSoftwareTypesL(compId); - - CSisRegistryObject* object = CSisRegistryObject::NewLC(); - ScrHelperUtil::GetComponentL(iScrSession, compId, *object); + + RemoveEntryL(compId); - DEBUG_PRINTF4(_L("Sis Registry Server - Removing package registry entry for UID: %08x, Name: %S, Vendor %S."), - object->Uid().iUid, &(object->Name()), &(object->Vendor())); - - RemoveEntryL(*object); - - CleanupStack::PopAndDestroy(); overwriteRegEntry = ETrue; } } @@ -2571,7 +2616,7 @@ { // update cache or just call refresh TComponentId compId = AddEntryL(*object, Usif::EScrCompHidden); // EScrCompHidden is supplied not to create any log for the ROM controller on the SCR side. - AddAppsFromStubL(compId, object->Uid()); + AddAppsFromStubL(compId, aFileName); // store a copy of the controller HBufC* name = SisRegistryUtil::BuildControllerFileNameLC(object->Uid(), object->Index(), diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/source/sisregistry/server/sisregistryserversession.h --- a/installationservices/swi/source/sisregistry/server/sisregistryserversession.h Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/source/sisregistry/server/sisregistryserversession.h Tue Jul 06 14:23:31 2010 +0300 @@ -161,12 +161,14 @@ //sets a particular component's state to the requested value void SetComponentStateL(const RMessage2& aMessage); + void SetComponentPresenceL(const RMessage2& aMessage); // Helper methods TBool IsRegisteredL(const TUid& aUid); TBool IsRegisteredL(const CHashContainer& aHashContainer); TBool IsRegisteredL(const TUid& aUid, const TDesC& aPackageName); + void RemoveEntryL(const Usif::TComponentId aCompId); void RemoveEntryL(const CSisRegistryPackage& aPackage); void RemoveCleanupInfrastructureL(const CSisRegistryObject& aObject, Usif::RStsSession& aStsSession); TBool RemoveControllerL(const CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, TInt aDrive); @@ -174,7 +176,7 @@ TUint FixedDrivesL() const; Usif::TComponentId AddRegistryEntryL(CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, const TDesC8& aController, Usif::TScrComponentOperationType aOpType); Usif::TComponentId AddEntryL(CSisRegistryObject& aObject, Usif::TScrComponentOperationType aOpType); - void AddAppsFromStubL(Usif::TComponentId aCompId, TUid aUid); + void AddAppsFromStubL(Usif::TComponentId aCompId, const TDesC& aFileName); void AddControllerL(const CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, const TDesC8& aBuffer, const TInt aDrive); void AddCleanupInfrastructureL(CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, const TDesC8& aControllerBuffer); TUint CreateSubsessionHandleL(const TUid& aPackageUid); @@ -202,6 +204,7 @@ TBool IsFirmwareUpdatedL(); void UpdateRecentFWVersionL(); TInt GetStubFileInfoL(TUid aUid, TStubExtractionMode aMode, TInt aStartingFileNo, TInt& aFileCount, RPointerArray& aFileNames); + TInt GetStubFilesL(const TDesC& aFileName, RPointerArray& aFileNames); private: friend class CSisRevocationManager; diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/source/swis/server/siscontentprovider.cpp --- a/installationservices/swi/source/swis/server/siscontentprovider.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/source/swis/server/siscontentprovider.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -202,7 +202,7 @@ for (TInt option = 0; option < options.Count(); option++) { const RPointerArray& names = options[option].Names(); - ret.Append(&names[aLanguageIndex]->Data()); + ret.AppendL(&names[aLanguageIndex]->Data()); } CleanupStack::Pop(&ret); diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/test/swicaptests/registrycaptest.cpp --- a/installationservices/swi/test/swicaptests/registrycaptest.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/test/swicaptests/registrycaptest.cpp Tue Jul 06 14:23:31 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 the License "Eclipse Public License v1.0" @@ -492,6 +492,19 @@ TRAP(err, session.RecoverL()); CheckFailL(err, _L("RecoverL")); + +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + TRAP(err, session.SetComponentPresenceL(1, EFalse)); + CheckFailL(err, _L("SetComponentPresenceL")); + + // Negative tests + //TRAP(err, session.SetComponentPresenceL(1234, EFalse)); + //CheckFailL(err, _L("SetComponentPresenceL Negative 1")); + //TRAP(err, session.SetComponentPresenceL(0, EFalse)); + //CheckFailL(err, _L("SetComponentPresenceL Negative 2")); + //TRAP(err, session.SetComponentPresenceL(-1, EFalse)); + //CheckFailL(err, _L("SetComponentPresenceL Negative 3")); +#endif CleanupStack::PopAndDestroy(&session); } diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/test/swicaptests/scripts/swicaptests.ini --- a/installationservices/swi/test/swicaptests/scripts/swicaptests.ini Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/test/swicaptests/scripts/swicaptests.ini Tue Jul 06 14:23:31 2010 +0300 @@ -1,2 +1,14 @@ [swicaptests] DllName=swicaptests.dll + +[simple] +sis=z:\tswi\tsis\data\simple.sis +script=z:\tswi\tuiscriptadaptors\scripts\simple.xml +numexist=1 +exist0=C:\Documents\InstTest\file1.txt + +[u_simple] +uid=80000001 +script=z:\tswi\tuiscriptadaptors\scripts\uninstall.xml +numnonexist=1 +nonexist0=C:\Documents\InstTest\file1.txt diff -r 92f864ef0288 -r ae54820ef82c installationservices/swi/test/swicaptests/scripts/swicaptests.script --- a/installationservices/swi/test/swicaptests/scripts/swicaptests.script Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swi/test/swicaptests/scripts/swicaptests.script Tue Jul 06 14:23:31 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 the License "Eclipse Public License v1.0" @@ -18,7 +18,8 @@ PRINT Run all SWIS capability tests LOAD_SUITE aprcaptestframework - +LOAD_SUITE tuiscriptadaptors +LOAD_SUITE tscr // To delete the SCR DB //! @SYMTestCaseID API-SEC-SWI-CapTests-I-0001 //! @SYMTestCaseDesc Runs the whole suite of test cases for SWI interfaces. Both negtive and positive tests are included @@ -28,13 +29,21 @@ //! @SYMTestExpectedResults KErrPermissionDenied received on calls which should fail //! @SYMDevelopedForRelease Yankee - START_TESTCASE API-SEC-SWI-CapTests-I-0001 RUN_UTILS MkDir c:\tswi\ RUN_UTILS MkDir c:\tswi\swicaptests RUN_UTILS MkDir c:\tswi\swicaptests\data RUN_UTILS CopyFile z:\tswi\swicaptests\data\testdoc.txt c:\tswi\swicaptests\data\testdoc.txt + +// Delete the existing DB and install a test pacakage (so that ComponentId of 1 is valid) +RUN_TEST_STEP 100 tscr SCRDeleteDbFile z:\tusif\tscr\tscr.ini db_file +RUN_TEST_STEP 100 tuiscriptadaptors InstallStep z:\tswi\swicaptests\scripts\swicaptests.ini simple + RUN_TEST_STEP 100 aprcaptestframework RunThoroughCapabilityChecks z:\tswi\swicaptests\scripts\swicaptests.ini swicaptests +// Uninstall the test pacakage and delete the DB so that it does not interfere with remaining tests +RUN_TEST_STEP 100 tuiscriptadaptors UninstallStep z:\tswi\swicaptests\scripts\swicaptests.ini u_simple +RUN_TEST_STEP 100 tscr SCRDeleteDbFile z:\tusif\tscr\tscr.ini db_file + END_TESTCASE API-SEC-SWI-CapTests-I-0001 diff -r 92f864ef0288 -r ae54820ef82c installationservices/swiconfig/swi/swipolicy.ini --- a/installationservices/swiconfig/swi/swipolicy.ini Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swiconfig/swi/swipolicy.ini Tue Jul 06 14:23:31 2010 +0300 @@ -12,8 +12,12 @@ UserCapabilities = NetworkServices LocalServices ReadUserData WriteUserData Location UserEnvironment AllowPackagePropagate = true ApplicationShutdownTimeoutSeconds = 10 -RunWaitTimeoutSeconds = 180 -DeletePreinstalledFilesOnUninstall = false +RunWaitTimeoutSeconds = 600 +DeletePreinstalledFilesOnUninstall = true MaxNumOfLogEntries = 5 RemoveOnlyWithLastDependent = true AllowOverwriteOnRestore = false +SISCompatibleIfNoTargetDevices = false +AllowRunOnInstallUninstall = false +AlternativeCodeSigningOID = 1.3.6.1.4.1.94.1.49.1.2.2.1 1.3.6.1.4.1.94.1.49.1.2.2.5 +PhoneTsyName = phonetsy \ No newline at end of file diff -r 92f864ef0288 -r ae54820ef82c installationservices/swidevicetools/source/swiconsole/src/ciohandler.cpp --- a/installationservices/swidevicetools/source/swiconsole/src/ciohandler.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swidevicetools/source/swiconsole/src/ciohandler.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006-2009 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 the License "Eclipse Public License v1.0" @@ -433,11 +433,11 @@ if(aAllowDuplicates) { - aIntArr.Append(number); + aIntArr.AppendL(number); } else { - aIntArr.InsertInOrder(number); + aIntArr.InsertInOrderL(number); } string.Delete(0, pos); diff -r 92f864ef0288 -r ae54820ef82c installationservices/swidevicetools/source/swiconsole/src/cpreferencehandler.cpp --- a/installationservices/swidevicetools/source/swiconsole/src/cpreferencehandler.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swidevicetools/source/swiconsole/src/cpreferencehandler.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006-2009 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 the License "Eclipse Public License v1.0" @@ -67,7 +67,7 @@ { CPreferences* preferences = CPreferences::NewL(); // Ownership transfered to iPreferenceList - iPreferenceList.Append(preferences); + iPreferenceList.AppendL(preferences); return preferences; } diff -r 92f864ef0288 -r ae54820ef82c installationservices/swidevicetools/source/swiconsole/src/cpreferences.cpp --- a/installationservices/swidevicetools/source/swiconsole/src/cpreferences.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swidevicetools/source/swiconsole/src/cpreferences.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006-2009 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 the License "Eclipse Public License v1.0" @@ -104,14 +104,14 @@ { HBufC* ptr = aPackageName.AllocL(); // Ownership transfered to the list - iPackageNameList.Append(ptr); + iPackageNameList.AppendL(ptr); } void CPreferences::AddVendorNameL(const TDesC& aVendorName) { HBufC* ptr = aVendorName.AllocL(); // Ownership transfered to the list - iVendorNameList.Append(ptr); + iVendorNameList.AppendL(ptr); } TBool CPreferences::IsPackageNamePresent(const TDesC& aPackageName) const diff -r 92f864ef0288 -r ae54820ef82c installationservices/swinstallationfw/inc/sifnotification.h --- a/installationservices/swinstallationfw/inc/sifnotification.h Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swinstallationfw/inc/sifnotification.h Tue Jul 06 14:23:31 2010 +0300 @@ -462,7 +462,6 @@ @param aHandler A handle to the implementation of the MSifOperationsHandler class. @return A pointer to the newly allocated CSifOperationsNotifier object, if creation is successful. - The pointer is also put onto the cleanup stack. */ IMPORT_C static CSifOperationsNotifier* NewL(MSifOperationsHandler& aHandler); diff -r 92f864ef0288 -r ae54820ef82c installationservices/swinstallationfw/source/sifcommon.cpp --- a/installationservices/swinstallationfw/source/sifcommon.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/swinstallationfw/source/sifcommon.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -1005,6 +1005,7 @@ void CStringItem::ExternalizeL(RWriteStream& aStream) const { + CItemBase::ExternalizeL(aStream); aStream << *iString; } diff -r 92f864ef0288 -r ae54820ef82c installationservices/switestfw/test/autotesting/apr_bld.inf --- a/installationservices/switestfw/test/autotesting/apr_bld.inf Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/switestfw/test/autotesting/apr_bld.inf Tue Jul 06 14:23:31 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 the License "Eclipse Public License v1.0" @@ -47,12 +47,9 @@ #include "mw/appinstall/installationservices/swi/group/bld.inf" #include "mw/appinstall/installationservices/swidevicetools/group/bld.inf" -#include "mw/appinstall/secureswitools/swianalysistoolkit/group/bld.inf" - - #endif //TOOLS2 -// Only the SISTOOLS (makesis/signsis) and certapp build with TOOLS2 #include "mw/appinstall/secureswitools/swisistools/group/bld.inf" - +#include "mw/appinstall/secureswitools/swianalysistoolkit/group/bld.inf" +#include "mw/appinstall/secureswitools/makekeys/group/bld.inf" \ No newline at end of file diff -r 92f864ef0288 -r ae54820ef82c installationservices/switestfw/test/autotesting/test_spec_apr_9.5.txt --- a/installationservices/switestfw/test/autotesting/test_spec_apr_9.5.txt Wed Jun 23 18:20:02 2010 +0300 +++ b/installationservices/switestfw/test/autotesting/test_spec_apr_9.5.txt Tue Jul 06 14:23:31 2010 +0300 @@ -349,10 +349,10 @@ PERL, \dumpchainvalidity_test.txt,,\epoc32\winscw\c\tswi\tchainvalidity\testChainValidity.pl, 300, UDEB,, # DUMPINSTALLFILESTATUS test PERL, \dumpinstallstatus_test.txt,,\epoc32\winscw\c\tswi\tinstallfilestatus\testInstallStatus.pl, 300, UDEB,, +# DUMPSWICERTSTORE test +PERL, \dumpswicertstore_test.txt,,\epoc32\winscw\c\tswi\tdumpcertstore\testswiCertstore.pl, 600, UDEB,\epoc32\winscw\c\tswi\tdumpcertstore\predumpcertstoretest.bat, \epoc32\winscw\c\tswi\tdumpcertstore\postdumpcertstoretest.bat [SwiTools95Only] -# DUMPSWICERTSTORE test -PERL, \dumpswicertstore_test.txt,,\epoc32\winscw\c\tswi\tdumpcertstore\testswiCertstore.pl, 600, UDEB,\epoc32\winscw\c\tswi\tdumpcertstore\predumpcertstoretest.bat, \epoc32\winscw\c\tswi\tdumpcertstore\postdumpcertstoretest.bat # DUMPSWIREGISTRY test PERL, \dumpregistry_test.txt,,\epoc32\winscw\c\tswi\tdumpregistry\testregistry.pl, 300, UDEB,, diff -r 92f864ef0288 -r ae54820ef82c ncdengine/engine/engine.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ncdengine/engine/engine.pri Tue Jul 06 14:23:31 2010 +0300 @@ -0,0 +1,280 @@ + +# +# 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: +# + + +# Input +HEADERS +=./transport/inc/catalogshttpdownload.h \ + ./transport/inc/catalogshttpdownloadmanagerimpl.h \ + +SOURCES += ./src/catalogsbasemessageimpl.cpp \ +./src/catalogsclientserverserver.cpp \ +./src/catalogsclientserverserversession.cpp \ +./src/catalogsincompletemessage.cpp \ +./src/catalogsserverengine.cpp \ +./src/catalogsutils.cpp \ +./src/catalogskeyvaluepair.cpp \ +./src/catalogscontextimpl.cpp \ +./src/catalogsbigdes.cpp \ +./src/catalogsinterfacebase.cpp \ +./src/catalogsinterfaceidentifier.cpp \ +./src/catalogsstringmanager.cpp \ +./src/catalogsshutdownoperation.cpp \ +./transport/src/catalogstransportimpl.cpp \ +./transport/src/catalogshttpconfigimpl.cpp \ +./transport/src/catalogshttpheadersimpl.cpp \ +./transport/src/catalogshttpsessionimpl.cpp \ +./transport/src/catalogshttpdownloadmanagerimpl.cpp \ +./transport/src/catalogshttpdownload.cpp \ +./transport/src/catalogshttptransaction.cpp \ +./transport/src/catalogshttptransactionmanagerimpl.cpp \ +./transport/src/catalogshttpstack.cpp \ +./transport/src/catalogshttpsessionmanagerimpl.cpp \ +./transport/src/catalogshttpconnectioncreator.cpp \ +./transport/src/catalogshttpconnectionmanager.cpp \ +./transport/src/catalogssmssessionimpl.cpp \ +./transport/src/catalogssmsoperationimpl.cpp \ +./transport/src/catalogssmssender.cpp \ +./transport/src/catalogssmsutils.cpp \ +./transport/src/catalogsnetworkmanager.cpp \ +./transport/src/catalogsconnectioneventsink.cpp \ +./transport/src/catalogshttprequestparser.cpp \ +./transport/src/catalogshttprequestadapter.cpp \ +./transport/src/catalogshttpresponsecomposer.cpp \ +./transport/src/catalogshttputils.cpp \ +./transport/src/catalogsconnection.cpp \ +./accesspointmanager/src/catalogsaccesspointmanagerimpl.cpp \ +./accesspointmanager/src/catalogsaccesspoint.cpp \ +./accesspointmanager/src/catalogsaccesspointsettings.cpp\ +./accesspointmanager/src/catalogsaccesspointmap.cpp \ +./accesspointmanager/src/catalogsclientaccesspointdata.cpp \ +./accesspointmanager/src/catalogsremoveaccesspointshutdownoperation.cpp \ +../provider/server/src/ncdcommunicable.cpp \ +../provider/server/src/ncdproviderimpl.cpp \ +../provider/server/src/ncdnodemanager.cpp \ +../provider/server/src/ncdnodedbmanager.cpp \ +../provider/server/src/ncdoperationmanager.cpp \ +../provider/server/src/ncdnodeimpl.cpp \ +../provider/server/src/ncdnodefolder.cpp \ +../provider/server/src/ncdparentoftransparentnode.cpp \ +../provider/server/src/ncdnodetransparentfolder.cpp \ +../provider/server/src/ncdnodeitem.cpp \ +../provider/server/src/ncdrootnode.cpp \ +../provider/server/src/ncdnodemetadataimpl.cpp \ +../provider/server/src/ncdnodeitemmetadata.cpp \ +../provider/server/src/ncdnodefoldermetadata.cpp \ +../provider/server/src/ncdnodedisclaimer.cpp \ +../provider/server/src/ncdnodeiconimpl.cpp \ +../provider/server/src/ncdnodescreenshotimpl.cpp \ +../provider/server/src/ncdnodeskinimpl.cpp \ +../provider/server/src/ncdnodelink.cpp \ +../provider/server/src/ncdnodeitemlink.cpp \ +../provider/server/src/ncdnodefolderlink.cpp \ +../provider/server/src/ncdnodeidentifier.cpp \ +../provider/server/src/ncdnodeuserdataimpl.cpp \ +../provider/server/src/ncdnodedownloadimpl.cpp \ +../provider/server/src/ncdnodeupgradeimpl.cpp \ +../provider/server/src/ncdnodedependencyimpl.cpp \ +../provider/server/src/ncdnodecachecleaner.cpp \ +../provider/server/src/ncdnodecachecleanermanager.cpp \ +../provider/server/src/ncdnodefactory.cpp \ +../provider/server/src/ncdnodeidentifiereditor.cpp \ +../provider/server/src/ncddbmaxsizemap.cpp \ +../provider/server/src/ncdbaseoperation.cpp \ +../provider/server/src/ncdloadnodeoperationimpl.cpp \ +../provider/server/src/ncdloadrootnodeoperationimpl.cpp \ +../provider/server/src/ncdsendableprogress.cpp \ +../provider/server/src/ncdconfigurationmanagerimpl.cpp \ +../provider/server/src/ncdpurchaseoperationimpl.cpp \ +../provider/server/src/ncdpurchaseoptionimpl.cpp \ +../provider/server/src/ncdserversubscription.cpp \ +../provider/server/src/ncdserverpartofsubscription.cpp \ +../provider/server/src/ncdserverupgrade.cpp \ +../provider/server/src/ncdserversubscribablecontent.cpp \ +../provider/server/src/ncdnodeinstallimpl.cpp \ +../provider/server/src/ncdinstalloperationimpl.cpp \ +../provider/server/src/ncdnodecontentinfoimpl.cpp \ +../provider/server/src/ncdnodeuricontentimpl.cpp \ +../provider/server/src/ncdinstallinfo.cpp \ +../provider/server/src/ncdfileinfo.cpp \ +../provider/server/src/ncdsubscriptionmanagerimpl.cpp \ +../provider/server/src/ncdclientssubscriptions.cpp \ +../provider/server/src/ncdsubscriptiongroup.cpp \ +../provider/server/src/ncdsubscriptionimpl.cpp \ +../provider/server/src/ncdsubscriptionoperationimpl.cpp \ +../provider/server/src/ncdsubscriptionssourceidentifier.cpp \ +../provider/server/src/ncdrightsobjectoperationimpl.cpp \ +../provider/server/src/ncdnodepreviewimpl.cpp \ +../provider/server/src/ncdserveraddress.cpp \ +../provider/server/src/ncdsearchoperationimpl.cpp \ +../provider/server/src/ncdsearchnodeitem.cpp \ +../provider/server/src/ncdsearchnodefolder.cpp \ +../provider/server/src/ncdsearchnodebundle.cpp \ +../provider/server/src/ncdbundlefolder.cpp \ +../provider/server/src/ncdpreviewmanager.cpp \ +../provider/server/src/ncdchildentity.cpp \ +../provider/server/src/ncdchildentitymap.cpp \ +../provider/server/src/ncdsearchrootnode.cpp \ +../provider/server/src/ncdproviderutils.cpp \ +../provider/server/src/ncdserverdetailsimpl.cpp \ +../provider/server/src/ncdcontentdescriptor.cpp \ +../provider/server/src/ncdsubscriptiondatacompleter.cpp \ +../provider/server/src/ncdnodesupplier.cpp \ +../provider/server/src/ncdnodesupplierlink.cpp \ +../provider/server/src/ncddownloadinfo.cpp \ +../provider/server/src/ncdextendedinstallinfo.cpp \ +../provider/server/src/ncdloadbundlenodeoperationimpl.cpp \ +../provider/server/src/ncddependencyinfo.cpp \ +../provider/server/src/ncdfavoritemanagerimpl.cpp \ +../provider/server/src/ncdreportmanager.cpp \ +../provider/server/src/ncdreport.cpp \ +../provider/server/src/ncdreportdownload.cpp \ +../provider/server/src/ncdreportomadownload.cpp \ +../provider/server/src/ncdreportinstall.cpp \ +../provider/server/src/ncdnodeseeninfo.cpp \ +../provider/server/src/ncdnodeseenimpl.cpp \ +../provider/server/src/ncdnodeseenfolderimpl.cpp \ +../provider/server/src/ncdnodeidentifierutils.cpp \ +../provider/server/src/ncdpurchasehistoryutils.cpp \ +../provider/server/src/ncdcreateaccesspointoperationimpl.cpp \ +../provider/server/src/ncdsendhttprequestoperationimpl.cpp \ +../provider/server/src/ncdhttputils.cpp \ +../provider/server/src/ncdserverreportoperationimpl.cpp \ +../provider/server/src/ncdserverreportmanagerimpl.cpp \ +../provider/server/src/ncdprovidermanager.cpp \ +../provider/server/src/ncdgeneralmanager.cpp \ +../provider/server/src/ncddownloadoperationimpl.cpp \ +../provider/server/src/ncdbasedownloadhandler.cpp \ +../provider/server/src/ncdskindownloadhandler.cpp \ +../provider/server/src/ncdfilestoragefilehandler.cpp \ +../provider/server/src/ncddatabasefilehandler.cpp \ +../provider/server/src/ncdicondownloadhandler.cpp \ +../provider/server/src/ncdfiledownloadhandler.cpp \ +../provider/server/src/ncdpreviewdownloadhandler.cpp \ +../provider/server/src/ncdscreenshotdownloadhandler.cpp \ +../provider/server/src/ncdcontentdownloadoperation.cpp \ +../provider/server/src/ncddownloadsuboperation.cpp \ +../provider/server/src/ncddescriptordownloadsuboperation.cpp \ +../provider/server/src/ncdconfigurationparser.cpp \ +../provider/server/src/ncdengineconfigurationimpl.cpp \ +../provider/client/src/ncdqueryimpl.cpp \ +../provider/client/src/ncdqueryitemimpl.cpp \ +../provider/client/src/ncdquerytextitemimpl.cpp \ +../provider/client/src/ncdquerynumericitemimpl.cpp \ +../provider/client/src/ncdqueryselectionitemimpl.cpp \ +../provider/client/src/ncdquerypincodeitemimpl.cpp \ +../provider/client/src/ncdqueryoptionimpl.cpp \ +../provider/client/src/ncdexpirednode.cpp \ +../provider/client/src/ncdlocalizerutils.cpp \ +../provider/storage/src/ncdstoragemanagerimpl.cpp \ +../provider/storage/src/ncdstorageimpl.cpp \ +../provider/storage/src/ncdstorageclientimpl.cpp \ +../provider/storage/src/ncddbstoragemanager.cpp \ +../provider/storage/src/ncdstoragefiledataitem.cpp \ +../provider/storage/src/ncdfilestorageimpl.cpp \ +../provider/storage/src/ncdstoragebase.cpp \ +../provider/storage/src/ncddatabasestorageimpl.cpp \ +../provider/storage/src/ncdstoragedescriptordataitem.cpp \ +../provider/protocol/src/ncdparserimpl.cpp \ +../provider/protocol/src/ncdparserfactory.cpp \ +../provider/protocol/src/ncdprotocoldefaultobserverimpl.cpp \ +../provider/protocol/src/ncd_pp_iconimpl.cpp \ +../provider/protocol/src/ncd_pp_skinimpl.cpp \ +../provider/protocol/src/ncd_parser_pp_response.cpp \ +../provider/protocol/src/ncd_parser_pp_entityref.cpp \ +../provider/protocol/src/ncd_parser_pp_embeddeddata.cpp \ +../provider/protocol/src/ncd_parser_pp_datablocks.cpp \ +../provider/protocol/src/ncd_parser_pp_purchaseoption.cpp \ +../provider/protocol/src/ncd_parser_pp_dataentity.cpp \ +../provider/protocol/src/ncd_parser_pp_dataentitycontent.cpp \ +../provider/protocol/src/ncd_parser_pp_entitydependency.cpp \ +../provider/protocol/src/ncd_parser_pp_download.cpp \ +../provider/protocol/src/ncd_parser_pp_rights.cpp \ +../provider/protocol/src/ncd_parser_pp_information.cpp \ +../provider/protocol/src/ncd_parser_pp_messages.cpp \ +../provider/protocol/src/ncd_parser_pp_moreinfo.cpp \ +../provider/protocol/src/ncd_parser_pp_purchase.cpp \ +../provider/protocol/src/ncd_parser_pp_purchaseinformation.cpp \ +../provider/protocol/src/ncd_parser_pp_purchaseprocessed.cpp \ +../provider/protocol/src/ncd_parser_pp_purchaseentity.cpp \ +../provider/protocol/src/ncd_parser_pp_payment.cpp \ +../provider/protocol/src/ncd_parser_pp_expiredcacheddata.cpp \ +../provider/protocol/src/ncd_parser_pp_subscriptionreport.cpp \ +../provider/protocol/src/ncd_parser_pp_subscription.cpp \ +../provider/protocol/src/ncd_parser_pp_subscriptiondetails.cpp \ +../provider/protocol/src/ncd_parser_cp_actionrequest.cpp \ +../provider/protocol/src/ncd_parser_cp_response.cpp \ +../provider/protocol/src/ncd_parser_cp_capabilities.cpp \ +../provider/protocol/src/ncd_parser_cp_clientconfiguration.cpp \ +../provider/protocol/src/ncd_parser_cp_cookie.cpp \ +../provider/protocol/src/ncd_parser_cp_detail.cpp \ +../provider/protocol/src/ncd_parser_cp_details.cpp \ +../provider/protocol/src/ncd_parser_cp_error.cpp \ +../provider/protocol/src/ncd_parser_cp_query.cpp \ +../provider/protocol/src/ncd_parser_cp_queryelement.cpp \ +../provider/protocol/src/ncd_parser_cp_serverdetails.cpp \ +../provider/protocol/src/ncd_pp_folderrefimpl.cpp \ +../provider/protocol/src/ncd_pp_itemrefimpl.cpp \ +../provider/protocol/src/ncd_pp_datablockimpl.cpp \ +../provider/protocol/src/ncd_pp_dataentityimpl.cpp \ +../provider/protocol/src/ncd_pp_dataentitycontentimpl.cpp \ +../provider/protocol/src/ncd_pp_entitydependencyimpl.cpp \ +../provider/protocol/src/ncd_pp_embeddeddataimpl.cpp \ +../provider/protocol/src/ncd_pp_expiredcacheddataimpl.cpp \ +../provider/protocol/src/ncd_pp_informationimpl.cpp \ +../provider/protocol/src/ncd_pp_purchaseoptionimpl.cpp \ +../provider/protocol/src/ncd_pp_subscriptionimpl.cpp \ +../provider/protocol/src/ncd_pp_subscriptiondetailsimpl.cpp \ +../provider/protocol/src/ncd_pp_downloadimpl.cpp \ +../provider/protocol/src/ncd_pp_descriptorimpl.cpp \ +../provider/protocol/src/ncd_pp_rightsimpl.cpp \ +../provider/protocol/src/ncd_pp_purchaseimpl.cpp \ +../provider/protocol/src/ncd_pp_purchaseinformationimpl.cpp \ +../provider/protocol/src/ncd_pp_purchaseprocessedimpl.cpp \ +../provider/protocol/src/ncd_pp_purchaseentityimpl.cpp \ +../provider/protocol/src/ncd_pp_paymentimpl.cpp \ +../provider/protocol/src/ncd_pp_smsdetailsimpl.cpp \ +../provider/protocol/src/ncd_cp_actionrequestimpl.cpp \ +../provider/protocol/src/ncd_cp_clientconfigurationimpl.cpp \ +../provider/protocol/src/ncd_cp_cookieimpl.cpp \ +../provider/protocol/src/ncd_cp_detailimpl.cpp \ +../provider/protocol/src/ncd_cp_errorimpl.cpp \ +../provider/protocol/src/ncd_pp_errorimpl.cpp \ +../provider/protocol/src/ncd_cp_queryimpl.cpp \ +../provider/protocol/src/ncd_cp_queryelementimpl.cpp \ +../provider/protocol/src/ncd_cp_queryoptionimpl.cpp \ +../provider/protocol/src/ncd_cp_queryresponseimpl.cpp \ +../provider/protocol/src/ncd_cp_serverdetailsimpl.cpp \ +../provider/protocol/src/ncdsubparser.cpp \ +../provider/protocol/src/ncdtoplevelparser.cpp \ +../provider/protocol/src/ncdunknownparser.cpp \ +../provider/protocol/src/ncdprotocolutils.cpp \ +../provider/protocol/src/ncdparserobserverbundleimpl.cpp \ +../provider/protocol/src/ncdprotocolimpl.cpp \ +../provider/protocol/src/ncdsessionhandler.cpp \ +../provider/protocol/src/ncdstring.cpp \ +../provider/protocol/src/ncdrequestgenerator.cpp \ +../provider/protocol/src/ncdrequestbase.cpp \ +../provider/protocol/src/ncdrequestbrowsesearch.cpp \ +../provider/protocol/src/ncdrequestconfiguration.cpp \ +../provider/protocol/src/ncdrequestconfigurationdata.cpp \ +../provider/protocol/src/ncdrequestpurchase.cpp \ +../provider/protocol/src/ncdrequestmanagesubscriptions.cpp \ +../provider/protocol/src/ncdrequestinstallation.cpp \ +../provider/purchasehistory/src/ncdpurchasehistorydbimpl.cpp \ +../provider/src/ncdkeyvaluemap.cpp \ +../provider/src/ncdpurchasedetails.cpp \ +../provider/src/ncddelay.cpp \ No newline at end of file diff -r 92f864ef0288 -r ae54820ef82c ncdengine/engine/engine.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ncdengine/engine/engine.pro Tue Jul 06 14:23:31 2010 +0300 @@ -0,0 +1,58 @@ + +# +# 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 ( engine.pri ) + +IncludeBlock = \ + "$${LITERAL_HASH}include " \ + "$${LITERAL_HASH}include " \ + "$${LITERAL_HASH}include <../inc/catalogsuids.h>" \ + "$${LITERAL_HASH}include <./inc/build_config.mmpi>" + + +TEMPLATE = app +TARGET = ncdserver_20019119 +CONFIG += qt + +symbian: { + TARGET.CAPABILITY = CAP_APPLICATION + TARGET.VID = VID_DEFAULT + TARGET.UID3 = 0x20019119 + TARGET.EPOCALLOWDLLDATA = 1 + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + + INCLUDEPATH += ../provider/inc + INCLUDEPATH += ../provider/server/inc + INCLUDEPATH += ../provider/client/inc + INCLUDEPATH += ../provider/storage/inc + INCLUDEPATH += ../provider/protocol/inc + INCLUDEPATH += ../provider/deviceinteraction/inc + INCLUDEPATH += ../provider/purchasehistory/inc + + INCLUDEPATH += ../inc + INCLUDEPATH += ../engine/inc + INCLUDEPATH += ../engine/transport/inc + INCLUDEPATH += ../engine/accesspointmanager/inc + INCLUDEPATH += /epoc32/include/platform/mw/cwrt + INCLUDEPATH += /epoc32/include/ecom + + LIBS += -lcommonui -lWrtDownloadMgr -lapmime -lcmmanager -lecom -lapengine -lmsgs -lsmcm -lgsmu -linetprotutil + LIBS += -lhttpfiltercommon -lecom -lhttp -lesock -lcommdb -lsysutil -lhash -lestlib -lestor -lbafl -lplatformenv + LIBS += -lXmlEngineUtils -lXmlEngineDOM -lXmlEngine -lXmlInterface -lxmlframework -lcharconv -ledbms -lefsrv + LIBS += -lncdutils_20019119 -lncddevicemgmt_20019119 +} diff -r 92f864ef0288 -r ae54820ef82c ncdengine/engine/group/bld.inf --- a/ncdengine/engine/group/bld.inf Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/engine/group/bld.inf Tue Jul 06 14:23:31 2010 +0300 @@ -20,7 +20,7 @@ catalogsdebug.mmp ncdutils.mmp ncddevicemgmt.mmp -catalogsserver.mmp +//catalogsserver.mmp catalogsengine.mmp catalogsproxy.mmp catalogsundertaker.mmp diff -r 92f864ef0288 -r ae54820ef82c ncdengine/engine/group/ncddevicemgmt.mmp --- a/ncdengine/engine/group/ncddevicemgmt.mmp Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/engine/group/ncddevicemgmt.mmp Tue Jul 06 14:23:31 2010 +0300 @@ -86,7 +86,7 @@ LIBRARY avkon.lib LIBRARY etel3rdparty.lib LIBRARY apgrfx.lib -LIBRARY swinstcli.lib // Silent install +//LIBRARY swinstcli.lib // Silent install LIBRARY sif.lib // SIF installer LIBRARY scrclient.lib //Registry client //LIBRARY widgetregistryclient.lib // Widget Registry diff -r 92f864ef0288 -r ae54820ef82c ncdengine/engine/transport/inc/catalogshttpdownload.h --- a/ncdengine/engine/transport/inc/catalogshttpdownload.h Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/engine/transport/inc/catalogshttpdownload.h Tue Jul 06 14:23:31 2010 +0300 @@ -20,7 +20,8 @@ #define C_CATALOGSHTTPDOWNLOAD_H #include - +#include +#include #include #include "catalogshttpoperation.h" @@ -33,7 +34,8 @@ class CCatalogsHttpHeaders; class CCatalogsKeyValuePair; class CCatalogsHttpDownloadManager; - +class CCatalogsHttpQTDownload; +using namespace WRT; /** * HTTP file download implementation * @@ -77,7 +79,7 @@ */ static CCatalogsHttpDownload* NewLC( CCatalogsHttpDownloadManager& aOwner, - RHttpDownload* aDownload, + Download* aDownload, const CCatalogsHttpConfig& aConfig ); @@ -238,7 +240,8 @@ */ TInt StatusCode() const; - + TDownloadDeleteState GetStatusState(); + Download* GetDownload(); /** * Not supported * @see MCatalogsHttpOperation::StatusText() @@ -282,7 +285,9 @@ TBool HandleHttpError( MCatalogsHttpOperation& aOperation, TCatalogsHttpError aError ); - + + void HandledownloadEventL(DownloadEvent& aEvent); + public: /** @@ -321,7 +326,7 @@ */ CCatalogsHttpDownload( CCatalogsHttpDownloadManager& aOwner, - RHttpDownload* aDownload ); + Download* aDownload ); /** * 2nd phase constructor @@ -509,13 +514,14 @@ CCatalogsHttpDownloadManager& iOwner; TCatalogsTransportOperationId iId; // Operation id - RHttpDownload* iDownload; // Platform download + Download* iDownload; // Platform download CCatalogsHttpConfig* iConfig; // Configuration MCatalogsHttpObserver* iObserver; // Observer TCatalogsHttpEvent iState; // State of the download HBufC8* iUri; // Current URI HBufC8* iEncodedUri; // Current URI as encoded CCatalogsHttpHeaders* iResponseHeaders; // Headers from HTTP response + CCatalogsHttpQTDownload* iQTDownload; // added request headers not supported by DL man HBufC8* iAddedRequestHeaders; @@ -555,7 +561,7 @@ // For managing async pause with dlmgr. TBool iPausePending; TBool iQueuedResume; - + TDownloadDeleteState iStatus; protected: // Grant access to UpdateContentType @@ -563,4 +569,18 @@ }; +class CCatalogsHttpQTDownload: public QObject + { + Q_OBJECT + public: + CCatalogsHttpQTDownload(CCatalogsHttpDownload* aHttpDownload,Download* aDownload); + public slots: + void downloadEvent(WRT::DownloadEvent*); + void downloadError(WRT::Error); + public: + CCatalogsHttpDownload* iCatalogsHttpDownload; + Download* iDownload; // Platform download + }; + + #endif // C_CATALOGSHTTPDOWNLOAD_H diff -r 92f864ef0288 -r ae54820ef82c ncdengine/engine/transport/inc/catalogshttpdownloadmanagerimpl.h --- a/ncdengine/engine/transport/inc/catalogshttpdownloadmanagerimpl.h Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/engine/transport/inc/catalogshttpdownloadmanagerimpl.h Tue Jul 06 14:23:31 2010 +0300 @@ -24,9 +24,12 @@ #include "catalogstransportoperationid.h" #include "catalogshttpsession.h" // RCatalogsHttpOperationArray #include "catalogshttpsessionmanager.h" + #include "catalogsconnectionmethod.h" #include "catalogsaccesspointobserver.h" - +#include +#include +#include class MCatalogsHttpConfig; class CCatalogsHttpConfig; class CCatalogsHttpDownload; @@ -38,16 +41,22 @@ class CCatalogsHttpSession; class CCatalogsConnection; class CCatalogsNetworkManager; +class CCatalogsHttpQTDownloadManager; +using namespace WRT; + +const TInt KNCDEngineAppID = 0X2002E685; + /** * HTTP file download manager * */ class CCatalogsHttpDownloadManager : + public CActive, - public MHttpDownloadMgrObserver, public MCatalogsAccessPointObserver { + public: // Constructors and destructor /** @@ -69,7 +78,7 @@ * Destructor */ virtual ~CCatalogsHttpDownloadManager(); - + public: // New methods /** @@ -159,7 +168,7 @@ void AddRef(); - + DownloadManager* GetDownloadManager(); TInt Release(); void SetConnectionMethodL( @@ -202,15 +211,9 @@ TInt NewDownloadId(); - RHttpDownload& CreatePlatformDownloadL( const TDesC8& aUrl ); - - public: // From MHttpDownloadMngrObserver - - /** - * Handles events from Download manager - */ - virtual void HandleDMgrEventL( RHttpDownload& aDownload, - THttpDownloadEvent aEvent ); + WRT::Download& CreatePlatformDownloadL( const TDesC8& aUrl ); + void downloadMgrEventRecieved(WRT::DownloadEvent* dlmEvent); + public: // from MCatalogsAccessPointObserver @@ -316,8 +319,7 @@ * Deletes downloads that have not been paused by the user */ void DeleteHangingDownloads(); - - + private: MCatalogsHttpSessionManager& iManager; @@ -326,8 +328,9 @@ CCatalogsHttpConnectionManager& iConnectionManager; CCatalogsNetworkManager* iNetworkManager; // Not owned TInt32 iSessionId; - RHttpDownloadMgr iDmgr; - + DownloadManager *iDmgr; + CCatalogsHttpQTDownloadManager* iQTmgr; + WRT::Download* iDownload; // Platform download // All downloads except those that are in Restored RCatalogsHttpOperationArray iDownloads; RCatalogsHttpOperationArray iRestoredDownloads; @@ -344,4 +347,18 @@ TInt iCurrentDlId; // id of the last created download }; -#endif // C_CATALOGSHTTPDOWNLOADMANAGER_H + + +class CCatalogsHttpQTDownloadManager: public QObject + { + Q_OBJECT + public: + CCatalogsHttpQTDownloadManager(CCatalogsHttpDownloadManager* aDownloadManager,DownloadManager* aDmgr); + public slots: + void downloadMgrEventRecieved(WRT::DownloadEvent*); + public: + CCatalogsHttpDownloadManager* iDownloadManager; + DownloadManager* iDmgr ; + }; + + #endif // C_CATALOGSHTTPDOWNLOADMANAGER_H \ No newline at end of file diff -r 92f864ef0288 -r ae54820ef82c ncdengine/engine/transport/src/catalogshttpdownload.cpp --- a/ncdengine/engine/transport/src/catalogshttpdownload.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/engine/transport/src/catalogshttpdownload.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -23,7 +23,10 @@ #include #include // TDataType #include +#include + +#include #include "catalogshttpdownloadmanagerimpl.h" #include "catalogshttpobserver.h" #include "catalogshttpconfigimpl.h" @@ -95,7 +98,7 @@ // CCatalogsHttpDownload* CCatalogsHttpDownload::NewLC( CCatalogsHttpDownloadManager& aOwner, - RHttpDownload* aDownload, + Download* aDownload, const CCatalogsHttpConfig& aConfig ) { CCatalogsHttpDownload* self = new( ELeave ) CCatalogsHttpDownload( @@ -140,7 +143,7 @@ else { DLTRACE(( "Deleting download" )); - iDownload->Delete(); + iOwner.GetDownloadManager()->removeOne(iDownload); if ( iState.iOperationState != ECatalogsHttpOpCompleted ) { @@ -244,8 +247,8 @@ { iObserver = NULL; TInt32 state = 0; - iDownload->GetIntAttribute( EDlAttrState, state ); - + + state = (Download::State)iDownload->attribute(State).toInt(); if ( IsOneOf( static_cast( state ), EHttpDlCreated, @@ -473,7 +476,14 @@ TInt err = KErrNone; if ( iDownload ) { - err = iDownload->Pause(); + try + { + iDownload->pause(); + } + catch(const std::exception& exception) + { + err = qt_symbian_exception2Error(exception); + } } DLTRACE(("Pause err: %d", err )); @@ -680,7 +690,8 @@ // client-server communication with the Download manager server if ( iDownload && iContentSize <= 0 ) { - iDownload->GetIntAttribute( EDlAttrLength, iContentSize ); + + int downloadbytes = iDownload->attribute(DownloadedSize).toInt(); DLTRACE(("Content size from download: %i", iContentSize )); } return iContentSize; @@ -706,7 +717,8 @@ TBool pausable = ETrue; if ( iDownload ) { - iDownload->GetBoolAttribute( EDlAttrPausable, pausable ); + + pausable=iDownload->attribute(Pausable).toBool(); } return pausable; } @@ -839,7 +851,88 @@ return KErrNone; } +void CCatalogsHttpDownload::HandledownloadEventL(DownloadEvent& aEvent) +{ + + switch(aEvent.type()) + { + + case DownloadEvent::Started: + + break; + + case DownloadEvent::Failed: + { + TInt32 errorId = -1; + SetTransferring( EFalse ); + errorId = iDownload->attribute(LastError).toInt(); + if ( ( errorId == ConnectionFailed || + errorId == TransactionFailed )) + { + DLTRACE(("Try to reconnect")); + iReconnectWhenFail = EFalse; + iDownload->start(); + break; + } + else if ( errorId == ContentExpired || + errorId == PartialContentModified ) + { + DLTRACE(("Content has changed, reset and restart")); + iReconnectWhenFail = EFalse; + iDownload->cancel(); + iDownload->start(); + break; + } + + } + break; + + case DownloadEvent::Cancelled: + + break; + case DownloadEvent::ContentTypeChanged: + + break; + case DownloadEvent::HeadersReceived: + { + // Read the response headers from platform DL manager + UpdateResponseHeadersL(); + UpdateContentType(); + } + break; + + case DownloadEvent::NetworkLoss: + + break; + + case DownloadEvent::Completed: + { + // move/rename temp file as the target file + TRAPD( err, MoveFileL() ); + + // DLMAIN-546, delete DL manager's download before starting + // the next one so that downloads don't jam, again + if ( iDownload ) + { + iTransferredSize = iDownload->attribute(DownloadedSize).toInt(); + + + DLTRACE(("Deleting download")); + DeletePlatformDownload(); + } + } + break; + + case DownloadEvent::InProgress: + + break; + + default: + { + } + }; +} // --------------------------------------------------------------------------- // Handles events from the transaction // --------------------------------------------------------------------------- @@ -1025,20 +1118,20 @@ TInt32 statusCode = -1; - iDownload->GetIntAttribute( EDlAttrStatusCode, statusCode ); - DLINFO( ("Response status: %i", statusCode ) ); + statusCode = (Download::State)iDownload->attribute(WRT::State).toInt(); + DLINFO( ("Response status: %i", statusCode ) ); #ifdef CATALOGS_BUILD_CONFIG_DEBUG TInt32 errorId = 0; + errorId=iDownload->attribute(LastError).toInt(); - iDownload->GetIntAttribute( EDlAttrErrorId, errorId ); DLINFO( ("Error id: %i", errorId ) ); #endif TInt32 globalErrorId = 0; - iDownload->GetIntAttribute( - EDlAttrGlobalErrorId, globalErrorId ); + globalErrorId= iDownload->attribute(LastError).toInt(); + DLINFO( ("Global error id: %i", globalErrorId ) ); @@ -1085,7 +1178,7 @@ { DLTRACE(("Try to reconnect")); iReconnectWhenFail = EFalse; - iDownload->Start(); + iDownload->start(); break; } @@ -1143,9 +1236,9 @@ // DLMAIN-546, delete DL manager's download before starting // the next one so that downloads don't jam, again if ( iDownload ) - { - iDownload->GetIntAttribute( - EDlAttrDownloadedSize, iTransferredSize ); + { + iTransferredSize = iDownload->attribute(DownloadedSize).toInt(); + DLTRACE(("Deleting download")); DeletePlatformDownload(); @@ -1179,7 +1272,8 @@ DLTRACE(( "Download failed" )); TInt32 errorId = -1; SetTransferring( EFalse ); - iDownload->GetIntAttribute( EDlAttrErrorId, errorId ); + errorId = iDownload->attribute(LastError).toInt(); + DLINFO( ("Error id: %i", errorId ) ); DLINFO( ("Global error id: %i", globalErrorId ) ); @@ -1190,7 +1284,7 @@ { DLTRACE(("Try to reconnect")); iReconnectWhenFail = EFalse; - iDownload->Start(); + iDownload->start(); break; } else if ( errorId == EContentExpired || @@ -1198,8 +1292,8 @@ { DLTRACE(("Content has changed, reset and restart")); iReconnectWhenFail = EFalse; - iDownload->Reset(); - iDownload->Start(); + iDownload->cancel(); + iDownload->start(); break; } @@ -1388,8 +1482,7 @@ if ( !iPaused ) { TInt32 globalErrorId = 0; - iDownload->GetIntAttribute( - EDlAttrGlobalErrorId, globalErrorId ); + globalErrorId = iDownload->attribute(LastError).toInt(); DLINFO( ("Global error id: %i", globalErrorId ) ); if ( globalErrorId == KErrCancel ) @@ -1495,7 +1588,8 @@ iReconnectCount = KReconnectAttempts; TInt32 size = 0; - iDownload->GetIntAttribute( EDlAttrDownloadedSize, size ); + size = iDownload->attribute(DownloadedSize).toInt(); + DLTRACE(("Transferred size from download: %i", size)); if ( size != iTransferredSize ) @@ -1636,7 +1730,7 @@ // CCatalogsHttpDownload::CCatalogsHttpDownload( CCatalogsHttpDownloadManager& aOwner, - RHttpDownload* aDownload ) : + Download* aDownload ) : iOwner( aOwner ), iDownload( aDownload ), iState( ECatalogsHttpOpCreated, ECatalogsHttpNone ), @@ -1659,7 +1753,8 @@ { // id part will be updated from disk iId = TCatalogsTransportOperationId( iOwner.SessionId(), KErrNotFound ); - + iQTDownload = new CCatalogsHttpQTDownload(this,iDownload); + UpdateSecondaryIdL(); User::LeaveIfError( SetDeleteState( EDownloadCanBeDeleted ) ); @@ -1700,8 +1795,11 @@ { // Download always exists when this is called so no need to check DLTRACE(("Updating the content type")); - iDownload->GetStringAttribute( EDlAttrContentType, - iContentType ); + QString contentType; + contentType= iDownload->attribute(WRT::ContentType).toString(); + TBuf ContentType(contentType.utf16()); + iContentType.Copy(ContentType); + } DLTRACEOUT(("Content-type: %S", &iContentType )); } @@ -1821,9 +1919,16 @@ RBuf8 buf; CleanupClosePushL( buf ); buf.CreateL( KMaxUrlLength ); - - User::LeaveIfError( iDownload->GetStringAttribute( EDlAttrCurrentUrl, - buf ) ); + QString string; + try + { + string = iDownload->attribute(SourceUrl).toString(); + } + catch(const std::exception& exception) + { + qt_symbian_exception2LeaveL(exception); + } + // DL manager has the encoded URI AssignDesL( iEncodedUri, buf ); @@ -1867,8 +1972,8 @@ } else { - User::LeaveIfError( iDownload->SetStringAttribute( - predefined, headers[i]->Value() ) ); +/* User::LeaveIfError( iDownload->SetStringAttribute( + predefined, headers[i]->Value() ) );*/ } } @@ -1877,8 +1982,8 @@ if ( iAddedRequestHeaders ) { DLTRACE(( "added request headers: %S", iAddedRequestHeaders )); - User::LeaveIfError( iDownload->SetStringAttribute( - EDlAttrRequestHeaderAddon, *iAddedRequestHeaders ) ); + /* User::LeaveIfError( iDownload->SetStringAttribute( + EDlAttrRequestHeaderAddon, *iAddedRequestHeaders ) );*/ delete iAddedRequestHeaders; iAddedRequestHeaders = NULL; } @@ -2254,10 +2359,17 @@ InitializeDownloadL(); } }); - + if ( err == KErrNone ) { - err = iDownload->Start(); + try + { + iDownload->start(); + } + catch(const std::exception& exception) + { + qt_symbian_exception2LeaveL(exception); + } } return err; } @@ -2471,13 +2583,17 @@ TInt err = KErrNone; if ( iDownload ) { - err = iDownload->SetIntAttribute( EDlAttrUserData, aStatus ); + + iStatus = aStatus; } return err; } - +CCatalogsHttpDownload::TDownloadDeleteState CCatalogsHttpDownload::GetStatusState() + { + return iStatus; + } // --------------------------------------------------------------------------- // Gets delete status and download id from the platform download // --------------------------------------------------------------------------- @@ -2491,7 +2607,8 @@ TInt err = KErrNotReady; if ( iDownload ) { - err = iDownload->GetIntAttribute( EDlAttrUserData, data ); + + err = iStatus; DLTRACE(("Data: %d", data)); aStatus = static_cast( data ); } @@ -2572,8 +2689,14 @@ // Check if the download has been set progressive TBool progressive = EFalse; - User::LeaveIfError( iDownload->GetBoolAttribute( - EDlAttrProgressive, progressive ) ); + try + { + progressive =iDownload->attribute(Progressive).toBool(); + } + catch(const std::exception& exception) + { + qt_symbian_exception2LeaveL(exception); + } // We want to have progressive downloads because then DL manager uses @@ -2591,18 +2714,30 @@ !iFileIsSet ) { DLTRACE(("Setting download as progressive")); - User::LeaveIfError( iDownload->SetBoolAttribute( - EDlAttrProgressive, ETrue ) ); - } + try + { + iDownload->setAttribute(Progressive,ETrue); + } + catch(const std::exception& exception) + { + qt_symbian_exception2LeaveL(exception); + } + } // Doesn't pause the download after content type has been received - User::LeaveIfError( iDownload->SetBoolAttribute( - EDlAttrNoContentTypeCheck, ETrue ) ); + try + { + iDownload->setAttribute(Progressive,ETrue); + } + catch(const std::exception& exception) + { + qt_symbian_exception2LeaveL(exception); + } if ( !iFileIsSet ) { DLTRACE(("Setting filehandle to download")); - User::LeaveIfError( iDownload->SetFileHandleAttribute( file ) ); + // User::LeaveIfError( iDownload->SetFileHandleAttribute( file ) ); iFileIsSet = ETrue; } @@ -2610,7 +2745,10 @@ } } - +Download* CCatalogsHttpDownload::GetDownload() +{ + return iDownload; +} // --------------------------------------------------------------------------- // Delete platform download and reset secondary id // --------------------------------------------------------------------------- @@ -2619,7 +2757,7 @@ { if ( iDownload ) { - iDownload->Delete(); + iOwner.GetDownloadManager()->removeOne(iDownload); iDownload = NULL; iId.SetSecondaryId( KErrNotFound ); } @@ -2633,8 +2771,7 @@ void CCatalogsHttpDownload::UpdateSecondaryIdL() { TInt32 secondaryId = KErrNotFound; - User::LeaveIfError( - iDownload->GetIntAttribute( EDlAttrId, secondaryId ) ); + secondaryId = iDownload->id(); iId.SetSecondaryId( secondaryId ); } @@ -2675,3 +2812,19 @@ aName.Append( aExt ); } } + +CCatalogsHttpQTDownload::CCatalogsHttpQTDownload(CCatalogsHttpDownload* aHttpDownload,Download* aDownload) + { + iCatalogsHttpDownload = aHttpDownload; + iDownload = aDownload; + connect(iDownload, SIGNAL(downloadEvent(DownloadManagerEvent*)), this,SLOT(downloadEvent(DownloadEvent*))); + } + +void CCatalogsHttpQTDownload::downloadEvent(WRT::DownloadEvent* aEvent) + { + iCatalogsHttpDownload->HandledownloadEventL(*aEvent); + } +void CCatalogsHttpQTDownload::downloadError(WRT::Error) + { + //iCatalogsHttpDownload->HandledownloadEventL(*aEvent); + } \ No newline at end of file diff -r 92f864ef0288 -r ae54820ef82c ncdengine/engine/transport/src/catalogshttpdownloadmanagerimpl.cpp --- a/ncdengine/engine/transport/src/catalogshttpdownloadmanagerimpl.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/engine/transport/src/catalogshttpdownloadmanagerimpl.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -32,7 +32,10 @@ #include "catalogsconnection.h" #include "catalogsdebug.h" - +#include +#include +#include +#include // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -59,6 +62,7 @@ DLTRACE(("constructor ok")); CleanupStack::PushL( self ); + self->ConstructL( aCleanup ); CleanupStack::Pop( self ); return self; @@ -102,15 +106,17 @@ iNetworkManager->RemoveObserver( *this ); } - if ( iDmgr.Handle() ) + + if ( iDmgr ) { DLTRACE(("We were connected to DL manager")); DeleteHangingDownloads(); } - + // Close download manager session - iDmgr.Close(); + iDmgr->removeAll(); + delete iDefaultConfig; iManager.Release(); @@ -124,24 +130,20 @@ { DLTRACEIN(("")); // This pauses all downloads in addition to disconnecting - iDmgr.Disconnect(); - const CDownloadArray& downloads( iDmgr.CurrentDownloads() ); - - TInt count = downloads.Count(); - while( count-- ) - { - RHttpDownload& dl = *( downloads[ count ] ); - TInt32 deleteStatus = 0; - dl.GetIntAttribute( EDlAttrUserData, deleteStatus ); - DLTRACE(("DeleteStatus: %d", deleteStatus )); - - if ( deleteStatus == CCatalogsHttpDownload::EDownloadCanBeDeleted ) + iDmgr->pauseAll(); + TInt count = iDownloads.Count(); + for ( TInt i = 0; i < count; ++i ) + { + TInt32 deleteStatus = 0; + deleteStatus = dynamic_cast(iDownloads[i])->GetStatusState(); + + if ( deleteStatus == CCatalogsHttpDownload::EDownloadCanBeDeleted ) { DLTRACE(("Deleting download")); - dl.Delete(); + iDmgr->removeOne(dynamic_cast(iDownloads[i])->GetDownload()); } + } - } } // --------------------------------------------------------------------------- @@ -172,16 +174,18 @@ { DLTRACEIN(("")); // Create a new download + QString Url = QString::fromRawData( reinterpret_cast(aUrl.Ptr()),aUrl.Length()); + iDownload = iDmgr->createDownload( Url ); + CCatalogsHttpDownload* dl = CCatalogsHttpDownload::NewLC( *this, //download, - NULL, + iDownload, *iDefaultConfig ); dl->SetUriL( aUrl ); dl->SetFileServerSession( iFs ); - - // If the given observer != NULL, set it as the observer for the download + // If the given observer != NULL, set it as the observer for the download if ( aObserver ) { dl->Config().SetObserver( aObserver ); @@ -207,6 +211,7 @@ TInt count = iDownloads.Count(); for ( TInt i = 0; i < count; ++i ) { + if ( iDownloads[i]->OperationId() == aId ) { return iDownloads[i]; @@ -396,12 +401,19 @@ DLTRACEIN(("")); if ( aMethod != iCurrentAp ) { + try + { DLTRACE( ( "Set AP, type: %d, id: %u, apn: %d", aMethod.iType, aMethod.iId, aMethod.iApnId )); - User::LeaveIfError( iDmgr.Disconnect() ); - User::LeaveIfError( iDmgr.SetIntAttribute( EDlMgrIap, aMethod.iApnId ) ); + iDmgr->pauseAll(); + iCurrentAp = aMethod; DLTRACE(("AP set")); + } + catch(const std::exception& exception) + { + qt_symbian_exception2LeaveL(exception); + } } } @@ -460,40 +472,23 @@ { return iSessionId; } - - + // --------------------------------------------------------------------------- // Handles download manager events // --------------------------------------------------------------------------- -// -void CCatalogsHttpDownloadManager::HandleDMgrEventL( RHttpDownload& aDownload, - THttpDownloadEvent aEvent ) - { - DLTRACEIN(( "Dl state: %i, pr: %i, DL: %x", aEvent.iDownloadState, - aEvent.iProgressState, &aDownload )); - - TDownloadEvent event( aDownload, aEvent ); +// + void CCatalogsHttpDownloadManager::downloadMgrEventRecieved(WRT::DownloadEvent* dlmEvent) + { + + switch(dlmEvent ->type()) + { + + default: + break; + }; - if ( IsOneOf( aEvent.iDownloadState, EHttpDlDeleted, EHttpDlDeleting ) ) - { - DLTRACEOUT(("Download was deleted")) - RemoveUnhandledEvents( event ); - } - // Handle everything but Download name change events - else if ( aEvent.iProgressState != EHttpProgDlNameChanged ) - { - DLTRACE(("Adding event to queue")); - - if ( aEvent.iProgressState == EHttpProgResponseBodyReceived ) - { - // Filter unhandled progress events from the queue - RemoveUnhandledProgressEvents( event ); - } - - iEventQueue.AppendL( event ); - ContinueEventHandling(); - } - } + + } // --------------------------------------------------------------------------- @@ -507,8 +502,19 @@ DLTRACEIN(("")); if ( aEvent == ECatalogsAccessPointClosed ) { + try + { DLTRACE(("Disconnecting download manager")); - User::LeaveIfError( iDmgr.Disconnect() ); + + iDmgr->pauseAll(); + } + + catch(const std::exception& exception) + { + qt_symbian_exception2LeaveL(exception); + } + + } } @@ -556,6 +562,11 @@ // shared so that RFiles can be given to Download manager User::LeaveIfError( iFs.ShareProtected() ); + + QString DmgrUid(QString::number(KNCDEngineAppID)); + iDmgr = new DownloadManager(DmgrUid); + iDmgr->initialize(); + iQTmgr = new CCatalogsHttpQTDownloadManager(this,iDmgr); TUid sessionId( TUid::Uid( iSessionId ) ); if ( aCleanup ) @@ -581,7 +592,6 @@ do { - // TRAP( err, iDmgr.ConnectL( sessionId, *this, ETrue ) ); if ( err != KErrNone ) { DLERROR(("DL manager connection failed with err: %d, retry attempts left", @@ -607,13 +617,17 @@ iNetworkManager = &CCatalogsHttpSessionManager::NetworkManagerL(); iNetworkManager->AddObserverL( *this ); -// iDmgr.SetIntAttribute( EDlMgrExitAction, EExitPause ); // Restore downloads from previous sessions // RestoreDownloadsL(); + DLTRACEOUT(("")); + } - +DownloadManager* CCatalogsHttpDownloadManager::GetDownloadManager() +{ + return iDmgr; +} // --------------------------------------------------------------------------- // Restore downloads from previous session // --------------------------------------------------------------------------- @@ -621,17 +635,19 @@ void CCatalogsHttpDownloadManager::RestoreDownloadsL() { DLTRACEIN(("")); - const CDownloadArray& downloads = iDmgr.CurrentDownloads(); TBuf8 url; - TBuf filename; + + QList downloads = iDmgr->currentDownloads(); + + // Go through downloads, create wrappers for DL manager downloads and // add them to HttpDownloadManager - for ( TInt i = 0; i < downloads.Count(); ++i ) + for ( TInt i = 0; i < downloads.size(); ++i ) { DLTRACE(( "Restoring dl %i", i )); - RHttpDownload* dlPtr = downloads[i]; + WRT::Download *dlPtr = downloads[i]; // Create the download and push it to cleanup stack CCatalogsHttpDownload* dl = CCatalogsHttpDownload::NewLC( *this, @@ -639,8 +655,9 @@ // set file server session dl->SetFileServerSession( iFs ); - - dlPtr->GetStringAttribute( EDlAttrDestFilename, filename ); + + QString name = dlPtr->attribute(FileName).toString(); + TBuf filename(name.utf16()); // Separate the filename from the path TParsePtrC parser( filename ); @@ -683,7 +700,7 @@ DASSERT( aDownload ); TInt32 id = 0; - aDownload->GetIntAttribute( EDlAttrId, id ); + //aDownload->GetIntAttribute( EDlAttrId, id ); TInt count = aArray.Count(); for ( TInt i = 0; i < count; ++i ) @@ -954,8 +971,23 @@ } -RHttpDownload& CCatalogsHttpDownloadManager::CreatePlatformDownloadL( +Download& CCatalogsHttpDownloadManager::CreatePlatformDownloadL( const TDesC8& aUrl ) { - return iDmgr.CreateDownloadL( aUrl ); + + QString myString= QString::fromRawData( reinterpret_cast(aUrl.Ptr()),aUrl.Length()); + + return *(iDmgr->createDownload( myString )); } + +CCatalogsHttpQTDownloadManager::CCatalogsHttpQTDownloadManager(CCatalogsHttpDownloadManager* aDownloadManager,DownloadManager* aDmgr) + { + iDownloadManager = aDownloadManager; + iDmgr = aDmgr; + connect(iDmgr, SIGNAL(downloadManagerEvent(WRT::DownloadManagerEvent*)), this,SLOT(downloadMgrEventRecieved(WRT::DownloadEvent*))); + } + +void CCatalogsHttpQTDownloadManager::downloadMgrEventRecieved(WRT::DownloadEvent* aEvent) + { + iDownloadManager->downloadMgrEventRecieved(aEvent); + } \ No newline at end of file diff -r 92f864ef0288 -r ae54820ef82c ncdengine/inc/ncdnodeinstall.h --- a/ncdengine/inc/ncdnodeinstall.h Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/inc/ncdnodeinstall.h Tue Jul 06 14:23:31 2010 +0300 @@ -32,18 +32,12 @@ class MDesCArray; class MNcdInstalledContent; -// Forward declaration for SwiUI::TInstallOptions -// SwiUI namespace contains install options -// that are used for the silent install. -// #include -// is required when SwiUI::TInstallOptions is created -// in the implementation code. -namespace SwiUI +// Forward declaration for Usif::TInstallOptions +namespace Usif { - class TInstallOptions; + class COpaqueNamedParams; } - /** * Provides functions that can be used to install the node object. * Before installing, the data should have been downloaded using @@ -83,7 +77,6 @@ */ virtual MNcdInstallOperation* InstallL( MNcdInstallOperationObserver& aObserver ) = 0; - /** * Starts the silent installing operation of the node object. * Because installation is silent, normal installation query dialogs are not shown. @@ -96,7 +89,7 @@ * function of the operation should be called when operation is not needed anymore. * * @note Requires TrustedUI capabilities - * @note Only SIS packages and Java archives are installed silently, other content + * @note Only SIS packages and Java archives and widgets are installed silently, other content * is installed exactly like with InstallL * * @param aObserver Observer for the operation. @@ -109,9 +102,9 @@ * Leaves with KNcdErrorParallelOperationNotAllowed if a parallel client is running * an operation for the same metadata. See MNcdOperation for full explanation. */ - virtual MNcdInstallOperation* SilentInstallL( MNcdInstallOperationObserver& aObserver, - const SwiUI::TInstallOptions& aInstallOptions ) = 0; - + virtual MNcdInstallOperation* SilentInstallL( + MNcdInstallOperationObserver& aObserver, + Usif::COpaqueNamedParams* aInstallOptions ) = 0; /** * Checks if the item content has already been installed and is currently present in the diff -r 92f864ef0288 -r ae54820ef82c ncdengine/ncdengine.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ncdengine/ncdengine.pro Tue Jul 06 14:23:31 2010 +0300 @@ -0,0 +1,19 @@ +# +# 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: +# + +TEMPLATE = subdirs + +SUBDIRS += engine/engine.pro diff -r 92f864ef0288 -r ae54820ef82c ncdengine/provider/client/inc/ncdnodeinstallproxy.h --- a/ncdengine/provider/client/inc/ncdnodeinstallproxy.h Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/provider/client/inc/ncdnodeinstallproxy.h Tue Jul 06 14:23:31 2010 +0300 @@ -125,14 +125,12 @@ */ MNcdInstallOperation* InstallL( MNcdInstallOperationObserver& aObserver ); - /** * @see MNcdNodeInstall::SilentInstallL() */ - MNcdInstallOperation* SilentInstallL( MNcdInstallOperationObserver& aObserver, - const SwiUI::TInstallOptions& aInstallOptions ); - - + MNcdInstallOperation* SilentInstallL( + MNcdInstallOperationObserver& aObserver, + Usif::COpaqueNamedParams* aInstallOptions ); /** * @see MNcdNodeInstall::IsInstalledL() */ diff -r 92f864ef0288 -r ae54820ef82c ncdengine/provider/client/inc/ncdoperationmanagerproxy.h --- a/ncdengine/provider/client/inc/ncdoperationmanagerproxy.h Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/provider/client/inc/ncdoperationmanagerproxy.h Tue Jul 06 14:23:31 2010 +0300 @@ -63,10 +63,10 @@ // Forward declaration for silent install -// SwiUI::TInstallOptions -namespace SwiUI +// Usif::TInstallOptions +namespace Usif { - class TInstallOptions; + class COpaqueNamedParams; } /** @@ -230,7 +230,7 @@ virtual CNcdSilentInstallOperationProxy* CreateSilentInstallOperationL( CNcdNodeProxy& aNode, MNcdInstallOperationObserver* aObserverconst, - const SwiUI::TInstallOptions& aInstallOptions ); + Usif::COpaqueNamedParams* aInstallOptions ); /** diff -r 92f864ef0288 -r ae54820ef82c ncdengine/provider/client/inc/ncdsilentinstalloperationproxy.h --- a/ncdengine/provider/client/inc/ncdsilentinstalloperationproxy.h Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/provider/client/inc/ncdsilentinstalloperationproxy.h Tue Jul 06 14:23:31 2010 +0300 @@ -22,7 +22,7 @@ #include // For silent install options and options package -#include +#include #include "ncdinstalloperationproxy.h" @@ -51,7 +51,7 @@ CNcdNodeManagerProxy* aNodeManager, MNcdInstallOperationObserver* aObserver, MNcdInstallationService& aInstallationService, - const SwiUI::TInstallOptions& aInstallOptions ); + Usif::COpaqueNamedParams* aInstallOptions ); protected: // CActive @@ -70,7 +70,7 @@ * @see NewLC */ CNcdSilentInstallOperationProxy( MNcdInstallationService& aInstallationService, - const SwiUI::TInstallOptions& aInstallOptions ); + Usif::COpaqueNamedParams* aInstallOptions ); virtual ~CNcdSilentInstallOperationProxy(); @@ -99,10 +99,10 @@ virtual void UseInstallServiceL( const CNcdFileInfo& aFile ); /** - * @return const SwiUI::TInstallOptionsPckg& Contains the install options + * @return const Usif::COpaqueNamedParams* Contains the install options * for silent install in a data buffer. */ - const SwiUI::TInstallOptionsPckg& SilentInstallOptionsPackage() const; + const Usif::COpaqueNamedParams* SilentInstallOptions() const; private: // new methods @@ -114,8 +114,9 @@ private: // data + // This will contain the install options for silent install in a data buffer. - SwiUI::TInstallOptionsPckg iInstallOptionsPackage; + Usif::COpaqueNamedParams* iInstallOptions; }; diff -r 92f864ef0288 -r ae54820ef82c ncdengine/provider/client/src/ncdnodeinstallproxy.cpp --- a/ncdengine/provider/client/src/ncdnodeinstallproxy.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/provider/client/src/ncdnodeinstallproxy.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -202,14 +202,13 @@ return op; } - // --------------------------------------------------------------------------- // Creates an install operation // --------------------------------------------------------------------------- // MNcdInstallOperation* CNcdNodeInstallProxy::SilentInstallL( MNcdInstallOperationObserver& aObserver, - const SwiUI::TInstallOptions& aInstallOptions ) + Usif::COpaqueNamedParams* aInstallOptions ) { DLTRACEIN(("")); @@ -219,9 +218,12 @@ // observer. // Notice that TrustedUI capabilites are checked when silent install operation is // created in the server side. + CNcdInstallOperationProxy* op = Metadata().Node().OperationManager().CreateSilentInstallOperationL( Metadata().Node(), this, aInstallOptions ); + + iOperationObserver = &aObserver; DLTRACEOUT(("")); diff -r 92f864ef0288 -r ae54820ef82c ncdengine/provider/client/src/ncdoperationmanagerproxy.cpp --- a/ncdengine/provider/client/src/ncdoperationmanagerproxy.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/provider/client/src/ncdoperationmanagerproxy.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -442,7 +442,7 @@ CNcdSilentInstallOperationProxy* CNcdOperationManagerProxy::CreateSilentInstallOperationL( CNcdNodeProxy& aNode, MNcdInstallOperationObserver* aObserver, - const SwiUI::TInstallOptions& aInstallOptions ) + Usif::COpaqueNamedParams* aInstallOptions ) { DLTRACEIN(("")); diff -r 92f864ef0288 -r ae54820ef82c ncdengine/provider/client/src/ncdsilentinstalloperationproxy.cpp --- a/ncdengine/provider/client/src/ncdsilentinstalloperationproxy.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/provider/client/src/ncdsilentinstalloperationproxy.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -39,7 +39,7 @@ CNcdNodeManagerProxy* aNodeManager, MNcdInstallOperationObserver* aObserver, MNcdInstallationService& aInstallationService, - const SwiUI::TInstallOptions& aInstallOptions ) + Usif::COpaqueNamedParams* aInstallOptions ) { CNcdSilentInstallOperationProxy* self = new( ELeave ) CNcdSilentInstallOperationProxy( aInstallationService, @@ -59,15 +59,14 @@ // CNcdSilentInstallOperationProxy::CNcdSilentInstallOperationProxy( MNcdInstallationService& aInstallationService, - const SwiUI::TInstallOptions& aInstallOptions ) + /*const*/ Usif::COpaqueNamedParams* aInstallOptions ) : CNcdInstallOperationProxy( aInstallationService ) { // Copy all the install options into the buffer that will be used // when silent installation is delegated to the installer. - iInstallOptionsPackage = aInstallOptions; + iInstallOptions = aInstallOptions; } - // --------------------------------------------------------------------------- // Destructor // --------------------------------------------------------------------------- @@ -190,7 +189,7 @@ iFileHandle, aFile.MimeType(), aFile.Purpose(), - SilentInstallOptionsPackage() ); + SilentInstallOptions() ); break; } @@ -201,7 +200,7 @@ iFileHandle, aFile.MimeType(), aFile.Data(), - SilentInstallOptionsPackage() ); + SilentInstallOptions() ); break; } @@ -212,7 +211,7 @@ { Installer().SilentInstallWidgetL( iFileHandle, - SilentInstallOptionsPackage() ); + SilentInstallOptions() ); break; } @@ -227,9 +226,8 @@ DLTRACEOUT(("")); } - -const SwiUI::TInstallOptionsPckg& CNcdSilentInstallOperationProxy::SilentInstallOptionsPackage() const +const Usif::COpaqueNamedParams* CNcdSilentInstallOperationProxy::SilentInstallOptions() const { DLTRACEIN(("")); - return iInstallOptionsPackage; + return iInstallOptions; } diff -r 92f864ef0288 -r ae54820ef82c ncdengine/provider/deviceinteraction/inc/ncdinstallationservice.h --- a/ncdengine/provider/deviceinteraction/inc/ncdinstallationservice.h Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/provider/deviceinteraction/inc/ncdinstallationservice.h Tue Jul 06 14:23:31 2010 +0300 @@ -22,7 +22,8 @@ // SwiUI namespace contains install options // and install options package definitions // that are used for the silent install. -#include +//#include +#include #include "ncditempurpose.h" @@ -124,7 +125,7 @@ virtual void SilentInstallL( RFile& aFile, const TDesC& aMimeType, const TNcdItemPurpose& aPurpose , - const SwiUI::TInstallOptionsPckg& aInstallOptionsPckg ) = 0; + const Usif::COpaqueNamedParams* aInstallOptionsPckg ) = 0; /** @@ -134,13 +135,13 @@ virtual void SilentInstallJavaL( RFile& aFile, const TDesC& aMimeType, const TDesC8& aDescriptorData, - const SwiUI::TInstallOptionsPckg& aInstallOptionsPckg ) = 0; + const Usif::COpaqueNamedParams* aInstallOptionsPckg ) = 0; /* * Use SWI API to install widget silently. */ virtual void SilentInstallWidgetL(RFile& aFile, - const SwiUI::TInstallOptionsPckg& aInstallOptionsPckg ) = 0; + const Usif::COpaqueNamedParams* aInstallOptionsPckg ) = 0; /** * Cancels the silent installation if it is going on. diff -r 92f864ef0288 -r ae54820ef82c ncdengine/provider/deviceinteraction/inc/ncdinstallationserviceimpl.h --- a/ncdengine/provider/deviceinteraction/inc/ncdinstallationserviceimpl.h Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/provider/deviceinteraction/inc/ncdinstallationserviceimpl.h Tue Jul 06 14:23:31 2010 +0300 @@ -26,8 +26,6 @@ #include #include #include -#include -//#include #include #include @@ -123,7 +121,7 @@ void SilentInstallL( RFile& aFile, const TDesC& aMimeType, const TNcdItemPurpose& aPurpose, - const SwiUI::TInstallOptionsPckg& aInstallOptionsPckg ); + const Usif::COpaqueNamedParams* aInstallOptionsPckg ); /** * @see MNcdInstallationService::SilentInstallJavaL @@ -131,13 +129,13 @@ void SilentInstallJavaL( RFile& aFile, const TDesC& aMimeType, const TDesC8& aDescriptorData, - const SwiUI::TInstallOptionsPckg& aInstallOptionsPckg ); + const Usif::COpaqueNamedParams* aInstallOptionsPckg ); /** * @see MNcdInstallationService::SilentInstallWidgetJavaL */ void SilentInstallWidgetL( RFile& aFile, - const SwiUI::TInstallOptionsPckg& aInstallOptionsPckg ); + const Usif::COpaqueNamedParams* aInstallOptionsPckg ); /** * @see MNcdInstallationService::MNcdCancelSilentInstall @@ -295,7 +293,7 @@ void InstallL( RFile& aFile, const TDesC& aMimeType, const TNcdItemPurpose& aPurpose, - const SwiUI::TInstallOptionsPckg* aSilentInstallOptionsPckg ); + const Usif::COpaqueNamedParams* aSilentInstallOptions ); /** * @see MNcdInstallationService::InstallJavaL @@ -306,12 +304,12 @@ void InstallJavaL( RFile& aFile, const TDesC& aMimeType, const TDesC8& aDescriptorData, - const SwiUI::TInstallOptionsPckg* aSilentInstallOptionsPckg ); + const Usif::COpaqueNamedParams* aSilentInstallOptions ); void InstallWidgetL( RFile& aFile, - const SwiUI::TInstallOptionsPckg* aSilentInstallOptionsPckg ); + const Usif::COpaqueNamedParams* aSilentInstallOptions ); // Sets correct values for member variables after installation has finished @@ -448,15 +446,14 @@ CNcdActiveOperationObserver* iInstallStatusObserver; - SwiUI::RSWInstLauncher iInstaller; - + //SwiUI::RSWInstLauncher iInstaller; + Usif::RSoftwareInstall iInstaller; + Usif::COpaqueNamedParams* iArguments; + Usif::COpaqueNamedParams* iResults; + // ROM application UIDS RArray iRomUids; - // needed for cancelling install correctly - SwiUI::TServerRequest iCancelCode; - - //RWidgetRegistryClientSession iWidgetRegistry; Usif::RSoftwareComponentRegistry iScrSession; diff -r 92f864ef0288 -r ae54820ef82c ncdengine/provider/deviceinteraction/inc/ncdsilentinstallactiveobserver.h --- a/ncdengine/provider/deviceinteraction/inc/ncdsilentinstallactiveobserver.h Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/provider/deviceinteraction/inc/ncdsilentinstallactiveobserver.h Tue Jul 06 14:23:31 2010 +0300 @@ -23,7 +23,9 @@ #include #include // For silent install -#include +#include + + class MNcdAsyncSilentInstallObserver; @@ -68,20 +70,20 @@ * Sets this object active for observing a silent install operation. * * @param aFileName Installation file name. - * @param aSilentInstallOptionsPckg Silent installation options. + * @param aSilentInstallOptions Silent installation options. */ void StartToObserveL( const TDesC& aFileName, - const SwiUI::TInstallOptionsPckg& aSilentInstallOptionsPckg ); + const Usif::COpaqueNamedParams* aSilentInstallOptions ); /** * Sets this object active for observing a silent install operation. * * @param aFile Installation file handle. - * @param aSilentInstallOptionsPckg Silent installation options. + * @param aSilentInstallOptions Silent installation options. */ void StartToObserveL( RFile& aFile, - const SwiUI::TInstallOptionsPckg& aSilentInstallOptionsPckg ); + const Usif::COpaqueNamedParams* aSilentInstallOptions ); /** @@ -147,8 +149,7 @@ * that handles the installation operations that this * class object observes. Ownerhsip is not transferred. */ - SwiUI::RSWInstSilentLauncher& SilentLauncher(); - + Usif::RSoftwareInstall& SilentLauncher(); /** * Converts the given error code if necessary. @@ -176,10 +177,11 @@ // The silent launcher handles the install operations that // this class object observes. - SwiUI::RSWInstSilentLauncher iSilentLauncher; + // SwiUI::RSWInstSilentLauncher iSilentLauncher; + Usif::RSoftwareInstall iInstaller; + Usif::COpaqueNamedParams* iResults; + Usif::COpaqueNamedParams* iArguments; - SwiUI::TServerRequest iCancelCode; - }; #endif // NCD_SILENT_INSTALL_ACTIVE_OBSERVER_H diff -r 92f864ef0288 -r ae54820ef82c ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp --- a/ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -45,7 +45,7 @@ const TUint KFileOpenFlags = EFileShareReadersOrWriters; -const TInt KWidgetBundleIdLength = KMaxFileName + 1; +//const TInt KWidgetBundleIdLength = KMaxFileName + 1; // ======== CALLBACK FUNCTION ======== @@ -108,6 +108,11 @@ delete iJadFileName; delete iRecognizedMime; + delete iResults; + delete iArguments; + + iApaLs.Close(); + if( iThemes ) { @@ -138,6 +143,10 @@ void CNcdInstallationService::ConstructL() { DLTRACEIN(("")); + + iResults = 0; + iArguments = 0; + iDocHandler = CDocumentHandler::NewL(); iDocHandler->SetExitObserver( this ); @@ -224,7 +233,7 @@ void CNcdInstallationService::SilentInstallL( RFile& aFile, const TDesC& aMimeType, const TNcdItemPurpose& aPurpose, - const SwiUI::TInstallOptionsPckg& aInstallOptionsPckg ) + const Usif::COpaqueNamedParams* aInstallOptionsPckg ) { DLTRACEIN(("")); @@ -234,7 +243,7 @@ iSilentInstallActiveObserver = CNcdSilentInstallActiveObserver::NewL( *this ); } - InstallL( aFile, aMimeType, aPurpose, &aInstallOptionsPckg ); + InstallL( aFile, aMimeType, aPurpose, aInstallOptionsPckg ); DLTRACEOUT(("")); } @@ -247,7 +256,7 @@ void CNcdInstallationService::SilentInstallJavaL( RFile& aFile, const TDesC& aMimeType, const TDesC8& aDescriptorData, - const SwiUI::TInstallOptionsPckg& aInstallOptionsPckg ) + const Usif::COpaqueNamedParams* aInstallOptionsPckg ) { DLTRACEIN(("")); @@ -257,7 +266,7 @@ iSilentInstallActiveObserver = CNcdSilentInstallActiveObserver::NewL( *this ); } - InstallJavaL( aFile, aMimeType, aDescriptorData, &aInstallOptionsPckg ); + InstallJavaL( aFile, aMimeType, aDescriptorData, aInstallOptionsPckg ); DLTRACEOUT(("")); } @@ -267,7 +276,7 @@ // --------------------------------------------------------------------------- // void CNcdInstallationService::SilentInstallWidgetL( RFile& aFile, - const SwiUI::TInstallOptionsPckg& aInstallOptionsPckg ) + const Usif::COpaqueNamedParams* aInstallOptionsPckg ) { DLTRACEIN(("")); @@ -277,7 +286,7 @@ iSilentInstallActiveObserver = CNcdSilentInstallActiveObserver::NewL( *this ); } - InstallWidgetL( aFile, &aInstallOptionsPckg ); + InstallWidgetL( aFile, aInstallOptionsPckg ); DLTRACEOUT(("")); } @@ -891,7 +900,7 @@ iInstaller.Close(); - if ( aError == SwiUI::KSWInstErrUserCancel ) + if ( aError == KErrCancel ) { DLTRACE(("User cancelled, converting error to KErrAbort" ) ); aError = KErrAbort; @@ -1280,7 +1289,7 @@ void CNcdInstallationService::InstallL( RFile& aFile, const TDesC& aMimeType, const TNcdItemPurpose& aPurpose, - const SwiUI::TInstallOptionsPckg* aSilentInstallOptionsPckg ) + const Usif::COpaqueNamedParams* aSilentInstallOptions ) { DLTRACEIN(( _L("iBusy=%d, MIME: %S"),iBusy, &aMimeType )); DASSERT( iObserver ); @@ -1326,7 +1335,7 @@ aFile, *iRecognizedMime, KNullDesC8, - aSilentInstallOptionsPckg ); + aSilentInstallOptions ); return; } else if ( MatchWidget( aFile, aMimeType ) ) @@ -1334,7 +1343,7 @@ DLTRACE(("Widget")); InstallWidgetL( aFile, - aSilentInstallOptionsPckg ); + aSilentInstallOptions ); return; } @@ -1376,13 +1385,25 @@ // Start application installation. DLINFO(( "Calling doc handler Open" )); - if ( !aSilentInstallOptionsPckg ) + if ( !aSilentInstallOptions ) { DLINFO(("Normal install")); InitializeInstallerL(); - iCancelCode = SwiUI::ERequestInstallHandle; + //iCancelCode = SwiUI::ERequestInstallHandle; - iInstaller.Install( iInstallStatusObserver->iStatus, aFile ); + if ( !iArguments ) + { + iArguments = Usif::COpaqueNamedParams::NewL(); + } + if ( !iResults ) + { + iResults = Usif::COpaqueNamedParams::NewL(); + } + + iArguments->AddIntL( Usif::KSifInParam_InstallSilently, EFalse ); + + iInstaller.Install( aFile, *iArguments, *iResults, iInstallStatusObserver->iStatus ); + //iInstaller.Install( iInstallStatusObserver->iStatus, aFile ); iInstallStatusObserver->StartToObserve(); } else @@ -1392,7 +1413,7 @@ // of the silent install and it will forward the information for the callback // function of this class object. iSilentInstallActiveObserver->StartToObserveL( aFile, - *aSilentInstallOptionsPckg ); + aSilentInstallOptions ); } iBusy = ETrue; @@ -1463,7 +1484,7 @@ void CNcdInstallationService::InstallJavaL( RFile& aFile, const TDesC& /*aMimeType*/, const TDesC8& aDescriptorData, - const SwiUI::TInstallOptionsPckg* aSilentInstallOptionsPckg ) + const Usif::COpaqueNamedParams* aSilentInstallOptions ) { DLTRACEIN((_L("iBusy=%d, descriptor=%d"),iBusy, aDescriptorData.Length() )); DASSERT( iObserver ); @@ -1498,7 +1519,7 @@ iInstallType = EJavaInstall; TDataType dataType; - if ( aSilentInstallOptionsPckg == NULL ) + if ( aSilentInstallOptions == NULL ) { DLINFO(("Normal install")); InitializeInstallerL(); @@ -1506,15 +1527,40 @@ { DLTRACE(("Installing JAD+JAR")); // JAD+JAR install - iCancelCode = SwiUI::ERequestInstall; - iInstaller.Install( iInstallStatusObserver->iStatus, *iJadFileName ); + //iCancelCode = SwiUI::ERequestInstall; + if ( !iArguments ) + { + iArguments = Usif::COpaqueNamedParams::NewL(); + } + if ( !iResults ) + { + iResults = Usif::COpaqueNamedParams::NewL(); + } + + iArguments->AddIntL( Usif::KSifInParam_InstallSilently, EFalse ); + + iInstaller.Install( *iJadFileName, *iArguments, *iResults, iInstallStatusObserver->iStatus ); + //iInstaller.Install( iInstallStatusObserver->iStatus, *iJadFileName ); } else { DLTRACE(("Installing JAR")); // JAR install - iCancelCode = SwiUI::ERequestInstallHandle; - iInstaller.Install( iInstallStatusObserver->iStatus, aFile ); + //iCancelCode = SwiUI::ERequestInstallHandle; + if ( !iArguments ) + { + iArguments = Usif::COpaqueNamedParams::NewL(); + } + if ( !iResults ) + { + iResults = Usif::COpaqueNamedParams::NewL(); + } + + iArguments->AddIntL( Usif::KSifInParam_InstallSilently, EFalse ); + + iInstaller.Install( aFile, *iArguments, *iResults, iInstallStatusObserver->iStatus ); + + //iInstaller.Install( iInstallStatusObserver->iStatus, aFile ); } iInstallStatusObserver->StartToObserve(); @@ -1530,7 +1576,7 @@ // of the silent install and it will forward the information for the callback // function of this class object. iSilentInstallActiveObserver->StartToObserveL( *iJadFileName, - *aSilentInstallOptionsPckg ); + aSilentInstallOptions ); } else { @@ -1540,7 +1586,7 @@ // of the silent install and it will forward the information for the callback // function of this class object. iSilentInstallActiveObserver->StartToObserveL( aFile, - *aSilentInstallOptionsPckg ); + aSilentInstallOptions ); } } @@ -1556,7 +1602,7 @@ // void CNcdInstallationService::InstallWidgetL( RFile& aFile, - const SwiUI::TInstallOptionsPckg* aSilentInstallOptionsPckg ) + const Usif::COpaqueNamedParams* aSilentInstallOptions ) { DLTRACEIN(("")); @@ -1570,13 +1616,24 @@ // Start application installation. DLINFO(( "Calling doc handler Open" )); - if ( !aSilentInstallOptionsPckg ) + if ( !aSilentInstallOptions ) { DLINFO(("Normal install")); InitializeInstallerL(); - iCancelCode = SwiUI::ERequestInstallHandle; - - iInstaller.Install( iInstallStatusObserver->iStatus, aFile ); + //iCancelCode = SwiUI::ERequestInstallHandle; + if ( !iArguments ) + { + iArguments = Usif::COpaqueNamedParams::NewL(); + } + if ( !iResults ) + { + iResults = Usif::COpaqueNamedParams::NewL(); + } + + iArguments->AddIntL( Usif::KSifInParam_InstallSilently, EFalse ); + iInstaller.Install(aFile, *iArguments, *iResults, iInstallStatusObserver->iStatus ); + + //iInstaller.Install( iInstallStatusObserver->iStatus, aFile ); iInstallStatusObserver->StartToObserve(); } else @@ -1586,7 +1643,7 @@ // of the silent install and it will forward the information for the callback // function of this class object. iSilentInstallActiveObserver->StartToObserveL( aFile, - *aSilentInstallOptionsPckg ); + aSilentInstallOptions ); } iBusy = ETrue; @@ -1603,10 +1660,13 @@ DeletePtr( iInstallStatusObserver ); iInstallStatusObserver = CNcdActiveOperationObserver::NewL( *this ); + User::LeaveIfError( iInstaller.Connect() ); + /* if ( !iInstaller.Handle() ) { User::LeaveIfError( iInstaller.Connect() ); } + */ } @@ -1617,11 +1677,13 @@ void CNcdInstallationService::CancelInstall() { DLTRACEIN(("")); - if ( iInstallStatusObserver && - iInstaller.Handle() ) + //if ( iInstallStatusObserver && + // iInstaller.Handle() ) + if ( iInstallStatusObserver ) { DLTRACE(("Cancelling installation")); - iInstaller.CancelAsyncRequest( iCancelCode ); + iInstaller.CancelOperation(); + //iInstaller.CancelAsyncRequest( iCancelCode ); } DeletePtr( iInstallStatusObserver ); @@ -1920,7 +1982,7 @@ TUid CNcdInstallationService::InstalledMidletUidL() { - Usif::COpaqueNamedParams* iResults = 0; // to be removed + //Usif::COpaqueNamedParams* iResults = 0; // to be removed RArray appUids; TUid midletUid = KNullUid; diff -r 92f864ef0288 -r ae54820ef82c ncdengine/provider/deviceinteraction/src/ncdsilentinstallactiveobserver.cpp --- a/ncdengine/provider/deviceinteraction/src/ncdsilentinstallactiveobserver.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/ncdengine/provider/deviceinteraction/src/ncdsilentinstallactiveobserver.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -19,6 +19,8 @@ #include "ncdsilentinstallactiveobserver.h" #include "ncdasyncsilentinstallobserver.h" +#include + CNcdSilentInstallActiveObserver* CNcdSilentInstallActiveObserver::NewL( MNcdAsyncSilentInstallObserver& aObserver ) { @@ -49,6 +51,9 @@ void CNcdSilentInstallActiveObserver::ConstructL() { + + iResults = 0; + CActiveScheduler::Add( this ); } @@ -60,6 +65,9 @@ // cancel install operation and closes the silent installer. // If no operation is going on, the installer is already closed. // So, no need to close the silent launcher here separately. + + delete (iResults); + CancelAsyncOperation(); } @@ -72,12 +80,37 @@ // Notice, that we do not call the callback functions of the observer here // because we suppose that the observer has started the cancel operation itself // or the caller will inform the observer itself. - SilentLauncher().CancelAsyncRequest( iCancelCode ); + + SilentLauncher().CancelOperation(); } void CNcdSilentInstallActiveObserver::StartToObserveL( const TDesC& aFileName, - const SwiUI::TInstallOptionsPckg& aSilentInstallOptionsPckg ) + const Usif::COpaqueNamedParams* aSilentInstallOptions ) + { + // For silent installation + // Notice that if the user does not have TrustedUI capabilities + // then this will given KErrPermissionDenied. + // Connect to the launcher here just before it is needed, + // because the launcher will be shown in the application list. + // So, it would not be nice to connect in the ConstructL and to show + // the icon in the list all the time. + // User::LeaveIfError( SilentLauncher().Connect() ); + User::LeaveIfError( SilentLauncher().Connect() ); + + if (!iResults) + { + iResults = Usif::COpaqueNamedParams::NewL(); + } + + iInstaller.Install( aFileName, *aSilentInstallOptions, *iResults, iStatus ); + + + } + + +void CNcdSilentInstallActiveObserver::StartToObserveL( RFile& aFile, + const Usif::COpaqueNamedParams* aSilentInstallOptions ) { // For silent installation // Notice that if the user does not have TrustedUI capabilities @@ -86,34 +119,73 @@ // because the launcher will be shown in the application list. // So, it would not be nice to connect in the ConstructL and to show // the icon in the list all the time. + User::LeaveIfError( SilentLauncher().Connect() ); - iCancelCode = SwiUI::ERequestSilentInstall; - SilentLauncher().SilentInstall( iStatus, - aFileName, - aSilentInstallOptionsPckg ); + if (!iResults) + { + iResults = Usif::COpaqueNamedParams::NewL(); + } + /* + if (iResults) + { + delete (iResults); + iResults = 0; + } + iResults = Usif::COpaqueNamedParams::NewL(); - SetActive(); - } - + if (iArguments) + { + delete (iArguments); + iArguments = 0; + } + iArguments = Usif::COpaqueNamedParams::NewL(); -void CNcdSilentInstallActiveObserver::StartToObserveL( RFile& aFile, - const SwiUI::TInstallOptionsPckg& aSilentInstallOptionsPckg ) - { - // For silent installation - // Notice that if the user does not have TrustedUI capabilities - // then this will given KErrPermissionDenied. - // Connect to the launcher here just before it is needed, - // because the launcher will be shown in the application list. - // So, it would not be nice to connect in the ConstructL and to show - // the icon in the list all the time. - User::LeaveIfError( SilentLauncher().Connect() ); + // Silent installation request + + TBool iSet = ETrue; + + enum TSifPolicy + { + EAllowed = 0, + ENotAllowed = 1, + EUserConfirm = 2 + }; - iCancelCode = SwiUI::ERequestSilentInstallHandle; - SilentLauncher().SilentInstall( iStatus, - aFile, - aSilentInstallOptionsPckg ); - + if (iSet) + iArguments->AddIntL( Usif::KSifInParam_InstallSilently, ETrue ); + else + iArguments->AddIntL( Usif::KSifInParam_InstallSilently, EFalse ); + if (iSet) + iArguments->AddIntL( Usif::KSifInParam_PerformOCSP, Usif::ENotAllowed ); + if (iSet) + iArguments->AddIntL( Usif::KSifInParam_AllowUpgrade, Usif::EAllowed ); + if (iSet) + iArguments->AddIntL( Usif::KSifInParam_AllowUntrusted, Usif::ENotAllowed ); + if (iSet) + iArguments->AddIntL( Usif::KSifInParam_GrantCapabilities, Usif::ENotAllowed ); + if (iSet) + iArguments->AddIntL( Usif::KSifInParam_InstallOptionalItems, Usif::EAllowed ); + if (iSet) + iArguments->AddIntL( Usif::KSifInParam_IgnoreOCSPWarnings, Usif::EAllowed ); + //iArguments->AddIntL( Usif::KSifInParam_PackageInfo, ETrue ); + if (iSet) + iArguments->AddIntL( Usif::KSifInParam_AllowAppShutdown, Usif::EAllowed ); + if (iSet) + iArguments->AddIntL( Usif::KSifInParam_AllowDownload, Usif::EAllowed ); + if (iSet) + iArguments->AddIntL( Usif::KSifInParam_AllowOverwrite, Usif::EAllowed ); + + + //iArguments->AddIntL(Usif::KSifInParam_InstallSilently, 1); + //iArguments->AddIntL( Usif::KSifInParam_DisplayPackageInfo, ETrue ); + + iInstaller.Install(aFile, *iArguments, *iResults, iStatus); + */ + + iInstaller.Install( aFile, *aSilentInstallOptions, *iResults, iStatus ); + + SetActive(); } @@ -140,6 +212,15 @@ // Close the installer. // The launcher is shown in the application list. // So, it would not be nice to leave it there after operation is completed. + + + TInt ErrCategory = 0; + TInt ErrCode = 0; + TInt ExtendedErrCode =0; + + TBool ret = iResults->GetIntByNameL(Usif::KSifOutParam_ErrCategory, ErrCategory); + ret = iResults->GetIntByNameL(Usif::KSifOutParam_ErrCode, ErrCode); + ret = iResults->GetIntByNameL(Usif::KSifOutParam_ExtendedErrCode, ExtendedErrCode); SilentLauncher().Close(); TInt errorCode( ConvertErrorCode( iStatus.Int() ) ); @@ -154,15 +235,16 @@ return iObserver; } - -SwiUI::RSWInstSilentLauncher& CNcdSilentInstallActiveObserver::SilentLauncher() +Usif::RSoftwareInstall& CNcdSilentInstallActiveObserver::SilentLauncher() { - return iSilentLauncher; + // return iSilentLauncher; + return iInstaller; } TInt CNcdSilentInstallActiveObserver::ConvertErrorCode( TInt aErrorCode ) { + /* switch ( aErrorCode ) { case SwiUI::KSWInstErrUserCancel: @@ -181,7 +263,8 @@ // Nothing to do here. break; } - + */ + return aErrorCode; } diff -r 92f864ef0288 -r ae54820ef82c secureswitools/makekeys/group/bld.inf --- a/secureswitools/makekeys/group/bld.inf Wed Jun 23 18:20:02 2010 +0300 +++ b/secureswitools/makekeys/group/bld.inf Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -23,19 +23,14 @@ */ PRJ_PLATFORMS -TOOLS +TOOLS2 PRJ_EXPORTS PRJ_MMPFILES -#ifdef TOOLS -#ifndef TOOLS2 -#ifdef MSVCDOTNET -makefile ../src/makekeys.net.fil -#else //!MSVCDOTNET -makefile ../src/makekeys.fil -#endif // MSVCDOTNET -#endif // TOOLS2 -#endif // TOOLS -PRJ_TESTMMPFILES +#ifdef TOOLS2 +#ifndef TOOLS2_LINUX +makekeys.mmp +#endif +#endif diff -r 92f864ef0288 -r ae54820ef82c secureswitools/makekeys/group/makekeys.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/secureswitools/makekeys/group/makekeys.mmp Tue Jul 06 14:23:31 2010 +0300 @@ -0,0 +1,51 @@ +/* +* 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 the License "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: +* This mmp file is used to replace calling makefile directly. +* +*/ + + +TARGET makekeys.exe +TARGETTYPE exe + + +USERINCLUDE ../../swisistools/source/makesis + +MW_LAYER_SYSTEMINCLUDE_SYMBIAN +SYSTEMINCLUDE ../../openssllib/import/inc + + +SOURCEPATH ../src +SOURCE CertificateGenerator.cpp +SOURCE CertificateRequestGenerator.cpp +SOURCE DSAKeyGenerator.cpp +SOURCE KeyGenerator.cpp +SOURCE MAKEKEYS.CPP +SOURCE PARSECMD.CPP +SOURCE RSAKeyGenerator.cpp +SOURCE UTILS.CPP + + +#ifndef TOOLS2_LINUX + MACRO _UNICODE _CONSOLE _STLP_THREADS _WIN32 UNICODE +#else + MACRO _UNICODE _CONSOLE UNICODE +#endif + +STATICLIBRARY eay32 + +OPTION GCC -w +OPTION GCC -fno-stack-check +OPTION GCC -fpermissive diff -r 92f864ef0288 -r ae54820ef82c secureswitools/makekeys/src/MAKEKEYS.CPP --- a/secureswitools/makekeys/src/MAKEKEYS.CPP Wed Jun 23 18:20:02 2010 +0300 +++ b/secureswitools/makekeys/src/MAKEKEYS.CPP Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -56,7 +56,7 @@ :m_fVerbose(FALSE) { ; } -int CMakeKeys::Run(const int argc, const _TCHAR *argv[], const _TCHAR *envp[]) +int CMakeKeys::Run(const int argc, const _TCHAR *argv[]) // Inputs : argc, argv, envp - The command line passed to the process { BOOL bValid = TRUE; @@ -117,6 +117,7 @@ OUT << _T("Warning: the private key should be encrypted with the -password option") << endl; OUT << _T("Do you want to use a password (y/n)? "); + OUT.flush(); cin >> Warn; @@ -166,6 +167,7 @@ OUT << _T("Warning: the private key should be encrypted with the -password option") << endl; OUT << _T("Do you want to use a password (y/n)? "); + OUT.flush(); cin >> Warn; @@ -296,9 +298,13 @@ // main function - constructs a CMakeKeys object and calls it's run method extern "C" { - int _tmain(int argc, const _TCHAR *argv[], const _TCHAR *envp[]) + int main(int argc, const char *argv[], const char *envp[]) { + // MingW doesn't support _tmain(), + // so using GetCommandLineW() to get wide args. + wchar_t** argvW = CommandLineToArgvW( GetCommandLineW(), &argc); + CMakeKeys app; - return app.Run(argc, argv, envp); + return app.Run(argc, argvW); } } diff -r 92f864ef0288 -r ae54820ef82c secureswitools/makekeys/src/MAKEKEYS.H --- a/secureswitools/makekeys/src/MAKEKEYS.H Wed Jun 23 18:20:02 2010 +0300 +++ b/secureswitools/makekeys/src/MAKEKEYS.H Tue Jul 06 14:23:31 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -53,7 +53,7 @@ public: CMakeKeys(); - int Run(const int argc, const _TCHAR *argv[], const _TCHAR *envp[]); + int Run(const int argc, const _TCHAR *argv[]); public: CKeyGenerator* m_KeyGen; diff -r 92f864ef0288 -r ae54820ef82c secureswitools/swianalysistoolkit/group/bld.inf --- a/secureswitools/swianalysistoolkit/group/bld.inf Wed Jun 23 18:20:02 2010 +0300 +++ b/secureswitools/swianalysistoolkit/group/bld.inf Tue Jul 06 14:23:31 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 the License "Eclipse Public License v1.0" @@ -22,27 +22,24 @@ */ PRJ_PLATFORMS -DEFAULT TOOLS -TOOLS2 +DEFAULT TOOLS2 +TOOLS PRJ_MMPFILES -#ifdef TOOLS -#ifndef TOOLS2 -#ifdef SYMBIAN_OLD_EXPORT_LOCATION -makefile ../source/chainvalidityandinstallfilestatustools/dumpchainvaliditytool/dumpchainvaliditytool.fil -#else -makefile ../source/chainvalidityandinstallfilestatustools/dumpchainvaliditytool/dumpchainvaliditytool2.fil +#ifdef TOOLS2 +#ifndef TOOLS2_LINUX +dumpchainvaliditytool.mmp +dumpinstallfilestatustool.mmp +dumpswicertstoretool.mmp +#endif #endif -makefile ../source/chainvalidityandinstallfilestatustools/dumpinstallfilestatustool/dumpinstallfilestatustool.fil -makefile ../source/dumpswicertstoretool/dumpswicertstoretool.fil #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#ifdef TOOLS makefile ../source/dumpswiregistrytool/dumpswiregistrytool.fil #endif - -#endif #endif @@ -186,7 +183,7 @@ ../test/tdumpregistry/dumpregistry-output/a0000206.out /epoc32/winscw/c/tswi/tdumpregistry/dumpregistry-output/a0000206.out ../test/tdumpregistry/dumpregistry-output/a0000206.tmp /epoc32/winscw/c/tswi/tdumpregistry/dumpregistry-output/a0000206.tmp ../test/tdumpregistry/testregistry.pl /epoc32/winscw/c/tswi/tdumpregistry/testregistry.pl - +#endif // tdumpcertstore ../test/tdumpcertstore/certstore.bat /epoc32/winscw/c/tswi/tdumpcertstore/certstore.bat @@ -220,5 +217,4 @@ ../test/tdumpcertstore/predumpcertstoretest.bat /epoc32/winscw/c/tswi/tdumpcertstore/predumpcertstoretest.bat ../test/tdumpcertstore/postdumpcertstoretest.bat /epoc32/winscw/c/tswi/tdumpcertstore/postdumpcertstoretest.bat ../test/tdumpcertstore/testswicertstore.pl /epoc32/winscw/c/tswi/tdumpcertstore/testswicertstore.pl -#endif // End of file diff -r 92f864ef0288 -r ae54820ef82c secureswitools/swianalysistoolkit/group/dumpchainvaliditytool.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/secureswitools/swianalysistoolkit/group/dumpchainvaliditytool.mmp Tue Jul 06 14:23:31 2010 +0300 @@ -0,0 +1,56 @@ +/* +* 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 the License "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: +* This mmp file is used to replace calling makefile directly. +* +*/ + + +TARGET dumpchainvaliditytool.exe +TARGETTYPE exe + + +USERINCLUDE ../source/chainvalidityandinstallfilestatustools/dumpchainvaliditytool +USERINCLUDE ../source/chainvalidityandinstallfilestatustools/common +USERINCLUDE ../source/common +USERINCLUDE ../../swisistools/source/makesis +USERINCLUDE ../../swisistools/source/common + +MW_LAYER_SYSTEMINCLUDE_SYMBIAN +SYSTEMINCLUDE ../../openssllib/import/inc + +SOURCEPATH ../source/chainvalidityandinstallfilestatustools + +SOURCE ./dumpchainvaliditytool/dumpchainvalidity.cpp +SOURCE ./dumpchainvaliditytool/options.cpp +SOURCE ./common/certificatechain.cpp +SOURCE ./common/dumpchainvaliditytool.cpp +SOURCE ./common/launchprocess.cpp +SOURCE ./common/siscertificatechain.cpp +SOURCE ./common/swicertstore.cpp +SOURCE ../common/osinterface.cpp + +#ifndef TOOLS2_LINUX + MACRO _UNICODE _CONSOLE _STLP_THREADS _WIN32 GENERATE_ERRORS DUMPCHAINVALIDITYTOOL //UNICODE +#else + MACRO _UNICODE _CONSOLE UNICODE GENERATE_ERRORS DUMPCHAINVALIDITYTOOL +#endif + +STATICLIBRARY eay32 +STATICLIBRARY shlwapi + +OPTION GCC -w +OPTION GCC -fno-stack-check +OPTION GCC -fpermissive + diff -r 92f864ef0288 -r ae54820ef82c secureswitools/swianalysistoolkit/group/dumpinstallfilestatustool.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/secureswitools/swianalysistoolkit/group/dumpinstallfilestatustool.mmp Tue Jul 06 14:23:31 2010 +0300 @@ -0,0 +1,57 @@ +/* +* 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 the License "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: +* This mmp file is used to replace calling makefile directly. +* +*/ + + +TARGET dumpinstallfilestatustool.exe +TARGETTYPE exe + + +USERINCLUDE ../source/chainvalidityandinstallfilestatustools/dumpinstallfilestatustool +USERINCLUDE ../source/chainvalidityandinstallfilestatustools/common +USERINCLUDE ../source/common +USERINCLUDE ../../swisistools/source/makesis +USERINCLUDE ../../swisistools/source/common + +MW_LAYER_SYSTEMINCLUDE_SYMBIAN +SYSTEMINCLUDE ../../openssllib/import/inc + +SOURCEPATH ../source/chainvalidityandinstallfilestatustools + +SOURCE ./dumpinstallfilestatustool/dumpinstallfilestatustool.cpp +SOURCE ./dumpinstallfilestatustool/sisfiledata.cpp +SOURCE ./dumpinstallfilestatustool/options.cpp +SOURCE ./common/certificatechain.cpp +SOURCE ./common/dumpchainvaliditytool.cpp +SOURCE ./common/launchprocess.cpp +SOURCE ./common/siscertificatechain.cpp +SOURCE ./common/swicertstore.cpp +SOURCE ../common/osinterface.cpp + +#ifndef TOOLS2_LINUX + MACRO _UNICODE _CONSOLE _STLP_THREADS _WIN32 GENERATE_ERRORS DUMPINSTALLFILESTATUSTOOL //UNICODE +#else + MACRO _UNICODE _CONSOLE UNICODE GENERATE_ERRORS DUMPINSTALLFILESTATUSTOOL +#endif + +STATICLIBRARY eay32 +STATICLIBRARY shlwapi + +OPTION GCC -w +OPTION GCC -fno-stack-check +OPTION GCC -fpermissive + diff -r 92f864ef0288 -r ae54820ef82c secureswitools/swianalysistoolkit/group/dumpswicertstoretool.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/secureswitools/swianalysistoolkit/group/dumpswicertstoretool.mmp Tue Jul 06 14:23:31 2010 +0300 @@ -0,0 +1,62 @@ +/* +* 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 the License "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: +* This mmp file is used to replace calling makefile directly. +* +*/ + + +TARGET dumpswicertstoretool.exe +TARGETTYPE exe + +USERINCLUDE ../source/dumpswicertstoretool +USERINCLUDE ../source/common +USERINCLUDE ../source/common/utf8 +USERINCLUDE ../../swisistools/source/makesis + +MW_LAYER_SYSTEMINCLUDE_SYMBIAN +SYSTEMINCLUDE ../../openssllib/import/inc + + +SOURCEPATH ../source/common/utf8 +SOURCE utf8.cpp + +SOURCEPATH ../source/common +SOURCE osinterface.cpp +SOURCE ucmp.cpp +SOURCE streamreader.cpp + +SOURCEPATH ../source/dumpswicertstoretool + +SOURCE certificate.cpp +SOURCE datalocator.cpp +SOURCE options.cpp +SOURCE pfsdump.cpp +SOURCE dumpswicertstoretool.cpp +SOURCE swicertstoremetadata.cpp + + +#ifndef TOOLS2_LINUX + MACRO _UNICODE _CONSOLE _STLP_THREADS _WIN32 _MBCS DUMPSWICERTSTORETOOL +#else + MACRO _UNICODE _CONSOLE UNICODE DUMPSWICERTSTORETOOL + STATICLIBRARY crypto +#endif + +STATICLIBRARY eay32 +STATICLIBRARY shlwapi + +OPTION GCC -w +OPTION GCC -fno-stack-check +OPTION GCC -fpermissive diff -r 92f864ef0288 -r ae54820ef82c secureswitools/swianalysistoolkit/source/chainvalidityandinstallfilestatustools/common/certificatechain.cpp --- a/secureswitools/swianalysistoolkit/source/chainvalidityandinstallfilestatustools/common/certificatechain.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/secureswitools/swianalysistoolkit/source/chainvalidityandinstallfilestatustools/common/certificatechain.cpp Tue Jul 06 14:23:31 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 the License "Eclipse Public License v1.0" @@ -450,7 +450,7 @@ capabilities.append("Unknown"+capability); } - iDevCapabilities += pow(2,capability); + iDevCapabilities += pow((double)2,capability); } capability++; } @@ -540,7 +540,7 @@ buf[j] = *(buffer++); } - deviceId.append(buf); + deviceId.assign(buf,(KDeviceIdLength-2)); deviceId.append("\n"); } } diff -r 92f864ef0288 -r ae54820ef82c secureswitools/swianalysistoolkit/source/chainvalidityandinstallfilestatustools/dumpinstallfilestatustool/dumpinstallfilestatustool.cpp --- a/secureswitools/swianalysistoolkit/source/chainvalidityandinstallfilestatustools/dumpinstallfilestatustool/dumpinstallfilestatustool.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/secureswitools/swianalysistoolkit/source/chainvalidityandinstallfilestatustools/dumpinstallfilestatustool/dumpinstallfilestatustool.cpp Tue Jul 06 14:23:31 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 the License "Eclipse Public License v1.0" @@ -15,7 +15,7 @@ * */ - +#include #include "dumpinstallfilestatustool.h" #include "osinterface.h" #ifdef _MSC_VER diff -r 92f864ef0288 -r ae54820ef82c secureswitools/swianalysistoolkit/source/chainvalidityandinstallfilestatustools/dumpinstallfilestatustool/options.cpp --- a/secureswitools/swianalysistoolkit/source/chainvalidityandinstallfilestatustools/dumpinstallfilestatustool/options.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/secureswitools/swianalysistoolkit/source/chainvalidityandinstallfilestatustools/dumpinstallfilestatustool/options.cpp Tue Jul 06 14:23:31 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 the License "Eclipse Public License v1.0" @@ -263,7 +263,7 @@ { if(capabilities.compare(listOfCapabilities[i])==0) { - userCaps += pow(2,i); + userCaps += pow((double)2,i); } } } diff -r 92f864ef0288 -r ae54820ef82c secureswitools/swianalysistoolkit/source/common/streamreader.cpp --- a/secureswitools/swianalysistoolkit/source/common/streamreader.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/secureswitools/swianalysistoolkit/source/common/streamreader.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -225,7 +225,7 @@ // This memory will be freed by the caller of this function char *ptrUtf8 = new char[targetLength + 1]; - UTF16* sourceStart = static_cast(aSource); + UTF16* sourceStart = reinterpret_cast(aSource); UTF16* sourceEnd = sourceStart + aSrcLength; UTF8* targetStart = reinterpret_cast(ptrUtf8); UTF8* targetEnd; diff -r 92f864ef0288 -r ae54820ef82c secureswitools/swianalysistoolkit/source/dumpswicertstoretool/pfsdump.cpp --- a/secureswitools/swianalysistoolkit/source/dumpswicertstoretool/pfsdump.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/secureswitools/swianalysistoolkit/source/dumpswicertstoretool/pfsdump.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -206,7 +206,8 @@ Stream StoreFile::RootStream() { Toc::Head const& head=iToc.Header(); - return FindStream(head.Root()); + Handle hndl = static_cast(head.Root()); + return FindStream(hndl); } Stream StoreFile::FindStream(Handle& aHandle) diff -r 92f864ef0288 -r ae54820ef82c secureswitools/swianalysistoolkit/source/dumpswicertstoretool/swicertstoremetadata.cpp --- a/secureswitools/swianalysistoolkit/source/dumpswicertstoretool/swicertstoremetadata.cpp Wed Jun 23 18:20:02 2010 +0300 +++ b/secureswitools/swianalysistoolkit/source/dumpswicertstoretool/swicertstoremetadata.cpp Tue Jul 06 14:23:31 2010 +0300 @@ -143,7 +143,7 @@ capability.append("Unknown"+unknownIndex); unknownIndex++; } - cap += pow(2,j); + cap += pow((double)2,j); } else {