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;
|
|
58 |
FLOG(_L("RDmDevDialog::OpenL()- Secured client"));
|
|
59 |
res = CreateSession( KDMDEVDIALOGSERVER,TVersion(KDmDevDialogServerVersionMajor,
|
|
60 |
KDmDevDialogServerVersionMinor,0),KDefaultMessageSlots );
|
|
61 |
if ( res != KErrNone )
|
|
62 |
{
|
|
63 |
FLOG(_L("RDmDevDialog::OpenL()- session not created"));
|
|
64 |
res = StartServerL();
|
|
65 |
User::LeaveIfError( res );
|
|
66 |
res = CreateSession( KDMDEVDIALOGSERVER,TVersion(KDmDevDialogServerVersionMajor,
|
|
67 |
KDmDevDialogServerVersionMinor,0),KDefaultMessageSlots );
|
|
68 |
}
|
|
69 |
FLOG(_L("RDmDevDialog::OpenL()- End %d"),res);
|
|
70 |
return res;
|
|
71 |
}
|
|
72 |
|
|
73 |
// ---------------------------------------------------------------------------
|
|
74 |
// RDmDevDialog::Close()
|
|
75 |
// ---------------------------------------------------------------------------
|
|
76 |
EXPORT_C void RDmDevDialog::Close()
|
|
77 |
{
|
|
78 |
FLOG(_L(" RDmDevDialog::Close"));
|
|
79 |
RSessionBase::Close();
|
|
80 |
}
|
|
81 |
|
|
82 |
// ----------------------------------------------------------------------------
|
|
83 |
// RDmDevDialog::LaunchPkgZeroL()
|
|
84 |
// ----------------------------------------------------------------------------
|
|
85 |
EXPORT_C void RDmDevDialog::LaunchPkgZero(const TInt& aProfileId,
|
|
86 |
const TInt& ajobId, const TInt& aUimode,
|
|
87 |
TDes8& aResponse, TRequestStatus& aStatus )
|
|
88 |
{
|
|
89 |
FLOG(_L(" RDmDevDialog::LaunchPkgZero--Begin"));
|
|
90 |
SendReceive( EServerAlert, TIpcArgs(aProfileId,ajobId,aUimode,&aResponse),
|
|
91 |
aStatus);
|
|
92 |
FLOG(_L(" RDmDevDialog::LaunchPkgZero end "));
|
|
93 |
}
|
|
94 |
|
|
95 |
// ---------------------------------------------------------------------------
|
|
96 |
// RDmDevDialog::IsPkgZeroConnectNoteShown()
|
|
97 |
// ---------------------------------------------------------------------------
|
|
98 |
EXPORT_C TInt RDmDevDialog::IsPkgZeroConnectNoteShown(TInt& aConectNoteShown)
|
|
99 |
{
|
|
100 |
FLOG(_L(" RDmDevDialog::IsPkgZeroConnectNoteShown--Begin"));
|
|
101 |
TPckgBuf<TInt> result(aConectNoteShown);
|
|
102 |
TInt err = SendReceive( EPkgConnectNoteIsActive,TIpcArgs(&result));
|
|
103 |
aConectNoteShown = result();
|
|
104 |
FLOG(_L(" RDmDevDialog::IsPkgZeroConnectNoteShown--End as %d,%d"),err,
|
|
105 |
aConectNoteShown);
|
|
106 |
return err;
|
|
107 |
}
|
|
108 |
|
|
109 |
// ---------------------------------------------------------------------------
|
|
110 |
// RDmDevDialog::DismissConnectDialog()
|
|
111 |
// ---------------------------------------------------------------------------
|
|
112 |
EXPORT_C TInt RDmDevDialog::DismissConnectDialog()
|
|
113 |
{
|
|
114 |
FLOG(_L(" RDmDevDialog::DismissConnectDialog--Begin"));
|
|
115 |
TInt err = SendReceive( EPkgZeroConnectNoteDismiss,TIpcArgs());
|
|
116 |
FLOG(_L(" RDmDevDialog::DismissConnectDialog--End as %d,%d"),err);
|
|
117 |
return err;
|
|
118 |
}
|
|
119 |
|
|
120 |
// ---------------------------------------------------------------------------
|
|
121 |
// RDmDevDialog::ShowConnectDialog()
|
|
122 |
// ---------------------------------------------------------------------------
|
|
123 |
EXPORT_C TInt RDmDevDialog::ShowConnectDialog()
|
|
124 |
{
|
|
125 |
FLOG(_L(" RDmDevDialog::ShowConnectDialog--Begin"));
|
|
126 |
TInt err = SendReceive( EPkgZeroConnectNoteShowAgain,TIpcArgs());
|
|
127 |
FLOG(_L(" RDmDevDialog::ShowConnectDialog--error is %d"),err);
|
|
128 |
return err;
|
|
129 |
}
|
|
130 |
|
|
131 |
// ---------------------------------------------------------------------------
|
|
132 |
// RDmDevDialog::ShowDisplayAlert()
|
|
133 |
// ---------------------------------------------------------------------------
|
|
134 |
EXPORT_C void RDmDevDialog::ShowDisplayAlert(const TDesC& aNoteDisplayText,
|
|
135 |
TRequestStatus& aStatus)
|
|
136 |
{
|
|
137 |
FLOG(_L(" RDmDevDialog::ShowDisplayAlert--Begin"));
|
|
138 |
SendReceive( EShowDisplayAlert,TIpcArgs(&aNoteDisplayText),aStatus);
|
|
139 |
FLOG(_L(" RDmDevDialog::ShowDisplayAlert end" ));
|
|
140 |
}
|
|
141 |
|
|
142 |
|
|
143 |
// ---------------------------------------------------------------------------
|
|
144 |
// RDmDevDialog::ShowConfirmationAlert()
|
|
145 |
// ---------------------------------------------------------------------------
|
|
146 |
EXPORT_C void RDmDevDialog::ShowConfirmationAlert(const TInt& aTimeout,
|
|
147 |
const TDesC& aNoteHeader, const TDesC& aNoteDisplayText,
|
|
148 |
TRequestStatus& aStatus)
|
|
149 |
{
|
|
150 |
FLOG(_L(" RDmDevDialog::ShowConfirmationAlert--Begin"));
|
|
151 |
SendReceive( EShowConfirmationalert,TIpcArgs(aTimeout,&aNoteHeader,
|
|
152 |
&aNoteDisplayText),aStatus);
|
|
153 |
FLOG(_L(" RDmDevDialog::ShowConfirmationAlert--End "));
|
|
154 |
}
|
|
155 |
|
|
156 |
// ---------------------------------------------------------------------------
|
|
157 |
// RDmDevDialog::CancelPkgZeroNote()
|
|
158 |
// ---------------------------------------------------------------------------
|
|
159 |
EXPORT_C TInt RDmDevDialog::CancelPkgZeroNote()
|
|
160 |
{
|
|
161 |
FLOG(_L(" RDmDevDialog::CancelPkgZeroNote--Begin"));
|
|
162 |
TInt err = SendReceive(ECancelServerAlert, TIpcArgs());
|
|
163 |
FLOG(_L(" RDmDevDialog::CancelPkgZeroNote--End "));
|
|
164 |
return err;
|
|
165 |
}
|
|
166 |
|
|
167 |
//End of file
|