author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:59:48 +0300 | |
branch | RCL_3 |
changeset 69 | cf1b3ddbe9a1 |
parent 58 | 83ca720e2b9a |
permissions | -rw-r--r-- |
58 | 1 |
/* |
2 |
* Copyright (c) 2004 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: Represents a connection |
|
15 |
* |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
||
20 |
// INCLUDE FILES |
|
21 |
#include <stdlib.h> |
|
22 |
#include <nifvar.h> |
|
23 |
#include <StringLoader.h> |
|
24 |
#include <ConnectionMonitorUi.rsg> |
|
25 |
#include <avkon.rsg> |
|
26 |
#include <AknUtils.h> |
|
27 |
#include <apgcli.h> |
|
28 |
||
29 |
#include "ConnectionMonitorUiLogger.h" |
|
30 |
#include "ConnectionInfoBase.h" |
|
31 |
#include "ActiveWrapper.h" |
|
32 |
||
33 |
// CONSTANTS |
|
34 |
||
35 |
const TUint KUpArrowChar = 0x2191; ///< ASCII code of UpArrow |
|
36 |
const TUint KDownArrowChar = 0x2193; ///< ASCII code of DownArrow |
|
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
37 |
const TUint KBannedServerUID = 0x101fd9c5; // Banned DHCP server UID |
58 | 38 |
|
39 |
const TInt KFeedsServerUid = 0x1020728E; |
|
40 |
const TInt KDownloadMgrServerUid = 0x10008D60; |
|
41 |
const TInt KMessagingServerUid = 0x1000484b; |
|
42 |
const TInt KJavaVMUid = 0x102033E6; |
|
43 |
const TInt KSUPLServerUid = 0x102073CA; |
|
44 |
||
45 |
LOCAL_D const TInt KStringsGranularity = 5; |
|
46 |
||
47 |
_LIT( KMrouterName, "mRouter"); ///< see CheckMrouteIap |
|
48 |
_LIT( KEmpty, ""); ///< Empty string |
|
49 |
||
50 |
||
51 |
||
52 |
||
53 |
// ================= MEMBER FUNCTIONS ======================= |
|
54 |
||
55 |
// --------------------------------------------------------- |
|
56 |
// CConnectionInfoBase::~CConnectionInfoBase |
|
57 |
// --------------------------------------------------------- |
|
58 |
// |
|
59 |
CConnectionInfoBase::~CConnectionInfoBase() |
|
60 |
{ |
|
61 |
delete iDetailsArray; |
|
62 |
delete iAppNames; |
|
63 |
} |
|
64 |
||
65 |
||
66 |
// --------------------------------------------------------- |
|
67 |
// CConnectionInfoBase::CConnectionInfoBase |
|
68 |
// --------------------------------------------------------- |
|
69 |
// |
|
70 |
CConnectionInfoBase::CConnectionInfoBase( |
|
71 |
TInt aConnectionId, |
|
72 |
RConnectionMonitor* const aConnectionMonitor, |
|
73 |
TConnMonBearerType aConnectionBearerType, |
|
74 |
CActiveWrapper* aActiveWrapper ) : |
|
75 |
iConnectionMonitor( aConnectionMonitor ), |
|
76 |
iStartTime( NULL ), |
|
77 |
iLastSpeedUpdate( 0 ), |
|
78 |
iDeletedFromCMUI( EFalse ), |
|
79 |
iActiveWrapper( aActiveWrapper ) |
|
80 |
{ |
|
81 |
CMUILOGGER_WRITE( "CConnectionInfoBase constuctor - start " ); |
|
82 |
iConnectionStatus = EConnectionUninitialized; |
|
83 |
iConnectionId = aConnectionId; |
|
84 |
iConnectionBearerType = aConnectionBearerType; |
|
85 |
CMUILOGGER_WRITE( "CConnectionInfoBase constuctor - end " ); |
|
86 |
} |
|
87 |
||
88 |
||
89 |
// --------------------------------------------------------- |
|
90 |
// CConnectionInfoBase::ConstructL |
|
91 |
// --------------------------------------------------------- |
|
92 |
// |
|
93 |
void CConnectionInfoBase::ConstructL() |
|
94 |
{ |
|
95 |
CMUILOGGER_ENTERFN( "CConnectionInfoBase::ConstructL() start" ); |
|
96 |
||
97 |
if ( iConnectionBearerType >= EBearerExternalCSD ) |
|
98 |
{ |
|
99 |
StringLoader::Load( iConnectionName, |
|
100 |
R_QTN_CMON_ITEM_CONN_NAME_MODEM ); |
|
101 |
} |
|
102 |
else |
|
103 |
{ |
|
104 |
iActiveWrapper->StartGetStringAttribute( iConnectionId, |
|
105 |
iConnectionMonitor, |
|
106 |
KIAPName, |
|
107 |
iConnectionName ); |
|
108 |
TInt err( iActiveWrapper->iStatus.Int() ); |
|
109 |
CMUILOGGER_WRITE_F( "CConnectionInfoBase::ConstructL() status: %d", |
|
110 |
err ); |
|
111 |
CMUILOGGER_WRITE_F( "iConnectionName : %S", &iConnectionName ); |
|
112 |
CMUILOGGER_WRITE_F( "iConnectionId : %d", iConnectionId ); |
|
113 |
CMUILOGGER_WRITE_F( "iConnectionBearerType : %d", |
|
114 |
( TInt )iConnectionBearerType ); |
|
115 |
if ( err != KErrNone ) |
|
116 |
{ |
|
117 |
User::Leave( err ); |
|
118 |
} |
|
119 |
} |
|
120 |
||
121 |
if ( !iAppNames ) |
|
122 |
{ |
|
123 |
iAppNames = new( ELeave ) CDesCArrayFlat( KStringsGranularity ); |
|
124 |
} |
|
125 |
||
126 |
StatusChangedL(); |
|
127 |
if ( GetStatus() == EConnectionSuspended ) |
|
128 |
{ |
|
129 |
InitializeConnectionInfoL(); |
|
130 |
} |
|
131 |
CMUILOGGER_LEAVEFN( "CConnectionInfoBase::ConstructL() end" ); |
|
132 |
} |
|
133 |
||
134 |
||
135 |
// --------------------------------------------------------- |
|
136 |
// CConnectionInfoBase::StatusChangedL |
|
137 |
// --------------------------------------------------------- |
|
138 |
// |
|
139 |
void CConnectionInfoBase::StatusChangedL() |
|
140 |
{ |
|
141 |
CMUILOGGER_WRITE( "CConnectionInfoBase::StatusChangedL() start" ); |
|
142 |
||
143 |
RefreshConnectionStatus(); |
|
144 |
||
145 |
switch ( iConnectionStatus ) |
|
146 |
{ |
|
147 |
case EConnectionCreated: |
|
148 |
{ |
|
149 |
InitializeConnectionInfoL(); |
|
150 |
break; |
|
151 |
} |
|
152 |
case EConnectionSuspended: |
|
153 |
{ |
|
154 |
RefreshDetailsL(); |
|
155 |
if ( !iDetailsArray ) |
|
156 |
{ |
|
157 |
ToArrayDetailsL(); |
|
158 |
} |
|
159 |
RefreshDetailsArrayL(); |
|
160 |
break; |
|
161 |
} |
|
162 |
case EConnectionClosing: |
|
163 |
case EConnectionClosed: |
|
164 |
case EConnectionUninitialized: |
|
165 |
{ |
|
166 |
if ( iDetailsArray ) // if there is details array |
|
167 |
{ |
|
168 |
RefreshDetailsArrayL(); |
|
169 |
} |
|
170 |
break; |
|
171 |
} |
|
172 |
case EConnectionCreating: |
|
173 |
default : |
|
174 |
{ |
|
175 |
break; |
|
176 |
} |
|
177 |
} |
|
178 |
||
179 |
RefreshConnectionListBoxItemTextL(); |
|
180 |
||
181 |
CMUILOGGER_WRITE( "CConnectionInfoBase::StatusChangedL() end" ); |
|
182 |
} |
|
183 |
||
184 |
// --------------------------------------------------------- |
|
185 |
// CConnectionInfoBase::IsAlive |
|
186 |
// --------------------------------------------------------- |
|
187 |
// |
|
188 |
TBool CConnectionInfoBase::IsAlive() const |
|
189 |
{ |
|
190 |
TBool alive( EFalse ); |
|
191 |
if ( ( iConnectionStatus == EConnectionSuspended ) || |
|
192 |
( iConnectionStatus == EConnectionCreated ) ) |
|
193 |
{ |
|
194 |
alive = ETrue; |
|
195 |
} |
|
196 |
return alive; |
|
197 |
} |
|
198 |
||
199 |
// --------------------------------------------------------- |
|
200 |
// CConnectionInfoBase::IsSuspended |
|
201 |
// --------------------------------------------------------- |
|
202 |
// |
|
203 |
TBool CConnectionInfoBase::IsSuspended() const |
|
204 |
{ |
|
205 |
TBool suspended( EFalse ); |
|
206 |
if ( iConnectionStatus == EConnectionSuspended ) |
|
207 |
{ |
|
208 |
suspended = ETrue; |
|
209 |
} |
|
210 |
return suspended; |
|
211 |
} |
|
212 |
||
213 |
// --------------------------------------------------------- |
|
214 |
// CConnectionInfoBase::GetConnectionId |
|
215 |
// --------------------------------------------------------- |
|
216 |
// |
|
217 |
CDesCArrayFlat* CConnectionInfoBase::GetDetailsArray() const |
|
218 |
{ |
|
219 |
return iDetailsArray; |
|
220 |
} |
|
221 |
||
222 |
// --------------------------------------------------------- |
|
223 |
// CConnectionInfoBase::GetConnectionId |
|
224 |
// --------------------------------------------------------- |
|
225 |
// |
|
226 |
TUint CConnectionInfoBase::GetConnectionId() const |
|
227 |
{ |
|
228 |
return iConnectionId; |
|
229 |
} |
|
230 |
||
231 |
// --------------------------------------------------------- |
|
232 |
// CConnectionInfoBase::GetStatus |
|
233 |
// --------------------------------------------------------- |
|
234 |
// |
|
235 |
TConnectionStatus CConnectionInfoBase::GetStatus() const |
|
236 |
{ |
|
237 |
return iConnectionStatus; |
|
238 |
} |
|
239 |
||
240 |
// --------------------------------------------------------- |
|
241 |
// CConnectionInfoBase::GetName |
|
242 |
// --------------------------------------------------------- |
|
243 |
// |
|
244 |
HBufC* CConnectionInfoBase::GetNameLC() const |
|
245 |
{ |
|
246 |
HBufC* name = iConnectionName.AllocLC(); |
|
247 |
return name; |
|
248 |
} |
|
249 |
||
250 |
// --------------------------------------------------------- |
|
251 |
// CConnectionInfoBase::GetBearerType |
|
252 |
// --------------------------------------------------------- |
|
253 |
// |
|
254 |
TConnMonBearerType CConnectionInfoBase::GetBearerType() const |
|
255 |
{ |
|
256 |
return iConnectionBearerType; |
|
257 |
} |
|
258 |
||
259 |
||
260 |
// --------------------------------------------------------- |
|
261 |
// CConnectionInfoBase::GetConnectionListBoxItemText |
|
262 |
// --------------------------------------------------------- |
|
263 |
// |
|
264 |
TPtrC CConnectionInfoBase::GetConnectionListBoxItemText() const |
|
265 |
{ |
|
266 |
return iListBoxItemText; |
|
267 |
} |
|
268 |
||
269 |
// --------------------------------------------------------- |
|
270 |
// CConnectionInfoBase::RefreshConnectionStatus |
|
271 |
// --------------------------------------------------------- |
|
272 |
// |
|
273 |
void CConnectionInfoBase::RefreshConnectionStatus() |
|
274 |
{ |
|
275 |
TConnectionStatus connStatus( EConnectionUninitialized ); |
|
276 |
iActiveWrapper->StartGetIntAttribute( iConnectionId, |
|
277 |
iConnectionMonitor, |
|
278 |
KConnectionStatus, |
|
279 |
( ( TInt& )( connStatus ) ) ); |
|
280 |
TInt err( iActiveWrapper->iStatus.Int() ); |
|
281 |
CMUILOGGER_WRITE_F( "RefreshConnectionStatus status : %d", |
|
282 |
err ); |
|
283 |
if ( err == KErrNone ) |
|
284 |
{ |
|
285 |
RefreshConnectionStatus( connStatus ); |
|
286 |
} |
|
287 |
else |
|
288 |
{ |
|
289 |
iActiveWrapper->Cancel(); |
|
290 |
} |
|
291 |
} |
|
292 |
||
293 |
// --------------------------------------------------------- |
|
294 |
// CConnectionInfoBase::RefreshConnectionStatus |
|
295 |
// --------------------------------------------------------- |
|
296 |
// |
|
297 |
void CConnectionInfoBase::RefreshConnectionStatus( |
|
298 |
const TInt aConnectionStatus ) |
|
299 |
{ |
|
300 |
CMUILOGGER_ENTERFN( "RefreshConnectionStatus" ); |
|
301 |
CMUILOGGER_WRITE_F( "RefreshConnectionStatus aConnectionStatus %d", |
|
302 |
( TInt )aConnectionStatus ); |
|
303 |
CMUILOGGER_WRITE_F( "iConnectionStatus before %d", |
|
304 |
( TInt )iConnectionStatus ); |
|
305 |
||
306 |
||
307 |
if ( ( aConnectionStatus == KLinkLayerOpen ) || |
|
308 |
( ( aConnectionStatus == KConnectionOpen ) && |
|
309 |
( iConnectionBearerType >= EBearerExternalCSD ) ) ) |
|
310 |
{ |
|
311 |
CMUILOGGER_WRITE("1"); |
|
312 |
iConnectionStatus = EConnectionCreated; |
|
313 |
} |
|
314 |
else if ( ( aConnectionStatus == KConnectionClosed ) || |
|
315 |
( aConnectionStatus == KLinkLayerClosed ) ) |
|
316 |
{ |
|
317 |
CMUILOGGER_WRITE("2"); |
|
318 |
iConnectionStatus = EConnectionClosed; |
|
319 |
} |
|
320 |
else if ( ( ( aConnectionStatus >= KMinAgtProgress ) && |
|
321 |
( aConnectionStatus <= KConnectionOpen ) ) || |
|
322 |
( aConnectionStatus == KStartingSelection ) || |
|
323 |
( aConnectionStatus == KFinishedSelection ) || |
|
324 |
( aConnectionStatus == KConfigDaemonStartingRegistration ) || |
|
325 |
( aConnectionStatus == KConfigDaemonFinishedRegistration ) ) |
|
326 |
// creating |
|
327 |
{ |
|
328 |
CMUILOGGER_WRITE("5"); |
|
329 |
iConnectionStatus = EConnectionCreating; |
|
330 |
} |
|
331 |
else if ( aConnectionStatus == KDataTransferTemporarilyBlocked ) |
|
332 |
{ |
|
333 |
CMUILOGGER_WRITE("6"); |
|
334 |
iConnectionStatus = EConnectionSuspended; |
|
335 |
} |
|
336 |
else if ( ( iConnectionStatus == EConnectionCreated ) && |
|
337 |
( ( aConnectionStatus >= KConnectionStartingClose ) && |
|
338 |
( aConnectionStatus < KConnectionClosed ) || |
|
339 |
( aConnectionStatus == KConfigDaemonFinishedDeregistrationStop ) || |
|
340 |
( aConnectionStatus == KConfigDaemonStartingDeregistration ) || |
|
341 |
( aConnectionStatus == KLinkLayerClosed ) || |
|
342 |
( aConnectionStatus == KConnectionUninitialised ) |
|
343 |
) ) |
|
344 |
// closing |
|
345 |
{ |
|
346 |
CMUILOGGER_WRITE("7"); |
|
347 |
iConnectionStatus = EConnectionClosing; |
|
348 |
} |
|
349 |
else if ( ( aConnectionStatus == KConnectionUninitialised ) && |
|
350 |
( iConnectionStatus == EConnectionSuspended ) ) |
|
351 |
{ // Back to created from suspended |
|
352 |
CMUILOGGER_WRITE("4"); |
|
353 |
iConnectionStatus = EConnectionCreated; |
|
354 |
} |
|
355 |
else if ( aConnectionStatus == KConnectionUninitialised ) |
|
356 |
{ |
|
357 |
CMUILOGGER_WRITE("3"); |
|
358 |
iConnectionStatus = EConnectionUninitialized; |
|
359 |
} |
|
360 |
||
361 |
else |
|
362 |
{ |
|
363 |
CMUILOGGER_WRITE_F( " else iConnectionStatus %d", |
|
364 |
( TInt )iConnectionStatus ); |
|
365 |
CMUILOGGER_WRITE_F( "else aConnectionStatus %d", |
|
366 |
( TInt )aConnectionStatus ); |
|
367 |
||
368 |
CMUILOGGER_WRITE("else"); |
|
369 |
} |
|
370 |
||
371 |
||
372 |
CMUILOGGER_WRITE_F( "iConnectionStatus after %d", |
|
373 |
( TInt )iConnectionStatus ); |
|
374 |
CMUILOGGER_LEAVEFN( "RefreshConnectionStatus" ); |
|
375 |
} |
|
376 |
||
377 |
||
378 |
// --------------------------------------------------------- |
|
379 |
// CConnectionInfoBase::RefreshSentReceivedDataL |
|
380 |
// --------------------------------------------------------- |
|
381 |
// |
|
382 |
void CConnectionInfoBase::RefreshSentReceivedDataL() |
|
383 |
{ |
|
384 |
CMUILOGGER_ENTERFN( "CConnectionInfoBase::RefreshSentReceivedDataL" ); |
|
385 |
// Downloaded |
|
386 |
CMUILOGGER_WRITE("Downloaded before"); |
|
387 |
iActiveWrapper->StartGetUintAttribute( iConnectionId, |
|
388 |
iConnectionMonitor, |
|
389 |
KDownlinkData, |
|
390 |
iDownloaded ); |
|
391 |
TInt errDownload( iActiveWrapper->iStatus.Int() ); |
|
392 |
CMUILOGGER_WRITE_F( "Download status: %d", errDownload ); |
|
393 |
if ( errDownload != KErrNone ) |
|
394 |
{ |
|
395 |
iActiveWrapper->Cancel(); |
|
396 |
User::Leave( errDownload ); |
|
397 |
} |
|
398 |
CMUILOGGER_WRITE("Downloaded after"); |
|
399 |
// Uploaded |
|
400 |
CMUILOGGER_WRITE("Uploaded before"); |
|
401 |
iActiveWrapper->StartGetUintAttribute( iConnectionId, |
|
402 |
iConnectionMonitor, |
|
403 |
KUplinkData, |
|
404 |
iUploaded ); |
|
405 |
TInt errUpload( iActiveWrapper->iStatus.Int() ); |
|
406 |
CMUILOGGER_WRITE_F( "Upload status: %d", errUpload ); |
|
407 |
if ( errUpload != KErrNone ) |
|
408 |
{ |
|
409 |
iActiveWrapper->Cancel(); |
|
410 |
User::Leave( errUpload ); |
|
411 |
} |
|
412 |
CMUILOGGER_WRITE("Uploaded after"); |
|
413 |
||
414 |
CMUILOGGER_LEAVEFN( "CConnectionInfoBase::RefreshSentReceivedDataL" ); |
|
415 |
} |
|
416 |
||
417 |
||
418 |
// --------------------------------------------------------- |
|
419 |
// CConnectionInfoBase::RefreshTransferSpeedsL |
|
420 |
// --------------------------------------------------------- |
|
421 |
// |
|
422 |
void CConnectionInfoBase::RefreshTransferSpeedsL() |
|
423 |
{ |
|
424 |
CMUILOGGER_ENTERFN( "CConnectionInfoBase::RefreshTransferSpeedsL" ); |
|
425 |
const TInt KUpdatingIntervalInMillisec = 500; |
|
426 |
const TInt KStandardKilo = 1000; |
|
427 |
const TInt KDataKilo = 1024; |
|
428 |
||
429 |
TUint up = iUploaded; |
|
430 |
TUint down = iDownloaded; |
|
431 |
||
432 |
RefreshSentReceivedDataL(); |
|
433 |
||
434 |
TTime now; |
|
435 |
now.UniversalTime(); |
|
436 |
||
437 |
// calculate time difference in milliseconds |
|
438 |
TInt diffTime = I64INT( now.MicroSecondsFrom( iLastSpeedUpdate ).Int64() / |
|
439 |
TInt64( KStandardKilo ) ); |
|
440 |
||
441 |
if ( iLastSpeedUpdate.Int64() == 0 ) |
|
442 |
{ |
|
443 |
iLastSpeedUpdate = now; |
|
444 |
||
445 |
// speed cannot be calculated at the first time |
|
446 |
iUpSpeed.quot = 0; |
|
447 |
iUpSpeed.rem = 0; |
|
448 |
iDownSpeed.quot = 0; |
|
449 |
iDownSpeed.rem = 0; |
|
450 |
} |
|
451 |
else if ( diffTime > KUpdatingIntervalInMillisec ) |
|
452 |
{ |
|
453 |
// bytes/millisec |
|
454 |
TInt upSpeed = ( iUploaded - up ) / diffTime; |
|
455 |
TInt downSpeed = ( iDownloaded - down ) / diffTime; |
|
456 |
||
457 |
// bytes/sec |
|
458 |
upSpeed *= KStandardKilo; |
|
459 |
downSpeed *= KStandardKilo; |
|
460 |
||
461 |
// kbytes/sec |
|
462 |
iUpSpeed = div( upSpeed, KDataKilo ); |
|
463 |
iDownSpeed = div( downSpeed, KDataKilo ); |
|
464 |
||
465 |
iLastSpeedUpdate = now; |
|
466 |
} |
|
467 |
||
468 |
CMUILOGGER_LEAVEFN( "CConnectionInfoBase::RefreshTransferSpeedsL" ); |
|
469 |
} |
|
470 |
||
471 |
||
472 |
// --------------------------------------------------------- |
|
473 |
// CConnectionInfoBase::RefreshDuration |
|
474 |
// --------------------------------------------------------- |
|
475 |
// |
|
476 |
void CConnectionInfoBase::RefreshDuration() |
|
477 |
{ |
|
478 |
CMUILOGGER_ENTERFN( "CConnectionInfoBase::RefreshDuration" ); |
|
479 |
TTime now; |
|
480 |
now.UniversalTime(); |
|
481 |
||
482 |
// passed time since connection established. |
|
483 |
iDuration = now.MicroSecondsFrom( iStartTime ).Int64(); |
|
484 |
CMUILOGGER_LEAVEFN( "CConnectionInfoBase::RefreshDuration" ); |
|
485 |
} |
|
486 |
||
487 |
||
488 |
// --------------------------------------------------------- |
|
489 |
// CConnectionInfoBase::RefreshAppNamesL |
|
490 |
// --------------------------------------------------------- |
|
491 |
// |
|
492 |
TInt CConnectionInfoBase::RefreshAppNamesL() |
|
493 |
{ |
|
494 |
CMUILOGGER_ENTERFN( "CConnectionInfoBase::RefreshAppNamesL" ); |
|
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
495 |
|
58 | 496 |
TInt sharings( 0 ); |
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
497 |
|
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
498 |
if ( IsAlive() ) |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
499 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
500 |
if ( iAppNames ) |
58 | 501 |
{ |
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
502 |
iAppNames->Reset(); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
503 |
HBufC* actAppName = NULL; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
504 |
// Check whether it is an internal or external (modem) connection |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
505 |
// External (modem) connections does not need application name |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
506 |
if ( iConnectionBearerType < EBearerExternalCSD ) |
58 | 507 |
{ |
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
508 |
TInt count( 0 ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
509 |
TConnMonClientEnumBuf clientBuf; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
510 |
iActiveWrapper->StartGetConnSharings( iConnectionId, |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
511 |
iConnectionMonitor, |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
512 |
clientBuf ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
513 |
|
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
514 |
TInt err( iActiveWrapper->iStatus.Int() ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
515 |
CMUILOGGER_WRITE_F( "RefreshSharings status: %d", err ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
516 |
|
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
517 |
if ( !err ) |
58 | 518 |
{ |
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
519 |
count = clientBuf().iCount; |
58 | 520 |
} |
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
521 |
|
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
522 |
CMUILOGGER_WRITE_F( "clientBuf().iCount: %d", count ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
523 |
|
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
524 |
#ifndef __WINS__ // Appl. uid is always zero in emulator |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
525 |
|
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
526 |
RApaLsSession appSess; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
527 |
TApaAppInfo appInfo; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
528 |
|
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
529 |
// The connection could be shared by several applications |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
530 |
User::LeaveIfError( appSess.Connect() ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
531 |
|
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
532 |
TUint i; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
533 |
for ( i = 0; i < count; i++ ) |
58 | 534 |
{ |
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
535 |
actAppName = NULL; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
536 |
appInfo.iCaption.Zero(); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
537 |
|
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
538 |
TInt result = appSess.GetAppInfo( appInfo, |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
539 |
clientBuf().iUid[i] ); |
58 | 540 |
|
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
541 |
//================================ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
542 |
CMUILOGGER_WRITE_F( "result: %d", result ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
543 |
CMUILOGGER_WRITE_F( "iClientInfo.iUid[i].iUid: %x", |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
544 |
clientBuf().iUid[i].iUid ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
545 |
|
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
546 |
if ( result != KErrNone ) |
58 | 547 |
{ |
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
548 |
TInt resId = 0; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
549 |
switch ( clientBuf().iUid[i].iUid ) |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
550 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
551 |
case KMessagingServerUid: // Messaging |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
552 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
553 |
resId = R_QTN_CMON_SHARING_APP_MSG_SERVER; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
554 |
break; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
555 |
} |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
556 |
case KDownloadMgrServerUid: // Downloads |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
557 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
558 |
resId = R_QTN_CMON_SHARING_APP_DL_MG; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
559 |
break; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
560 |
} |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
561 |
case KFeedsServerUid: // Web Feeds |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
562 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
563 |
resId = R_QTN_CMON_SHARING_APP_RSS_SERVER; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
564 |
break; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
565 |
} |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
566 |
case KJavaVMUid: // Application |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
567 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
568 |
resId = R_QTN_CMON_SHARING_APP_JAVA_MIDLET; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
569 |
break; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
570 |
} |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
571 |
case KBannedServerUID: |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
572 |
{ // Forget about DHCP server! |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
573 |
break; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
574 |
} |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
575 |
case KSUPLServerUid: |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
576 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
577 |
resId = R_QTN_CMON_SHARING_APP_SUPL; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
578 |
break; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
579 |
} |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
580 |
default: // (unknown) |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
581 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
582 |
resId = R_QTN_CMON_SHARING_APP_UNKNOWN; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
583 |
break; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
584 |
} |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
585 |
} |
58 | 586 |
|
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
587 |
if ( resId ) |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
588 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
589 |
actAppName = StringLoader::LoadL( resId ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
590 |
} |
58 | 591 |
} |
592 |
else |
|
593 |
{ |
|
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
594 |
actAppName = HBufC::NewL( appInfo.iCaption.Length() ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
595 |
TPtr actAppNameBuf = actAppName->Des(); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
596 |
actAppNameBuf.Append( appInfo.iCaption ); |
58 | 597 |
} |
598 |
||
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
599 |
if ( actAppName ) |
58 | 600 |
{ |
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
601 |
iAppNames->AppendL( actAppName->Des() ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
602 |
delete actAppName; |
58 | 603 |
} |
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
604 |
} |
58 | 605 |
|
606 |
iAppNames->Sort(); |
|
607 |
appSess.Close(); |
|
608 |
#else |
|
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
609 |
TInt countBan( 0 ); |
58 | 610 |
|
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
611 |
if ( !err ) |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
612 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
613 |
// remove the DHCP server is not actually |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
614 |
// an owner of the connection |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
615 |
for ( TUint tmp = 0; tmp < count; ++tmp ) |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
616 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
617 |
TUid uid = clientBuf().iUid[tmp]; |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
618 |
|
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
619 |
if ( uid.iUid == KBannedServerUID ) |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
620 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
621 |
++countBan; |
58 | 622 |
} |
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
623 |
} // end |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
624 |
} |
58 | 625 |
|
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
626 |
_LIT( KStrApplication, "Application" ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
627 |
// Give a dummy name of the application |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
628 |
for ( TInt i = 0; i < ( count - countBan ); i++ ) |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
629 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
630 |
iAppNames->AppendL( KStrApplication ); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
631 |
} |
58 | 632 |
|
633 |
#endif // __WINS__ |
|
634 |
||
69
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
635 |
} |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
636 |
/* modem connections does not need application name |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
637 |
else |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
638 |
{ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
639 |
} |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
640 |
*/ |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
641 |
sharings = iAppNames->Count(); |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
642 |
} |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
643 |
} |
cf1b3ddbe9a1
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
644 |
|
58 | 645 |
CMUILOGGER_LEAVEFN( "CConnectionInfoBase::RefreshAppNamesL" ); |
646 |
return sharings; |
|
647 |
} |
|
648 |
||
649 |
||
650 |
// --------------------------------------------------------- |
|
651 |
// CConnectionInfoBase::ToDetailsListBoxItemTextL |
|
652 |
// --------------------------------------------------------- |
|
653 |
// |
|
654 |
HBufC* CConnectionInfoBase::ToDetailsListBoxItemTextL( |
|
655 |
const TUint aResourceId, |
|
656 |
const HBufC* aValueText ) const |
|
657 |
{ |
|
658 |
CMUILOGGER_ENTERFN( "CConnectionInfoBase::ToDetailsListBoxItemTextL" ); |
|
659 |
||
660 |
HBufC* columnName = NULL; |
|
661 |
if ( aResourceId ) |
|
662 |
{ |
|
663 |
columnName = StringLoader::LoadLC( aResourceId ); |
|
664 |
} |
|
665 |
else |
|
666 |
{ |
|
667 |
columnName = KEmpty().AllocLC(); |
|
668 |
} |
|
669 |
||
670 |
HBufC* listBoxItemText = HBufC::NewL( KDetailsListItemText ); |
|
671 |
||
672 |
TPtr ptrToListBoxItemText = listBoxItemText->Des(); |
|
673 |
||
674 |
ptrToListBoxItemText.Format( KDetailsListItemTextFormat, |
|
675 |
columnName, aValueText ); |
|
676 |
CleanupStack::PopAndDestroy( columnName ); |
|
677 |
||
678 |
||
679 |
CMUILOGGER_LEAVEFN( "CConnectionInfoBase::ToDetailsListBoxItemTextL" ); |
|
680 |
||
681 |
return listBoxItemText; |
|
682 |
} |
|
683 |
||
684 |
// --------------------------------------------------------- |
|
685 |
// CConnectionInfoBase::ToDetailsListBoxItemTextWithAppendL |
|
686 |
// --------------------------------------------------------- |
|
687 |
// |
|
688 |
void CConnectionInfoBase::ToDetailsListBoxItemTextWithAppendL( |
|
689 |
const TUint aResourceId, |
|
690 |
const HBufC* aValueText ) |
|
691 |
{ |
|
692 |
HBufC* listBoxItemText = ToDetailsListBoxItemTextL( aResourceId, |
|
693 |
aValueText ); |
|
694 |
CleanupStack::PushL( listBoxItemText ); |
|
695 |
CMUILOGGER_WRITE_F( "LISTBOXITEM: %S", listBoxItemText ); |
|
696 |
iDetailsArray->AppendL( *listBoxItemText ); |
|
697 |
CleanupStack::PopAndDestroy( listBoxItemText ); |
|
698 |
} |
|
699 |
||
700 |
||
701 |
// --------------------------------------------------------- |
|
702 |
// CConnectionInfoBase::ToDetailsListBoxItemTextWithReplaceL |
|
703 |
// --------------------------------------------------------- |
|
704 |
// |
|
705 |
void CConnectionInfoBase::ToDetailsListBoxItemTextWithReplaceL( |
|
706 |
const TUint aResourceId, |
|
707 |
const HBufC* aValueText, |
|
708 |
TInt aIndex ) |
|
709 |
{ |
|
710 |
CMUILOGGER_ENTERFN |
|
711 |
( "CConnectionInfoBase::ToDetailsListBoxItemTextWithReplaceL" ); |
|
712 |
CMUILOGGER_WRITE_F( "aValueText: %S", aValueText ); |
|
713 |
||
714 |
if ( /*( iDetailsArray ) && */ |
|
715 |
( aIndex < iDetailsArray->Count() ) && |
|
716 |
( aIndex > KErrNotFound ) ) |
|
717 |
{ |
|
718 |
HBufC* listBoxItemText = ToDetailsListBoxItemTextL( aResourceId, |
|
719 |
aValueText ); |
|
720 |
iDetailsArray->Delete( aIndex ); |
|
721 |
CleanupStack::PushL( listBoxItemText ); |
|
722 |
iDetailsArray->InsertL( aIndex, *listBoxItemText ); |
|
723 |
CleanupStack::PopAndDestroy( listBoxItemText ); |
|
724 |
iDetailsArray->Compress(); |
|
725 |
} |
|
726 |
CMUILOGGER_LEAVEFN |
|
727 |
( "CConnectionInfoBase::ToDetailsListBoxItemTextWithReplaceL" ); |
|
728 |
||
729 |
} |
|
730 |
||
731 |
// --------------------------------------------------------- |
|
732 |
// CConnectionInfoBase::ToStringBearerLC |
|
733 |
// --------------------------------------------------------- |
|
734 |
// |
|
735 |
HBufC* CConnectionInfoBase::ToStringBearerLC() const |
|
736 |
{ |
|
737 |
HBufC* bearer = NULL; |
|
738 |
TUint resourceId( 0 ); |
|
739 |
||
740 |
// Bearer type |
|
741 |
if ( iConnectionBearerType == EBearerHSCSD || |
|
742 |
iConnectionBearerType == EBearerExternalHSCSD ) |
|
743 |
{ |
|
744 |
resourceId = R_QTN_CMON_BEARER_HSCSD; |
|
745 |
||
746 |
} |
|
747 |
else if ( iConnectionBearerType == EBearerCSD || |
|
748 |
iConnectionBearerType == EBearerExternalCSD || |
|
749 |
iConnectionBearerType == EBearerWcdmaCSD || |
|
750 |
iConnectionBearerType == EBearerExternalWcdmaCSD ) |
|
751 |
{ |
|
752 |
resourceId = R_QTN_SET_BEARER_DATA_CALL; |
|
753 |
} |
|
754 |
else if ( iConnectionBearerType == EBearerWLAN ) |
|
755 |
{ |
|
756 |
resourceId = R_QTN_WLAN_SETT_BEARER_WLAN; |
|
757 |
} |
|
758 |
else |
|
759 |
{ |
|
760 |
resourceId = R_QTN_SET_BEARER_PACKET_DATA; |
|
761 |
} |
|
762 |
||
763 |
bearer = StringLoader::LoadLC( resourceId ); |
|
764 |
||
765 |
return bearer; |
|
766 |
} |
|
767 |
||
768 |
||
769 |
// --------------------------------------------------------- |
|
770 |
// CConnectionInfoBase::ToStringStatusLC |
|
771 |
// --------------------------------------------------------- |
|
772 |
// |
|
773 |
HBufC* CConnectionInfoBase::ToStringStatusLC( TBool aIsDetailsView ) const |
|
774 |
{ |
|
775 |
HBufC* status = NULL; |
|
776 |
TUint resourceId( 0 ); |
|
777 |
switch ( iConnectionStatus ) |
|
778 |
{ |
|
779 |
case EConnectionCreated: |
|
780 |
{ |
|
781 |
if ( iUpSpeed.quot || iUpSpeed.rem || |
|
782 |
iDownSpeed.quot || iDownSpeed.rem ) |
|
783 |
{ |
|
784 |
resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_ACTIVE |
|
785 |
: R_QTN_CMON_STATUS_ACTIVE; |
|
786 |
} |
|
787 |
else |
|
788 |
{ |
|
789 |
resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_IDLE |
|
790 |
: R_QTN_CMON_STATUS_IDLE; |
|
791 |
} |
|
792 |
break; |
|
793 |
} |
|
794 |
case EConnectionUninitialized: |
|
795 |
case EConnectionClosed: |
|
796 |
{ |
|
797 |
resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_CLOSED |
|
798 |
: R_QTN_CMON_STATUS_CLOSED; |
|
799 |
break; |
|
800 |
} |
|
801 |
case EConnectionClosing: |
|
802 |
{ |
|
803 |
resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_CLOSING |
|
804 |
: R_QTN_CMON_STATUS_CLOSING; |
|
805 |
break; |
|
806 |
} |
|
807 |
case EConnectionSuspended: |
|
808 |
{ |
|
809 |
resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_SUSPENDED |
|
810 |
: R_QTN_CMON_STATUS_SUSPENDED; |
|
811 |
break; |
|
812 |
} |
|
813 |
case EConnectionCreating: |
|
814 |
default : |
|
815 |
{ |
|
816 |
resourceId = aIsDetailsView ? R_QTN_CMON_STATUS_DETAILS_CREATING |
|
817 |
: R_QTN_CMON_STATUS_CREATING; |
|
818 |
break; |
|
819 |
} |
|
820 |
} |
|
821 |
||
822 |
status = StringLoader::LoadLC( resourceId ); |
|
823 |
||
824 |
return status; |
|
825 |
} |
|
826 |
||
827 |
||
828 |
// --------------------------------------------------------- |
|
829 |
// CConnectionInfoBase::ToStringTotalTransmittedDataLC |
|
830 |
// --------------------------------------------------------- |
|
831 |
// |
|
832 |
HBufC* CConnectionInfoBase::ToStringTotalTransmittedDataLC() const |
|
833 |
{ |
|
834 |
TUint total = iUploaded + iDownloaded; |
|
835 |
CMUILOGGER_WRITE_F( "iUploaded : %d", iUploaded ); |
|
836 |
CMUILOGGER_WRITE_F( "iDownloaded : %d", iDownloaded ); |
|
837 |
CMUILOGGER_WRITE_F( "total : %d", total ); |
|
838 |
||
839 |
return ToStringLoadedDataLC( total ); |
|
840 |
} |
|
841 |
||
842 |
// --------------------------------------------------------- |
|
843 |
// CConnectionInfoBase::ToStringSentDataLC |
|
844 |
// --------------------------------------------------------- |
|
845 |
// |
|
846 |
HBufC* CConnectionInfoBase::ToStringSentDataLC( TBool aToBeThreeDigit ) const |
|
847 |
{ |
|
848 |
return ToStringLoadedDataLC( iUploaded, aToBeThreeDigit, KUpArrowChar ); |
|
849 |
} |
|
850 |
||
851 |
||
852 |
// --------------------------------------------------------- |
|
853 |
// CConnectionInfoBase::ToStringReceivedDataLC |
|
854 |
// --------------------------------------------------------- |
|
855 |
// |
|
856 |
HBufC* CConnectionInfoBase::ToStringReceivedDataLC( TBool aToBeThreeDigit ) const |
|
857 |
{ |
|
858 |
return ToStringLoadedDataLC( iDownloaded, aToBeThreeDigit, KDownArrowChar ); |
|
859 |
} |
|
860 |
||
861 |
||
862 |
// --------------------------------------------------------- |
|
863 |
// CConnectionInfoBase::ToStringTransferSpeedUpLC |
|
864 |
// --------------------------------------------------------- |
|
865 |
// |
|
866 |
HBufC* CConnectionInfoBase::ToStringTransferSpeedUpLC() const |
|
867 |
{ |
|
868 |
return ToStringTransferSpeedLC( iUpSpeed, KUpArrowChar ); |
|
869 |
} |
|
870 |
||
871 |
||
872 |
// --------------------------------------------------------- |
|
873 |
// CConnectionInfoBase::ToStringTransferSpeedDownLC |
|
874 |
// --------------------------------------------------------- |
|
875 |
// |
|
876 |
HBufC* CConnectionInfoBase::ToStringTransferSpeedDownLC() const |
|
877 |
{ |
|
878 |
return ToStringTransferSpeedLC( iDownSpeed, KDownArrowChar ); |
|
879 |
} |
|
880 |
||
881 |
||
882 |
// --------------------------------------------------------- |
|
883 |
// CConnectionInfoBase::ToStringDurationLC |
|
884 |
// --------------------------------------------------------- |
|
885 |
// |
|
886 |
HBufC* CConnectionInfoBase::ToStringDurationLC() const |
|
887 |
{ |
|
888 |
const TUint KTimeStringLength = 64; |
|
889 |
const TUint KTimeFormatBuf = 16; |
|
890 |
const TUint KDateFormatBuf = 16; |
|
891 |
_LIT( KDayFormat, "%d" ); |
|
892 |
||
893 |
||
894 |
TTime now; |
|
895 |
now.UniversalTime(); |
|
896 |
HBufC* timeString = NULL; |
|
897 |
||
898 |
TTimeIntervalDays days = NULL; |
|
899 |
||
900 |
if ( iStartTime != NULL ) |
|
901 |
{ |
|
902 |
// calculate days passed since connection started |
|
903 |
days = now.DaysFrom( iStartTime ); |
|
904 |
CMUILOGGER_WRITEF( _L( "ToStringDurationLC days before: %d" ), |
|
905 |
days.Int() ); |
|
906 |
} |
|
907 |
||
908 |
// passed time since connection established. |
|
909 |
if ( days.Int() <= 0 ) |
|
910 |
// it's still within 1 day |
|
911 |
{ |
|
912 |
timeString = HBufC::NewLC( KTimeStringLength ); |
|
913 |
TPtr16 tempBuf( timeString->Des() ); |
|
914 |
||
915 |
HBufC* temp = StringLoader::LoadLC( R_QTN_TIME_DURAT_LONG_WITH_ZERO ); |
|
916 |
||
917 |
iDuration.FormatL( tempBuf, *temp ); |
|
918 |
CleanupStack::PopAndDestroy( temp ); |
|
919 |
} |
|
920 |
else |
|
921 |
// more than 1 day |
|
922 |
{ |
|
923 |
CMUILOGGER_WRITEF( _L( "ToStringDurationLC days after: %d" ), |
|
924 |
days.Int() ); |
|
925 |
||
926 |
TBuf<KDateFormatBuf> dayFormat; |
|
927 |
dayFormat.Format( KDayFormat, days.Int() ); |
|
928 |
||
929 |
// format time format string |
|
930 |
HBufC* tempFormat = StringLoader::LoadLC( |
|
931 |
R_QTN_TIME_DURAT_SHORT_WITH_ZERO ); |
|
932 |
TBuf<KTimeFormatBuf> tempBuf; |
|
933 |
||
934 |
// format hours:mins |
|
935 |
iDuration.FormatL( tempBuf, *tempFormat ); |
|
936 |
||
937 |
CDesCArrayFlat* strings = new( ELeave ) CDesCArrayFlat( 2 ); |
|
938 |
CleanupStack::PushL( strings ); |
|
939 |
||
940 |
strings->AppendL( dayFormat ); |
|
941 |
strings->AppendL( tempBuf ); |
|
942 |
||
943 |
timeString = StringLoader::LoadL( R_QTN_CMON_DURATION_OVER_24H, |
|
944 |
*strings ); |
|
945 |
||
946 |
CleanupStack::PopAndDestroy( strings ); |
|
947 |
CleanupStack::PopAndDestroy( tempFormat ); |
|
948 |
CleanupStack::PushL( timeString ); |
|
949 |
} |
|
950 |
||
951 |
CMUILOGGER_WRITE_F( "duration time1: %S", timeString ); |
|
952 |
||
953 |
TPtr temp( timeString->Des() ); |
|
954 |
AknTextUtils::DisplayTextLanguageSpecificNumberConversion( temp ); |
|
955 |
CMUILOGGER_WRITE_F( "duration temp: %S", &temp ); |
|
956 |
||
957 |
CMUILOGGER_WRITE_F( "duration time2: %S", timeString ); |
|
958 |
||
959 |
||
960 |
return timeString; |
|
961 |
} |
|
962 |
||
963 |
||
964 |
// --------------------------------------------------------- |
|
965 |
// CConnectionInfoBase::CheckMrouterIap |
|
966 |
// --------------------------------------------------------- |
|
967 |
// |
|
968 |
TBool CConnectionInfoBase::CheckMrouterIap() |
|
969 |
{ |
|
970 |
CMUILOGGER_ENTERFN( "CheckMrouterIap" ); |
|
971 |
TBool result( ETrue ); |
|
972 |
||
973 |
CMUILOGGER_WRITE_F( "IAP name: %S", &iConnectionName ); |
|
974 |
iConnectionName.Trim(); |
|
975 |
if ( iConnectionName.Left( |
|
976 |
KMrouterName().Length() ).CompareF( KMrouterName ) ) |
|
977 |
{ |
|
978 |
result = EFalse; |
|
979 |
} |
|
980 |
CMUILOGGER_LEAVEFN( "CheckMrouterIap" ); |
|
981 |
return result; |
|
982 |
} |
|
983 |
||
984 |
||
985 |
// --------------------------------------------------------- |
|
986 |
// CConnectionInfoBase::ToStringLoadedDataLC |
|
987 |
// --------------------------------------------------------- |
|
988 |
// |
|
989 |
HBufC* CConnectionInfoBase::ToStringLoadedDataLC( TUint aLoadedData, |
|
990 |
TBool aToBeThreeDigit, |
|
991 |
const TUint aArrowChar ) const |
|
992 |
{ |
|
993 |
const TUint KTransferedBytesFormatBuf = 16; |
|
994 |
const TUint KTransferedBytesWidth = 10; |
|
995 |
TUint transferedBytesDecimalPlaces(2); |
|
996 |
TUint resId; |
|
997 |
HBufC* loadedTxt = NULL; |
|
998 |
||
999 |
TBuf<KTransferedBytesFormatBuf> buf; |
|
1000 |
||
1001 |
if ( aLoadedData < 1000 ) // bytes |
|
1002 |
{ |
|
1003 |
if ( aToBeThreeDigit ) // added arrow to listbox |
|
1004 |
{ |
|
1005 |
_LIT( KUdLinkFormatBytes, "%c%d" ); |
|
1006 |
||
1007 |
buf.Format( KUdLinkFormatBytes, aArrowChar, aLoadedData ); |
|
1008 |
} |
|
1009 |
else |
|
1010 |
{ |
|
1011 |
_LIT( KUdLinkFormatBytes, "%d" ); |
|
1012 |
||
1013 |
buf.Format( KUdLinkFormatBytes, aLoadedData ); |
|
1014 |
} |
|
1015 |
resId = R_QTN_LOG_GPRS_AMOUNT_B; |
|
1016 |
} |
|
1017 |
else |
|
1018 |
{ // KB, MB, GB |
|
1019 |
TUint denom; |
|
1020 |
||
1021 |
if ( aLoadedData < 1000 * 1024 ) |
|
1022 |
{ |
|
1023 |
denom = 1024; |
|
1024 |
resId = R_QTN_LOG_GPRS_AMOUNT_KB; |
|
1025 |
} |
|
1026 |
else if ( aLoadedData < 1000 * 1024 * 1024 ) |
|
1027 |
{ |
|
1028 |
denom = 1024 * 1024; |
|
1029 |
resId = R_QTN_LOG_GPRS_AMOUNT_MB; |
|
1030 |
} |
|
1031 |
else |
|
1032 |
{ |
|
1033 |
denom = 1024 * 1024 * 1024; |
|
1034 |
resId = R_QTN_LOG_GPRS_AMOUNT_GB; |
|
1035 |
} |
|
1036 |
||
1037 |
TReal value = STATIC_CAST( TReal, aLoadedData ) / |
|
1038 |
STATIC_CAST( TReal, denom ); |
|
1039 |
||
1040 |
if ( aToBeThreeDigit ) |
|
1041 |
{ |
|
1042 |
if ( value < 10 ) // number of decimal places |
|
1043 |
{ |
|
1044 |
transferedBytesDecimalPlaces = 2; |
|
1045 |
} |
|
1046 |
else if ( value < 100 ) |
|
1047 |
{ |
|
1048 |
transferedBytesDecimalPlaces = 1; |
|
1049 |
} |
|
1050 |
else |
|
1051 |
{ |
|
1052 |
transferedBytesDecimalPlaces = 0; |
|
1053 |
} |
|
1054 |
} |
|
1055 |
||
1056 |
TRealFormat Format( KTransferedBytesWidth, |
|
1057 |
transferedBytesDecimalPlaces ); |
|
1058 |
||
1059 |
HBufC* number = HBufC::NewLC( KTransferedBytesWidth ); |
|
1060 |
number->Des().Num( value, Format ); |
|
1061 |
||
1062 |
if ( aToBeThreeDigit ) // added arrow to listbox |
|
1063 |
{ |
|
1064 |
_LIT( KUdFormatLarge, "%c%S" ); |
|
1065 |
buf.Format( KUdFormatLarge, aArrowChar, number ); |
|
1066 |
} |
|
1067 |
else |
|
1068 |
{ |
|
1069 |
_LIT( KUdFormatLarge, "%S" ); |
|
1070 |
buf.Format( KUdFormatLarge, number ); |
|
1071 |
} |
|
1072 |
CleanupStack::PopAndDestroy( number ); |
|
1073 |
} |
|
1074 |
||
1075 |
loadedTxt = StringLoader::LoadLC( resId, buf ); |
|
1076 |
||
1077 |
TPtr temp( loadedTxt->Des() ); |
|
1078 |
AknTextUtils::DisplayTextLanguageSpecificNumberConversion( temp ); |
|
1079 |
||
1080 |
return loadedTxt; |
|
1081 |
} |
|
1082 |
||
1083 |
||
1084 |
// --------------------------------------------------------- |
|
1085 |
// CConnectionInfoBase::ToStringTransferSpeedLC |
|
1086 |
// --------------------------------------------------------- |
|
1087 |
// |
|
1088 |
HBufC* CConnectionInfoBase::ToStringTransferSpeedLC( div_t aSpeed, |
|
1089 |
const TUint aArrowChar ) const |
|
1090 |
{ |
|
1091 |
const TUint KUpDownSpeedBufSize = 16; |
|
1092 |
_LIT( KUdSpeedFmt, "%c%d%S%02d" ); |
|
1093 |
||
1094 |
TBuf<KUpDownSpeedBufSize> buf; |
|
1095 |
TInt resId; |
|
1096 |
||
1097 |
HBufC* decSep = StringLoader::LoadLC( R_TEXT_CALC_DECIMAL_SEPARATOR ); |
|
1098 |
||
1099 |
resId = R_QTN_CMON_DATA_TRANSF_RATE_UL; |
|
1100 |
buf.Format( KUdSpeedFmt, aArrowChar, aSpeed.quot, decSep, aSpeed.rem ); |
|
1101 |
||
1102 |
CleanupStack::PopAndDestroy( decSep ); |
|
1103 |
||
1104 |
HBufC* speedTxt = StringLoader::LoadLC( resId, buf ); |
|
1105 |
||
1106 |
TPtr temp( speedTxt->Des() ); |
|
1107 |
AknTextUtils::DisplayTextLanguageSpecificNumberConversion( temp ); |
|
1108 |
||
1109 |
return speedTxt; |
|
1110 |
} |
|
1111 |
||
1112 |
// --------------------------------------------------------- |
|
1113 |
// CConnectionInfoBase::InitializeConnectionInfoL |
|
1114 |
// --------------------------------------------------------- |
|
1115 |
// |
|
1116 |
void CConnectionInfoBase::InitializeConnectionInfoL() |
|
1117 |
{ |
|
1118 |
CMUILOGGER_WRITE( "InitializeConnectionInfoL - start " ); |
|
1119 |
TConnMonTimeBuf timeBuf; |
|
1120 |
iActiveWrapper->StartGetConnTime( iConnectionId, |
|
1121 |
iConnectionMonitor, |
|
1122 |
timeBuf ); |
|
1123 |
TInt err( iActiveWrapper->iStatus.Int() ); |
|
1124 |
CMUILOGGER_WRITE_F( "IntiConnectionInfo() status: %d", err ); |
|
1125 |
if ( err != KErrNone ) |
|
1126 |
{ |
|
1127 |
User::Leave( err ); |
|
1128 |
} |
|
1129 |
||
1130 |
iStartTime = timeBuf(); |
|
1131 |
TDateTime dt = iStartTime.DateTime(); |
|
1132 |
CMUILOGGER_WRITE_F( "Day : %d", dt.Day() ); |
|
1133 |
CMUILOGGER_WRITE_F( "Hour : %d", dt.Hour() ); |
|
1134 |
CMUILOGGER_WRITE_F( "Minute : %d", dt.Minute() ); |
|
1135 |
CMUILOGGER_WRITE_F( "Second : %d", dt.Second() ); |
|
1136 |
||
1137 |
||
1138 |
RefreshDetailsL(); |
|
1139 |
if ( !iDetailsArray ) |
|
1140 |
{ |
|
1141 |
ToArrayDetailsL(); |
|
1142 |
} |
|
1143 |
CMUILOGGER_WRITE( "InitializeConnectionInfoL - end " ); |
|
1144 |
} |
|
1145 |
||
1146 |
// --------------------------------------------------------- |
|
1147 |
// CConnectionInfoBase::StringMarkerRemoval |
|
1148 |
// --------------------------------------------------------- |
|
1149 |
// |
|
1150 |
void CConnectionInfoBase::StringMarkerRemoval( HBufC* aStringHolder ) |
|
1151 |
{ |
|
1152 |
TPtr bufPtr = aStringHolder->Des(); |
|
1153 |
||
1154 |
const TText KLRMarker = 0x200E; |
|
1155 |
const TText KRLMarker = 0x200F; |
|
1156 |
||
1157 |
TBuf<2> markers; |
|
1158 |
markers.Append( KLRMarker ); |
|
1159 |
markers.Append( KRLMarker ); |
|
1160 |
||
1161 |
// This function is requested to remove directional markers, because they |
|
1162 |
// cause a display error in languages such Hebrew. Directional markers will |
|
1163 |
// be correctly added later, when the one or two parts of the time string |
|
1164 |
// are merged, again with StringLoader functions. |
|
1165 |
AknTextUtils::StripCharacters( bufPtr, markers ); |
|
1166 |
} |
|
1167 |
||
1168 |
// --------------------------------------------------------- |
|
1169 |
// CConnectionInfoBase::ToStringAppNameLC |
|
1170 |
// --------------------------------------------------------- |
|
1171 |
// |
|
1172 |
HBufC* CConnectionInfoBase::ToStringAppNameLC( TInt aAppIndex ) |
|
1173 |
{ |
|
1174 |
HBufC* appName = ( iAppNames->MdcaPoint( aAppIndex ) ).AllocLC(); |
|
1175 |
||
1176 |
return appName; |
|
1177 |
} |
|
1178 |
||
1179 |
// --------------------------------------------------------- |
|
1180 |
// CConnectionInfoBase::GetDeletedFromCMUI |
|
1181 |
// --------------------------------------------------------- |
|
1182 |
// |
|
1183 |
TBool CConnectionInfoBase::GetDeletedFromCMUI() const |
|
1184 |
{ |
|
1185 |
return iDeletedFromCMUI; |
|
1186 |
} |
|
1187 |
||
1188 |
// --------------------------------------------------------- |
|
1189 |
// CConnectionInfoBase::SetAllDeletedFromCMUI |
|
1190 |
// --------------------------------------------------------- |
|
1191 |
// |
|
1192 |
void CConnectionInfoBase::SetAllDeletedFromCMUI() |
|
1193 |
{ |
|
1194 |
iConnectionStatus = EConnectionClosing; |
|
1195 |
} |
|
1196 |
||
1197 |
// --------------------------------------------------------- |
|
1198 |
// CConnectionInfoBase::SetDeletedFromCMUI |
|
1199 |
// --------------------------------------------------------- |
|
1200 |
// |
|
1201 |
void CConnectionInfoBase::SetDeletedFromCMUI() |
|
1202 |
{ |
|
1203 |
iConnectionStatus = EConnectionClosing; |
|
1204 |
||
1205 |
iDeletedFromCMUI = ETrue; |
|
1206 |
} |
|
1207 |
||
1208 |
||
1209 |
// End of File |