author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 15:30:06 +0300 | |
branch | RCL_3 |
changeset 76 | 3cdbd92ee07b |
parent 65 | 5cc2995847ea |
permissions | -rw-r--r-- |
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
b497e44ab2fc
Revision: 200949
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". |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Implementation of terminalsecurity components |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
// INCLUDE FILES |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include <e32svr.h> |
62 | 22 |
#include <bautils.h> |
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#include <e32math.h> |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include <e32uid.h> |
62 | 25 |
#include <barsc.h> |
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
#include <AknGlobalNote.h> |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
#include <aknnotewrappers.h> |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
#include <AknQueryDialog.h> |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
#include <AknGlobalConfirmationQuery.h> |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
#include "SCPClient.h" |
62 | 32 |
#include "SCPQueryDialog.h" |
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
#include "SCPParamObject.h" |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
|
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
35 |
#include <SCPNotifier.rsg> |
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
#include "SCP_IDs.h" |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
#include <centralrepository.h> |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
#include "SCPLockCode.h" |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
//#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
#include <TerminalControl3rdPartyAPI.h> |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
#include <SCPServerInterface.h> |
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
43 |
#include <SecUi.rsg> |
62 | 44 |
#include <scptimestamppluginlang.rsg> |
9
57a65a3a658c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
45 |
#include <secui.hrh> |
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
#include <StringLoader.h> |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
#include <bautils.h> |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
//#endif // DEVICE_LOCK_ENHANCEMENTS |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
#include <featmgr.h> |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
#include "SCPDebug.h" |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
#include <e32property.h> |
62 | 53 |
#include <SCPPServerPluginDefs.hrh> |
54 |
#include <apgtask.h> |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
/*#ifdef _DEBUG |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
#define __SCP_DEBUG |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
#endif // _DEBUG |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
// Define this so the precompiler in CW 3.1 won't complain about token pasting, |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
// the warnings are not valid |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
#pragma warn_illtokenpasting off |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
#ifdef __SCP_DEBUG |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
#define Dprint(a) RDebug::Print##a |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
#else |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
#define Dprint(a) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
#endif // _DEBUG*/ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
static const TUint KDefaultMessageSlots = 3; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
static const TInt KSCPConnectRetries( 2 ); |
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
71 |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
//#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
_LIT( KDriveZ, "Z:" ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
_LIT( KSCPResourceFilename, "\\Resource\\SCPNotifier.RSC" ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
_LIT( KSCPSecUIResourceFilename, "\\Resource\\SecUi.RSC" ); |
62 | 77 |
_LIT( KSCPTimestampPluginResFilename, "\\Resource\\SCPTimestampPluginLang.rsc"); |
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
//#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
// Uid for the application; this should match the mmp file |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
const TUid KServerUid3 = {0x10207836}; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
#ifdef __WINS__ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
static const TUint KServerMinHeapSize = 0x1000; // 4K |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
static const TUint KServerMaxHeapSize = 0x10000; // 64K |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
#endif |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
static TInt StartServer(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
static TInt CreateServerProcess(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
// LOCAL FUNCTION PROTOTYPES |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
// ==================== LOCAL FUNCTIONS ==================== |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
// StartServer() Server starter check |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
// Determines if the server is running, if not, calls the starter function |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
100 |
// Returns: TInt: Operation status, a standard error code |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
105 |
static TInt StartServer() |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
Dprint( (_L("--> SCPClient::StartServer()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
108 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
TInt result; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
TFindServer findSCPServer( KSCPServerName ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
TFullName name; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
result = findSCPServer.Next( name ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
if ( result != KErrNone ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
// The server is not running, try to create the server process |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
result = CreateServerProcess(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
Dprint( (_L("<-- SCPClient::StartServer(): Exit code: %d"), result )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
return result; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
// CreateServerProcess() Server starter function |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
// Starts the SCP server |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
129 |
// Returns: TInt: Operation status, a standard error code |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
130 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
133 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
static TInt CreateServerProcess() |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
135 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
136 |
Dprint( (_L("--> SCPClient::CreateServerProcess()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
137 |
TInt result; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
138 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
139 |
const TUidType serverUid( KNullUid, KNullUid, KServerUid3 ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
RProcess server; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
_LIT( KEmpty, ""); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
result = server.Create( KSCPServerFileName, KEmpty ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
if ( result != KErrNone ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
147 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
148 |
Dprint( (_L("<-- SCPClient::CreateServerProcess(), process creation error!") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
149 |
return result; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
TRequestStatus stat; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
server.Rendezvous(stat); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
if ( stat != KRequestPending ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
server.Kill(0); // abort startup |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
else |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
server.Resume(); // logon OK - start the server |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
User::WaitForRequest(stat); // wait for start or death |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
167 |
// we can't use the 'exit reason' if the server panicked as this |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
// is the panic 'reason' and may be '0' which cannot be distinguished |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
// from KErrNone |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
170 |
result = ( server.ExitType() == EExitPanic ) ? KErrGeneral : stat.Int(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
171 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
172 |
server.Close(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
173 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
Dprint( (_L("<-- SCPClient::CreateServerProcess(): %d"), result )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
175 |
return result; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
176 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
178 |
//#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
179 |
|
62 | 180 |
// --------------------------------------------------------- |
181 |
// RunDialog() Dialog execution wrapper |
|
182 |
// Initialize and run the query dialog |
|
183 |
// Returns: TInt: The return code from the dialog. |
|
184 |
// Can leave with a generic error code. |
|
185 |
// |
|
186 |
// Status : Approved |
|
187 |
// --------------------------------------------------------- |
|
188 |
// |
|
189 |
TInt RunDialogL( TDes& aReplyBuf, |
|
190 |
RSCPClient::TSCPButtonConfig aButtonsShown, |
|
191 |
TInt aMinLen, |
|
192 |
TInt aMaxLen, |
|
193 |
TUint aResId = 0, |
|
194 |
TDesC* aPrompt = NULL, |
|
195 |
TBool aECSSupport = EFalse, |
|
196 |
CSCPQueryDialog :: TKeypadContext aContext = CSCPQueryDialog :: ENumeric |
|
197 |
) |
|
198 |
{ |
|
199 |
Dprint(_L("[RSCPClient]-> RunDialogL() >>> ")); |
|
200 |
Dprint(_L("[RSCPClient]-> RunDialogL() aContext = %d "), aContext); |
|
201 |
||
202 |
FeatureManager::InitializeLibL(); |
|
203 |
if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) |
|
204 |
{ |
|
205 |
FeatureManager::UnInitializeLib(); |
|
206 |
return KErrNotSupported; |
|
207 |
} |
|
208 |
FeatureManager::UnInitializeLib(); |
|
209 |
if ( ( aPrompt == NULL ) && ( aResId == 0 ) ) |
|
210 |
{ |
|
211 |
return KErrArgument; |
|
212 |
} |
|
213 |
Dprint((_L("--> SCPClient::RunDialogL() start the dialog"))); |
|
214 |
CSCPQueryDialog* dialog = new (ELeave) CSCPQueryDialog( |
|
215 |
aReplyBuf, |
|
216 |
aButtonsShown, |
|
217 |
aMinLen, |
|
218 |
aMaxLen, |
|
219 |
aECSSupport, |
|
220 |
aContext |
|
221 |
); |
|
222 |
||
223 |
CleanupStack::PushL( dialog ); |
|
224 |
||
225 |
if ( aResId != 0 ) |
|
226 |
{ |
|
227 |
// Load and set the prompt from a resource ID |
|
228 |
HBufC* prompt; |
|
229 |
||
230 |
prompt = StringLoader::LoadLC( aResId ); |
|
231 |
dialog->SetPromptL( *prompt ); |
|
232 |
||
233 |
CleanupStack::PopAndDestroy( prompt ); |
|
234 |
} |
|
235 |
else |
|
236 |
{ |
|
237 |
// Set the given prompt |
|
238 |
dialog->SetPromptL( *aPrompt ); |
|
239 |
} |
|
240 |
Dprint((_L("-- SCPClient::RunDialogL() dialog->ExecuteLD"))); |
|
241 |
TInt ret = dialog->ExecuteLD( R_SCP_CODE_QUERY ); |
|
242 |
||
243 |
CleanupStack::Pop( dialog ); |
|
244 |
Dprint( (_L("-- SCPClient::RunDialogL(): ret val %d"), ret)); |
|
245 |
return ret; |
|
246 |
} |
|
247 |
||
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
248 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
249 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
250 |
// LoadResources() Resource loader |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
251 |
// Load the resources for the library |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
// Returns: TInt: A generic error code. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
253 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
254 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
255 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
256 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
257 |
TInt LoadResources( TInt& aRes1, TInt& aRes2 ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
258 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
259 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
260 |
TRAPD ( err, FeatureManager::InitializeLibL() ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
261 |
if ( err == KErrNone ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
262 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
263 |
if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
264 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
265 |
FeatureManager::UnInitializeLib(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
266 |
return KErrNotSupported; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
267 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
268 |
FeatureManager::UnInitializeLib(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
269 |
// Load the resource files for this DLL |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
270 |
TInt err = KErrNone; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
271 |
TInt err2 = KErrNone; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
272 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
273 |
// Localize the file name, and load the SCP resources |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
274 |
TFileName resFile; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
275 |
resFile.Copy( KDriveZ ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
276 |
resFile.Append( KSCPResourceFilename ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resFile ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
278 |
TRAP( err, aRes1 = CCoeEnv::Static()->AddResourceFileL( resFile ) ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
279 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
280 |
if ( err == KErrNone ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
281 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
282 |
// Localize the file name, and load the SecUi resources |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
283 |
resFile.Copy( KDriveZ ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
284 |
resFile.Append( KSCPSecUIResourceFilename ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
285 |
BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resFile ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
286 |
TRAP( err2, aRes2 = CCoeEnv::Static()->AddResourceFileL( resFile ) ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
287 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
288 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
289 |
if ( ( err != KErrNone ) || ( err2 != KErrNone ) ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
290 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
291 |
if ( err == KErrNone ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
292 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
293 |
// First resource was loaded OK, remove it |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
294 |
CCoeEnv::Static()->DeleteResourceFile( aRes1 ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
295 |
err = err2; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
296 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
297 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
298 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
299 |
return err; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
300 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
301 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
302 |
//#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
303 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
304 |
// ================= MEMBER FUNCTIONS ======================= |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
305 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
306 |
// C++ default constructor can NOT contain any code, that |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
307 |
// might leave. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
308 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
309 |
EXPORT_C RSCPClient::RSCPClient() |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
310 |
: RSessionBase() |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
311 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
312 |
// No implementation required |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
313 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
314 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
315 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
316 |
// TInt RSCPClient::Connect() |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
317 |
// Creates a new session, and starts the server, if required. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
318 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
319 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
320 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
321 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
322 |
EXPORT_C TInt RSCPClient::Connect() |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
323 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
324 |
Dprint( (_L("--> RSCPClient::Connect()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
325 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
326 |
// Use a mutex-object so that two processes cannot start the server at the same time |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
327 |
RMutex startMutex; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
328 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
329 |
TRAPD( errf, FeatureManager::InitializeLibL() ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
330 |
if( errf != KErrNone ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
331 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
332 |
return errf; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
333 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
334 |
if(FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
335 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
336 |
isFlagEnabled = ETrue; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
337 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
338 |
else |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
339 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
340 |
isFlagEnabled = EFalse; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
341 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
342 |
FeatureManager::UnInitializeLib(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
343 |
TInt mRet = startMutex.OpenGlobal( KSCPServerName ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
344 |
if ( mRet == KErrNotFound ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
345 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
346 |
mRet = startMutex.CreateGlobal( KSCPServerName ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
347 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
348 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
349 |
if ( mRet != KErrNone ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
350 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
351 |
return mRet; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
352 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
353 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
354 |
// Acquire the mutex |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
355 |
startMutex.Wait(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
356 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
357 |
TInt retry = KSCPConnectRetries; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
358 |
TInt r; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
359 |
for (;;) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
360 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
361 |
r = CreateSession( KSCPServerName, Version(), KDefaultMessageSlots ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
362 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
363 |
if ( ( r != KErrNotFound ) && ( r != KErrServerTerminated ) ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
364 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
365 |
break; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
366 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
367 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
368 |
if ( --retry == 0 ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
369 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
370 |
break; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
371 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
372 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
373 |
r = StartServer(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
374 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
375 |
if ( ( r != KErrNone ) && ( r != KErrAlreadyExists ) ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
376 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
377 |
break; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
378 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
379 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
380 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
381 |
Dprint( (_L("<-- RSCPClient::Connect(), exiting: %d"), r )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
382 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
383 |
// Release the mutex |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
384 |
startMutex.Signal(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
385 |
startMutex.Close(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
386 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
387 |
return r; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
388 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
389 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
390 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
391 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
392 |
// TVersion RSCPClient::Version() |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
393 |
// Constructs a TVersion object containing the defined version |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
394 |
// numbers, and returns it |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
395 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
396 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
397 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
398 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
399 |
EXPORT_C TVersion RSCPClient::Version() const |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
400 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
401 |
Dprint( (_L("<--> RSCPClient::Version()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
402 |
return( TVersion( KSCPServMajorVersionNumber, |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
403 |
KSCPServMinorVersionNumber, |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
404 |
KSCPServBuildVersionNumber ) ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
405 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
406 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
407 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
408 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
409 |
// TInt RSCPClient::GetCode( TSCPSecCode& aCode ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
410 |
// Requests the stored ISA code. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
411 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
412 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
413 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
414 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
415 |
EXPORT_C TInt RSCPClient::GetCode( TSCPSecCode& aCode ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
416 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
417 |
Dprint( (_L("--> RSCPClient::GetCode()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
418 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
419 |
TInt ret = SendReceive(ESCPServGetCode, TIpcArgs( &aCode ) ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
420 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
421 |
Dprint( (_L("<-- RSCPClient::GetCode(): %d"), ret )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
422 |
return ret; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
423 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
424 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
425 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
426 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
427 |
// TInt RSCPClient::StoreCode( TSCPSecCode& aCode ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
428 |
// Propagates the store code -request to the server along |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
429 |
// with the buffer parameter. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
430 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
431 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
432 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
433 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
434 |
EXPORT_C TInt RSCPClient::StoreCode( TSCPSecCode& aCode ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
435 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
436 |
Dprint( (_L("--> RSCPClient::StoreCode()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
437 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
438 |
TInt ret = SendReceive(ESCPServSetCode, TIpcArgs( &aCode ) ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
439 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
440 |
Dprint( (_L("<-- RSCPClient::StoreCode(): %d"), ret )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
441 |
return ret; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
442 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
443 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
444 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
445 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
446 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
447 |
// TInt RSCPClient::ChangeCode( TDes& aNewCode ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
448 |
// Propagates the change code -request to the server, along with |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
449 |
// the code parameter. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
450 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
451 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
452 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
453 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
454 |
EXPORT_C TInt RSCPClient::ChangeCode( TDes& aNewCode ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
455 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
456 |
Dprint( (_L("--> RSCPClient::ChangeCode()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
457 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
458 |
TInt ret = SendReceive(ESCPServChangeCode, TIpcArgs( &aNewCode ) ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
459 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
460 |
Dprint( (_L("<-- RSCPClient::ChangeCode(): %d"), ret )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
461 |
return ret; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
462 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
463 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
464 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
465 |
// TInt RSCPClient::SetPhoneLock() |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
466 |
// Propagates the lock/unlock phone -request to the server |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
467 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
468 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
469 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
470 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
471 |
EXPORT_C TInt RSCPClient::SetPhoneLock( TBool aLocked ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
472 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
473 |
Dprint( (_L("--> RSCPClient::SetPhoneLock( %d)"), aLocked )); |
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
474 |
|
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
475 |
if(aLocked==0) |
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
476 |
InformAutolockTask(); |
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
477 |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
478 |
TInt ret = SendReceive(ESCPServSetPhoneLock, TIpcArgs( aLocked ) ); |
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
479 |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
480 |
Dprint( (_L("<-- RSCPClient::SetPhoneLock(): %d"), ret )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
481 |
return ret; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
482 |
} |
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
483 |
|
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
484 |
// --------------------------------------------------------- |
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
485 |
// TInt RSCPClient::InformAutolockTask() |
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
486 |
// Informs the autolock to Unlock the homescreen |
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
487 |
// Status : Approved |
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
488 |
// --------------------------------------------------------- |
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
489 |
// |
62 | 490 |
void RSCPClient::InformAutolockTask() |
491 |
{ |
|
492 |
Dprint( (_L("RSCPClient::InformAutolockTask") )); |
|
493 |
// Deactivation call, send the deactivation message to Autolock |
|
494 |
RWsSession wsSession; |
|
495 |
if ( wsSession.Connect() != KErrNone ) |
|
496 |
{ |
|
497 |
Dprint( (_L("RSCPClient::InformAutolockTask():\ |
|
498 |
WsSession connection failed") )); |
|
499 |
User::Leave( KErrGeneral ); |
|
500 |
} |
|
501 |
CleanupClosePushL( wsSession ); |
|
502 |
||
503 |
TApaTaskList taskList( wsSession ); |
|
504 |
TApaTask task = taskList.FindApp( TUid::Uid( 0x100059B5 ) ); // Autolock |
|
505 |
||
506 |
if ( task.Exists() ) |
|
507 |
{ |
|
508 |
Dprint( (_L("RSCPClient::InformAutolockTask():\ |
|
509 |
Autolock task found, sending msg") )); |
|
510 |
// No parameters, just a dummy buffer |
|
511 |
TBuf8<8> buf; |
|
512 |
buf.Zero(); |
|
513 |
const TPtrC8& message = buf; |
|
514 |
User::LeaveIfError( |
|
515 |
task.SendMessage( TUid::Uid( SCP_CMDUID_UNLOCK+1 ), message ) |
|
516 |
); |
|
517 |
} |
|
518 |
else |
|
519 |
{ |
|
520 |
Dprint( (_L("RSCPClient::InformAutolockTask():\ |
|
521 |
Autolock task not found") )); |
|
522 |
User::Leave( KErrNotFound ); |
|
523 |
} |
|
524 |
||
525 |
CleanupStack::PopAndDestroy(); // wsSession |
|
526 |
} |
|
527 |
||
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
528 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
529 |
// TBool RSCPClient::QueryAdminCmd( TSCPAdminCommand aCommand ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
530 |
// Packs the command parameter into a buffer, and propagates |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
531 |
// the call to the server, the response is received in the |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
532 |
// same buffer. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
533 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
534 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
535 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
536 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
537 |
EXPORT_C TBool RSCPClient::QueryAdminCmd( TSCPAdminCommand aCommand ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
538 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
539 |
Dprint( (_L("--> RSCPClient::QueryAdminCmd()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
540 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
541 |
TInt status = 0; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
542 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
543 |
TPckg<TInt> retPackage(status); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
544 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
545 |
TInt ret = SendReceive( ESCPServQueryAdminCmd, TIpcArgs( aCommand, &retPackage ) ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
546 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
547 |
Dprint( (_L("<-- RSCPClient::QueryAdminCmd(): %d"), retPackage() )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
548 |
return static_cast<TBool>( status ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
549 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
550 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
551 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
552 |
// TInt RSCPClient::GetLockState( TBool& aState ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
553 |
// Package the parameter, and send it to the server. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
554 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
555 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
556 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
557 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
558 |
EXPORT_C TInt RSCPClient::GetLockState( TBool& aState ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
559 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
560 |
Dprint( (_L("--> RSCPClient::GetLockState()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
561 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
562 |
TPckg<TBool> retPackage(aState); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
563 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
564 |
TInt ret = SendReceive( ESCPServGetLockState, TIpcArgs( &retPackage ) ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
565 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
566 |
Dprint( (_L("<-- RSCPClient::GetLockState(): %d"), retPackage() )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
567 |
return ret; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
568 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
569 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
570 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
571 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
572 |
// TInt RSCPClient::GetParamValue( TInt aParamID, TDes& aValue ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
573 |
// The server contains all the logic for the parameters, just |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
574 |
// propagate the call. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
575 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
576 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
577 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
578 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
579 |
EXPORT_C TInt RSCPClient::GetParamValue( TInt aParamID, TDes& aValue ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
580 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
581 |
Dprint( (_L("--> RSCPClient::GetParamValue()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
582 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
583 |
TInt ret = SendReceive( ESCPServGetParam, TIpcArgs( aParamID, &aValue ) ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
584 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
585 |
Dprint( (_L("<-- RSCPClient::GetParamValue(): %d"), ret)); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
586 |
return ret; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
587 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
588 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
589 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
590 |
// TInt RSCPClient::SetParamValue( TInt aParamID, TDes& aValue ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
591 |
// The server contains all the logic for the parameters, just |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
592 |
// propagate the call. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
593 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
594 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
595 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
596 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
597 |
EXPORT_C TInt RSCPClient::SetParamValue( TInt aParamID, TDes& aValue ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
598 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
599 |
Dprint( (_L("--> RSCPClient::SetParamValue()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
600 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
601 |
TInt ret = SendReceive( ESCPServSetParam, TIpcArgs( aParamID, &aValue ) ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
602 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
603 |
Dprint( (_L("<-- RSCPClient::SetParamValue(): %d"), ret )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
604 |
return ret; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
605 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
606 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
607 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
608 |
// *********** Device lock new features ************* -->> |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
609 |
|
62 | 610 |
// --------------------------------------------------------- |
611 |
// RSCPClient::SecCodeQuery() |
|
612 |
// Request the security code from the user and authenticate |
|
613 |
// through the server. |
|
614 |
// |
|
615 |
// Status : Approved |
|
616 |
// --------------------------------------------------------- |
|
617 |
// |
|
618 |
EXPORT_C TInt RSCPClient::SecCodeQuery( RMobilePhone::TMobilePassword& aPassword, |
|
619 |
TSCPButtonConfig aButtonsShown, |
|
620 |
TBool aECSSupport, |
|
621 |
TInt aFlags ) |
|
622 |
{ |
|
623 |
TInt lErr = KErrNone; |
|
624 |
TInt lStatus = KErrNone; |
|
625 |
TInt lResFileSCP = NULL; |
|
626 |
TInt lResFileSecUi = NULL; |
|
627 |
Dprint( (_L("--> RSCPClient::SecCodeQuery(%d, %d"), aButtonsShown, aECSSupport )); |
|
628 |
TRAP(lErr, lStatus = SetSecurityCodeL(aPassword, aButtonsShown, aECSSupport, aFlags, lResFileSCP, lResFileSecUi)); |
|
629 |
||
630 |
||
631 |
if(lResFileSCP) { |
|
632 |
CCoeEnv :: Static()->DeleteResourceFile(lResFileSCP); |
|
633 |
} |
|
634 |
||
635 |
if(lResFileSecUi) { |
|
636 |
||
637 |
||
638 |
CCoeEnv :: Static()->DeleteResourceFile(lResFileSecUi); |
|
639 |
} |
|
640 |
||
641 |
Dprint((_L("<-- RSCPClient::SecCodeQuery(): lStatus= %d, lErr= %d"), lStatus, lErr)); |
|
642 |
return (lErr != KErrNone) ? lErr : lStatus; |
|
643 |
} |
|
644 |
||
645 |
// --------------------------------------------------------- |
|
646 |
// RSCPClient::ChangeCodeRequest() |
|
647 |
// Show the current code query dialog and continue in GetNew |
|
648 |
// CodeAndChange. |
|
649 |
// |
|
650 |
// Status : Approved |
|
651 |
// --------------------------------------------------------- |
|
652 |
// |
|
653 |
EXPORT_C TInt RSCPClient::ChangeCodeRequest() |
|
654 |
{ |
|
655 |
Dprint((_L("[RSCPClient] ChangeCodeRequest() >>>"))); |
|
656 |
||
657 |
if(EFalse == isFlagEnabled) { |
|
658 |
Dprint((_L("[RSCPClient]-> ChangeCodeRequest(): ERROR: Function not supported in this variant"))); |
|
659 |
User :: Invariant(); |
|
660 |
return KErrNotSupported; |
|
661 |
} |
|
662 |
||
663 |
TInt lRet(KErrNone); |
|
664 |
TInt lErr(KErrNone); |
|
665 |
||
666 |
TInt resourceFileSCP(NULL); |
|
667 |
TInt resourceFileSecUi(NULL); |
|
668 |
||
669 |
// Check if the code change is allowed |
|
670 |
{ |
|
671 |
HBufC8* addParamsHBuf = NULL; |
|
672 |
TRAP(lErr, addParamsHBuf = HBufC8 :: NewL(KSCPMaxTARMNotifParamLen)); |
|
673 |
||
674 |
if(lErr != KErrNone) { |
|
675 |
return lErr; |
|
676 |
} |
|
677 |
||
678 |
TPtr8 addParams = addParamsHBuf->Des(); |
|
679 |
addParams.Zero(); |
|
680 |
||
681 |
TInt status(KErrNone); |
|
682 |
TPckg<TInt> retPackage(status); |
|
683 |
||
684 |
TInt ret = SendReceive(ESCPServCodeChangeQuery, TIpcArgs(&retPackage, &addParams)); |
|
685 |
||
686 |
if((ret == KErrNone) && (addParams.Length() > 0)) { |
|
687 |
// The server has sent additional parameters, ignore errors in processing |
|
688 |
TRAP_IGNORE(ProcessServerCommandsL(addParams)); |
|
689 |
} |
|
690 |
||
691 |
delete addParamsHBuf; |
|
692 |
||
693 |
if((ret != KErrNone) || (status != KErrNone)) { |
|
694 |
// Password cannot be changed now |
|
695 |
return KErrAbort; |
|
696 |
} |
|
697 |
} |
|
698 |
||
699 |
// Load the required resource files into this process |
|
700 |
lRet = LoadResources(resourceFileSCP, resourceFileSecUi); |
|
701 |
||
702 |
if(lRet != KErrNone) { |
|
703 |
return lRet; |
|
704 |
} |
|
705 |
||
706 |
HBufC* codeHBuf = NULL; |
|
707 |
||
708 |
TRAP(lErr, codeHBuf = HBufC :: NewL(KSCPPasscodeMaxLength + 1)); |
|
709 |
||
710 |
if(lErr != KErrNone) { |
|
711 |
// Remove the resource files |
|
712 |
CCoeEnv :: Static()->DeleteResourceFile(resourceFileSCP); |
|
713 |
CCoeEnv :: Static()->DeleteResourceFile(resourceFileSecUi); |
|
714 |
return lErr; |
|
715 |
} |
|
716 |
||
717 |
TPtr codeBuffer = codeHBuf->Des(); |
|
718 |
codeBuffer.Zero(); |
|
719 |
||
720 |
TInt def_code = -1; |
|
721 |
CRepository* lRepository = NULL; |
|
722 |
||
723 |
TRAP(lErr, lRepository = CRepository :: NewL(KCRUidSCPLockCode)); |
|
724 |
||
725 |
if(KErrNone == lErr) { |
|
726 |
lErr = lRepository->Get(KSCPLockCodeDefaultLockCode, def_code); |
|
727 |
||
728 |
if(def_code == 0) { |
|
729 |
TRAP(lErr, lRet = RunDialogL(codeBuffer, SCP_OK_CANCEL, KSCPPasscodeMinLength, |
|
730 |
KSCPPasscodeMaxLength, R_SECUI_TEXT_ENTER_SEC_CODE)); |
|
731 |
||
732 |
if((lRet) && (lErr == KErrNone) && (lRet != ESecUiEmergencyCall)) { |
|
733 |
lErr = GetNewCodeAndChange(codeBuffer, KSCPNormalChange); |
|
734 |
} |
|
735 |
||
736 |
if(lErr != KErrNone) { |
|
737 |
Dprint((_L("RSCPClient::ChangeCodeRequest(): Code change FAILED: %d"), lErr)); |
|
738 |
} |
|
739 |
||
740 |
if(((!lRet) && (lErr == KErrNone)) || (lRet == ESecUiEmergencyCall)) { |
|
741 |
// Cancelled by user |
|
742 |
lErr = KErrAbort; |
|
743 |
} |
|
744 |
} |
|
745 |
else if(def_code != -1) { |
|
746 |
_LIT(KText, "12345"); |
|
747 |
TBufC<10> NBuf (KText); |
|
748 |
TPtr codeBuf = NBuf.Des(); |
|
749 |
||
750 |
lErr = GetNewCodeAndChange(codeBuf, KSCPNormalChange); |
|
751 |
||
752 |
if(lErr == KErrNone) { |
|
753 |
lRepository->Set(KSCPLockCodeDefaultLockCode, 0); |
|
754 |
} |
|
755 |
else { |
|
756 |
Dprint((_L("RSCPClient::ChangeCodeRequest(): Code change FAILED automatic: %d"), lErr)); |
|
757 |
} |
|
758 |
} |
|
759 |
||
760 |
delete lRepository; |
|
761 |
} |
|
762 |
||
763 |
Dprint((_L("<-- RSCPClient::ChangeCodeRequest(): %d"), lErr )); |
|
764 |
||
765 |
// Remove the resource files |
|
766 |
CCoeEnv :: Static()->DeleteResourceFile(resourceFileSCP); |
|
767 |
CCoeEnv :: Static()->DeleteResourceFile(resourceFileSecUi); |
|
768 |
delete codeHBuf; |
|
769 |
return lErr; |
|
770 |
} |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
771 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
772 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
773 |
// RSCPClient::CheckConfiguration() |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
774 |
// Ask the server if the configuration is OK |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
775 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
776 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
777 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
778 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
779 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
780 |
EXPORT_C TInt RSCPClient::CheckConfiguration( TInt aMode ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
781 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
782 |
Dprint( (_L("--> RSCPClient::CheckConfiguration()") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
783 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
784 |
TInt status = 0; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
785 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
786 |
TPckg<TInt> retPackage(status); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
787 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
788 |
TInt ret = SendReceive(ESCPServCheckConfig, TIpcArgs( aMode, &retPackage ) ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
789 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
790 |
if ( ret == KErrNone ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
791 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
792 |
ret = status; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
793 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
794 |
if ( status == KErrNone ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
795 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
796 |
Dprint( (_L("RSCPClient::CheckConfiguration(): Configuration OK") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
797 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
798 |
else if ( status == KErrAccessDenied ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
799 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
800 |
if ( aMode == KSCPInitial ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
801 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
802 |
Dprint( (_L("RSCPClient::CheckConfiguration(): Initial check failed") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
803 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
804 |
else |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
805 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
806 |
Dprint( (_L("RSCPClient::CheckConfiguration(): WARNING:\ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
807 |
Configuration Out of sync") )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
808 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
809 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
810 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
811 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
812 |
Dprint( (_L("<-- RSCPClient::CheckConfiguration(): %d"), status )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
813 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
814 |
return ret; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
815 |
} |
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
816 |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
817 |
EXPORT_C TInt RSCPClient :: PerformCleanupL(RArray<TUid>& aAppIDs) { |
62 | 818 |
Dprint((_L("RSCPClient::PerformCleanupL() >>>"))); |
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
819 |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
820 |
TInt lCount = aAppIDs.Count(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
821 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
822 |
if(lCount < 1) { |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
823 |
return KErrNone; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
824 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
825 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
826 |
HBufC8* lBuff = HBufC8 :: NewLC(lCount * sizeof(TInt32)); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
827 |
TPtr8 lBufPtr = lBuff->Des(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
828 |
RDesWriteStream lWriteStream(lBufPtr); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
829 |
CleanupClosePushL(lWriteStream); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
830 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
831 |
for(TInt i=0; i < lCount; i++) { |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
832 |
Dprint((_L("[RSCPClient]-> Marking %d for cleanup"), aAppIDs[i].iUid )); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
833 |
lWriteStream.WriteInt32L(aAppIDs[i].iUid); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
834 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
835 |
lWriteStream.CommitL(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
836 |
TInt lStatus = SendReceive(ESCPApplicationUninstalled, TIpcArgs(ESCPApplicationUninstalled, &lBuff->Des())); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
837 |
CleanupStack :: PopAndDestroy(2); // lBuff, lWriteStream |
62 | 838 |
Dprint((_L("RSCPClient::PerformCleanupL() <<<"))); |
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
839 |
return lStatus; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
840 |
} |
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
841 |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
842 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
843 |
// The server contains all the logic for the parameters, just |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
844 |
// propagate the call. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
845 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
846 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
847 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
848 |
EXPORT_C TInt RSCPClient :: SetParamValue(TInt aParamID, TDes& aValue, TUint32 aCallerSID) { |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
849 |
Dprint((_L("RSCPClient::SetParamValue() >>>"))); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
850 |
TPckgBuf<TUint32> lCallerID(aCallerSID); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
851 |
TInt ret = SendReceive(ESCPServSetParam, TIpcArgs(aParamID, &aValue, &lCallerID)); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
852 |
Dprint((_L("RSCPClient::SetParamValue(): %d <<<"), ret)); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
853 |
return ret; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
854 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
855 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
856 |
/* --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
857 |
* Alternative function that can be used to set the Auto Lock period |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
858 |
* Caller should have AllFiles access level |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
859 |
* Primarily called from the general settings components |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
860 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
861 |
*/ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
862 |
EXPORT_C TInt RSCPClient :: SetAutoLockPeriod( TInt aValue ) { |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
863 |
Dprint((_L("[RSCPClient]-> SetAutoLockPeriod() >>>"))); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
864 |
TPckgBuf<TInt> lAutoLockPeriod(aValue); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
865 |
TInt ret = SendReceive(ESCPServUISetAutoLock, TIpcArgs(&lAutoLockPeriod)); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
866 |
Dprint((_L("[RSCPClient]-> SetAutoLockPeriod(): %d <<<"), ret)); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
867 |
return ret; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
868 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
869 |
//#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
870 |
|
62 | 871 |
// --------------------------------------------------------- |
872 |
// RSCPClient::GetNewCodeAndChange() |
|
873 |
// Show the new code request and verification dialogs and |
|
874 |
// send the change request to the server. |
|
875 |
// |
|
876 |
// Status : Approved |
|
877 |
// --------------------------------------------------------- |
|
878 |
// |
|
879 |
TInt RSCPClient::GetNewCodeAndChange( TDes& aOldCode, |
|
880 |
TInt aMode, |
|
881 |
TSCPSecCode* aNewDOSCode /*=NULL*/, |
|
882 |
HBufC** aNewCodePptr/* = NULL*/) |
|
883 |
{ |
|
884 |
||
885 |
Dprint(_L("[RSCPClient]-> GetNewCodeAndChange() >>>")); |
|
886 |
||
887 |
if(!isFlagEnabled) |
|
888 |
{ |
|
889 |
return KErrNotSupported; |
|
890 |
} |
|
891 |
TInt err = KErrNone; |
|
892 |
TInt ret = KErrNone; |
|
893 |
||
894 |
||
895 |
TInt maxLen = KSCPPasscodeMaxLength; |
|
896 |
TInt minLen = 1; |
|
897 |
||
898 |
// Fetch the minimum and maximum lengths for the code, if available. |
|
899 |
// This feature is commented out for correction to BU error ID: BNIN-6LC3AP. |
|
900 |
// Left in the code for possible inclusion in the future. |
|
901 |
//FetchLimits( minLen, maxLen ); |
|
902 |
||
903 |
// Request the new code and verify it. Repeat this until the codes match. |
|
904 |
||
905 |
// Create the buffers on the heap |
|
906 |
HBufC* newCodeHBuf = NULL; |
|
907 |
HBufC* verifyCodeHBuf = NULL; |
|
908 |
||
909 |
TRAP( err, newCodeHBuf = HBufC::NewL( KSCPPasscodeMaxLength + 1 ) ); |
|
910 |
if ( err == KErrNone ) |
|
911 |
{ |
|
912 |
TRAP( err, verifyCodeHBuf = HBufC::NewL( KSCPPasscodeMaxLength + 1 ) ); |
|
913 |
} |
|
914 |
||
915 |
if ( err != KErrNone ) |
|
916 |
{ |
|
917 |
if ( newCodeHBuf != NULL ) |
|
918 |
{ |
|
919 |
delete newCodeHBuf; |
|
920 |
} |
|
921 |
return err; |
|
922 |
} |
|
923 |
||
924 |
TPtr newCodeBuffer = newCodeHBuf->Des(); |
|
925 |
TPtr verifyCodeBuffer = verifyCodeHBuf->Des(); |
|
926 |
||
927 |
// Configure the buttons according to the mode |
|
928 |
TSCPButtonConfig bConfig; |
|
929 |
TBool ecSupport; |
|
930 |
if ( aMode == KSCPForcedChange ) |
|
931 |
{ |
|
932 |
bConfig = SCP_OK_ETEL; |
|
933 |
ecSupport = ETrue; |
|
934 |
} |
|
935 |
else |
|
936 |
{ |
|
937 |
bConfig = SCP_OK_CANCEL; |
|
938 |
ecSupport = EFalse; |
|
939 |
} |
|
940 |
||
941 |
TBool isMismatch = EFalse; |
|
942 |
do // Repeat loop BEGIN |
|
943 |
{ |
|
944 |
isMismatch = EFalse; |
|
945 |
||
946 |
if ( err == KErrSCPInvalidCode ) |
|
947 |
{ |
|
948 |
err = KErrNone; // "reset" |
|
949 |
} |
|
950 |
||
951 |
newCodeBuffer.Zero(); |
|
952 |
||
953 |
TRAP( err, ret = RunDialogL( newCodeBuffer, |
|
954 |
bConfig, |
|
955 |
minLen, |
|
956 |
maxLen, |
|
957 |
R_SECUI_TEXT_ENTER_NEW_SEC_CODE, |
|
958 |
NULL, |
|
959 |
ecSupport) ); |
|
960 |
||
961 |
if ( ( ret ) && ( ret != ESecUiEmergencyCall ) && ( err == KErrNone ) ) |
|
962 |
{ |
|
963 |
verifyCodeBuffer.Zero(); |
|
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
964 |
|
62 | 965 |
/*TChar ch = static_cast<TChar>(newCodeBuffer[0]); |
966 |
||
967 |
CSCPQueryDialog :: TKeypadContext lKPContext = |
|
968 |
(ch.IsDigit() ? CSCPQueryDialog :: ENumeric : CSCPQueryDialog :: EAlphaNumeric);*/ |
|
969 |
||
970 |
TRAP( err, ret = RunDialogL( verifyCodeBuffer, |
|
971 |
bConfig, |
|
972 |
minLen, |
|
973 |
maxLen, |
|
974 |
R_SECUI_TEXT_VERIFY_NEW_SEC_CODE, |
|
975 |
NULL, |
|
976 |
ecSupport)); |
|
977 |
} |
|
978 |
||
979 |
if ( ( !ret ) || ( err != KErrNone ) || ( ret == ESecUiEmergencyCall ) ) |
|
980 |
{ |
|
981 |
break; |
|
982 |
} |
|
983 |
||
984 |
if ( verifyCodeBuffer.Compare( newCodeBuffer ) != 0 ) |
|
985 |
{ |
|
986 |
// Ignore the errors from showing the note, it's better to continue if it fails |
|
987 |
||
988 |
TRAP_IGNORE( |
|
989 |
// Show an error note, the entered codes don't match |
|
990 |
CAknNoteDialog* noteDlg = |
|
991 |
new (ELeave) CAknNoteDialog(reinterpret_cast<CEikDialog**>( ¬eDlg ) ); |
|
992 |
noteDlg->SetTimeout( CAknNoteDialog::ELongTimeout ); |
|
993 |
noteDlg->SetTone( CAknNoteDialog::EErrorTone ); |
|
994 |
noteDlg->ExecuteLD( R_CODES_DONT_MATCH ); |
|
995 |
); |
|
996 |
||
997 |
isMismatch = ETrue; // Repeat code query |
|
998 |
} |
|
999 |
||
1000 |
if ( !isMismatch ) |
|
1001 |
{ |
|
1002 |
HBufC8* addParamsHBuf = NULL; |
|
1003 |
||
1004 |
TRAP( err, addParamsHBuf = HBufC8::NewL( KSCPMaxTARMNotifParamLen ) ); |
|
1005 |
if ( err != KErrNone ) |
|
1006 |
{ |
|
1007 |
delete verifyCodeHBuf; |
|
1008 |
delete newCodeHBuf; |
|
1009 |
return err; |
|
1010 |
} |
|
1011 |
||
1012 |
TPtr8 addParams = addParamsHBuf->Des(); |
|
1013 |
addParams.Zero(); |
|
1014 |
||
1015 |
if ( !isMismatch ) |
|
1016 |
{ |
|
1017 |
// Try to change the code |
|
1018 |
TSCPSecCode newDOSCode; |
|
1019 |
newDOSCode.Zero(); |
|
1020 |
||
1021 |
err = SendReceive( ESCPServChangeEnhCode, |
|
1022 |
TIpcArgs( &aOldCode, &verifyCodeBuffer, &addParams, &newDOSCode ) |
|
1023 |
); |
|
1024 |
||
1025 |
if ( addParams.Length() > 0 ) |
|
1026 |
{ |
|
1027 |
// The server has sent additional parameters |
|
1028 |
TRAPD( err, ProcessServerCommandsL( addParams ) ); |
|
1029 |
if ( err != KErrNone ) |
|
1030 |
{ |
|
1031 |
Dprint( (_L("RSCPClient::GetNewCodeAndChange():\ |
|
1032 |
Process cmds FAILED: %d"), err )); |
|
1033 |
} |
|
1034 |
} |
|
1035 |
||
1036 |
if ( aNewDOSCode != NULL ) |
|
1037 |
{ |
|
1038 |
(*aNewDOSCode).Copy( newDOSCode ); |
|
1039 |
} |
|
1040 |
} |
|
1041 |
||
1042 |
delete addParamsHBuf; |
|
1043 |
} |
|
1044 |
||
1045 |
} while ( ( isMismatch ) || ( err == KErrSCPInvalidCode ) ); // Loop END |
|
1046 |
||
1047 |
if ( ( ( !ret ) && ( err == KErrNone ) ) || ( ret == ESecUiEmergencyCall ) ) |
|
1048 |
{ |
|
1049 |
// Cancelled by user |
|
1050 |
err = KErrAbort; |
|
1051 |
} |
|
1052 |
||
1053 |
if((KErrNone == err) && (aNewCodePptr != 0)) { |
|
1054 |
Dprint(_L("[RSCPClient]-> INFO: Updating new lock code to aNewCodePptr")); |
|
1055 |
TRAP(err, *aNewCodePptr = HBufC :: NewL(verifyCodeHBuf->Des().Length())); |
|
1056 |
||
1057 |
if(*aNewCodePptr != NULL) { |
|
1058 |
(*aNewCodePptr)->Des().Copy(verifyCodeHBuf->Des()); |
|
1059 |
Dprint(_L("[RSCPClient]-> INFO: Updated new lock code to aNewCodePptr")); |
|
1060 |
} |
|
1061 |
} |
|
1062 |
||
1063 |
delete verifyCodeHBuf; |
|
1064 |
delete newCodeHBuf; |
|
1065 |
||
1066 |
Dprint(_L("[RSCPClient]-> GetNewCodeAndChange() <<<")); |
|
1067 |
return err; |
|
1068 |
} |
|
1069 |
||
1070 |
||
1071 |
||
1072 |
// --------------------------------------------------------- |
|
1073 |
// RSCPClient::ProcessServerCommandsL() |
|
1074 |
// Handle the commands in the server's param-buffer |
|
1075 |
// |
|
1076 |
// Status : Approved |
|
1077 |
// --------------------------------------------------------- |
|
1078 |
// |
|
1079 |
void RSCPClient::ProcessServerCommandsL( TDes8& aInParams, |
|
1080 |
CSCPParamObject** aOutParams, |
|
1081 |
TBool isNotifierEvent ) |
|
1082 |
{ |
|
1083 |
||
1084 |
if(!isFlagEnabled) |
|
1085 |
{ |
|
1086 |
User::Leave(KErrNotSupported); |
|
1087 |
} |
|
1088 |
Dprint( (_L("--> RSCPClient::ProcessServerCommandsL()") )); |
|
1089 |
(void)aOutParams; |
|
1090 |
||
1091 |
CSCPParamObject* theParams = CSCPParamObject::NewL(); |
|
1092 |
CleanupStack::PushL( theParams ); |
|
1093 |
||
1094 |
theParams->Parse( aInParams ); |
|
1095 |
TInt actionID; |
|
1096 |
TInt ret = theParams->Get( KSCPParamAction, actionID ); |
|
1097 |
||
1098 |
Dprint( (_L("RSCPClient::ProcessServerCommandsL():Params parsed") )); |
|
1099 |
||
1100 |
if ( ret != KErrNone ) |
|
1101 |
{ |
|
1102 |
Dprint( (_L("RSCPClient::ProcessServerCommands(): Can't get action ID: %d"), ret )); |
|
1103 |
} |
|
1104 |
else |
|
1105 |
{ |
|
1106 |
switch ( actionID ) |
|
1107 |
{ |
|
1108 |
case ( KSCPActionShowUI ): |
|
1109 |
{ |
|
1110 |
TRAP( ret, ShowUIL( *theParams ) ); |
|
1111 |
break; |
|
1112 |
} |
|
1113 |
||
1114 |
case ( KSCPActionForceChange ): |
|
1115 |
{ |
|
1116 |
if ( isNotifierEvent ) |
|
1117 |
{ |
|
1118 |
break; // Calling this through the notifier would jam the system |
|
1119 |
// since the server is busy. |
|
1120 |
} |
|
1121 |
||
1122 |
HBufC* codeHBuf = NULL; |
|
1123 |
codeHBuf = HBufC::NewL( KSCPPasscodeMaxLength + 1 ); |
|
1124 |
CleanupStack::PushL( codeHBuf ); |
|
1125 |
||
1126 |
TPtr codeBuf = codeHBuf->Des(); |
|
1127 |
codeBuf.Zero(); |
|
1128 |
||
1129 |
ret = theParams->Get( KSCPParamPassword, codeBuf ); |
|
1130 |
||
1131 |
if ( ret == KErrNone ) |
|
1132 |
{ |
|
1133 |
TInt lResFile = 0; |
|
1134 |
TFileName resFile; |
|
1135 |
resFile.Copy( KDriveZ ); |
|
1136 |
resFile.Append( KSCPTimestampPluginResFilename ); |
|
1137 |
BaflUtils :: NearestLanguageFile( CCoeEnv :: Static()->FsSession(), resFile ); |
|
1138 |
lResFile = CCoeEnv :: Static()->AddResourceFileL(resFile); |
|
1139 |
||
1140 |
CAknNoteDialog* lNoteDlg = new (ELeave) CAknNoteDialog(CAknNoteDialog :: ENoTone, CAknNoteDialog :: ELongTimeout); |
|
1141 |
CleanupStack :: PushL(lNoteDlg); |
|
1142 |
||
1143 |
HBufC* lExpNoteMsg = CEikonEnv :: Static()->AllocReadResourceLC(R_SET_SEC_CODE_AGING); |
|
1144 |
lNoteDlg->SetTextL(lExpNoteMsg->Des()); |
|
1145 |
||
1146 |
lNoteDlg->ExecuteLD(R_DIALOG_WARNING); |
|
1147 |
CleanupStack :: PopAndDestroy(1); //lExpNoteMsg |
|
1148 |
CleanupStack :: Pop(1); //lNoteDlg |
|
1149 |
||
1150 |
CCoeEnv :: Static()->DeleteResourceFile( lResFile ); |
|
1151 |
||
1152 |
TSCPSecCode newDOSCode; |
|
1153 |
ret = GetNewCodeAndChange( codeBuf, KSCPForcedChange, &newDOSCode ); |
|
1154 |
||
1155 |
// If aOutParams is defined, return the new code |
|
1156 |
if ( aOutParams != NULL ) |
|
1157 |
{ |
|
1158 |
(*aOutParams) = CSCPParamObject::NewL(); |
|
1159 |
(*aOutParams)->Set( KSCPParamPassword, newDOSCode ); |
|
1160 |
} |
|
1161 |
} |
|
1162 |
||
1163 |
CleanupStack::PopAndDestroy( codeHBuf ); |
|
1164 |
||
1165 |
break; |
|
1166 |
} |
|
1167 |
} |
|
1168 |
} |
|
1169 |
||
1170 |
CleanupStack::PopAndDestroy( theParams ); |
|
1171 |
||
1172 |
Dprint( (_L("<-- RSCPClient::ProcessServerCommandsL()") )); |
|
1173 |
User::LeaveIfError( ret ); |
|
1174 |
} |
|
1175 |
||
1176 |
// --------------------------------------------------------- |
|
1177 |
// RSCPClient::ShowUI() |
|
1178 |
// Show the requested UI through AVKON |
|
1179 |
// |
|
1180 |
// Status : Approved |
|
1181 |
// --------------------------------------------------------- |
|
1182 |
// |
|
1183 |
void RSCPClient::ShowUIL( CSCPParamObject& aContext ) |
|
1184 |
{ |
|
1185 |
||
1186 |
if(!isFlagEnabled) |
|
1187 |
{ |
|
1188 |
User::Leave(KErrNotSupported); |
|
1189 |
} |
|
1190 |
Dprint( (_L("--> RSCPClient::ShowUIL()") )); |
|
1191 |
TInt mode; |
|
1192 |
User::LeaveIfError( aContext.Get( KSCPParamUIMode, mode ) ); |
|
1193 |
||
1194 |
switch ( mode ) |
|
1195 |
{ |
|
1196 |
case ( KSCPUINote ): |
|
1197 |
{ |
|
1198 |
// Get prompt |
|
1199 |
TBuf<KSCPMaxPromptTextLen> promptText; |
|
1200 |
aContext.Get( KSCPParamPromptText, promptText ); |
|
1201 |
||
1202 |
// Try to get note icon, default is to use "error" |
|
1203 |
TInt noteType = KSCPUINoteError; |
|
1204 |
Dprint( (_L("RSCPClient::ShowUIL(): Creating note object") )); |
|
1205 |
||
1206 |
CAknResourceNoteDialog* note = NULL; |
|
1207 |
||
1208 |
if ( aContext.Get( KSCPParamNoteIcon, noteType ) != KErrNone ) |
|
1209 |
{ |
|
1210 |
noteType = KSCPUINoteError; |
|
1211 |
} |
|
1212 |
||
1213 |
switch ( noteType ) |
|
1214 |
{ |
|
1215 |
case ( KSCPUINoteWarning ): |
|
1216 |
{ |
|
1217 |
note = new (ELeave) CAknWarningNote( ETrue ); |
|
1218 |
break; |
|
1219 |
} |
|
1220 |
||
1221 |
case ( KSCPUINoteError ): |
|
1222 |
default: // default to error |
|
1223 |
{ |
|
1224 |
note = new (ELeave) CAknErrorNote( ETrue ); |
|
1225 |
break; |
|
1226 |
} |
|
1227 |
} |
|
1228 |
||
1229 |
if ( note != NULL ) |
|
1230 |
{ |
|
1231 |
Dprint( (_L("RSCPClient::ShowUIL(): Showing note") )); |
|
1232 |
note->ExecuteLD( promptText ); |
|
1233 |
} |
|
1234 |
} |
|
1235 |
} |
|
1236 |
||
1237 |
Dprint( (_L("<-- RSCPClient::ShowUIL()") )); |
|
1238 |
} |
|
1239 |
||
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1240 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1241 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1242 |
// RSCPClient::FetchLimits() |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1243 |
// Retrieve the limit-parameter values if available |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1244 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1245 |
// Status : Approved |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1246 |
// --------------------------------------------------------- |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1247 |
// |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1248 |
void RSCPClient::FetchLimits( TInt& aMin, TInt& aMax ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1249 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1250 |
if(!isFlagEnabled) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1251 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1252 |
return; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1253 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1254 |
TInt maxLenID = RTerminalControl3rdPartySession::EPasscodeMaxLength; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1255 |
TInt minLenID = RTerminalControl3rdPartySession::EPasscodeMinLength; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1256 |
TBuf<KSCPMaxIntLength> intBuf; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1257 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1258 |
intBuf.Zero(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1259 |
if ( GetParamValue( minLenID, intBuf ) != KErrNone ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1260 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1261 |
aMin = KSCPPasscodeMinLength; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1262 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1263 |
else |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1264 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1265 |
TLex lex( intBuf ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1266 |
if ( ( lex.Val( aMin ) != KErrNone ) || ( aMin <= 0 ) ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1267 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1268 |
aMin = KSCPPasscodeMinLength; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1269 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1270 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1271 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1272 |
intBuf.Zero(); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1273 |
if ( GetParamValue( maxLenID, intBuf ) != KErrNone ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1274 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1275 |
aMax = KSCPPasscodeMaxLength; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1276 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1277 |
else |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1278 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1279 |
TLex lex( intBuf ); |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1280 |
if ( ( lex.Val( aMax ) != KErrNone ) || ( aMax <= 0 ) ) |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1281 |
{ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1282 |
aMax = KSCPPasscodeMaxLength; |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1283 |
} |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1284 |
} |
62 | 1285 |
} |
1286 |
TInt RSCPClient :: SetSecurityCodeL(RMobilePhone :: TMobilePassword& aPassword, |
|
1287 |
TSCPButtonConfig aButtonsShown, TBool aECSSupport, TInt aFlags, TInt& aResFileSCP, TInt& aResFileSecUi) { |
|
1288 |
Dprint((_L("[RSCPClient]-> SetSecurityCodeL() >>>"))); |
|
1289 |
Dprint((_L("[RSCPClient]-> input params - aButtonsShown=%d, aECSSupport=%d"), aButtonsShown, aECSSupport)); |
|
1290 |
||
1291 |
if(EFalse == isFlagEnabled) { |
|
1292 |
(void)aPassword; |
|
1293 |
Dprint((_L("[RSCPClient]-> ERROR: Function not supported in this variant"))); |
|
1294 |
User :: Invariant(); |
|
1295 |
return KErrNotSupported; |
|
1296 |
} |
|
1297 |
||
1298 |
TInt lRet = LoadResources(aResFileSCP, aResFileSecUi); |
|
1299 |
||
1300 |
if(lRet != KErrNone) { |
|
1301 |
return lRet; |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1302 |
} |
1
a9c0ce913924
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1303 |
|
62 | 1304 |
TInt lDefCode = 0; |
1305 |
CRepository* lRepository = CRepository :: NewLC(KCRUidSCPLockCode); |
|
1306 |
lRet = lRepository->Get(KSCPLockCodeDefaultLockCode, lDefCode); |
|
1307 |
||
1308 |
if(lRet != KErrNone) { |
|
1309 |
Dprint(_L("[RSCPClient]-> ERROR: Unable to perform get on CenRep, lErr=%d"), lRet); |
|
1310 |
CleanupStack :: PopAndDestroy(lRepository); |
|
1311 |
return lRet; |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1312 |
} |
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
1313 |
|
62 | 1314 |
HBufC* codeHBuf = HBufC :: NewLC(KSCPPasscodeMaxLength + 1); |
1315 |
HBufC8* addParamsHBuf = HBufC8 :: NewLC(KSCPMaxTARMNotifParamLen); |
|
1316 |
TPtr codeBuffer = codeHBuf->Des(); |
|
1317 |
TPtr8 addParams = addParamsHBuf->Des(); |
|
1318 |
||
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
1319 |
if(lDefCode == 0) { |
62 | 1320 |
Dprint(_L("[RSCPClient]-> INFO: Default lock code has been set already by the user...")); |
1321 |
||
1322 |
lRet = RunDialogL(codeBuffer, aButtonsShown, KSCPPasscodeMinLength, KSCPPasscodeMaxLength, |
|
1323 |
R_SECUI_TEXT_ENTER_SEC_CODE, NULL, aECSSupport); |
|
1324 |
||
1325 |
if((lRet) && (lRet != ESecUiEmergencyCall) && (lRet != EAknSoftkeyEmergencyCall)) { |
|
1326 |
Dprint(_L("[RSCPClient]-> INFO: User has updated the lock code...")); |
|
1327 |
||
1328 |
lRet = SendReceive( ESCPServAuthenticateS60, TIpcArgs( &codeBuffer, &aPassword, &addParams, aFlags)); |
|
1329 |
||
1330 |
Dprint((_L("[RSCPClient]-> INFO: addParams.Length()=%d")), addParams.Length()); |
|
1331 |
Dprint((_L("[RSCPClient]-> INFO: lRet=%d")), lRet); |
|
1332 |
} |
|
1333 |
else { |
|
1334 |
switch(lRet) { |
|
1335 |
case 0: |
|
1336 |
lRet = KErrCancel; |
|
1337 |
break; |
|
1338 |
case EAknSoftkeyEmergencyCall: |
|
1339 |
//lRet = KErrCancel; |
|
1340 |
break; |
|
1341 |
case ESecUiEmergencyCall: |
|
1342 |
lRet = ESecUiEmergencyCall; |
|
1343 |
break; |
|
1344 |
/*default: |
|
1345 |
break;*/ |
|
1346 |
} |
|
1347 |
} |
|
1348 |
} |
|
1349 |
else { |
|
1350 |
TRequestStatus statusSave; |
|
1351 |
Dprint(_L("[RSCPClient]-> INFO: Default lock code not set by the user, requesting for the same")); |
|
1352 |
||
1353 |
HBufC* msgConfirmSave = NULL; |
|
1354 |
CAknGlobalConfirmationQuery* query = CAknGlobalConfirmationQuery :: NewLC(); |
|
1355 |
||
1356 |
if(aButtonsShown == SCP_OK || aButtonsShown == SCP_OK_ETEL) { |
|
1357 |
//msgConfirmSave = CEikonEnv :: Static()->AllocReadResourceLC(R_SET_SEC_CODE); |
|
1358 |
msgConfirmSave = CEikonEnv :: Static()->AllocReadResourceLC(R_SET_SEC_CODE_SETTING_QUERY_SERVER); |
|
1359 |
query->ShowConfirmationQueryL(statusSave, *msgConfirmSave, R_AVKON_SOFTKEYS_OK_EMPTY__OK, R_QGN_NOTE_INFO_ANIM); |
|
1360 |
} |
|
1361 |
else { |
|
1362 |
msgConfirmSave = CEikonEnv :: Static()->AllocReadResourceLC(R_SET_SEC_CODE); |
|
1363 |
query->ShowConfirmationQueryL(statusSave, *msgConfirmSave, R_AVKON_SOFTKEYS_YES_NO__YES, R_QGN_NOTE_QUERY_ANIM); |
|
1364 |
} |
|
1365 |
||
1366 |
User :: WaitForRequest(statusSave); |
|
1367 |
CleanupStack :: PopAndDestroy(2); // msgConfirmSave query |
|
1368 |
||
1369 |
if((statusSave == EAknSoftkeyYes) || (statusSave == EAknSoftkeyOk)) { |
|
1370 |
Dprint(_L("[RSCPClient]-> INFO: calling GetNewCodeAndChange() ...")); |
|
1371 |
||
1372 |
TBufC<10> NBuf(KSCPDefaultEnchSecCode); |
|
1373 |
TPtr codeBuf = NBuf.Des(); |
|
1374 |
||
1375 |
TSCPSecCode lNewSecCode; |
|
1376 |
TInt lButtonCfg = (aButtonsShown == SCP_OK || aButtonsShown == SCP_OK_ETEL) ? KSCPForcedChange : KSCPNormalChange; |
|
1377 |
HBufC* lNewLkCodeBuf = NULL; |
|
1378 |
lRet = GetNewCodeAndChange(codeBuf, lButtonCfg, &lNewSecCode, &lNewLkCodeBuf); |
|
1379 |
||
1380 |
Dprint(_L("[RSCPClient]-> INFO: GetNewCodeAndChange() complete, err=%d"), lRet); |
|
1381 |
||
1382 |
if(KErrNone == lRet) { |
|
1383 |
/* This is being called as a workaround for a freezing issue with SecUI. This is in place |
|
1384 |
* as a temporary measure until the source is identified. |
|
1385 |
*/ |
|
1386 |
TInt lTmpRet = SendReceive(ESCPServAuthenticateS60, TIpcArgs(&lNewLkCodeBuf->Des(), &aPassword, &addParams, aFlags)); |
|
1387 |
||
1388 |
Dprint(_L("[RSCPClient]-> INFO: lTmpRet from SendReceive()=%d"), lTmpRet); |
|
1389 |
if(KErrNone == lRet) { |
|
1390 |
Dprint(_L("[RSCPClient]-> INFO: updating CenRep ...")); |
|
1391 |
lRepository->Set(KSCPLockCodeDefaultLockCode, 0); |
|
1392 |
Dprint(_L("[RSCPClient]-> INFO: User updated lock code for the first time...err= %d"), lRet); |
|
1393 |
} |
|
1394 |
} |
|
1395 |
||
1396 |
if(lNewLkCodeBuf) { |
|
1397 |
delete lNewLkCodeBuf; |
|
1398 |
} |
|
1399 |
} |
|
1400 |
else { |
|
1401 |
Dprint(_L("[RSCPClient]-> INFO: Returning KErrCancel")); |
|
1402 |
lRet = KErrCancel; |
|
1403 |
} |
|
1404 |
||
1405 |
if(KErrAbort == lRet) { |
|
1406 |
Dprint(_L("[RSCPClient]-> INFO: Returning KErrCancel")); |
|
1407 |
lRet = KErrCancel; |
|
1408 |
} |
|
1409 |
||
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1410 |
} |
1
a9c0ce913924
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
1411 |
|
62 | 1412 |
if(addParams.Length() > 0) { |
1413 |
CSCPParamObject* tmp = CSCPParamObject :: NewLC(); |
|
1414 |
TInt lTempRet = tmp->Parse(addParams); |
|
1415 |
||
1416 |
if(lTempRet == KErrNone) { |
|
1417 |
lTempRet = tmp->Set(KSCPParamPassword, codeBuffer); |
|
1418 |
} |
|
1419 |
||
1420 |
if(lTempRet == KErrNone) { |
|
1421 |
addParams.Zero(); |
|
1422 |
HBufC8* tmpBuf; |
|
1423 |
lTempRet = tmp->GetBuffer(tmpBuf); |
|
1424 |
||
1425 |
if(lTempRet == KErrNone) { |
|
1426 |
addParams.Copy(tmpBuf->Des()); |
|
1427 |
delete tmpBuf; |
|
1428 |
} |
|
1429 |
} |
|
1430 |
||
1431 |
if(lTempRet == KErrNone) { |
|
1432 |
CSCPParamObject* outParams = NULL; |
|
1433 |
/* |
|
1434 |
* aECSSupport when passed to ProcessServerCommandsL decides if the expiry note and subsequently change device lock |
|
1435 |
* code has to be shown or not. Normally if the lock code has expired, the same has to be prompted from the user and |
|
1436 |
* has to be done only during device unlock. aECSSupport value is being passed to ensure that new lock code is prompted |
|
1437 |
* only during device unlock. |
|
1438 |
*/ |
|
1439 |
ProcessServerCommandsL(addParams, &outParams, !aECSSupport); |
|
1440 |
||
1441 |
if(outParams != NULL) { |
|
1442 |
TSCPSecCode newSecCode; |
|
1443 |
if(outParams->Get(KSCPParamPassword, newSecCode) == KErrNone) { |
|
1444 |
Dprint((_L("[RSCPClient]-> INFO: Updating encoded password received from the server into aPassword..."))); |
|
1445 |
aPassword.Copy(newSecCode); |
|
1446 |
} |
|
1447 |
||
1448 |
delete outParams; |
|
1449 |
} |
|
1450 |
} |
|
1451 |
||
1452 |
CleanupStack :: PopAndDestroy(tmp); |
|
1453 |
} |
|
1454 |
||
76
3cdbd92ee07b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
65
diff
changeset
|
1455 |
CleanupStack :: PopAndDestroy(3); // repository, addParamsHBuf, codeHBuf |
62 | 1456 |
Dprint(_L("[RSCPClient]-> SetSecurityCodeL() <<< lRet=%d"), lRet); |
1457 |
return lRet; |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1458 |
} |
62 | 1459 |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1460 |
//#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1461 |
// <<-- *********** Device lock new features ************* |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1462 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1463 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1464 |
// ================= OTHER EXPORTED FUNCTIONS ============== |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1465 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1466 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1467 |
// End of File |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1468 |
|
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1469 |