51
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Implementation of fotaserver component
|
|
15 |
* This is part of fotaapplication.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
#include <dmdevdialogclient.h>
|
|
20 |
#include "dmdevdialogclientserver.h"
|
|
21 |
#include "dmdevdialogclientdebug.h"
|
|
22 |
|
|
23 |
// ---------------------------------------------------------------------------
|
|
24 |
// StartServerL()
|
|
25 |
// Starts DM device Dialog server
|
|
26 |
// ---------------------------------------------------------------------------
|
|
27 |
TInt StartServerL()
|
|
28 |
{
|
|
29 |
FLOG(_L("StartServerLt Started"));
|
|
30 |
TInt res = KErrNone;
|
|
31 |
RProcess server;
|
|
32 |
res=server.Create(KDMDEVDIALOGSERVER,KNullDesC);
|
|
33 |
FLOG(_L("StartServerL-- create server error as %d"),res);
|
|
34 |
if (res!=KErrNone)
|
|
35 |
{
|
|
36 |
return res;
|
|
37 |
}
|
|
38 |
TRequestStatus stat;
|
|
39 |
server.Rendezvous(stat);
|
|
40 |
if (stat!=KRequestPending)
|
|
41 |
server.Kill(0); // abort startup
|
|
42 |
else
|
|
43 |
server.Resume(); // logon OK - start the server
|
|
44 |
User::WaitForRequest(stat); // wait for start or death
|
|
45 |
res=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int();
|
|
46 |
FLOG(_L("StartServerL-- server.ExitType() returns %d"),res);
|
|
47 |
server.Close();
|
|
48 |
return res;
|
|
49 |
}
|
|
50 |
|
|
51 |
// ---------------------------------------------------------------------------
|
|
52 |
// RDmDevDialog::OpenL()
|
|
53 |
// ---------------------------------------------------------------------------
|
|
54 |
EXPORT_C TInt RDmDevDialog::OpenL()
|
|
55 |
{
|
|
56 |
FLOG(_L("RDmDevDialog::OpenL()- Begin"));
|
|
57 |
TInt res = KErrNone;
|
73
|
58 |
FLOG(_L("RDmDevDialog::OpenL()- Secured client"));
|
|
59 |
const int maxRetry(4);
|
|
60 |
TInt retry = maxRetry;
|
|
61 |
do {
|
|
62 |
res = CreateSession( KDMDEVDIALOGSERVER,TVersion(KDmDevDialogServerVersionMajor,
|
51
|
63 |
KDmDevDialogServerVersionMinor,0),KDefaultMessageSlots );
|
73
|
64 |
if (KErrNotFound != res && KErrServerTerminated != res) {
|
|
65 |
retry =0;
|
|
66 |
} else {
|
|
67 |
TRAP(res, StartServerL());
|
|
68 |
if (KErrNone == res || KErrAlreadyExists == res) {
|
|
69 |
retry =0;
|
|
70 |
res = CreateSession( KDMDEVDIALOGSERVER,TVersion(KDmDevDialogServerVersionMajor,
|
51
|
71 |
KDmDevDialogServerVersionMinor,0),KDefaultMessageSlots );
|
73
|
72 |
}
|
|
73 |
}
|
|
74 |
} while (--retry > 0);
|
|
75 |
User::LeaveIfError( res );
|
51
|
76 |
FLOG(_L("RDmDevDialog::OpenL()- End %d"),res);
|
|
77 |
return res;
|
|
78 |
}
|
|
79 |
|
|
80 |
// ---------------------------------------------------------------------------
|
|
81 |
// RDmDevDialog::Close()
|
|
82 |
// ---------------------------------------------------------------------------
|
|
83 |
EXPORT_C void RDmDevDialog::Close()
|
|
84 |
{
|
|
85 |
FLOG(_L(" RDmDevDialog::Close"));
|
|
86 |
RSessionBase::Close();
|
|
87 |
}
|
|
88 |
|
|
89 |
// ----------------------------------------------------------------------------
|
|
90 |
// RDmDevDialog::LaunchPkgZeroL()
|
|
91 |
// ----------------------------------------------------------------------------
|
|
92 |
EXPORT_C void RDmDevDialog::LaunchPkgZero(const TInt& aProfileId,
|
|
93 |
const TInt& ajobId, const TInt& aUimode,
|
|
94 |
TDes8& aResponse, TRequestStatus& aStatus )
|
|
95 |
{
|
|
96 |
FLOG(_L(" RDmDevDialog::LaunchPkgZero--Begin"));
|
|
97 |
SendReceive( EServerAlert, TIpcArgs(aProfileId,ajobId,aUimode,&aResponse),
|
|
98 |
aStatus);
|
|
99 |
FLOG(_L(" RDmDevDialog::LaunchPkgZero end "));
|
|
100 |
}
|
|
101 |
|
|
102 |
// ---------------------------------------------------------------------------
|
|
103 |
// RDmDevDialog::IsPkgZeroConnectNoteShown()
|
|
104 |
// ---------------------------------------------------------------------------
|
|
105 |
EXPORT_C TInt RDmDevDialog::IsPkgZeroConnectNoteShown(TInt& aConectNoteShown)
|
|
106 |
{
|
|
107 |
FLOG(_L(" RDmDevDialog::IsPkgZeroConnectNoteShown--Begin"));
|
|
108 |
TPckgBuf<TInt> result(aConectNoteShown);
|
|
109 |
TInt err = SendReceive( EPkgConnectNoteIsActive,TIpcArgs(&result));
|
|
110 |
aConectNoteShown = result();
|
|
111 |
FLOG(_L(" RDmDevDialog::IsPkgZeroConnectNoteShown--End as %d,%d"),err,
|
|
112 |
aConectNoteShown);
|
|
113 |
return err;
|
|
114 |
}
|
|
115 |
|
|
116 |
// ---------------------------------------------------------------------------
|
|
117 |
// RDmDevDialog::DismissConnectDialog()
|
|
118 |
// ---------------------------------------------------------------------------
|
|
119 |
EXPORT_C TInt RDmDevDialog::DismissConnectDialog()
|
|
120 |
{
|
|
121 |
FLOG(_L(" RDmDevDialog::DismissConnectDialog--Begin"));
|
|
122 |
TInt err = SendReceive( EPkgZeroConnectNoteDismiss,TIpcArgs());
|
|
123 |
FLOG(_L(" RDmDevDialog::DismissConnectDialog--End as %d,%d"),err);
|
|
124 |
return err;
|
|
125 |
}
|
|
126 |
|
|
127 |
// ---------------------------------------------------------------------------
|
|
128 |
// RDmDevDialog::ShowConnectDialog()
|
|
129 |
// ---------------------------------------------------------------------------
|
|
130 |
EXPORT_C TInt RDmDevDialog::ShowConnectDialog()
|
|
131 |
{
|
|
132 |
FLOG(_L(" RDmDevDialog::ShowConnectDialog--Begin"));
|
|
133 |
TInt err = SendReceive( EPkgZeroConnectNoteShowAgain,TIpcArgs());
|
|
134 |
FLOG(_L(" RDmDevDialog::ShowConnectDialog--error is %d"),err);
|
|
135 |
return err;
|
|
136 |
}
|
|
137 |
|
|
138 |
// ---------------------------------------------------------------------------
|
|
139 |
// RDmDevDialog::ShowDisplayAlert()
|
|
140 |
// ---------------------------------------------------------------------------
|
|
141 |
EXPORT_C void RDmDevDialog::ShowDisplayAlert(const TDesC& aNoteDisplayText,
|
|
142 |
TRequestStatus& aStatus)
|
|
143 |
{
|
|
144 |
FLOG(_L(" RDmDevDialog::ShowDisplayAlert--Begin"));
|
|
145 |
SendReceive( EShowDisplayAlert,TIpcArgs(&aNoteDisplayText),aStatus);
|
|
146 |
FLOG(_L(" RDmDevDialog::ShowDisplayAlert end" ));
|
|
147 |
}
|
|
148 |
|
|
149 |
|
|
150 |
// ---------------------------------------------------------------------------
|
|
151 |
// RDmDevDialog::ShowConfirmationAlert()
|
|
152 |
// ---------------------------------------------------------------------------
|
|
153 |
EXPORT_C void RDmDevDialog::ShowConfirmationAlert(const TInt& aTimeout,
|
|
154 |
const TDesC& aNoteHeader, const TDesC& aNoteDisplayText,
|
|
155 |
TRequestStatus& aStatus)
|
|
156 |
{
|
|
157 |
FLOG(_L(" RDmDevDialog::ShowConfirmationAlert--Begin"));
|
|
158 |
SendReceive( EShowConfirmationalert,TIpcArgs(aTimeout,&aNoteHeader,
|
|
159 |
&aNoteDisplayText),aStatus);
|
|
160 |
FLOG(_L(" RDmDevDialog::ShowConfirmationAlert--End "));
|
|
161 |
}
|
|
162 |
|
|
163 |
// ---------------------------------------------------------------------------
|
|
164 |
// RDmDevDialog::CancelPkgZeroNote()
|
|
165 |
// ---------------------------------------------------------------------------
|
|
166 |
EXPORT_C TInt RDmDevDialog::CancelPkgZeroNote()
|
|
167 |
{
|
|
168 |
FLOG(_L(" RDmDevDialog::CancelPkgZeroNote--Begin"));
|
|
169 |
TInt err = SendReceive(ECancelServerAlert, TIpcArgs());
|
|
170 |
FLOG(_L(" RDmDevDialog::CancelPkgZeroNote--End "));
|
|
171 |
return err;
|
|
172 |
}
|
|
173 |
|
|
174 |
//End of file
|