author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 19 Aug 2010 09:48:13 +0300 | |
branch | RCL_3 |
changeset 24 | 6c158198356e |
permissions | -rw-r--r-- |
24
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Implementation of Midp2BackupPlugin with USIF |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
#include <connect/sbdefs.h> |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#include <s32mem.h> |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include <s32file.h> |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include <f32file.h> |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include <apgcli.h> |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include "midp2backuppluginusif.h" |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
#include "midp2backupdataids.h" |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
#include "javastoragebackuputil.h" |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
#include "javaversionbackuputil.h" |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
#include "javascrbackuputil.h" |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
#include "javastoragenames.h" |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
#include "javastorageentry.h" |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
#include "javastorage.h" |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
#include "javacommonutils.h" |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
#include "logger.h" |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
using namespace std; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
using namespace java::storage; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
using namespace java::backup; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
// ======== MEMBER FUNCTIONS ======== |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
CMidp2BackupPlugin::CMidp2BackupPlugin() |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin constructor"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
void CMidp2BackupPlugin::ConstructL() |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::ConstructL"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
iIconDescIndex = 0; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
iBufferSpaceLeft = 0; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
iFirstCallToGetBackupDataSection = ETrue; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
iStorageDataBackup = ETrue; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
iScrDataBackup = ETrue; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
iStorageDataRestore = ETrue; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
iJavaVersionInfoWritten = EFalse; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
iRestoreState = EVersion; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
User::LeaveIfError(iFs.Connect()); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
// to share file handles with AppArc |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
User::LeaveIfError(iFs.ShareProtected()); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
iStorageBackupUtil = CStorageBackupUtil::NewL(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
//iAppArcUtil = CAppArcBackupUtil::NewL(iFs); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
iScrBackupUtil = CScrBackupUtil::NewL(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
CMidp2BackupPlugin* CMidp2BackupPlugin::NewL() |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::NewL"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
CMidp2BackupPlugin* self = new(ELeave) CMidp2BackupPlugin(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
CleanupStack::PushL(self); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
self->ConstructL(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
CleanupStack::Pop(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
return self; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
CMidp2BackupPlugin::~CMidp2BackupPlugin() |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin destructor"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
iFs.Close(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
iIconUidArray.Close(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
//delete iAppArcUtil; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
delete iIconDesc; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
delete iRestoreIconDesc; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
delete iStorageBackupUtil; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
// from base class CBackupPlugin |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
100 |
void CMidp2BackupPlugin::PrepareForBURL(TInt aBackupStateValue) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
(void)aBackupStateValue; // Just to suppress a warning in release builds |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
LOG1(EBackup, EInfo, "CMidp2BackupPlugin::PrepareForBURL, BUR state: %d", aBackupStateValue); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
105 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
void CMidp2BackupPlugin::ReceiveSnapshotDataL(TDriveNumber /* aDrive */, TDesC8& /* aBuffer */, TBool /* aLastSection */) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
108 |
JELOG2(EBackup); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
User::Leave(KErrNotSupported); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
TUint CMidp2BackupPlugin::GetExpectedDataSize(TDriveNumber /* aDrive */) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
JELOG2(EBackup); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
return 0; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
void CMidp2BackupPlugin::GetSnapshotDataL(TDriveNumber /* aDrive */, TPtr8& /* aBuffer */, TBool& /* aFinished */) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
JELOG2(EBackup); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
User::Leave(KErrNotSupported); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
void CMidp2BackupPlugin::InitialiseGetBackupDataL(TDriveNumber aDrive) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseGetBackupDataL"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
iDrive = aDrive; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
129 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
130 |
void CMidp2BackupPlugin::GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::GetBackupDataSectionL"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
133 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
iBufferSpaceLeft = aBuffer.MaxLength(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
135 |
RDesWriteStream stream(aBuffer); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
136 |
CleanupClosePushL(stream); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
137 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
138 |
if (!iJavaVersionInfoWritten) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
139 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
JavaVersionBackupUtil::WriteJavaVersionL(stream); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
iJavaVersionInfoWritten = ETrue; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
iBufferSpaceLeft -= 8; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
if (iStorageDataBackup) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
147 |
iStorageBackupUtil->BackupStorageDataL(stream, iStorageDataBackup, iBufferSpaceLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
148 |
aFinished = EFalse; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
149 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
else if(iScrDataBackup) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
iScrBackupUtil->BackupScrDataL(stream,iScrDataBackup,iBufferSpaceLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
aFinished = EFalse; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
CleanupStack::PopAndDestroy(&stream); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
void CMidp2BackupPlugin::InitialiseRestoreBaseDataL(TDriveNumber aDrive) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseRestoreBaseDataL"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
iDrive = aDrive; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
void CMidp2BackupPlugin::RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
167 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreBaseDataSectionL"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
170 |
iBufferSpaceLeft = aBuffer.Size(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
171 |
RDesReadStream stream(aBuffer); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
172 |
CleanupClosePushL(stream); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
173 |
TBool versionCheck = ETrue; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
175 |
if (((iRestoreState == EVersion) || (iRestoreState == EInstall)) && iBufferSpaceLeft >= 8) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
176 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
if (iRestoreState == EInstall) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
178 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
179 |
versionCheck = EFalse; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
180 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
181 |
TUint ret = JavaVersionBackupUtil::CheckJavaVersionL(stream,iDrive,versionCheck); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
if (1==ret) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
183 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
184 |
// Here set the satus to restore finished, so that control goes back to SBE & SBE calls B&R for another drive |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
iRestoreState = EInstall; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
186 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
187 |
else |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
188 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
189 |
/* version information has been written to stream. |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
190 |
So change restore state to restore storage data */ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
191 |
iRestoreState = EStorage; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
192 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
// version information is of length 8 bytes. |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
iBufferSpaceLeft -= 8; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
197 |
if (iRestoreState == EStorage) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
198 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
199 |
iStorageBackupUtil -> RestoreStorageDataL(stream, iRestoreState, iBufferSpaceLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
200 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
201 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
202 |
if(iRestoreState == EScr) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
204 |
iScrBackupUtil->RestoreScrDataL(stream,iRestoreState,iBufferSpaceLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
205 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
206 |
// Only at first call |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
207 |
if ((iRestoreState != EScr && iRestoreState != EVersion) && (iRestoreState != EInstall)) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
208 |
{/* |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
209 |
if (iRestoreState == EAppArc) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
211 |
// Making AppArc deregistrations |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
TRAPD(err, iAppArcUtil->DeregisterAppsL(iDrive)); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
213 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
214 |
if (err) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
216 |
ELOG(EBackup, "Leave in deregistering apps"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
217 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
218 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
219 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
220 |
// Process the data buffer for restore |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
221 |
ProcessBufferL(stream); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
223 |
if (aFinished) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
224 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
// Set state to EStorage |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
226 |
iRestoreState = EStorage; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
227 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
*/ } |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
229 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
aFinished = ETrue; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
231 |
CleanupStack::PopAndDestroy(&stream); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
233 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
234 |
void CMidp2BackupPlugin::InitialiseRestoreIncrementDataL(TDriveNumber /* aDrive */) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
JELOG2(EBackup); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
User::Leave(KErrNotSupported); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
240 |
void CMidp2BackupPlugin::RestoreIncrementDataSectionL(TDesC8& /* aBuffer */, TBool /* aFinished */) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
241 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
242 |
JELOG2(EBackup); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
243 |
User::Leave(KErrNotSupported); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
244 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
245 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
246 |
void CMidp2BackupPlugin::RestoreComplete(TDriveNumber /* aDrive */) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
247 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
248 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreComplete"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
249 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
250 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
251 |
TUint CMidp2BackupPlugin::MmcIdL() |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
253 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::MmcIdL()"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
254 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
255 |
TVolumeInfo* volumeInfo = new(ELeave) TVolumeInfo(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
256 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
257 |
TInt err = iFs.Volume(*volumeInfo, iDrive); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
258 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
259 |
if (!err) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
260 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
261 |
TUint mmcId = volumeInfo->iUniqueID; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
262 |
return mmcId; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
263 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
264 |
else |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
265 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
266 |
return 0; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
267 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
268 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
269 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
270 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
271 |
/* |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
272 |
void CMidp2BackupPlugin::ProcessBufferL(RDesReadStream& stream) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
273 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
274 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessBuffer()"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
275 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
276 |
// Cycle until there's data in the buffer |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
while (iBufferSpaceLeft > 0) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
278 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
279 |
switch (iRestoreState) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
280 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
281 |
case EAppArc: |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
282 |
ProcessFirstBufferL(stream, iBufferSpaceLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
283 |
break; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
284 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
285 |
case EInIcon: |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
286 |
ProcessInIconL(stream, iBufferSpaceLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
287 |
break; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
288 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
289 |
case EInSize: |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
290 |
ProcessInSizeL(stream, iBufferSpaceLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
291 |
break; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
292 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
293 |
default: |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
294 |
CleanupStack::PopAndDestroy(&stream); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
295 |
User::Leave(KErrNotSupported); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
296 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
297 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
298 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
299 |
*/ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
300 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
301 |
_LIT(KStarWildCard, "*.*"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
302 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
303 |
void CMidp2BackupPlugin::RestoreMmcRegistryL() |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
304 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
305 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreMmcRegistry()"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
306 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
307 |
/* If backed up MMC is not the same as the current MMC, copy the entries |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
308 |
from the directory of the backed up MMC to the directory |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
309 |
of the current MMC */ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
310 |
TUint32 mmc = MmcIdL(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
311 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
312 |
if (iBackupMmc != mmc) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
313 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
314 |
// Create path to old place |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
315 |
TPath path_old; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
316 |
CreateMmcPath(path_old, iDrive, iBackupMmc); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
317 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
318 |
// Create path to new place |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
319 |
TPath path_new; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
320 |
CreateMmcPath(path_new, iDrive, mmc); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
321 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
322 |
// Get old files list |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
323 |
CFileMan* fileMan = CFileMan::NewL(iFs); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
324 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
325 |
CleanupStack::PushL(fileMan); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
326 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
327 |
// Copy to new place |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
328 |
iFs.MkDir(path_new); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
329 |
path_old.Append(KStarWildCard); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
330 |
TInt err = fileMan->Copy(path_old, path_new); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
331 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
332 |
ILOG1(EBackup, "File copy, status: %d", err); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
333 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
334 |
User::LeaveIfError(err); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
335 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
336 |
CleanupStack::PopAndDestroy(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
337 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
338 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
339 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
340 |
_LIT(KPrivatePath, "C:\\private\\"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
341 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
342 |
void CMidp2BackupPlugin::CreateMmcPath(TDes& aPathName, TInt aDrive, TUint aUniqueId) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
343 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
344 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::CreateMmcPath()"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
345 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
346 |
aPathName.Zero(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
347 |
aPathName.Append(KPrivatePath); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
348 |
aPathName.AppendNum(KRegistryServerUid, EHex); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
349 |
aPathName.Append(KPathDelimiter); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
350 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
351 |
// append drive name |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
352 |
TDriveUnit driveUnit(aDrive); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
353 |
aPathName.Append(driveUnit.Name().Left(1)); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
354 |
aPathName.Append(KPathDelimiter); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
355 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
356 |
TUint64 id = aUniqueId; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
357 |
aPathName.AppendNum(id, EHex); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
358 |
aPathName.Append(KPathDelimiter); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
359 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
360 |
/* |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
361 |
TBool CMidp2BackupPlugin::NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
362 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
363 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::NextIcon()"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
364 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
365 |
if (iIconUidArray.Count() > iIconFilePointer) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
366 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
367 |
aCurrentUid = iIconUidArray[iIconFilePointer]; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
368 |
iAppArcUtil->GetIconFilename(iIconUidArray[iIconFilePointer], aFullFileName); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
369 |
iIconFilePointer++; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
370 |
return ETrue; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
371 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
372 |
else |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
373 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
374 |
// There are no more icon files |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
375 |
return EFalse; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
376 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
377 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
378 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
379 |
void CMidp2BackupPlugin::ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
380 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
381 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessFirstBuffer()"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
382 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
383 |
if (iDrive >= EDriveE && iDrive <= EDriveZ) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
384 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
385 |
// Read MMC id and restore MMC entries if needed |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
386 |
iBackupMmc = aStream.ReadUint32L(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
387 |
aBufferSpaceLeft -= sizeof(iBackupMmc); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
388 |
LOG1(EBackup, EInfo, "Read MMC Id: %u", iBackupMmc); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
389 |
RestoreMmcRegistryL(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
390 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
391 |
if (aBufferSpaceLeft >= sizeof(TInt32)) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
392 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
393 |
iIconFileSizeLeft = aStream.ReadInt32L(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
394 |
aBufferSpaceLeft -= sizeof(iIconFileSizeLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
395 |
iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
396 |
iRestoreState = EInIcon; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
397 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
398 |
else |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
399 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
400 |
// No more data to read |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
401 |
aBufferSpaceLeft = 0; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
402 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
403 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
404 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
405 |
void CMidp2BackupPlugin::ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
406 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
407 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInIcon()"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
408 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
409 |
TPtr8 restoreIconPtr = iRestoreIconDesc->Des(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
410 |
HBufC8* tempDesc = HBufC8::NewL(iIconFileSizeLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
411 |
CleanupStack::PushL(tempDesc); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
412 |
TPtr8 tempPtr = tempDesc->Des(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
413 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
414 |
// Icon cannot be read fully |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
415 |
if (iIconFileSizeLeft > aBufferSpaceLeft) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
416 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
417 |
aStream.ReadL(tempPtr, aBufferSpaceLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
418 |
restoreIconPtr.Append(tempPtr); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
419 |
iIconFileSizeLeft -= aBufferSpaceLeft; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
420 |
aBufferSpaceLeft = 0; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
421 |
iRestoreState = EInIcon; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
422 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
423 |
// Icon can be read fully |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
424 |
else |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
425 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
426 |
aStream.ReadL(tempPtr, iIconFileSizeLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
427 |
restoreIconPtr.Append(tempPtr); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
428 |
aBufferSpaceLeft -= iIconFileSizeLeft; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
429 |
iRestoreState = EInSize; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
430 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
431 |
TRAPD(err, iAppArcUtil->RegisterAppL(restoreIconPtr, iDrive)); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
432 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
433 |
if (err) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
434 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
435 |
ELOG(EBackup, "Registerin application to AppArc failed."); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
436 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
437 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
438 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
439 |
CleanupStack::PopAndDestroy(tempDesc); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
440 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
441 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
442 |
void CMidp2BackupPlugin::ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
443 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
444 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInSize()"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
445 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
446 |
if (aBufferSpaceLeft >= sizeof(TInt32)) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
447 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
448 |
if (iSizeBuffer.Size() != 0) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
449 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
450 |
// Read leftover part of size |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
451 |
TInt readData = sizeof(TInt32) - iSizeBuffer.Size(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
452 |
aStream.ReadL(iSizeBuffer, readData); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
453 |
RMemReadStream sizeStream(iSizeBuffer.Ptr(), 4); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
454 |
CleanupClosePushL(sizeStream); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
455 |
iIconFileSizeLeft = sizeStream.ReadInt32L(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
456 |
CleanupStack::PopAndDestroy(&sizeStream); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
457 |
aBufferSpaceLeft -= sizeof(readData); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
458 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
459 |
else |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
460 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
461 |
// Read size in full |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
462 |
iIconFileSizeLeft = aStream.ReadInt32L(); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
463 |
aBufferSpaceLeft -= sizeof(iIconFileSizeLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
464 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
465 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
466 |
delete iRestoreIconDesc; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
467 |
iRestoreIconDesc = NULL; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
468 |
iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
469 |
iRestoreState = EInIcon; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
470 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
471 |
else |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
472 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
473 |
// Read first byte(s) of size |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
474 |
aStream.ReadL(iSizeBuffer, aBufferSpaceLeft); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
475 |
aBufferSpaceLeft = 0; |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
476 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
477 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
478 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
479 |
void CMidp2BackupPlugin::ResetIconArray() |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
480 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
481 |
LOG(EBackup, EInfo, "CMidp2BackupPlugin::ResetIconArray()"); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
482 |
|
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
483 |
// Remove all entries |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
484 |
while (iIconUidArray.Count()) |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
485 |
{ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
486 |
iIconUidArray.Remove(0); |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
487 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
488 |
} |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
489 |
*/ |
6c158198356e
Revision: v2.2.9
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
490 |