branch | RCL_3 |
changeset 25 | 7333d7932ef7 |
parent 18 | f9033e605ee2 |
child 26 | 8b7f4e561641 |
24:5cc91383ab1e | 25:7333d7932ef7 |
---|---|
1 /* |
1 /* |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
23 #include <iaupdateresult.h> |
23 #include <iaupdateresult.h> |
24 #include <w32std.h> |
24 #include <w32std.h> |
25 #include <apgwgnam.h> |
25 #include <apgwgnam.h> |
26 #include <apgcli.h> |
26 #include <apgcli.h> |
27 #include <apacmdln.h> |
27 #include <apacmdln.h> |
28 #include <avkon.hrh> |
|
29 #include <StringLoader.h> |
|
30 #include <iaupdate.rsg> |
|
31 #include <data_caging_path_literals.hrh> |
|
32 #include <bautils.h> |
28 #include <bautils.h> |
33 #include <apgtask.h> |
29 #include <apgtask.h> |
34 #include <sysversioninfo.h> //sysversioninfo |
30 #include <sysversioninfo.h> //sysversioninfo |
35 #include <featurecontrol.h> |
31 #include <featurecontrol.h> |
36 |
32 |
33 #include <hb/hbcore/hbtextresolversymbian.h> |
|
37 #include "iaupdateprivatecrkeys.h" |
34 #include "iaupdateprivatecrkeys.h" |
38 #include "iaupdate.hrh" |
35 #include "iaupdate.hrh" |
39 |
36 |
40 #include "iaupdatebgrefreshtimer.h" |
37 #include "iaupdatebgrefreshtimer.h" |
41 #include "iaupdatebglogger.h" |
38 #include "iaupdatebglogger.h" |
43 #include "iaupdatebginternalfilehandler.h" |
40 #include "iaupdatebginternalfilehandler.h" |
44 #include "iaupdatebgconst.h" |
41 #include "iaupdatebgconst.h" |
45 |
42 |
46 //MACROS |
43 //MACROS |
47 _LIT8( KRefreshFromNetworkDenied, "1" ); |
44 _LIT8( KRefreshFromNetworkDenied, "1" ); |
48 _LIT(KIAUpdateResourceFile, "iaupdate.rsc"); |
|
49 _LIT(KIAUpdateLauncherExe, "iaupdatelauncher.exe" ); |
45 _LIT(KIAUpdateLauncherExe, "iaupdatelauncher.exe" ); |
50 //_LIT(KImageFile, "qgn_note_swupdate_notification.svg"); |
|
51 |
46 |
52 //CONSTANTS |
47 //CONSTANTS |
53 const TUint KIADUpdateLauncherUid( 0x2001FE2F ); |
48 const TUint KIADUpdateLauncherUid( 0x2001FE2F ); |
54 |
49 |
55 // ---------------------------------------------------------- |
50 // ---------------------------------------------------------- |
71 void CIAUpdateBGTimer::ConstructL() |
66 void CIAUpdateBGTimer::ConstructL() |
72 { |
67 { |
73 CTimer::ConstructL(); |
68 CTimer::ConstructL(); |
74 CActiveScheduler::Add( this ); |
69 CActiveScheduler::Add( this ); |
75 |
70 |
76 iReminderTimer = CIAUpdateBGReminderTimer::NewL( this ); |
|
77 iUpdate = NULL; |
71 iUpdate = NULL; |
78 iParameters = NULL; |
72 iParameters = NULL; |
79 |
73 |
80 iIAUpdateCRSession = NULL; |
74 iIAUpdateCRSession = NULL; |
81 iNotifyHandler = NULL; |
75 iNotifyHandler = NULL; |
82 |
76 |
83 iControllerFile = CIAUpdateBGControllerFile::NewL(); |
77 iControllerFile = CIAUpdateBGControllerFile::NewL(); |
84 |
78 |
85 iInternalFile = CIAUpdateBGInternalFileHandler::NewL(); |
79 iInternalFile = CIAUpdateBGInternalFileHandler::NewL(); |
86 |
80 |
87 iSoftNotification = CIAUpdateBGSoftNotification::NewL( this, iInternalFile ); |
81 iSoftNotification = CIAUpdateBGSoftNotification::NewL( this ); |
88 iSoftNotification->StartObservingIfNeededL(); |
82 |
89 |
83 iIndicatorNotifyHandler = CIAUpdateBGNotifyHandler::NewL(); |
90 // Get resource file path |
84 |
91 TFileName fileName; |
85 // loc: initialize localisation text loader |
92 fileName.Copy(TParsePtrC(RProcess().FileName()).Drive()); |
86 /* |
93 fileName.Append(KDC_APP_RESOURCE_DIR); |
87 TBool res = HbTextResolverSymbian::Init(KLocFile, KLocFilePath); |
94 fileName.Append(KIAUpdateResourceFile); |
88 if ( res != KErrNone ) |
95 |
89 { |
96 User::LeaveIfError(iFs.Connect()); |
90 // nothing to do |
97 |
91 } |
98 // Get language of resource file |
92 */ |
99 BaflUtils::NearestLanguageFile( iFs, fileName ); |
93 } |
100 |
|
101 // Open resource file |
|
102 iResourceFile.OpenL( iFs, fileName ); |
|
103 iResourceFile.ConfirmSignatureL(); |
|
104 } |
|
105 |
|
106 |
94 |
107 // ---------------------------------------------------------- |
95 // ---------------------------------------------------------- |
108 // CIAUpdateBGTimer::~CIAUpdateBGTimer() |
96 // CIAUpdateBGTimer::~CIAUpdateBGTimer() |
109 // ---------------------------------------------------------- |
97 // ---------------------------------------------------------- |
110 CIAUpdateBGTimer::~CIAUpdateBGTimer() |
98 CIAUpdateBGTimer::~CIAUpdateBGTimer() |
111 { |
99 { |
112 Cancel(); |
100 Cancel(); |
113 delete iUpdate; |
101 delete iUpdate; |
114 delete iParameters; |
102 delete iParameters; |
115 delete iReminderTimer; |
|
116 |
103 |
117 if ( iNotifyHandler ) |
104 if ( iNotifyHandler ) |
118 { |
105 { |
119 iNotifyHandler->StopListening(); |
106 iNotifyHandler->StopListening(); |
120 delete iNotifyHandler; |
107 delete iNotifyHandler; |
122 |
109 |
123 delete iIAUpdateCRSession; |
110 delete iIAUpdateCRSession; |
124 delete iControllerFile; |
111 delete iControllerFile; |
125 delete iInternalFile; |
112 delete iInternalFile; |
126 delete iSoftNotification; |
113 delete iSoftNotification; |
127 |
114 delete iIndicatorNotifyHandler; |
128 iResourceFile.Close(); |
115 |
129 iFs.Close(); |
116 } |
130 } |
|
131 |
|
132 |
117 |
133 // ---------------------------------------------------------- |
118 // ---------------------------------------------------------- |
134 // CIAUpdateBGTimer::StartProcessL() |
119 // CIAUpdateBGTimer::StartProcessL() |
135 // ---------------------------------------------------------- |
120 // ---------------------------------------------------------- |
136 void CIAUpdateBGTimer::StartProcessL() |
121 void CIAUpdateBGTimer::StartProcessL() |
137 { |
122 { |
138 FLOG("[bgchecker] StartProcessL"); |
123 FLOG("[bgchecker] StartProcessL"); |
124 |
|
125 // start listening indicator remove |
|
126 iIndicatorNotifyHandler->StartListeningL( this ); |
|
127 |
|
128 |
|
129 iMode = ModeL(); |
|
130 |
|
131 switch ( iMode ) |
|
132 { |
|
133 case EFirstTimeMode: |
|
134 { |
|
135 // while not released keep in sleep mode |
|
136 int test = 0; |
|
137 if ( test == 0 ) |
|
138 { |
|
139 ListenAutoUpdateSettingsL(); |
|
140 iMode = ESleepMode; |
|
141 SetModeL( iMode ); |
|
142 return; |
|
143 } |
|
139 |
144 |
140 iMode = ModeL(); |
|
141 |
|
142 switch ( iMode ) |
|
143 { |
|
144 case EFirstTimeMode: |
|
145 case EFirstTimeRemindMode: |
|
146 { |
|
147 if ( IsFirstTimeDialogDisabledL() ) |
145 if ( IsFirstTimeDialogDisabledL() ) |
148 { |
146 { |
149 //this should only happen in testing |
147 //this should only happen in testing |
150 FLOG("[bgchecker] StartProcessL Firs time dialog is disabled, this should only happen in testing"); |
148 FLOG("[bgchecker] StartProcessL Firs time dialog is disabled, this should only happen in testing"); |
151 |
149 |
169 } |
167 } |
170 |
168 |
171 |
169 |
172 FLOG("[bgchecker] StartProcessL EFirstTimeMode"); |
170 FLOG("[bgchecker] StartProcessL EFirstTimeMode"); |
173 |
171 |
174 |
|
175 |
|
176 |
|
177 //Wait for some days before activate the first time mode |
172 //Wait for some days before activate the first time mode |
178 TTimeIntervalMinutes timetowait = |
173 TTimeIntervalMinutes timetowait = |
179 TimeIntervalFromNextShowOfNewFeatureDialogL(); |
174 TimeIntervalFromNextShowOfNewFeatureDialogL(); |
180 FLOG_NUM( " time to wait = %d", timetowait.Int() ); |
175 FLOG_NUM( " time to wait = %d", timetowait.Int() ); |
181 if (timetowait.Int() <= 0) |
176 if (timetowait.Int() <= 0) |
218 break; |
213 break; |
219 } |
214 } |
220 |
215 |
221 case EFirstTimeMode2: |
216 case EFirstTimeMode2: |
222 { |
217 { |
223 FLOG("[bgchecker] StartProcessL EFirstTimeMode2"); |
218 FLOG("[bgchecker] StartProcessL EFirstTimeMode 2"); |
224 RunL(); |
|
225 break; |
|
226 } |
|
227 |
|
228 case EFirstTimeMode3: |
|
229 { |
|
230 FLOG("[bgchecker] StartProcessL EFirstTimeMode 3"); |
|
231 //if user accepted the disclaimer already and reboot the phone, |
219 //if user accepted the disclaimer already and reboot the phone, |
232 //this mode could go to network immediately after boot |
220 //this mode could go to network immediately after boot |
233 //We put one min delay here to wait for network ready. |
221 //We put one min delay here to wait for network ready. |
234 StartL(StartAfterOneMin); |
222 StartL(StartAfterOneMin); |
235 break; |
223 break; |
248 { |
236 { |
249 iNotifyHandler = CCenRepNotifyHandler::NewL( *this, *iIAUpdateCRSession ); |
237 iNotifyHandler = CCenRepNotifyHandler::NewL( *this, *iIAUpdateCRSession ); |
250 } |
238 } |
251 |
239 |
252 iNotifyHandler->StartListeningL(); |
240 iNotifyHandler->StartListeningL(); |
241 |
|
242 |
|
243 if ( !IsAgreementAcceptedL() ) |
|
244 { |
|
245 FLOG("[bgchecker] EFirstTimeMode4 ShowIndicator"); |
|
246 // Set number of updates; zero for first case |
|
247 iSoftNotification->SetNrOfUpdates( 0 ); |
|
248 |
|
249 // do not show indicator when testing |
|
250 int test = 0; |
|
251 if ( test == 1) |
|
252 iSoftNotification->ShowIndicatorL(); |
|
253 |
|
254 } |
|
255 |
|
256 |
|
253 break; |
257 break; |
254 } |
258 } |
255 |
259 |
256 case ENormalMode: |
260 case ENormalMode: |
257 case ERetryMode: |
261 case ERetryMode: |
258 { |
262 { |
263 |
|
264 // Should indicator be shown ? |
|
265 TInt entries = NrOfIndicatorEntries(); |
|
266 if ( entries ) |
|
267 { |
|
268 iSoftNotification->SetNrOfUpdates( entries ); |
|
269 iSoftNotification->ShowIndicatorL(); |
|
270 } |
|
271 |
|
259 StartUpdatesCheckingL(); |
272 StartUpdatesCheckingL(); |
273 |
|
260 break; |
274 break; |
261 } |
275 } |
262 |
276 |
263 default: |
277 default: |
264 break; |
278 break; |
276 CleanupStack::PushL( fthandler ); |
290 CleanupStack::PushL( fthandler ); |
277 TBool result = fthandler->AgreementAcceptedL(); |
291 TBool result = fthandler->AgreementAcceptedL(); |
278 |
292 |
279 CleanupStack::PopAndDestroy( fthandler ); |
293 CleanupStack::PopAndDestroy( fthandler ); |
280 |
294 |
281 return result; |
|
282 } |
|
283 |
|
284 |
|
285 // ---------------------------------------------------------- |
|
286 // CIAUpdateBGTimer::IsAskedAlreadyL() |
|
287 // ---------------------------------------------------------- |
|
288 TBool CIAUpdateBGTimer::IsAskedAlreadyL() |
|
289 { |
|
290 CIAUpdateBGFirstTimeHandler* fthandler = CIAUpdateBGFirstTimeHandler::NewL(); |
|
291 CleanupStack::PushL( fthandler ); |
|
292 TBool result = fthandler->AgreementAskedL(); |
|
293 CleanupStack::PopAndDestroy( fthandler ); |
|
294 return result; |
295 return result; |
295 } |
296 } |
296 |
297 |
297 |
298 |
298 // ---------------------------------------------------------- |
299 // ---------------------------------------------------------- |
329 else |
330 else |
330 { |
331 { |
331 FLOG_NUM( "Start checking update after %d minutes", timetowait.Int()); |
332 FLOG_NUM( "Start checking update after %d minutes", timetowait.Int()); |
332 StartL( timetowait ); |
333 StartL( timetowait ); |
333 |
334 |
334 //start reminder timer also if user choose later before reboot |
335 } |
335 //check the value from private folder |
|
336 |
|
337 if ( ReminderOnL() ) |
|
338 { |
|
339 TTime currenttime; |
|
340 currenttime.UniversalTime(); |
|
341 |
|
342 FTIME( currenttime ); |
|
343 |
|
344 TTime nextremindtime = NextRemindTimeL(); |
|
345 |
|
346 FTIME( nextremindtime ); |
|
347 |
|
348 TTimeIntervalMinutes timetogo; |
|
349 nextremindtime.MinutesFrom( currenttime, timetogo ); |
|
350 |
|
351 FLOG_NUM("time to go = %d", timetogo.Int() ); |
|
352 |
|
353 if ( timetogo.Int() <= 0 ) |
|
354 { |
|
355 //pop up the reminder directly |
|
356 ReminderTimerCallBack(); |
|
357 } |
|
358 else |
|
359 { |
|
360 iReminderTimer->StartReminderTimerL( timetogo ); |
|
361 } |
|
362 } |
|
363 } |
|
364 } |
336 } |
365 |
337 |
366 |
338 |
367 // ---------------------------------------------------------- |
339 // ---------------------------------------------------------- |
368 // CIAUpdateBGTimer::DoHandleNotifyGeneric() |
340 // CIAUpdateBGTimer::DoHandleNotifyGeneric() |
483 iInternalFile->SetLastTimeShowNewFeatureDialog( aTime ); |
455 iInternalFile->SetLastTimeShowNewFeatureDialog( aTime ); |
484 TRAPD( err,iInternalFile->WriteControllerDataL() ); |
456 TRAPD( err,iInternalFile->WriteControllerDataL() ); |
485 return err; |
457 return err; |
486 } |
458 } |
487 |
459 |
488 |
|
489 // ---------------------------------------------------------- |
|
490 // CIAUpdateBGTimer::NextRemindTimeL() |
|
491 // ---------------------------------------------------------- |
|
492 TTime CIAUpdateBGTimer::NextRemindTimeL() |
|
493 { |
|
494 iInternalFile->ReadControllerDataL(); |
|
495 return iInternalFile->NextRemindTime(); |
|
496 } |
|
497 |
|
498 |
|
499 // ---------------------------------------------------------- |
|
500 // CIAUpdateBGTimer::SetNextRemindTimeL() |
|
501 // ---------------------------------------------------------- |
|
502 TInt CIAUpdateBGTimer::SetNextRemindTimeL( TTime aTime ) |
|
503 { |
|
504 iInternalFile->SetNextRemindTime( aTime ); |
|
505 TRAPD( err,iInternalFile->WriteControllerDataL() ); |
|
506 return err; |
|
507 } |
|
508 |
|
509 |
|
510 // ---------------------------------------------------------- |
|
511 // CIAUpdateBGTimer::ReminderOnL() |
|
512 // ---------------------------------------------------------- |
|
513 TBool CIAUpdateBGTimer::ReminderOnL() |
|
514 { |
|
515 iInternalFile->ReadControllerDataL(); |
|
516 return iInternalFile->ReminderOn(); |
|
517 } |
|
518 |
|
519 |
|
520 // ---------------------------------------------------------- |
|
521 // CIAUpdateBGTimer::SetReminderL() |
|
522 // ---------------------------------------------------------- |
|
523 TInt CIAUpdateBGTimer::SetReminderL( TBool aOn ) |
|
524 { |
|
525 iInternalFile->SetReminder( aOn ); |
|
526 TRAPD( err,iInternalFile->WriteControllerDataL() ); |
|
527 return err; |
|
528 } |
|
529 |
|
530 |
|
531 // ---------------------------------------------------------- |
460 // ---------------------------------------------------------- |
532 // CIAUpdateBGTimer::ModeL() |
461 // CIAUpdateBGTimer::ModeL() |
533 // ---------------------------------------------------------- |
462 // ---------------------------------------------------------- |
534 TIAUpdateBGMode CIAUpdateBGTimer::ModeL() |
463 TIAUpdateBGMode CIAUpdateBGTimer::ModeL() |
535 { |
464 { |
546 iInternalFile->SetMode( aMode ); |
475 iInternalFile->SetMode( aMode ); |
547 TRAPD( err,iInternalFile->WriteControllerDataL() ); |
476 TRAPD( err,iInternalFile->WriteControllerDataL() ); |
548 return err; |
477 return err; |
549 } |
478 } |
550 |
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 } |
|
551 |
499 |
552 // ---------------------------------------------------------- |
500 // ---------------------------------------------------------- |
553 // CIAUpdateBGTimer::RetryTimesL() |
501 // CIAUpdateBGTimer::RetryTimesL() |
554 // ---------------------------------------------------------- |
502 // ---------------------------------------------------------- |
555 TInt CIAUpdateBGTimer::RetryTimesL() |
503 TInt CIAUpdateBGTimer::RetryTimesL() |
583 // CIAUpdateBGTimer::DoUpdatesCheckingL() |
531 // CIAUpdateBGTimer::DoUpdatesCheckingL() |
584 // ---------------------------------------------------------- |
532 // ---------------------------------------------------------- |
585 void CIAUpdateBGTimer::DoUpdatesCheckingL( const TBool& aUpdateFromServer ) |
533 void CIAUpdateBGTimer::DoUpdatesCheckingL( const TBool& aUpdateFromServer ) |
586 { |
534 { |
587 FLOG( "DoUpdatesCheckingL update"); |
535 FLOG( "DoUpdatesCheckingL update"); |
588 //turn off the reminder, user will decide whether to turn if on or off |
|
589 //The user's decision will be checked in soft notification callback function |
|
590 |
|
591 if ( ReminderOnL()) |
|
592 { |
|
593 FLOG( "Do CheckUpdates 3"); |
|
594 iReminderTimer->CancelReminderTimerL(); |
|
595 SetReminderL( EFalse ); |
|
596 } |
|
597 |
536 |
598 if( !iUpdate ) |
537 if( !iUpdate ) |
599 { |
538 { |
600 iUpdate = CIAUpdate::NewL( *this ); |
539 iUpdate = CIAUpdate::NewL( *this ); |
601 } |
540 } |
642 // ---------------------------------------------------------- |
581 // ---------------------------------------------------------- |
643 void CIAUpdateBGTimer::DoCheckUpdatesCompleteL( TInt aErrorCode, TInt aAvailableUpdates ) |
582 void CIAUpdateBGTimer::DoCheckUpdatesCompleteL( TInt aErrorCode, TInt aAvailableUpdates ) |
644 { |
583 { |
645 FLOG_NUM( "CheckUpdatesComplete aErrorCode = %d", aErrorCode ); |
584 FLOG_NUM( "CheckUpdatesComplete aErrorCode = %d", aErrorCode ); |
646 FLOG_NUM( "CheckUpdatesComplete aAvailableUpdates = %d", aAvailableUpdates ); |
585 FLOG_NUM( "CheckUpdatesComplete aAvailableUpdates = %d", aAvailableUpdates ); |
586 |
|
587 //HLa |
|
588 int test = 0; |
|
589 if ( test == 0 ) |
|
590 { |
|
591 aErrorCode = 0; |
|
592 aAvailableUpdates = 0; |
|
593 } |
|
594 |
|
647 if ( !IAUpdateEnabledL() ) |
595 if ( !IAUpdateEnabledL() ) |
648 { |
596 { |
649 Shutdown(); |
597 Shutdown(); |
650 return; |
598 return; |
651 } |
599 } |
686 |
634 |
687 if ( aAvailableUpdates > 0 ) |
635 if ( aAvailableUpdates > 0 ) |
688 { |
636 { |
689 FLOG( "CheckUpdatesComplete 4"); |
637 FLOG( "CheckUpdatesComplete 4"); |
690 |
638 |
691 LaunchSoftNotificationL(R_IAUPDATE_UPDATE_AVAILABLE, |
639 LaunchNotificationL( aAvailableUpdates ); |
692 R_TEXT_SOFTKEY_SHOW, R_TEXT_SOFTKEY_LATER ); |
|
693 } |
640 } |
694 |
641 |
695 FLOG( "CheckUpdatesComplete 5"); |
642 FLOG( "CheckUpdatesComplete 5"); |
696 |
643 |
697 // if update checking is from server, restart the refresh timer |
644 // if update checking is from server, restart the refresh timer |
733 if ( checkupdatefromserver ) |
680 if ( checkupdatefromserver ) |
734 { |
681 { |
735 TTimeIntervalMinutes interval( CheckingFrequencyInMinutesL() ); |
682 TTimeIntervalMinutes interval( CheckingFrequencyInMinutesL() ); |
736 StartL( interval ); |
683 StartL( interval ); |
737 SetLastRefreshTime(); |
684 SetLastRefreshTime(); |
738 } |
|
739 else |
|
740 { |
|
741 //don't show soft notification and restart the timer. |
|
742 TTimeIntervalMinutes oneweek( UpdateAvailableReminderIntervalInMinutesL() ); |
|
743 TTime currenttime; |
|
744 currenttime.UniversalTime(); |
|
745 TTime nextRemindTime = currenttime + oneweek; |
|
746 |
|
747 SetReminderL( ETrue ); |
|
748 SetNextRemindTimeL( nextRemindTime ); |
|
749 |
|
750 iReminderTimer->StartReminderTimerL( oneweek ); |
|
751 } |
685 } |
752 //clear the retry time |
686 //clear the retry time |
753 SetRetryTimesL( 0 ); |
687 SetRetryTimesL( 0 ); |
754 } |
688 } |
755 else |
689 else |
891 } |
825 } |
892 } |
826 } |
893 break; |
827 break; |
894 |
828 |
895 case EFirstTimeMode: |
829 case EFirstTimeMode: |
896 case EFirstTimeRemindMode: |
|
897 { |
830 { |
898 FLOG("[bgchecker] runl EFirstTimeMode"); |
831 FLOG("[bgchecker] runl EFirstTimeMode"); |
899 |
832 |
900 if ( iRuns == 0 ) |
833 if ( iRuns == 0 ) |
901 { |
834 { |
919 } |
852 } |
920 break; |
853 break; |
921 |
854 |
922 case EFirstTimeMode2: |
855 case EFirstTimeMode2: |
923 { |
856 { |
924 FLOG("[bgchecker] runl EFirstTimeMode2"); |
857 FLOG("[bgchecker] runl EFirstTimeMode2"); |
925 LaunchSoftNotificationL(R_IAUPDATE_REMIND_LATER, R_TEXT_SOFTKEY_YES, R_TEXT_SOFTKEY_NO ); |
|
926 } |
|
927 break; |
|
928 |
|
929 case EFirstTimeMode3: |
|
930 { |
|
931 FLOG("[bgchecker] runl EFirstTimeMode3"); |
|
932 //disclaimer is not accepted |
858 //disclaimer is not accepted |
933 |
859 |
934 if ( !IsAgreementAcceptedL() ) |
860 if ( !IsAgreementAcceptedL() ) |
935 { |
861 { |
936 FLOG("[bgchecker] runl EFirstTimeMode reject disclaimer"); |
862 FLOG("[bgchecker] runl EFirstTimeMode reject disclaimer"); |
982 } |
908 } |
983 else |
909 else |
984 { |
910 { |
985 //this is first time mode |
911 //this is first time mode |
986 FLOG("[bgchecker]HandlerFirstTimeL 3 "); |
912 FLOG("[bgchecker]HandlerFirstTimeL 3 "); |
987 LaunchSoftNotificationL( R_IAUPDATE_FEATURES_AVAILABLE, |
913 LaunchNotificationL( 0 ); |
988 R_TEXT_SOFTKEY_OK, R_TEXT_SOFTKEY_CANCEL ); |
|
989 } |
914 } |
990 } |
915 } |
991 |
916 |
992 |
917 |
993 // ---------------------------------------------------------- |
918 // ---------------------------------------------------------- |
1250 if ( ModeL() == EFirstTimeMode ) |
1175 if ( ModeL() == EFirstTimeMode ) |
1251 { |
1176 { |
1252 FLOG(" current mode is FirstTimeMode "); |
1177 FLOG(" current mode is FirstTimeMode "); |
1253 interval = FirstTimeDialogDelayInMinutesL(); |
1178 interval = FirstTimeDialogDelayInMinutesL(); |
1254 } |
1179 } |
1255 else if ( ModeL() == EFirstTimeRemindMode ) |
|
1256 { |
|
1257 FLOG(" current mode is FirstTimeRemindMode"); |
|
1258 interval = FirstTimeDialogReminderIntervalInMinutesL(); |
|
1259 } |
|
1260 else |
1180 else |
1261 { |
1181 { |
1262 //nothing |
1182 //nothing |
1263 FLOG(" current mode is wrong!!"); |
1183 FLOG(" current mode is wrong!!"); |
1264 User::LeaveIfError( KErrArgument ); |
1184 User::LeaveIfError( KErrArgument ); |
1288 iMode = ModeL(); |
1208 iMode = ModeL(); |
1289 |
1209 |
1290 switch ( iMode ) |
1210 switch ( iMode ) |
1291 { |
1211 { |
1292 case EFirstTimeMode: |
1212 case EFirstTimeMode: |
1293 case EFirstTimeRemindMode: |
|
1294 { |
1213 { |
1295 |
1214 |
1296 FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode"); |
1215 FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode"); |
1297 if ( !aIsAccepted ) |
1216 if ( !aIsAccepted ) |
1298 { |
1217 { |
1299 FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode not accepted"); |
1218 FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode, not accepted"); |
1300 iMode = EFirstTimeMode2; |
1219 //in sleep mode now |
1220 iMode = ESleepMode; |
|
1301 SetModeL( iMode ); |
1221 SetModeL( iMode ); |
1302 StartL( StartNow ); |
1222 |
1223 //subscribe to cenrep key for automatic checking for wake up from sleep mode |
|
1224 ListenAutoUpdateSettingsL(); |
|
1225 |
|
1303 } |
1226 } |
1304 else |
1227 else |
1305 { |
1228 { |
1306 FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMod accepeted"); |
1229 FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMod accepeted"); |
1307 StartIaupdateL(); |
1230 StartIaupdateL(); |
1308 //iaupdate is launched |
1231 //iaupdate is launched |
1309 //check the disclaimer acceptance and automatic checking setting in 10mins |
1232 //check the disclaimer acceptance and automatic checking setting in 10mins |
1310 |
1233 |
1311 StartL( KDelayForUserToAcceptDisclaimer ); |
1234 StartL( KDelayForUserToAcceptDisclaimer ); |
1312 iMode = EFirstTimeMode3; |
1235 iMode = EFirstTimeMode2; |
1313 SetModeL( iMode ); |
1236 SetModeL( iMode ); |
1314 |
1237 |
1315 |
1238 |
1316 //Still in first time mode, |
1239 //Still in first time mode, |
1317 //check user's setting and disclamier after 10mins. |
1240 //check user's setting and disclamier after 10mins. |
1318 } |
1241 } |
1319 break; |
1242 break; |
1320 } |
1243 } |
1321 |
1244 |
1322 |
|
1323 |
|
1324 case EFirstTimeMode2: |
|
1325 { |
|
1326 FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode2 "); |
|
1327 if ( aIsAccepted ) |
|
1328 { |
|
1329 FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode2, accepted"); |
|
1330 //user wants to be reminder so remind in 4 weeks |
|
1331 //set to first time remind mode |
|
1332 iMode = EFirstTimeRemindMode; |
|
1333 SetModeL( iMode ); |
|
1334 TTimeIntervalMinutes fourweeks( FirstTimeDialogReminderIntervalInMinutesL() ); |
|
1335 TTime currenttime; |
|
1336 currenttime.UniversalTime(); |
|
1337 |
|
1338 //save the next show new feature dialog time |
|
1339 //in case use switch off the device and restarted. |
|
1340 User::LeaveIfError( SetLastTimeShowNewFeatureDialogL( currenttime ) ); |
|
1341 |
|
1342 StartL( fourweeks ); |
|
1343 return; |
|
1344 } |
|
1345 else |
|
1346 { |
|
1347 FLOG("[bgchecker] SoftNotificationCallBack EFirstTimeMode2, not accepted"); |
|
1348 //in sleep mode now |
|
1349 iMode = ESleepMode; |
|
1350 SetModeL( iMode ); |
|
1351 |
|
1352 //subscribe to cenrep key for automatic checking for wake up from sleep mode |
|
1353 ListenAutoUpdateSettingsL(); |
|
1354 } |
|
1355 break; |
|
1356 } |
|
1357 |
|
1358 case ENormalMode: |
1245 case ENormalMode: |
1359 { |
1246 { |
1360 FLOG("[bgchecker] SoftNotificationCallBack ENormalMode"); |
1247 FLOG("[bgchecker] SoftNotificationCallBack ENormalMode"); |
1361 if ( !aIsAccepted ) |
1248 if ( !aIsAccepted ) |
1362 { |
1249 { |
1363 FLOG("[bgchecker] SoftNotificationCallBack ENormalMode not accpeted"); |
1250 FLOG("[bgchecker] SoftNotificationCallBack ENormalMode not accpeted"); |
1364 //user wants to be reminded later |
|
1365 TTimeIntervalMinutes oneweek( UpdateAvailableReminderIntervalInMinutesL() ); |
|
1366 TTime currenttime; |
|
1367 currenttime.UniversalTime(); |
|
1368 TTime nextRemindTime = currenttime + oneweek; |
|
1369 |
|
1370 SetReminderL( ETrue ); |
|
1371 SetNextRemindTimeL( nextRemindTime ); |
|
1372 |
1251 |
1373 iReminderTimer->StartReminderTimerL( oneweek ); |
|
1374 |
|
1375 //the reminder call back function will be called when reminder timer expires. |
|
1376 } |
1252 } |
1377 else |
1253 else |
1378 { |
1254 { |
1379 //accepted, launch iad |
1255 //accepted, clear indicator entries |
1256 SetNrOfIndicatorEntriesL( 0 ); |
|
1257 // start IAD |
|
1380 StartIaupdateL(); |
1258 StartIaupdateL(); |
1381 } |
1259 } |
1382 break; |
1260 break; |
1383 } |
1261 } |
1384 |
1262 |
1409 TIAUpdateBGMode CIAUpdateBGTimer::CurrentMode() |
1287 TIAUpdateBGMode CIAUpdateBGTimer::CurrentMode() |
1410 { |
1288 { |
1411 return iMode; |
1289 return iMode; |
1412 } |
1290 } |
1413 |
1291 |
1414 |
1292 // ---------------------------------------------------------- |
1415 // ---------------------------------------------------------- |
1293 // CIAUpdateBGTimer::LaunchNotificationL( const int aNrOfUpdates ) |
1416 // CIAUpdateBGTimer::DoReminderTimerCallBack() |
1294 // ---------------------------------------------------------- |
1417 // ---------------------------------------------------------- |
1295 void CIAUpdateBGTimer::LaunchNotificationL( const int aNrOfUpdates ) |
1418 void CIAUpdateBGTimer::DoReminderTimerCallBackL() |
1296 { |
1419 { |
1297 |
1420 FLOG("[bgchecker] ReminderTimerCallBack begin"); |
1298 _LIT( KFirstTimeText, "Update checking" ); |
1421 if ( !IAUpdateEnabledL() ) |
1299 _LIT( KNormalText, "Updates available" ); |
1422 { |
1300 _LIT( KSecondText, "Tap to view" ); |
1423 Shutdown(); |
1301 |
1424 return; |
1302 // loc: |
1425 } |
1303 /* |
1426 //Check the automatic update setting, if it has been disabled, |
1304 _LIT( KIcon, "z:\\resource\\iaupdate\\qgn_note_swupdate_notification.svg" ); |
1427 //then go to sleep mode. |
1305 _LIT(KLocFile, "Text_Map_Swupdate_"); |
1428 if ( IsAutoUpdateDisabledL() ) |
1306 _LIT(KLocFilePath, "z:\\resource\\iaupdate\\"); |
1429 { |
1307 |
1430 FLOG("[bgchecker] ReminderTimerCallBack autoupdate is disabled, switch to sleep mode"); |
1308 _LIT(KTitleFirstTime, "txt_software_dpophead_update_checking"); |
1431 ListenAutoUpdateSettingsL(); |
1309 _LIT(KTitleOneUpdate, "txt_software_dpophead_update_available"); |
1432 iMode = ESleepMode; |
1310 _LIT(KTitleSeveralUpdates, "txt_software_dpophead_updates_available"); |
1433 SetModeL( iMode ); |
1311 |
1434 return; |
1312 |
1435 } |
1313 _LIT(KSecondFirstTime, "txt_software_dpopinfo_tap_to_view"); |
1436 |
1314 _LIT(KSecondOneUpdate, "txt_software_dpopinfo_tap_to_view"); |
1437 TTimeIntervalMinutes timetowait = TimeIntervalFromNextRefreshL(); |
1315 _LIT(KSecondSeveralUpdates, "txt_software_dpopinfo_tap_to_view"); |
1438 |
1316 */ |
1439 if ( timetowait.Int() <= KRefreshTimerReminderTimerGap ) |
1317 |
1440 { |
1318 FLOG("[bgchecker] LaunchNotificationL "); |
1441 FLOG("[bgchecker] ReminderTimerCallBack refresh is about to come in one day. We don't show reminder then"); |
|
1442 return; |
|
1443 } |
|
1444 |
|
1445 //if reminder is still on which means the BGTimer is not expired |
|
1446 //and checkupdate() is not called yet, then go ahead to call DoupdatesChecking |
|
1447 //this is to avoid DoUpdateChecking being called at the same time. |
|
1448 |
|
1449 if ( ReminderOnL() ) |
|
1450 { |
|
1451 FLOG("[bgchecker] ReminderTimerCallBack Reminder is still ON"); |
|
1452 DoUpdatesCheckingL( EFalse ); |
|
1453 } |
|
1454 FLOG("[bgchecker] ReminderTimerCallBack end"); |
|
1455 } |
|
1456 |
|
1457 // ---------------------------------------------------------- |
|
1458 // CIAUpdateBGTimer::ReminderTimerCallBack() |
|
1459 // ---------------------------------------------------------- |
|
1460 void CIAUpdateBGTimer::ReminderTimerCallBack() |
|
1461 { |
|
1462 TRAP_IGNORE( DoReminderTimerCallBackL() ); |
|
1463 } |
|
1464 |
|
1465 // ---------------------------------------------------------- |
|
1466 // CIAUpdateBGTimer::LaunchSoftNotificationL() |
|
1467 // ---------------------------------------------------------- |
|
1468 void CIAUpdateBGTimer::LaunchSoftNotificationL( const TInt& aResourceId, const TInt& SK1, const TInt& SK2 ) |
|
1469 { |
|
1470 iInternalFile->ReadControllerDataL(); |
|
1471 TInt snid = iInternalFile->SoftNotificationID(); |
|
1472 if ( snid ) |
|
1473 { |
|
1474 //there is a soft notification buffered, remove it |
|
1475 iSoftNotification->RemoveSoftNotificationL( snid ); |
|
1476 } |
|
1477 |
|
1478 FLOG("[bgchecker] LaunchSoftNotificationL "); |
|
1479 HBufC* text = ReadResourceLC( aResourceId ); |
|
1480 HBufC* sk1 = ReadResourceLC( SK1 ); |
|
1481 HBufC* sk2 = ReadResourceLC( SK2 ); |
|
1482 |
|
1483 |
1319 |
1484 iMode = ModeL(); |
1320 iMode = ModeL(); |
1485 |
1321 |
1486 /* |
1322 // loc: initialize localisation text loader |
1487 // Commented out, so no icon is shown in the soft notification. |
1323 /* |
1488 // Other functions, used by the code below, are also commented out. |
1324 TBool res = HbTextResolverSymbian::Init(KLocFile, KLocFilePath); |
1325 if ( res != KErrNone ) |
|
1326 { |
|
1327 // nothing to do |
|
1328 } |
|
1329 */ |
|
1330 |
|
1331 |
|
1332 // loc: Resolve title text |
|
1333 /* |
|
1334 HBufC* titleText; |
|
1335 if ( aNrOfUpdates == 0 ) |
|
1336 { |
|
1337 // First time case |
|
1338 titleText = HbTextResolverSymbian::LoadL( KTitleFirstTime ); |
|
1339 } |
|
1340 else if ( aNrOfUpdates == 1 ) |
|
1341 { |
|
1342 // one update available |
|
1343 titleText = HbTextResolverSymbian::LoadL( KTitleOneUpdate ); |
|
1344 } |
|
1345 else |
|
1346 { |
|
1347 // several updates available |
|
1348 titleText = HbTextResolverSymbian::LoadL( KTitleSeveralUpdates ); |
|
1349 } |
|
1350 |
|
1351 // Resolve second text |
|
1352 HBufC* secondText; |
|
1353 if ( aNrOfUpdates == 0 ) |
|
1354 { |
|
1355 // First time case |
|
1356 secondText = HbTextResolverSymbian::LoadL( KSecondFirstTime ); |
|
1357 } |
|
1358 else if ( aNrOfUpdates == 1 ) |
|
1359 { |
|
1360 // one update available |
|
1361 secondText = HbTextResolverSymbian::LoadL( KSecondOneUpdate, aNrOfUpdates ); |
|
1362 } |
|
1363 else |
|
1364 { |
|
1365 // several updates available |
|
1366 // loc: text.append(hbTrId("txt_software_dblist_updates_available")); |
|
1367 secondText = HbTextResolverSymbian::LoadL( KSecondSeveralUpdates, aNrOfUpdates ); |
|
1368 } |
|
1369 */ |
|
1370 |
|
1371 // loc: Load title and second line |
|
1372 // HBufC* titleText = HbTextResolverSymbian::LoadL(KTextTitle); |
|
1373 // CleanupStack::PushL( titleText ); |
|
1374 // HBufC* secondText3 = HbTextResolverSymbian::LoadL(KTextSecond); |
|
1375 // CleanupStack::PushL( titleText ); |
|
1376 |
|
1377 |
|
1378 TBuf<128> titleText; |
|
1379 TBuf<128> secondText; |
|
1380 |
|
1381 //title text (normal/first time) |
|
1382 if ( iMode == ENormalMode ) |
|
1383 { |
|
1384 titleText.Append(KNormalText); |
|
1385 } |
|
1386 else |
|
1387 { |
|
1388 titleText.Append(KFirstTimeText); |
|
1389 } |
|
1390 |
|
1391 //text for 2nd line |
|
1392 secondText.Append(KSecondText); |
|
1393 |
|
1394 // icon |
|
1395 /* HLa--> |
|
1489 if ( iMode == ENormalMode ) |
1396 if ( iMode == ENormalMode ) |
1490 { |
1397 { |
1491 TFileName path; |
1398 TFileName path; |
1492 TInt err = GetPrivatePathL( path ); |
1399 TInt err = GetPrivatePathL( path ); |
1493 |
1400 |
1494 if ( err == KErrNone ) |
1401 if ( err == KErrNone ) |
1495 { |
1402 { |
1496 HBufC8* image = LoadFileLC( path ); |
1403 iSoftNotification->SetImagePathL( path ); |
1497 iSoftNotification->SetImageL( *image ); |
1404 //HBufC8* image = LoadFileLC( path ); |
1498 CleanupStack::PopAndDestroy( image ); |
1405 //iSoftNotification->SetImageL( *image ); |
1406 //CleanupStack::PopAndDestroy( image ); |
|
1499 } |
1407 } |
1500 } |
1408 } |
1501 */ |
1409 */ |
1410 // loc: set image path |
|
1411 // iSoftNotification->SetImagePathL( KIcon ); |
|
1502 |
1412 |
1503 |
1413 // Set texts |
1504 iSoftNotification->SetTextL( *text, *text ); |
1414 // loc: iSoftNotification->SetTextL( titleText->Des(), secondText->Des() ); |
1505 iSoftNotification->SetSoftkeyLabelsL( *sk1, *sk2 ); |
1415 iSoftNotification->SetTextL( titleText, secondText ); |
1506 |
1416 |
1507 iSoftNotification->ShowSoftNotificationL(); |
1417 // loc: delete text buffers |
1508 FLOG("[bgchecker] LaunchSoftNotificationL 1"); |
1418 // CleanupStack::PopAndDestroy( titleText ); |
1509 CleanupStack::PopAndDestroy( 3 ); //text, sk1, sk2 |
1419 // CleanupStack::PopAndDestroy( titleText ); |
1510 } |
1420 |
1511 |
1421 // Set number of updates for dialog and internal file |
1512 |
1422 iSoftNotification->SetNrOfUpdates( aNrOfUpdates ); |
1513 // ---------------------------------------------------------- |
1423 SetNrOfIndicatorEntriesL( aNrOfUpdates ); |
1514 // CIAUpdateBGTimer::GetPrivatePathL() |
1424 |
1515 // ---------------------------------------------------------- |
1425 iSoftNotification->ShowNotificationL(); |
1516 TInt CIAUpdateBGTimer::GetPrivatePathL( TFileName& /*aPath*/ ) |
1426 FLOG("[bgchecker] LaunchNotificationL 1"); |
1517 { |
1427 |
1518 /* |
1428 return; |
1519 RFs fsSession; |
1429 } |
1520 User::LeaveIfError( fsSession.Connect() ); |
|
1521 CleanupClosePushL( fsSession ); |
|
1522 |
|
1523 // This will set the correct drive and private path |
|
1524 // for the file server session. |
|
1525 TInt err = KErrNone; |
|
1526 TRAP( err, SetPrivateDriveL( fsSession, KImageFile ) ); |
|
1527 |
|
1528 if ( err != KErrNone ) |
|
1529 { |
|
1530 CleanupStack::PopAndDestroy( &fsSession ); |
|
1531 return err; |
|
1532 } |
|
1533 |
|
1534 err = fsSession.SessionPath( aPath ); |
|
1535 aPath.Append( KImageFile ); |
|
1536 |
|
1537 CleanupStack::PopAndDestroy( &fsSession ); |
|
1538 return err; |
|
1539 */ |
|
1540 return 0; |
|
1541 } |
|
1542 |
|
1543 // ---------------------------------------------------------- |
|
1544 // CIAUpdateBGTimer::LoadFileLC() |
|
1545 // ---------------------------------------------------------- |
|
1546 HBufC8* CIAUpdateBGTimer::LoadFileLC(const TDesC& /*aFile*/) |
|
1547 { |
|
1548 /* |
|
1549 RFs fs; |
|
1550 User::LeaveIfError( fs.Connect() ); |
|
1551 CleanupClosePushL( fs ); |
|
1552 RFile file; |
|
1553 User::LeaveIfError(file.Open(fs, aFile, EFileRead)); |
|
1554 CleanupClosePushL(file); |
|
1555 TInt size; |
|
1556 User::LeaveIfError(file.Size(size)); |
|
1557 HBufC8* imagebuf = HBufC8::NewL(size); |
|
1558 TPtr8 imageptr(imagebuf->Des()); |
|
1559 file.Read(imageptr); |
|
1560 CleanupStack::PopAndDestroy( &file ); |
|
1561 CleanupStack::PopAndDestroy( &fs ); |
|
1562 CleanupDeletePushL(imagebuf); |
|
1563 return imagebuf; |
|
1564 */ |
|
1565 return NULL; |
|
1566 } |
|
1567 |
|
1568 |
|
1569 // ---------------------------------------------------------- |
|
1570 // CIAUpdateBGTimer::SetPrivateDriveL() |
|
1571 // ---------------------------------------------------------- |
|
1572 void CIAUpdateBGTimer::SetPrivateDriveL( |
|
1573 RFs& /*aFs*/, |
|
1574 const TDesC& /*aFileName*/ ) const |
|
1575 { |
|
1576 /* |
|
1577 // First try to find the file from the private directory |
|
1578 // of the drive where the process exists. |
|
1579 RProcess process; |
|
1580 |
|
1581 // Set the session private path according to |
|
1582 // the process file name drive. |
|
1583 TInt driveNum( |
|
1584 SetSessionPrivatePathL( aFs, process.FileName() ) ); |
|
1585 |
|
1586 // Get the session path that was set above. |
|
1587 TFileName sessionPath; |
|
1588 User::LeaveIfError( aFs.SessionPath( sessionPath ) ); |
|
1589 |
|
1590 // Use the file finder to check if the file actually exists |
|
1591 // in the given drive path. If it does not, the file finder |
|
1592 // will automatically check from other drives. So, here we |
|
1593 // should always find the file if any exists. |
|
1594 TFindFile finder( aFs ); |
|
1595 User::LeaveIfError( finder.FindByDir( aFileName, sessionPath ) ); |
|
1596 |
|
1597 // The drive may have changed if the file was not found from |
|
1598 // the first suggested drive. So, be sure to have the correct |
|
1599 // private path. |
|
1600 driveNum = SetSessionPrivatePathL( aFs, finder.File() ); |
|
1601 |
|
1602 // Use the drive info to check if the drive is ROM drive. |
|
1603 // We prefer non ROM drives. But, accept ROM if nothing else is |
|
1604 // available. |
|
1605 TDriveInfo info; |
|
1606 User::LeaveIfError( aFs.Drive( info, driveNum ) ); |
|
1607 TBool isRomDrive( info.iDriveAtt & KDriveAttRom ); |
|
1608 if ( !isRomDrive ) |
|
1609 { |
|
1610 // The current file is not in ROM drive so use that. |
|
1611 return; |
|
1612 } |
|
1613 |
|
1614 // Because previous finding was ROM file, try to find a non ROM file. |
|
1615 TInt findErrorCode( finder.Find() ); |
|
1616 if ( findErrorCode == KErrNotFound ) |
|
1617 { |
|
1618 // Because no new file is found, use the current settings. |
|
1619 return; |
|
1620 } |
|
1621 User::LeaveIfError( findErrorCode ); |
|
1622 |
|
1623 // Update the session path for the correct file. |
|
1624 SetSessionPrivatePathL( aFs, finder.File() ); |
|
1625 */ |
|
1626 } |
|
1627 |
|
1628 |
|
1629 // ---------------------------------------------------------- |
|
1630 // CIAUpdateBGTimer::SetSessionPrivatePathL() |
|
1631 // ---------------------------------------------------------- |
|
1632 TInt CIAUpdateBGTimer::SetSessionPrivatePathL( |
|
1633 RFs& /*aFs*/, |
|
1634 const TDesC& /*aPath*/ ) const |
|
1635 { |
|
1636 /* |
|
1637 // Use the parser to get the drive information from the path. |
|
1638 TParsePtrC parser( aPath ); |
|
1639 |
|
1640 if ( !parser.DrivePresent() ) |
|
1641 { |
|
1642 User::Leave( KErrArgument ); |
|
1643 } |
|
1644 |
|
1645 // Drive check was passed above. |
|
1646 // So, drive information is safe to use. |
|
1647 const TDesC& drive( parser.Drive() ); |
|
1648 const TChar driveChar( drive[ 0 ] ); |
|
1649 TInt driveNum( EDriveA ); |
|
1650 User::LeaveIfError( |
|
1651 RFs::CharToDrive( driveChar, driveNum ) ); |
|
1652 |
|
1653 // Set the file drive to be file session private path drive. |
|
1654 User::LeaveIfError( aFs.SetSessionToPrivate( driveNum ) ); |
|
1655 |
|
1656 return driveNum; |
|
1657 */ |
|
1658 return 0; |
|
1659 } |
|
1660 |
|
1661 // ---------------------------------------------------------- |
|
1662 // CIAUpdateBGTimer::ReadResourceLC() |
|
1663 // ---------------------------------------------------------- |
|
1664 HBufC* CIAUpdateBGTimer::ReadResourceLC( TInt aResourceId ) |
|
1665 { |
|
1666 TResourceReader reader; |
|
1667 HBufC8* buff = iResourceFile.AllocReadLC( aResourceId ); |
|
1668 reader.SetBuffer( buff ); |
|
1669 HBufC* text = reader.ReadHBufCL(); |
|
1670 CleanupStack::PopAndDestroy( buff ); |
|
1671 CleanupStack::PushL( text ); |
|
1672 return text; |
|
1673 } |
|
1674 |
|
1675 |
1430 |
1676 // ---------------------------------------------------------- |
1431 // ---------------------------------------------------------- |
1677 // CIAUpdateBGTimer::IsAutoUpdateDisabledL() |
1432 // CIAUpdateBGTimer::IsAutoUpdateDisabledL() |
1678 // ---------------------------------------------------------- |
1433 // ---------------------------------------------------------- |
1679 TBool CIAUpdateBGTimer::IsAutoUpdateDisabledL() |
1434 TBool CIAUpdateBGTimer::IsAutoUpdateDisabledL() |
1798 FLOG("[bgchecker] Shutdown() begin"); |
1553 FLOG("[bgchecker] Shutdown() begin"); |
1799 Cancel(); |
1554 Cancel(); |
1800 delete iUpdate; |
1555 delete iUpdate; |
1801 iUpdate = NULL; |
1556 iUpdate = NULL; |
1802 |
1557 |
1803 delete iReminderTimer; |
1558 //delete iReminderTimer; |
1804 iReminderTimer = NULL; |
1559 //iReminderTimer = NULL; |
1805 |
1560 |
1806 if ( iNotifyHandler ) |
1561 if ( iNotifyHandler ) |
1807 { |
1562 { |
1808 iNotifyHandler->StopListening(); |
1563 iNotifyHandler->StopListening(); |
1809 delete iNotifyHandler; |
1564 delete iNotifyHandler; |
1810 iNotifyHandler = NULL; |
1565 iNotifyHandler = NULL; |
1811 } |
1566 } |
1812 |
1567 |
1813 if ( iSoftNotification ) |
1568 if ( iSoftNotification ) |
1814 { |
1569 { |
1815 TRAP_IGNORE( iSoftNotification->RemoveSoftNotificationL( iSoftNotification->Id() ) ); |
|
1816 delete iSoftNotification; |
1570 delete iSoftNotification; |
1817 iSoftNotification = NULL; |
1571 iSoftNotification = NULL; |
1572 } |
|
1573 |
|
1574 if ( iIndicatorNotifyHandler ) |
|
1575 { |
|
1576 delete iIndicatorNotifyHandler; |
|
1577 iIndicatorNotifyHandler = NULL; |
|
1818 } |
1578 } |
1819 |
1579 |
1820 CActiveScheduler::Stop(); |
1580 CActiveScheduler::Stop(); |
1821 |
1581 |
1822 FLOG("[bgchecker] Shutdown() end"); |
1582 FLOG("[bgchecker] Shutdown() end"); |
1823 } |
1583 } |
1824 |
1584 // --------------------------------------------------------------------------- |
1825 |
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 } |
|
1826 |
1596 |
1827 // End of file |
1597 // End of file |
1828 |
|
1829 |