1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
17 |
17 |
18 /** |
18 /** |
19 @file |
19 @file |
20 */ |
20 */ |
21 |
21 |
|
22 |
|
23 #include "OstTraceDefinitions.h" |
|
24 #ifdef OST_TRACE_COMPILER_IN_USE |
|
25 #include "smsubackupTraces.h" |
|
26 #endif |
|
27 |
22 #include <e32std.h> |
28 #include <e32std.h> |
23 #include "SmsuBackup.h" |
29 #include "SmsuBackup.h" |
24 #include <babackup.h> |
30 #include <babackup.h> |
25 #include "smsstacklog.h" |
|
26 |
31 |
27 |
32 |
28 const TInt KBURPartMask = 0x000000FF; |
33 const TInt KBURPartMask = 0x000000FF; |
29 |
34 |
30 #include <connect/sbdefs.h> |
35 #include <connect/sbdefs.h> |
32 using namespace conn; |
37 using namespace conn; |
33 |
38 |
34 |
39 |
35 EXPORT_C CBackupAndRestore* CBackupAndRestore::NewL(MNBBackupAndRestoreObserver& aBackupAndRestoreObserver) |
40 EXPORT_C CBackupAndRestore* CBackupAndRestore::NewL(MNBBackupAndRestoreObserver& aBackupAndRestoreObserver) |
36 { |
41 { |
37 LOGSMSU1("CBackupAndRestore::NewL()"); |
42 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CBACKUPANDRESTORE_NEWL_1, "CBackupAndRestore::NewL()"); |
38 |
43 |
39 CBackupAndRestore* me = new(ELeave) CBackupAndRestore(aBackupAndRestoreObserver); |
44 CBackupAndRestore* me = new(ELeave) CBackupAndRestore(aBackupAndRestoreObserver); |
40 CleanupStack::PushL(me); |
45 CleanupStack::PushL(me); |
41 me->ConstructL(); |
46 me->ConstructL(); |
42 CleanupStack::Pop(me); |
47 CleanupStack::Pop(me); |
51 } |
56 } |
52 |
57 |
53 |
58 |
54 void CBackupAndRestore::ConstructL() |
59 void CBackupAndRestore::ConstructL() |
55 { |
60 { |
56 LOGSMSU1("CBackupAndRestore::ConstructL()"); |
61 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBACKUPANDRESTORE_CONSTRUCTL_1, "CBackupAndRestore::ConstructL()"); |
57 |
62 |
58 iBackupOrRestoreInProgress = EFalse; |
63 iBackupOrRestoreInProgress = EFalse; |
59 User::LeaveIfError(iBackupProperty.Attach(KUidSystemCategory,KUidBackupRestoreKey)); |
64 User::LeaveIfError(iBackupProperty.Attach(KUidSystemCategory,KUidBackupRestoreKey)); |
60 CActiveScheduler::Add(this); |
65 CActiveScheduler::Add(this); |
61 iBackupProperty.Subscribe(iStatus); |
66 iBackupProperty.Subscribe(iStatus); |
70 } // CBackupAndRestore::~CBackupAndRestore |
75 } // CBackupAndRestore::~CBackupAndRestore |
71 |
76 |
72 |
77 |
73 void CBackupAndRestore::DoCancel() |
78 void CBackupAndRestore::DoCancel() |
74 { |
79 { |
75 LOGSMSU1("CBackupAndRestore::DoCancel()"); |
80 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBACKUPANDRESTORE_DOCANCEL_1, "CBackupAndRestore::DoCancel()"); |
76 |
81 |
77 iBackupProperty.Cancel(); |
82 iBackupProperty.Cancel(); |
78 } // CBackupAndRestore::DoCancel |
83 } // CBackupAndRestore::DoCancel |
79 |
84 |
80 |
85 |
81 EXPORT_C TBool CBackupAndRestore::IsBackupOrRestoreInProgress() |
86 EXPORT_C TBool CBackupAndRestore::IsBackupOrRestoreInProgress() |
82 { |
87 { |
83 LOGSMSU1("CBackupAndRestore::IsBackupOrRestoreInProgress()"); |
88 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CBACKUPANDRESTORE_ISBACKUPORRESTOREINPROGRESS_1, "CBackupAndRestore::IsBackupOrRestoreInProgress()"); |
84 |
89 |
85 return iBackupOrRestoreInProgress; |
90 return iBackupOrRestoreInProgress; |
86 } // CBackupAndRestore::IsBackupOrRestoreInProgress |
91 } // CBackupAndRestore::IsBackupOrRestoreInProgress |
87 |
92 |
88 |
93 |
89 /** |
94 /** |
90 * @leave KErrNotSupported if unknown backup flag is found |
95 * @leave KErrNotSupported if unknown backup flag is found |
91 */ |
96 */ |
92 void CBackupAndRestore::RunL() |
97 void CBackupAndRestore::RunL() |
93 { |
98 { |
94 LOGSMSU1("CBackupAndRestore::RunL()"); |
99 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBACKUPANDRESTORE_RUNL_1, "CBackupAndRestore::RunL()"); |
95 |
100 |
96 iBackupProperty.Subscribe(iStatus); |
101 iBackupProperty.Subscribe(iStatus); |
97 SetActive(); |
102 SetActive(); |
98 |
103 |
99 |
104 |