|
1 /* |
|
2 * Copyright (c) 2007 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: Diagnostics Framework Plug-in to test network coverage on |
|
15 the currently locked channel. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // CLASS DECLARATION |
|
21 #include "diagnetcoverageplugin.h" |
|
22 |
|
23 // SYSTEM INCLUDE FILES |
|
24 #include <centralrepository.h> |
|
25 #include <StringLoader.h> // StringLoader |
|
26 |
|
27 #include <DiagTestObserver.h> // MDiagTestObserver |
|
28 #include <DiagTestExecParam.h> // TDiagTestExecParam |
|
29 #include <DiagResultsDbItemBuilder.h> // CDiagResultsDbItemBuilder |
|
30 #include <DiagResultDetailBasic.h> // CDiagResultDetailBasic |
|
31 #include <DiagFrameworkDebug.h> // LOGSTRING |
|
32 #include <devdiagnetcoveragepluginrsc.rsg> |
|
33 |
|
34 // USER INCLUDE FILES |
|
35 #include "diagnetcoveragepluginprivatecrkeys.h" |
|
36 |
|
37 |
|
38 // ADO & Platformization Changes |
|
39 #include <DiagFrameworkDebug.h> // debug macros |
|
40 #include <DiagEngineCommon.h> // MDiagEngineCommon |
|
41 #include <DiagCommonDialog.h> |
|
42 #include <AknDialog.h> // ADO & Platformization Changes |
|
43 #include <aknmessagequerydialog.h> // ADO & Platformization Changes |
|
44 #include <DiagPluginExecPlan.h> |
|
45 #include <DiagExecPlanEntry.h> |
|
46 |
|
47 |
|
48 // EXTERNAL DATA STRUCTURES |
|
49 |
|
50 // EXTERNAL FUNCTION PROTOTYPES |
|
51 |
|
52 // CONSTANTS |
|
53 |
|
54 static const TInt KTotalTestSteps = 2; |
|
55 _LIT( KDiagNetCoveragePluginResourceFileName, "z:DevDiagNetCoveragePluginRsc.rsc" ); |
|
56 |
|
57 // MACROS |
|
58 |
|
59 // LOCAL CONSTANTS AND MACROS |
|
60 |
|
61 // MODULE DATA STRUCTURES |
|
62 |
|
63 // LOCAL FUNCTION PROTOTYPES |
|
64 |
|
65 // FORWARD DECLARATIONS |
|
66 |
|
67 // ============================= LOCAL FUNCTIONS ============================== |
|
68 |
|
69 // ========================= MEMBER FUNCTIONS ================================ |
|
70 |
|
71 // ---------------------------------------------------------------------------- |
|
72 // CDiagNetCoveragePlugin::CDiagNetCoveragePlugin() |
|
73 // |
|
74 // Constructor |
|
75 // ---------------------------------------------------------------------------- |
|
76 // |
|
77 CDiagNetCoveragePlugin::CDiagNetCoveragePlugin( CDiagPluginConstructionParam* aParam ) |
|
78 : CDiagTestPluginBase( aParam ), |
|
79 iNetworkInfoV1(), |
|
80 iSignalStrengthV1(), |
|
81 iNetworkInfoV1Pckg( iNetworkInfoV1 ), |
|
82 iSignalStrengthV1Pckg( iSignalStrengthV1 ) |
|
83 { |
|
84 } |
|
85 |
|
86 |
|
87 // --------------------------------------------------------------------------- |
|
88 // CDiagNetCoveragePlugin::NewL() |
|
89 // |
|
90 // Symbian OS default constructor |
|
91 // --------------------------------------------------------------------------- |
|
92 MDiagPlugin* CDiagNetCoveragePlugin::NewL( TAny* aInitParams ) |
|
93 { |
|
94 |
|
95 LOGSTRING( "CDiagNetCoveragePlugin::NewL" ) |
|
96 |
|
97 ASSERT( aInitParams != NULL ); |
|
98 |
|
99 CDiagPluginConstructionParam* param = |
|
100 static_cast<CDiagPluginConstructionParam*>( aInitParams ); |
|
101 |
|
102 CleanupStack::PushL( param ); |
|
103 CDiagNetCoveragePlugin* self = new( ELeave ) CDiagNetCoveragePlugin( param ); |
|
104 CleanupStack::Pop( param ); |
|
105 |
|
106 CleanupStack::PushL( self ); |
|
107 self->ConstructL(); |
|
108 CleanupStack::Pop( self ); |
|
109 |
|
110 return self; |
|
111 } |
|
112 |
|
113 |
|
114 |
|
115 // --------------------------------------------------------------------------- |
|
116 // CDiagNetCoveragePlugin::ConstructL() |
|
117 // |
|
118 // Symbian OS two-phased constructor |
|
119 // --------------------------------------------------------------------------- |
|
120 void CDiagNetCoveragePlugin::ConstructL() |
|
121 { |
|
122 LOGSTRING("CDiagNetCoveragePlugin::ConstructL"); |
|
123 |
|
124 BaseConstructL( KDiagNetCoveragePluginResourceFileName ); |
|
125 |
|
126 ReadThresholdValuesL(); |
|
127 idialogOn = EFalse; |
|
128 } |
|
129 |
|
130 |
|
131 // ---------------------------------------------------------------------------- |
|
132 // CDiagNetCoveragePlugin::~CDiagNetCoveragePlugin |
|
133 // |
|
134 // Destructor |
|
135 // ---------------------------------------------------------------------------- |
|
136 CDiagNetCoveragePlugin::~CDiagNetCoveragePlugin() |
|
137 { |
|
138 // Base class will call StopAndCleanup(), which callso |
|
139 // Cancel() -> DoCancel() |
|
140 // DoStopAndCleanupL() |
|
141 if ( iWaitDialog ) |
|
142 delete iWaitDialog; |
|
143 } |
|
144 |
|
145 |
|
146 // --------------------------------------------------------------------------- |
|
147 // From MDiagPlugin |
|
148 // CDiagNetCoveragePlugin::IsVisible() |
|
149 // --------------------------------------------------------------------------- |
|
150 TBool CDiagNetCoveragePlugin::IsVisible() const |
|
151 { |
|
152 return ETrue; |
|
153 } |
|
154 |
|
155 // --------------------------------------------------------------------------- |
|
156 // From MDiagTestPlugin |
|
157 // CDiagNetCoveragePlugin::RunMode() |
|
158 // --------------------------------------------------------------------------- |
|
159 MDiagTestPlugin::TRunMode CDiagNetCoveragePlugin::RunMode() const |
|
160 { |
|
161 return EAutomatic; |
|
162 } |
|
163 |
|
164 // --------------------------------------------------------------------------- |
|
165 // From MDiagTestPlugin |
|
166 // CDiagNetCoveragePlugin::TotalSteps() |
|
167 // --------------------------------------------------------------------------- |
|
168 TUint CDiagNetCoveragePlugin::TotalSteps() const |
|
169 { |
|
170 return KTotalTestSteps; |
|
171 } |
|
172 |
|
173 // --------------------------------------------------------------------------- |
|
174 // From MDiagPlugin |
|
175 // CDiagNetCoveragePlugin::GetPluginNameL |
|
176 // --------------------------------------------------------------------------- |
|
177 HBufC* CDiagNetCoveragePlugin::GetPluginNameL( TNameLayoutType aLayoutType ) const |
|
178 { |
|
179 switch ( aLayoutType ) |
|
180 { |
|
181 case ENameLayoutListSingle: |
|
182 return StringLoader::LoadL ( R_DIAG_NET_COVERAGE_PLUGIN_NAME ); |
|
183 |
|
184 case ENameLayoutHeadingPane: |
|
185 return StringLoader::LoadL ( R_QTN_DIAG_MSG_TITLE_VOICE_NETWORK ); |
|
186 |
|
187 case ENameLayoutPopupInfoPane: |
|
188 return StringLoader::LoadL ( R_QTN_DIAG_MSG_INFO_VOICE_NETWORK ); |
|
189 |
|
190 case ENameLayoutTitlePane: |
|
191 return StringLoader::LoadL ( R_QTN_DIAG_TITLE_TEST_VOICE_NETWORK ); |
|
192 |
|
193 case ENameLayoutListSingleGraphic: |
|
194 return StringLoader::LoadL ( R_QTN_DIAG_LST_TEST_VOICE_NETWORK ); |
|
195 |
|
196 default: |
|
197 LOGSTRING2( "CDiagNetCoveragePlugin::GetPluginNameL: " |
|
198 L"ERROR: Unsupported layout type %d", aLayoutType ) |
|
199 __ASSERT_DEBUG( 0, User::Invariant() ); |
|
200 return StringLoader::LoadL ( R_DIAG_NET_COVERAGE_PLUGIN_NAME ); |
|
201 } |
|
202 } |
|
203 |
|
204 // --------------------------------------------------------------------------- |
|
205 // From MDiagPlugin |
|
206 // CDiagNetCoveragePlugin::Uid |
|
207 // --------------------------------------------------------------------------- |
|
208 TUid CDiagNetCoveragePlugin::Uid() const |
|
209 { |
|
210 return KDiagNetCoveragePluginUid; |
|
211 } |
|
212 |
|
213 |
|
214 // --------------------------------------------------------------------------- |
|
215 // From CActive |
|
216 // CDiagNetCoveragePlugin::RunL |
|
217 // --------------------------------------------------------------------------- |
|
218 void CDiagNetCoveragePlugin::RunL() |
|
219 { |
|
220 ReportTestProgressL( iProgressCounter++ ); |
|
221 |
|
222 switch (iState) |
|
223 { |
|
224 case EStateWaitForBandType: |
|
225 CheckNetworkAccessL(); |
|
226 break; |
|
227 |
|
228 case EStateWaitForSignalStrength: |
|
229 CheckSignalStrengthL(); |
|
230 break; |
|
231 |
|
232 case EStateTestCancel: |
|
233 CompleteTestL( CDiagResultsDatabaseItem::ESkipped ); |
|
234 break; |
|
235 default: |
|
236 // Unsupported state |
|
237 ASSERT(0); |
|
238 break; |
|
239 } |
|
240 |
|
241 } |
|
242 |
|
243 // --------------------------------------------------------------------------- |
|
244 // From CActive |
|
245 // CDiagNetCoveragePlugin::DoCancel |
|
246 // --------------------------------------------------------------------------- |
|
247 void CDiagNetCoveragePlugin::DoCancel() |
|
248 { |
|
249 LOGSTRING("CDiagNetCoveragePlugin::DoCancel"); |
|
250 |
|
251 TInt result; |
|
252 |
|
253 // Cancel request to CTelephony |
|
254 switch ( iState ) |
|
255 { |
|
256 case EStateWaitForBandType: |
|
257 result = iTelephony->CancelAsync( CTelephony::EGetCurrentNetworkInfoCancel ); |
|
258 ASSERT( result == KErrNone ); |
|
259 break; |
|
260 |
|
261 case EStateWaitForSignalStrength: |
|
262 result = iTelephony->CancelAsync( CTelephony::EGetSignalStrengthCancel ); |
|
263 ASSERT( result == KErrNone ); |
|
264 break; |
|
265 |
|
266 default: |
|
267 // No cancel needed |
|
268 if (result == KErrNone) |
|
269 LOGSTRING("docancel() result"); |
|
270 break; |
|
271 } |
|
272 |
|
273 } |
|
274 |
|
275 // --------------------------------------------------------------------------- |
|
276 // From CDiagTestPluginBase |
|
277 // CDiagNetCoveragePlugin::DoRunTestL() |
|
278 // --------------------------------------------------------------------------- |
|
279 void CDiagNetCoveragePlugin::DoRunTestL() |
|
280 { |
|
281 LOGSTRING("CDiagNetCoveragePlugin::DoRunTestL"); |
|
282 |
|
283 // ADO & Platformization Changes |
|
284 if(!(ExecutionParam().Engine().ExecutionPlanL().CurrentExecutionItem().AsDependency())) |
|
285 { |
|
286 |
|
287 |
|
288 TInt aButtonId; |
|
289 |
|
290 ShowMessageQueryL(R_DIAG_MESSAGEQUERY_TITLE_NETCOVERAGE,aButtonId); |
|
291 |
|
292 if(aButtonId == ENetcoverageTestCancel) |
|
293 { |
|
294 CompleteTestL( CDiagResultsDatabaseItem::ESkipped ); |
|
295 return; |
|
296 } |
|
297 |
|
298 if(aButtonId == ENetcoverageTestSkip) |
|
299 { |
|
300 TInt confirmResult = 0; |
|
301 |
|
302 CAknDialog* dlg = ExecutionParam().Engine(). |
|
303 CreateCommonDialogLC( EDiagCommonDialogConfirmSkipAll, NULL ); |
|
304 |
|
305 if ( !RunWaitingDialogL(dlg, confirmResult ) ) |
|
306 { |
|
307 return; |
|
308 } |
|
309 |
|
310 if (confirmResult) |
|
311 { |
|
312 return; |
|
313 } |
|
314 } |
|
315 } |
|
316 // Changes Ends |
|
317 |
|
318 iProgressCounter = 1; |
|
319 iNetworkType = ETypeUnknown; |
|
320 iNetworkBand = EBandUnknown; |
|
321 |
|
322 // ones to use because they are less strict |
|
323 iNetworkBand = EBand1800_1900_2100; |
|
324 ObtainBandTypeAsyncL(); |
|
325 // Wait note display only if itz not a dependency execution. |
|
326 if(!(ExecutionParam().Engine().ExecutionPlanL().CurrentExecutionItem().AsDependency())) |
|
327 ShowProgressNoteL(); |
|
328 } |
|
329 |
|
330 // --------------------------------------------------------------------------- |
|
331 // CDiagNetCoveragePlugin::DoStopAndCleanupL() |
|
332 // --------------------------------------------------------------------------- |
|
333 void CDiagNetCoveragePlugin::DoStopAndCleanupL() |
|
334 { |
|
335 LOGSTRING("CDiagNetCoveragePlugin::DoStopAndCleanupL"); |
|
336 |
|
337 delete iTelephony; |
|
338 iTelephony = NULL; |
|
339 idialogOn = EFalse; |
|
340 iState = EStateTestCompleted; |
|
341 } |
|
342 |
|
343 // --------------------------------------------------------------------------- |
|
344 // CDiagNetCoveragePlugin::ObtainBandTypeAsyncL() |
|
345 // --------------------------------------------------------------------------- |
|
346 void CDiagNetCoveragePlugin::ObtainBandTypeAsyncL() |
|
347 { |
|
348 LOGSTRING("CDiagNetCoveragePlugin::ObtainBandTypeAsyncL"); |
|
349 |
|
350 ASSERT( iTelephony == NULL ); |
|
351 |
|
352 iTelephony = CTelephony::NewL(); |
|
353 iTelephony->GetCurrentNetworkInfo( iStatus, iNetworkInfoV1Pckg ); |
|
354 iState = EStateWaitForBandType; |
|
355 |
|
356 SetActive(); |
|
357 } |
|
358 |
|
359 // --------------------------------------------------------------------------- |
|
360 // CDiagNetCoveragePlugin::ReadThresholdValuesL() |
|
361 // --------------------------------------------------------------------------- |
|
362 void CDiagNetCoveragePlugin::ReadThresholdValuesL() |
|
363 { |
|
364 LOGSTRING("CDiagNetCoveragePlugin::ReadThresholdValuesL"); |
|
365 |
|
366 CRepository* repository = CRepository::NewLC( KCRUidNetworkCoverage ); |
|
367 |
|
368 LOGSTRING("CDiagNetCoveragePlugin::ReadThresholdValuesL:"); |
|
369 User::LeaveIfError( repository->Get(KPhoneDoctorGSM850SigStrThreshold, |
|
370 iThresholdValues[ETypeGSM][EBand900_850]) ); |
|
371 LOGSTRING2("\tKPhoneDoctorGSM850SigStrThreshold=%.2f",iThresholdValues[ETypeGSM][EBand900_850]); |
|
372 User::LeaveIfError( repository->Get(KPhoneDoctorGSM1900SigStrThreshold, |
|
373 iThresholdValues[ETypeGSM][EBand1800_1900_2100]) ); |
|
374 LOGSTRING2("\tKPhoneDoctorGSM1900SigStrThreshold=%.2f",iThresholdValues[ETypeGSM][EBand1800_1900_2100]); |
|
375 User::LeaveIfError( repository->Get(KPhoneDoctorUMTS850SigStrThreshold, |
|
376 iThresholdValues[ETypeUMTS][EBand900_850]) ); |
|
377 LOGSTRING2("\tKPhoneDoctorUMTS850SigStrThreshold=%.2f",iThresholdValues[ETypeUMTS][EBand900_850]); |
|
378 User::LeaveIfError( repository->Get(KPhoneDoctorUMTS1900SigStrThreshold, |
|
379 iThresholdValues[ETypeUMTS][EBand1800_1900_2100]) ); |
|
380 LOGSTRING2("\tKPhoneDoctorUMTS1900SigStrThreshold=%.2f",iThresholdValues[ETypeUMTS][EBand1800_1900_2100]); |
|
381 |
|
382 CleanupStack::PopAndDestroy(repository); |
|
383 } |
|
384 |
|
385 |
|
386 // --------------------------------------------------------------------------- |
|
387 // From CActive |
|
388 // CDiagNetCoveragePlugin::CheckNetworkAccessL |
|
389 // --------------------------------------------------------------------------- |
|
390 void CDiagNetCoveragePlugin::CheckNetworkAccessL() |
|
391 { |
|
392 if ( iStatus != KErrNone) |
|
393 { |
|
394 LOGSTRING2("CDiagNetCoveragePlugin::CheckNetworkAccessL: " |
|
395 L"Error obtaining network access type %d", iStatus.Int() ); |
|
396 if (idialogOn) |
|
397 iWaitDialog->ProcessFinishedL(); |
|
398 CompleteTestL( CDiagResultsDatabaseItem::EFailed ); |
|
399 } |
|
400 else |
|
401 { |
|
402 LOGSTRING("CDiagNetCoveragePlugin::CheckNetworkAccessL: Got Network Access Type"); |
|
403 // Set network band |
|
404 switch (iNetworkInfoV1.iAccess) |
|
405 { |
|
406 // This is used when there is no network activity and therefore no RAT active. |
|
407 case CTelephony::ENetworkAccessUnknown: |
|
408 LOGSTRING(" ENetworkAccessUnknown"); |
|
409 |
|
410 #ifdef __WINS__ |
|
411 // Fake network type for testing purposes |
|
412 iNetworkType = ETypeGSM; |
|
413 #else |
|
414 if (idialogOn) |
|
415 iWaitDialog->ProcessFinishedL(); |
|
416 CompleteTestL( CDiagResultsDatabaseItem::EFailed ); |
|
417 #endif |
|
418 break; |
|
419 |
|
420 // The access technology is GSM. |
|
421 case CTelephony::ENetworkAccessGsm: |
|
422 // FALL THROUGH |
|
423 |
|
424 // The access technology is GSM COMPACT. However GSM COMPACT systems |
|
425 // which use GSM frequency bands but with the CBPCCH broadcast channel |
|
426 // are considered as a separate access technology from GSM. |
|
427 case CTelephony::ENetworkAccessGsmCompact: |
|
428 |
|
429 LOGSTRING(" ENetworkAccessGsm"); |
|
430 iNetworkType = ETypeGSM; |
|
431 break; |
|
432 |
|
433 // The access technology is UTRAN (UMTS Network). |
|
434 case CTelephony::ENetworkAccessUtran: |
|
435 |
|
436 LOGSTRING(" ENetworkAccessUtran"); |
|
437 iNetworkType = ETypeUMTS; |
|
438 break; |
|
439 |
|
440 default: // Unexpected |
|
441 ASSERT(0); |
|
442 break; |
|
443 |
|
444 } |
|
445 |
|
446 // If test did not fail, obtain signal strength |
|
447 if ( iState == EStateWaitForBandType ) |
|
448 { |
|
449 iTelephony->GetSignalStrength(iStatus,iSignalStrengthV1Pckg); |
|
450 iState = EStateWaitForSignalStrength; |
|
451 SetActive(); |
|
452 } |
|
453 } |
|
454 } |
|
455 |
|
456 // --------------------------------------------------------------------------- |
|
457 // CDiagNetCoveragePlugin::CheckSignalStrengthL |
|
458 // --------------------------------------------------------------------------- |
|
459 void CDiagNetCoveragePlugin::CheckSignalStrengthL() |
|
460 { |
|
461 CDiagResultsDatabaseItem::TResult result = CDiagResultsDatabaseItem::EFailed; |
|
462 |
|
463 LOGSTRING2("CDiagNetCoveragePlugin::CheckSignalStrengthL Status %d",iStatus.Int()); |
|
464 |
|
465 if (iStatus.Int() == KErrNone) |
|
466 { |
|
467 |
|
468 TReal sigStrength = -iSignalStrengthV1.iSignalStrength; |
|
469 |
|
470 LOGSTRING3("CDiagNetCoveragePlugin::CheckSignalStrengthL: Got Signal Strength=%d bars, %.2f DBm", |
|
471 (TInt)iSignalStrengthV1.iBar, |
|
472 sigStrength); |
|
473 LOGSTRING3("CDiagNetCoveragePlugin::CheckSignalStrengthL: Network type = %d, band = %d",iNetworkType,iNetworkBand); |
|
474 |
|
475 TReal threshold = iThresholdValues[iNetworkType][iNetworkBand]; |
|
476 LOGSTRING2("CDiagNetCoveragePlugin::CheckSignalStrengthL: Threshold is %.2f",threshold); |
|
477 |
|
478 // Use band/type to index into threshold array and check |
|
479 // signal strength. If there is no signal, Dbm will be 0, which is actually |
|
480 // quite high, so check bars to cover this scenario. |
|
481 if ( ( sigStrength >= threshold ) && ( iSignalStrengthV1.iBar ) ) |
|
482 { |
|
483 result = CDiagResultsDatabaseItem::ESuccess; |
|
484 } |
|
485 } |
|
486 else |
|
487 { |
|
488 LOGSTRING2("CDiagNetCoveragePlugin::CheckSignalStrengthL: Signal strength error %d",iStatus.Int()); |
|
489 } |
|
490 |
|
491 |
|
492 if (idialogOn) |
|
493 iWaitDialog->ProcessFinishedL(); |
|
494 |
|
495 CompleteTestL( result ); |
|
496 |
|
497 // End of Test |
|
498 } |
|
499 |
|
500 // --------------------------------------------------------------------------- |
|
501 // CDiagNetCoveragePlugin::Panic |
|
502 // --------------------------------------------------------------------------- |
|
503 void CDiagNetCoveragePlugin::Panic(TInt aPanicCode) |
|
504 { |
|
505 _LIT(KDiagNetCoverageCategory,"Diag-NetCoverage"); |
|
506 User::Panic(KDiagNetCoverageCategory, aPanicCode); |
|
507 } |
|
508 |
|
509 |
|
510 // ---------------------------------------------------------------------------- |
|
511 // CDiagNetCoveragePlugin::ShowProgressNoteL |
|
512 // |
|
513 // wait Note |
|
514 // ---------------------------------------------------------------------------- |
|
515 |
|
516 void CDiagNetCoveragePlugin::ShowProgressNoteL() |
|
517 { |
|
518 if ( iWaitDialog ) |
|
519 { |
|
520 delete iWaitDialog; |
|
521 iWaitDialog = NULL; |
|
522 } |
|
523 |
|
524 // WAIT NOTE DIALOG |
|
525 iWaitDialog = new (ELeave) CAknWaitDialog( |
|
526 (REINTERPRET_CAST(CEikDialog**, &iWaitDialog)), |
|
527 ETrue); |
|
528 iWaitDialog->PrepareLC(R_NETWORK_PLUGIN_WAIT_NOTE); |
|
529 iWaitDialog->SetCallback(this); |
|
530 iWaitDialog->RunLD(); |
|
531 idialogOn = ETrue; |
|
532 LOGSTRING("CDiagNetCoveragePlugin::ShowProgressNoteL()"); |
|
533 } |
|
534 |
|
535 void CDiagNetCoveragePlugin::DialogDismissedL( TInt aButtonId ) |
|
536 { |
|
537 LOGSTRING2("CDiagNetCoveragePlugin::DialogDismissedL() = %d",aButtonId); |
|
538 |
|
539 if (aButtonId == ENetcoverageTestCancel && idialogOn) |
|
540 { |
|
541 // cancel the tests based on which Async Call the dialog is dismissed |
|
542 |
|
543 LOGSTRING2("CDiagNetCoveragePlugin::DialogDismissed @ iState= %d",iState); |
|
544 if (iState == EStateWaitForBandType) |
|
545 iTelephony->CancelAsync(CTelephony::EGetCurrentNetworkInfoCancel); |
|
546 else if (iState == EStateWaitForSignalStrength) |
|
547 iTelephony->CancelAsync(CTelephony::EGetSignalStrengthCancel); |
|
548 iState = EStateTestCancel; |
|
549 idialogOn = EFalse; |
|
550 iWaitDialog = NULL; |
|
551 |
|
552 } |
|
553 } |
|
554 |
|
555 // ---------------------------------------------------------------------------- |
|
556 // ---------------------------------------------------------------------------- |
|
557 // ---------------------------------------------------------------------------- |
|
558 |
|
559 TBool CDiagNetCoveragePlugin::ShowMessageQueryL( TInt aResourceId, TInt &aButtonId ) |
|
560 { |
|
561 LOGSTRING( "CDiagNetCoveragePlugin::ShowMessageQueryL IN" ) |
|
562 CAknMessageQueryDialog* dlg = NULL; |
|
563 TBool result = EFalse; |
|
564 |
|
565 // Create CAknMessageQueryDialog instance |
|
566 dlg = new ( ELeave ) CAknMessageQueryDialog(); |
|
567 |
|
568 dlg->PrepareLC( aResourceId ); |
|
569 |
|
570 CEikButtonGroupContainer& cba = dlg->ButtonGroupContainer(); |
|
571 |
|
572 switch ( aResourceId ) |
|
573 { |
|
574 case R_DIAG_MESSAGEQUERY_TITLE_NETCOVERAGE: |
|
575 { |
|
576 if ( SinglePluginExecution() ) |
|
577 { |
|
578 cba.SetCommandSetL( R_CBA_NETCOVERAGE_SINGLE_EXECUTION ); |
|
579 } |
|
580 else |
|
581 { |
|
582 cba.SetCommandSetL( R_CBA_NETCOVERAGE_GROUP_EXECUTION ); |
|
583 } |
|
584 } |
|
585 break; |
|
586 |
|
587 default: |
|
588 break; |
|
589 } |
|
590 |
|
591 result = RunWaitingDialogL( dlg, aButtonId ); |
|
592 |
|
593 LOGSTRING3( "CDiagNetCoveragePlugin::ShowMessageQueryL() OUT aButtonId=%d result=%d", aButtonId, result ); |
|
594 return result; |
|
595 } |
|
596 |
|
597 |
|
598 // End of File |
|
599 |