41 #include "iaupdatebgconst.h" |
41 #include "iaupdatebgconst.h" |
42 |
42 |
43 //MACROS |
43 //MACROS |
44 _LIT8( KRefreshFromNetworkDenied, "1" ); |
44 _LIT8( KRefreshFromNetworkDenied, "1" ); |
45 _LIT(KIAUpdateLauncherExe, "iaupdatelauncher.exe" ); |
45 _LIT(KIAUpdateLauncherExe, "iaupdatelauncher.exe" ); |
46 _LIT8( KFirstTimeCase, "0" ); |
|
47 |
46 |
48 //CONSTANTS |
47 //CONSTANTS |
49 const TUint KIADUpdateLauncherUid( 0x2001FE2F ); |
48 const TUint KIADUpdateLauncherUid( 0x2001FE2F ); |
50 |
49 |
51 // ---------------------------------------------------------- |
50 // ---------------------------------------------------------- |
79 |
78 |
80 iInternalFile = CIAUpdateBGInternalFileHandler::NewL(); |
79 iInternalFile = CIAUpdateBGInternalFileHandler::NewL(); |
81 |
80 |
82 iSoftNotification = CIAUpdateBGSoftNotification::NewL( this ); |
81 iSoftNotification = CIAUpdateBGSoftNotification::NewL( this ); |
83 |
82 |
|
83 iIndicatorNotifyHandler = CIAUpdateBGNotifyHandler::NewL(); |
|
84 |
84 // loc: initialize localisation text loader |
85 // loc: initialize localisation text loader |
85 /* |
86 /* |
86 TBool res = HbTextResolverSymbian::Init(KLocFile, KLocFilePath); |
87 TBool res = HbTextResolverSymbian::Init(KLocFile, KLocFilePath); |
87 if ( res != KErrNone ) |
88 if ( res != KErrNone ) |
88 { |
89 { |
108 |
109 |
109 delete iIAUpdateCRSession; |
110 delete iIAUpdateCRSession; |
110 delete iControllerFile; |
111 delete iControllerFile; |
111 delete iInternalFile; |
112 delete iInternalFile; |
112 delete iSoftNotification; |
113 delete iSoftNotification; |
|
114 delete iIndicatorNotifyHandler; |
113 |
115 |
114 } |
116 } |
115 |
117 |
116 // ---------------------------------------------------------- |
118 // ---------------------------------------------------------- |
117 // CIAUpdateBGTimer::StartProcessL() |
119 // CIAUpdateBGTimer::StartProcessL() |
118 // ---------------------------------------------------------- |
120 // ---------------------------------------------------------- |
119 void CIAUpdateBGTimer::StartProcessL() |
121 void CIAUpdateBGTimer::StartProcessL() |
120 { |
122 { |
121 FLOG("[bgchecker] StartProcessL"); |
123 FLOG("[bgchecker] StartProcessL"); |
122 |
124 |
|
125 // start listening indicator remove |
|
126 iIndicatorNotifyHandler->StartListeningL( this ); |
|
127 |
|
128 |
123 iMode = ModeL(); |
129 iMode = ModeL(); |
124 |
130 |
125 switch ( iMode ) |
131 switch ( iMode ) |
126 { |
132 { |
127 case EFirstTimeMode: |
133 case EFirstTimeMode: |
443 iInternalFile->SetLastTimeShowNewFeatureDialog( aTime ); |
455 iInternalFile->SetLastTimeShowNewFeatureDialog( aTime ); |
444 TRAPD( err,iInternalFile->WriteControllerDataL() ); |
456 TRAPD( err,iInternalFile->WriteControllerDataL() ); |
445 return err; |
457 return err; |
446 } |
458 } |
447 |
459 |
448 |
|
449 // ---------------------------------------------------------- |
460 // ---------------------------------------------------------- |
450 // CIAUpdateBGTimer::ModeL() |
461 // CIAUpdateBGTimer::ModeL() |
451 // ---------------------------------------------------------- |
462 // ---------------------------------------------------------- |
452 TIAUpdateBGMode CIAUpdateBGTimer::ModeL() |
463 TIAUpdateBGMode CIAUpdateBGTimer::ModeL() |
453 { |
464 { |
464 iInternalFile->SetMode( aMode ); |
475 iInternalFile->SetMode( aMode ); |
465 TRAPD( err,iInternalFile->WriteControllerDataL() ); |
476 TRAPD( err,iInternalFile->WriteControllerDataL() ); |
466 return err; |
477 return err; |
467 } |
478 } |
468 |
479 |
|
480 // ---------------------------------------------------------- |
|
481 // CIAUpdateBGTimer::NrOfIndicatorEntries() |
|
482 // ---------------------------------------------------------- |
|
483 TInt CIAUpdateBGTimer::NrOfIndicatorEntries() |
|
484 { |
|
485 iInternalFile->ReadControllerDataL(); |
|
486 return iInternalFile->NrOfIndicatorEntries(); |
|
487 } |
|
488 |
|
489 |
|
490 // ---------------------------------------------------------- |
|
491 // CIAUpdateBGTimer::SetNrOfIndicatorEntriesL() |
|
492 // ---------------------------------------------------------- |
|
493 TInt CIAUpdateBGTimer::SetNrOfIndicatorEntriesL( TInt aEntries ) |
|
494 { |
|
495 iInternalFile->SetNrOfIndicatorEntries( aEntries ); |
|
496 TRAPD( err,iInternalFile->WriteControllerDataL() ); |
|
497 return err; |
|
498 } |
469 |
499 |
470 // ---------------------------------------------------------- |
500 // ---------------------------------------------------------- |
471 // CIAUpdateBGTimer::RetryTimesL() |
501 // CIAUpdateBGTimer::RetryTimesL() |
472 // ---------------------------------------------------------- |
502 // ---------------------------------------------------------- |
473 TInt CIAUpdateBGTimer::RetryTimesL() |
503 TInt CIAUpdateBGTimer::RetryTimesL() |
1384 |
1416 |
1385 // loc: delete text buffers |
1417 // loc: delete text buffers |
1386 // CleanupStack::PopAndDestroy( titleText ); |
1418 // CleanupStack::PopAndDestroy( titleText ); |
1387 // CleanupStack::PopAndDestroy( titleText ); |
1419 // CleanupStack::PopAndDestroy( titleText ); |
1388 |
1420 |
1389 // Set number of updates |
1421 // Set number of updates for dialog and internal file |
1390 iSoftNotification->SetNrOfUpdates( aNrOfUpdates ); |
1422 iSoftNotification->SetNrOfUpdates( aNrOfUpdates ); |
1391 |
1423 SetNrOfIndicatorEntriesL( aNrOfUpdates ); |
|
1424 |
1392 iSoftNotification->ShowNotificationL(); |
1425 iSoftNotification->ShowNotificationL(); |
1393 FLOG("[bgchecker] LaunchNotificationL 1"); |
1426 FLOG("[bgchecker] LaunchNotificationL 1"); |
1394 |
1427 |
1395 return; |
1428 return; |
1396 } |
1429 } |
1536 { |
1569 { |
1537 delete iSoftNotification; |
1570 delete iSoftNotification; |
1538 iSoftNotification = NULL; |
1571 iSoftNotification = NULL; |
1539 } |
1572 } |
1540 |
1573 |
|
1574 if ( iIndicatorNotifyHandler ) |
|
1575 { |
|
1576 delete iIndicatorNotifyHandler; |
|
1577 iIndicatorNotifyHandler = NULL; |
|
1578 } |
|
1579 |
1541 CActiveScheduler::Stop(); |
1580 CActiveScheduler::Stop(); |
1542 |
1581 |
1543 FLOG("[bgchecker] Shutdown() end"); |
1582 FLOG("[bgchecker] Shutdown() end"); |
1544 } |
1583 } |
|
1584 // --------------------------------------------------------------------------- |
|
1585 // CIAUpdateBGTimer::HandleIndicatorRemoveL() |
|
1586 // --------------------------------------------------------------------------- |
|
1587 // |
|
1588 void CIAUpdateBGTimer::HandleIndicatorRemoveL() |
|
1589 { |
|
1590 // remove indicator from indicator menu |
|
1591 iSoftNotification->RemoveIndicatorL(); |
|
1592 |
|
1593 //clear nr of indicator entries in internal file |
|
1594 SetNrOfIndicatorEntriesL( 0 ); |
|
1595 } |
|
1596 |
1545 // End of file |
1597 // End of file |