197 FLOG(_L("CFotaServer::StartDownloadDialog >>")); |
198 FLOG(_L("CFotaServer::StartDownloadDialog >>")); |
198 //The dialog should not timeout here. |
199 //The dialog should not timeout here. |
199 if (!iFullScreenDialog) |
200 if (!iFullScreenDialog) |
200 { |
201 { |
201 //ConstructApplicationUI(ETrue); |
202 //ConstructApplicationUI(ETrue); |
202 iFullScreenDialog = new FotaFullscreenDialog(this); |
203 iFullScreenDialog = new HbFotaFullscreenDialog(this); |
203 } |
204 } |
204 |
205 |
205 iFullScreenDialog->SetSoftwareDetails(aSize, aVersion, aName); |
206 iFullScreenDialog->setSoftwareDetails(aSize, aVersion, aName); |
206 |
207 |
207 iFullScreenDialog->SetWarningDetails(EHbFotaDownload); |
208 iFullScreenDialog->setWarningDetails(EHbFotaDownload); |
208 |
209 |
209 TBool postpone = IsUserPostponeAllowed(); |
210 TBool postpone = IsUserPostponeAllowed(); |
210 if (!postpone) |
211 if (!postpone) |
211 { |
212 { |
212 FLOG(_L("Disabling option to resume later!")); |
213 FLOG(_L("Disabling option to resume later!")); |
213 iFullScreenDialog->DisableRSK(ETrue); |
214 iFullScreenDialog->disableRSK(ETrue); |
214 } |
215 } |
215 |
216 |
216 FLOG(_L("CFotaServer::StartDownloadDialog <<")); |
217 FLOG(_L("CFotaServer::StartDownloadDialog <<")); |
217 } |
218 } |
218 |
219 |
227 iPackageState.iPkgVersion); |
228 iPackageState.iPkgVersion); |
228 StartDownloadDialog(name, version, iPackageState.iPkgSize); |
229 StartDownloadDialog(name, version, iPackageState.iPkgSize); |
229 ConstructApplicationUI(ETrue); |
230 ConstructApplicationUI(ETrue); |
230 } |
231 } |
231 |
232 |
232 iFullScreenDialog->UpdateProgressBar(aProgress); |
233 iFullScreenDialog->updateProgressBar(aProgress); |
233 FLOG(_L("CFotaServer::UpdateDownloadDialog <<")); |
234 FLOG(_L("CFotaServer::UpdateDownloadDialog <<")); |
234 } |
235 } |
235 |
236 |
236 void CFotaServer::ShowDialogL(TFwUpdNoteTypes adialogid) |
237 void CFotaServer::ShowDialogL(TFwUpdNoteTypes adialogid) |
237 { |
238 { |
268 CleanupStack::PushL(keyParam4); |
268 CleanupStack::PushL(keyParam4); |
269 *keyParam4 = KKeyParam4; |
269 *keyParam4 = KKeyParam4; |
270 |
270 |
271 CHbSymbianVariant* dialogId = CHbSymbianVariant::NewL(&adialogid, |
271 CHbSymbianVariant* dialogId = CHbSymbianVariant::NewL(&adialogid, |
272 CHbSymbianVariant::EInt); |
272 CHbSymbianVariant::EInt); |
273 CleanupStack::PushL(dialogId); |
273 //CleanupStack::PushL(dialogId); |
274 iNotifParams->Add(*keyDialog, dialogId); |
274 iNotifParams->Add(*keyDialog, dialogId); |
275 |
|
276 if (!iNotifier) |
|
277 iNotifier = CFotaDownloadNotifHandler::NewL(this); |
|
278 |
275 |
279 switch (adialogid) |
276 switch (adialogid) |
280 { |
277 { |
281 case EFwUpdNotEnoughBattery: |
278 case EFwUpdNotEnoughBattery: |
282 case EFwUpdDeviceBusy: |
279 case EFwUpdDeviceBusy: |
289 case EFwUpdResumeDownload: |
286 case EFwUpdResumeDownload: |
290 { |
287 { |
291 FLOG(_L("CFotaServer::EFwUpdResumeUpdate / EFwUpdResumeDownload")); |
288 FLOG(_L("CFotaServer::EFwUpdResumeUpdate / EFwUpdResumeDownload")); |
292 CHbSymbianVariant* param1Val = CHbSymbianVariant::NewL( |
289 CHbSymbianVariant* param1Val = CHbSymbianVariant::NewL( |
293 &iPackageState.iPkgSize, CHbSymbianVariant::EInt); |
290 &iPackageState.iPkgSize, CHbSymbianVariant::EInt); |
294 CleanupStack::PushL(param1Val); |
291 //CleanupStack::PushL(param1Val); |
295 iNotifParams->Add(*keyParam1, param1Val); |
292 iNotifParams->Add(*keyParam1, param1Val); |
296 TBuf16<KFotaMaxPkgNameLength> temp1; |
293 TBuf16<KFotaMaxPkgNameLength> temp1; |
297 temp1.Copy(iPackageState.iPkgVersion); |
294 temp1.Copy(iPackageState.iPkgVersion); |
298 CHbSymbianVariant* param2Val = CHbSymbianVariant::NewL( |
295 CHbSymbianVariant* param2Val = CHbSymbianVariant::NewL( |
299 //&iPackageState.iPkgVersion, CHbSymbianVariant::EDes); |
296 //&iPackageState.iPkgVersion, CHbSymbianVariant::EDes); |
300 &temp1, CHbSymbianVariant::EDes); |
297 &temp1, CHbSymbianVariant::EDes); |
301 CleanupStack::PushL(param2Val); |
298 //CleanupStack::PushL(param2Val); |
302 iNotifParams->Add(*keyParam2, param2Val); |
299 iNotifParams->Add(*keyParam2, param2Val); |
303 TBuf16<KFotaMaxPkgNameLength> temp2; |
300 TBuf16<KFotaMaxPkgNameLength> temp2; |
304 temp2.Copy(iPackageState.iPkgName); |
301 temp2.Copy(iPackageState.iPkgName); |
305 CHbSymbianVariant* param3Val = CHbSymbianVariant::NewL( |
302 CHbSymbianVariant* param3Val = CHbSymbianVariant::NewL( |
306 &temp2, CHbSymbianVariant::EDes); |
303 &temp2, CHbSymbianVariant::EDes); |
307 CleanupStack::PushL(param3Val); |
304 //CleanupStack::PushL(param3Val); |
308 iNotifParams->Add(*keyParam3, param3Val); |
305 iNotifParams->Add(*keyParam3, param3Val); |
309 TBool postpone = IsUserPostponeAllowed(); |
306 TBool postpone = IsUserPostponeAllowed(); |
310 CHbSymbianVariant* param4Val = CHbSymbianVariant::NewL(&postpone, |
307 CHbSymbianVariant* param4Val = CHbSymbianVariant::NewL(&postpone, |
311 CHbSymbianVariant::EInt); |
308 CHbSymbianVariant::EInt); |
312 CleanupStack::PushL(param4Val); |
309 //CleanupStack::PushL(param4Val); |
313 iNotifParams->Add(*keyParam4, param4Val); |
310 iNotifParams->Add(*keyParam4, param4Val); |
314 iNotifier->LaunchNotifierL(iNotifParams, adialogid); |
311 iNotifier->LaunchNotifierL(iNotifParams, adialogid); |
315 CleanupStack::PopAndDestroy(4); |
312 //CleanupStack::PopAndDestroy(4); |
316 |
313 |
317 } |
314 } |
318 break; |
315 break; |
319 |
316 |
320 default: |
317 default: |
451 |
438 |
452 if (!iFullScreenDialog) |
439 if (!iFullScreenDialog) |
453 { |
440 { |
454 const QString ver = QString::fromUtf8( reinterpret_cast<const char*> (iPackageState.iPkgVersion.Ptr()), iPackageState.iPkgVersion.Length()); |
441 const QString ver = QString::fromUtf8( reinterpret_cast<const char*> (iPackageState.iPkgVersion.Ptr()), iPackageState.iPkgVersion.Length()); |
455 const QString name = QString::fromUtf8( reinterpret_cast<const char*> (iPackageState.iPkgName.Ptr()), iPackageState.iPkgName.Length()); |
442 const QString name = QString::fromUtf8( reinterpret_cast<const char*> (iPackageState.iPkgName.Ptr()), iPackageState.iPkgName.Length()); |
456 iFullScreenDialog = new FotaFullscreenDialog(this); |
443 iFullScreenDialog = new HbFotaFullscreenDialog(this); |
457 |
444 |
458 iFullScreenDialog->SetSoftwareDetails(iPackageState.iPkgSize, ver, name); |
445 iFullScreenDialog->setSoftwareDetails(iPackageState.iPkgSize, ver, name); |
459 iFullScreenDialog->SetWarningDetails(EHbFotaDownload); |
446 iFullScreenDialog->setWarningDetails(EHbFotaDownload); |
460 ConstructApplicationUI(ETrue); |
447 ConstructApplicationUI(ETrue); |
461 } |
448 } |
462 |
449 |
463 if (aType == EHbFotaUpdate) |
450 if (aType == EHbFotaUpdate) |
464 { |
451 { |
465 iFullScreenDialog->UpdateProgressBar(100); |
452 iFullScreenDialog->updateProgressBar(100); |
466 TBool postpone = IsUserPostponeAllowed(); |
453 TBool postpone = IsUserPostponeAllowed(); |
467 if (!postpone) |
454 if (!postpone) |
468 { |
455 { |
469 FLOG(_L("Disabling option to resume later!")); |
456 FLOG(_L("Disabling option to resume later!")); |
470 iFullScreenDialog->DisableRSK(ETrue); |
457 iFullScreenDialog->disableRSK(ETrue); |
471 } |
458 } |
472 |
459 |
473 iFullScreenDialog->ShowUpdateDialog(); |
460 iFullScreenDialog->showUpdateDialog(); |
474 } |
461 } |
475 else if (aType == EHbFotaLowBattery) |
462 else if (aType == EHbFotaLowBattery) |
476 { |
463 { |
477 iFullScreenDialog->UpdateProgressBar(100); |
464 iFullScreenDialog->updateProgressBar(100); |
478 iFullScreenDialog->DisableRSK(EFalse); |
465 iFullScreenDialog->disableRSK(EFalse); |
479 iFullScreenDialog->SetWarningDetails(EHbFotaLowBattery); |
466 iFullScreenDialog->setWarningDetails(EHbFotaLowBattery); |
480 } |
467 } |
481 |
468 |
482 FLOG(_L("CFotaServer::ShowFullScreenDialog <<")); |
469 FLOG(_L("CFotaServer::ShowFullScreenDialog <<")); |
483 } |
470 } |
484 |
471 |
605 CServer2(EPriorityStandard, EUnsharableSessions) /*CServer2(0)*/, |
592 CServer2(EPriorityStandard, EUnsharableSessions) /*CServer2(0)*/, |
606 iDatabase(0), iInitialized(EFalse), iDownloader(0), iUpdater(0), |
593 iDatabase(0), iInitialized(EFalse), iDownloader(0), iUpdater(0), |
607 iDownloadFinalizer(0), iUpdateFinalizer(0), iTimedExecuteResultFile(0), iTimedSMLSessionClose(0), |
594 iDownloadFinalizer(0), iUpdateFinalizer(0), iTimedExecuteResultFile(0), iTimedSMLSessionClose(0), |
608 iAppShutter(0), iMonitor(NULL), iSyncMLAttempts(0), iSyncJobId(-1),iRetryingGASend(EFalse), |
595 iAppShutter(0), iMonitor(NULL), iSyncMLAttempts(0), iSyncJobId(-1),iRetryingGASend(EFalse), |
609 iNetworkAvailable(EFalse),iFullScreenDialog(NULL), iNotifParams(NULL), iNotifier(NULL), |
596 iNetworkAvailable(EFalse),iFullScreenDialog(NULL), iNotifParams(NULL), iNotifier(NULL), |
610 iServerCanShut(EFalse), iAsyncOperation(EFalse),iDialogId (0), iConstructed(EFalse), iMainwindow(mainwindow) |
597 iServerCanShut(EFalse), iAsyncOperation(EFalse), iConstructed(EFalse), iMainwindow(mainwindow) |
611 { |
598 { |
612 RProcess pr; |
599 RProcess pr; |
613 TFullName fn = pr.FullName(); |
600 TFullName fn = pr.FullName(); |
614 TUint prid = pr.Id(); |
601 TUint prid = pr.Id(); |
615 FLOG(_L( "CFotaServer::CFotaServer process(id %d)%S. this 0x%x"), prid, |
602 FLOG(_L( "CFotaServer::CFotaServer process(id %d)%S. this 0x%x"), prid, |
750 FLOG(_L(" 1 got state id:%d state:%d result:%d"), tmp.iPkgId, |
739 FLOG(_L(" 1 got state id:%d state:%d result:%d"), tmp.iPkgId, |
751 tmp.iState, tmp.iResult); |
740 tmp.iState, tmp.iResult); |
752 |
741 |
753 //Download was started earlier and was interrupted. |
742 //Download was started earlier and was interrupted. |
754 if (tmp.iState == RFotaEngineSession::EStartingUpdate || tmp.iState |
743 if (tmp.iState == RFotaEngineSession::EStartingUpdate || tmp.iState |
755 == RFotaEngineSession::EDownloadProgressing || tmp.iState |
|
756 == RFotaEngineSession::EDownloadProgressing) |
744 == RFotaEngineSession::EDownloadProgressing) |
757 |
745 |
758 { |
746 { |
759 TBool ispkgvalid = ETrue; |
747 TBool ispkgvalid = ETrue; |
760 //Software version check from the time download started. |
748 //Software version check from the time download started. |
935 else if (iPackageState.iState == RFotaEngineSession::EDownloadProgressing) |
923 else if (iPackageState.iState == RFotaEngineSession::EDownloadProgressing) |
936 { |
924 { |
937 FLOG(_L("Download has paused due to an error. Invoking FMS...")); |
925 FLOG(_L("Download has paused due to an error. Invoking FMS...")); |
938 if (iFullScreenDialog) |
926 if (iFullScreenDialog) |
939 { |
927 { |
940 iFullScreenDialog->Close(); |
928 iFullScreenDialog->close(); |
941 iFullScreenDialog->deleteLater(); |
929 iFullScreenDialog->deleteLater(); |
942 iFullScreenDialog = NULL; |
930 iFullScreenDialog = NULL; |
943 } |
931 } |
944 SetStartupReason(EFotaDownloadInterrupted); |
932 SetStartupReason(EFotaDownloadInterrupted); |
945 InvokeFmsL(); |
933 InvokeFmsL(); |