25
|
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 |
// CDiagNetCoveragePlugin::RunError
|
|
245 |
// ---------------------------------------------------------------------------
|
|
246 |
//
|
|
247 |
TInt CDiagNetCoveragePlugin::RunError( TInt aError )
|
|
248 |
{
|
|
249 |
LOGSTRING2( "CDiagNetCoveragePlugin::RunError( %d )", aError )
|
|
250 |
return KErrNone;
|
|
251 |
}
|
|
252 |
|
|
253 |
// ---------------------------------------------------------------------------
|
|
254 |
// From CActive
|
|
255 |
// CDiagNetCoveragePlugin::DoCancel
|
|
256 |
// ---------------------------------------------------------------------------
|
|
257 |
void CDiagNetCoveragePlugin::DoCancel()
|
|
258 |
{
|
|
259 |
LOGSTRING("CDiagNetCoveragePlugin::DoCancel");
|
|
260 |
|
|
261 |
TInt result;
|
|
262 |
|
|
263 |
// Cancel request to CTelephony
|
|
264 |
switch ( iState )
|
|
265 |
{
|
|
266 |
case EStateWaitForBandType:
|
|
267 |
result = iTelephony->CancelAsync( CTelephony::EGetCurrentNetworkInfoCancel );
|
|
268 |
ASSERT( result == KErrNone );
|
|
269 |
break;
|
|
270 |
|
|
271 |
case EStateWaitForSignalStrength:
|
|
272 |
result = iTelephony->CancelAsync( CTelephony::EGetSignalStrengthCancel );
|
|
273 |
ASSERT( result == KErrNone );
|
|
274 |
break;
|
|
275 |
|
|
276 |
default:
|
|
277 |
// No cancel needed
|
|
278 |
if (result == KErrNone)
|
|
279 |
LOGSTRING("docancel() result");
|
|
280 |
break;
|
|
281 |
}
|
|
282 |
|
|
283 |
}
|
|
284 |
|
|
285 |
// ---------------------------------------------------------------------------
|
|
286 |
// From CDiagTestPluginBase
|
|
287 |
// CDiagNetCoveragePlugin::DoRunTestL()
|
|
288 |
// ---------------------------------------------------------------------------
|
|
289 |
void CDiagNetCoveragePlugin::DoRunTestL()
|
|
290 |
{
|
|
291 |
LOGSTRING("CDiagNetCoveragePlugin::DoRunTestL");
|
|
292 |
|
|
293 |
// ADO & Platformization Changes
|
|
294 |
if(!(ExecutionParam().Engine().ExecutionPlanL().CurrentExecutionItem().AsDependency()))
|
|
295 |
{
|
|
296 |
|
|
297 |
|
|
298 |
TInt aButtonId;
|
|
299 |
|
|
300 |
ShowMessageQueryL(R_DIAG_MESSAGEQUERY_TITLE_NETCOVERAGE,aButtonId);
|
|
301 |
|
|
302 |
if(aButtonId == ENetcoverageTestCancel)
|
|
303 |
{
|
|
304 |
CompleteTestL( CDiagResultsDatabaseItem::ESkipped );
|
|
305 |
return;
|
|
306 |
}
|
|
307 |
|
|
308 |
if(aButtonId == ENetcoverageTestSkip)
|
|
309 |
{
|
|
310 |
TInt confirmResult = 0;
|
|
311 |
|
|
312 |
CAknDialog* dlg = ExecutionParam().Engine().
|
|
313 |
CreateCommonDialogLC( EDiagCommonDialogConfirmSkipAll, NULL );
|
|
314 |
|
|
315 |
if ( !RunWaitingDialogL(dlg, confirmResult ) )
|
|
316 |
{
|
|
317 |
return;
|
|
318 |
}
|
|
319 |
|
|
320 |
if (confirmResult)
|
|
321 |
{
|
|
322 |
return;
|
|
323 |
}
|
|
324 |
}
|
|
325 |
}
|
|
326 |
// Changes Ends
|
|
327 |
|
|
328 |
iProgressCounter = 1;
|
|
329 |
iNetworkType = ETypeUnknown;
|
|
330 |
iNetworkBand = EBandUnknown;
|
|
331 |
|
|
332 |
// ones to use because they are less strict
|
|
333 |
iNetworkBand = EBand1800_1900_2100;
|
|
334 |
ObtainBandTypeAsyncL();
|
|
335 |
// Wait note display only if itz not a dependency execution.
|
|
336 |
if(!(ExecutionParam().Engine().ExecutionPlanL().CurrentExecutionItem().AsDependency()))
|
|
337 |
ShowProgressNoteL();
|
|
338 |
}
|
|
339 |
|
|
340 |
// ---------------------------------------------------------------------------
|
|
341 |
// CDiagNetCoveragePlugin::DoStopAndCleanupL()
|
|
342 |
// ---------------------------------------------------------------------------
|
|
343 |
void CDiagNetCoveragePlugin::DoStopAndCleanupL()
|
|
344 |
{
|
|
345 |
LOGSTRING("CDiagNetCoveragePlugin::DoStopAndCleanupL");
|
|
346 |
|
|
347 |
delete iTelephony;
|
|
348 |
iTelephony = NULL;
|
|
349 |
idialogOn = EFalse;
|
|
350 |
iState = EStateTestCompleted;
|
|
351 |
}
|
|
352 |
|
|
353 |
// ---------------------------------------------------------------------------
|
|
354 |
// CDiagNetCoveragePlugin::ObtainBandTypeAsyncL()
|
|
355 |
// ---------------------------------------------------------------------------
|
|
356 |
void CDiagNetCoveragePlugin::ObtainBandTypeAsyncL()
|
|
357 |
{
|
|
358 |
LOGSTRING("CDiagNetCoveragePlugin::ObtainBandTypeAsyncL");
|
|
359 |
|
|
360 |
ASSERT( iTelephony == NULL );
|
|
361 |
|
|
362 |
iTelephony = CTelephony::NewL();
|
|
363 |
iTelephony->GetCurrentNetworkInfo( iStatus, iNetworkInfoV1Pckg );
|
|
364 |
iState = EStateWaitForBandType;
|
|
365 |
|
|
366 |
SetActive();
|
|
367 |
}
|
|
368 |
|
|
369 |
// ---------------------------------------------------------------------------
|
|
370 |
// CDiagNetCoveragePlugin::ReadThresholdValuesL()
|
|
371 |
// ---------------------------------------------------------------------------
|
|
372 |
void CDiagNetCoveragePlugin::ReadThresholdValuesL()
|
|
373 |
{
|
|
374 |
LOGSTRING("CDiagNetCoveragePlugin::ReadThresholdValuesL");
|
|
375 |
|
|
376 |
CRepository* repository = CRepository::NewLC( KCRUidNetworkCoverage );
|
|
377 |
|
|
378 |
LOGSTRING("CDiagNetCoveragePlugin::ReadThresholdValuesL:");
|
|
379 |
User::LeaveIfError( repository->Get(KPhoneDoctorGSM850SigStrThreshold,
|
|
380 |
iThresholdValues[ETypeGSM][EBand900_850]) );
|
|
381 |
LOGSTRING2("\tKPhoneDoctorGSM850SigStrThreshold=%.2f",iThresholdValues[ETypeGSM][EBand900_850]);
|
|
382 |
User::LeaveIfError( repository->Get(KPhoneDoctorGSM1900SigStrThreshold,
|
|
383 |
iThresholdValues[ETypeGSM][EBand1800_1900_2100]) );
|
|
384 |
LOGSTRING2("\tKPhoneDoctorGSM1900SigStrThreshold=%.2f",iThresholdValues[ETypeGSM][EBand1800_1900_2100]);
|
|
385 |
User::LeaveIfError( repository->Get(KPhoneDoctorUMTS850SigStrThreshold,
|
|
386 |
iThresholdValues[ETypeUMTS][EBand900_850]) );
|
|
387 |
LOGSTRING2("\tKPhoneDoctorUMTS850SigStrThreshold=%.2f",iThresholdValues[ETypeUMTS][EBand900_850]);
|
|
388 |
User::LeaveIfError( repository->Get(KPhoneDoctorUMTS1900SigStrThreshold,
|
|
389 |
iThresholdValues[ETypeUMTS][EBand1800_1900_2100]) );
|
|
390 |
LOGSTRING2("\tKPhoneDoctorUMTS1900SigStrThreshold=%.2f",iThresholdValues[ETypeUMTS][EBand1800_1900_2100]);
|
|
391 |
|
|
392 |
CleanupStack::PopAndDestroy(repository);
|
|
393 |
}
|
|
394 |
|
|
395 |
|
|
396 |
// ---------------------------------------------------------------------------
|
|
397 |
// From CActive
|
|
398 |
// CDiagNetCoveragePlugin::CheckNetworkAccessL
|
|
399 |
// ---------------------------------------------------------------------------
|
|
400 |
void CDiagNetCoveragePlugin::CheckNetworkAccessL()
|
|
401 |
{
|
|
402 |
if ( iStatus != KErrNone)
|
|
403 |
{
|
|
404 |
LOGSTRING2("CDiagNetCoveragePlugin::CheckNetworkAccessL: "
|
|
405 |
L"Error obtaining network access type %d", iStatus.Int() );
|
|
406 |
if (idialogOn)
|
|
407 |
iWaitDialog->ProcessFinishedL();
|
|
408 |
CompleteTestL( CDiagResultsDatabaseItem::EFailed );
|
|
409 |
}
|
|
410 |
else
|
|
411 |
{
|
|
412 |
LOGSTRING("CDiagNetCoveragePlugin::CheckNetworkAccessL: Got Network Access Type");
|
|
413 |
// Set network band
|
|
414 |
switch (iNetworkInfoV1.iAccess)
|
|
415 |
{
|
|
416 |
// This is used when there is no network activity and therefore no RAT active.
|
|
417 |
case CTelephony::ENetworkAccessUnknown:
|
|
418 |
LOGSTRING(" ENetworkAccessUnknown");
|
|
419 |
|
|
420 |
#ifdef __WINS__
|
|
421 |
// Fake network type for testing purposes
|
|
422 |
iNetworkType = ETypeGSM;
|
|
423 |
#else
|
|
424 |
if (idialogOn)
|
|
425 |
iWaitDialog->ProcessFinishedL();
|
|
426 |
CompleteTestL( CDiagResultsDatabaseItem::EFailed );
|
|
427 |
#endif
|
|
428 |
break;
|
|
429 |
|
|
430 |
// The access technology is GSM.
|
|
431 |
case CTelephony::ENetworkAccessGsm:
|
|
432 |
// FALL THROUGH
|
|
433 |
|
|
434 |
// The access technology is GSM COMPACT. However GSM COMPACT systems
|
|
435 |
// which use GSM frequency bands but with the CBPCCH broadcast channel
|
|
436 |
// are considered as a separate access technology from GSM.
|
|
437 |
case CTelephony::ENetworkAccessGsmCompact:
|
|
438 |
|
|
439 |
LOGSTRING(" ENetworkAccessGsm");
|
|
440 |
iNetworkType = ETypeGSM;
|
|
441 |
break;
|
|
442 |
|
|
443 |
// The access technology is UTRAN (UMTS Network).
|
|
444 |
case CTelephony::ENetworkAccessUtran:
|
|
445 |
|
|
446 |
LOGSTRING(" ENetworkAccessUtran");
|
|
447 |
iNetworkType = ETypeUMTS;
|
|
448 |
break;
|
|
449 |
|
|
450 |
default: // Unexpected
|
|
451 |
ASSERT(0);
|
|
452 |
break;
|
|
453 |
|
|
454 |
}
|
|
455 |
|
|
456 |
// If test did not fail, obtain signal strength
|
|
457 |
if ( iState == EStateWaitForBandType )
|
|
458 |
{
|
|
459 |
iTelephony->GetSignalStrength(iStatus,iSignalStrengthV1Pckg);
|
|
460 |
iState = EStateWaitForSignalStrength;
|
|
461 |
SetActive();
|
|
462 |
}
|
|
463 |
}
|
|
464 |
}
|
|
465 |
|
|
466 |
// ---------------------------------------------------------------------------
|
|
467 |
// CDiagNetCoveragePlugin::CheckSignalStrengthL
|
|
468 |
// ---------------------------------------------------------------------------
|
|
469 |
void CDiagNetCoveragePlugin::CheckSignalStrengthL()
|
|
470 |
{
|
|
471 |
CDiagResultsDatabaseItem::TResult result = CDiagResultsDatabaseItem::EFailed;
|
|
472 |
|
|
473 |
LOGSTRING2("CDiagNetCoveragePlugin::CheckSignalStrengthL Status %d",iStatus.Int());
|
|
474 |
|
|
475 |
if (iStatus.Int() == KErrNone)
|
|
476 |
{
|
|
477 |
|
|
478 |
TReal sigStrength = -iSignalStrengthV1.iSignalStrength;
|
|
479 |
|
|
480 |
LOGSTRING3("CDiagNetCoveragePlugin::CheckSignalStrengthL: Got Signal Strength=%d bars, %.2f DBm",
|
|
481 |
(TInt)iSignalStrengthV1.iBar,
|
|
482 |
sigStrength);
|
|
483 |
LOGSTRING3("CDiagNetCoveragePlugin::CheckSignalStrengthL: Network type = %d, band = %d",iNetworkType,iNetworkBand);
|
|
484 |
|
|
485 |
TReal threshold = iThresholdValues[iNetworkType][iNetworkBand];
|
|
486 |
LOGSTRING2("CDiagNetCoveragePlugin::CheckSignalStrengthL: Threshold is %.2f",threshold);
|
|
487 |
|
|
488 |
// Use band/type to index into threshold array and check
|
|
489 |
// signal strength. If there is no signal, Dbm will be 0, which is actually
|
|
490 |
// quite high, so check bars to cover this scenario.
|
|
491 |
if ( ( sigStrength >= threshold ) && ( iSignalStrengthV1.iBar ) )
|
|
492 |
{
|
|
493 |
result = CDiagResultsDatabaseItem::ESuccess;
|
|
494 |
}
|
|
495 |
}
|
|
496 |
else
|
|
497 |
{
|
|
498 |
LOGSTRING2("CDiagNetCoveragePlugin::CheckSignalStrengthL: Signal strength error %d",iStatus.Int());
|
|
499 |
}
|
|
500 |
|
|
501 |
|
|
502 |
if (idialogOn)
|
|
503 |
iWaitDialog->ProcessFinishedL();
|
|
504 |
|
|
505 |
CompleteTestL( result );
|
|
506 |
|
|
507 |
// End of Test
|
|
508 |
}
|
|
509 |
|
|
510 |
// ---------------------------------------------------------------------------
|
|
511 |
// CDiagNetCoveragePlugin::Panic
|
|
512 |
// ---------------------------------------------------------------------------
|
|
513 |
void CDiagNetCoveragePlugin::Panic(TInt aPanicCode)
|
|
514 |
{
|
|
515 |
_LIT(KDiagNetCoverageCategory,"Diag-NetCoverage");
|
|
516 |
User::Panic(KDiagNetCoverageCategory, aPanicCode);
|
|
517 |
}
|
|
518 |
|
|
519 |
|
|
520 |
// ----------------------------------------------------------------------------
|
|
521 |
// CDiagNetCoveragePlugin::ShowProgressNoteL
|
|
522 |
//
|
|
523 |
// wait Note
|
|
524 |
// ----------------------------------------------------------------------------
|
|
525 |
|
|
526 |
void CDiagNetCoveragePlugin::ShowProgressNoteL()
|
|
527 |
{
|
|
528 |
if ( iWaitDialog )
|
|
529 |
{
|
|
530 |
delete iWaitDialog;
|
|
531 |
iWaitDialog = NULL;
|
|
532 |
}
|
|
533 |
|
|
534 |
// WAIT NOTE DIALOG
|
|
535 |
iWaitDialog = new (ELeave) CAknWaitDialog(
|
|
536 |
(REINTERPRET_CAST(CEikDialog**, &iWaitDialog)),
|
|
537 |
ETrue);
|
|
538 |
iWaitDialog->PrepareLC(R_NETWORK_PLUGIN_WAIT_NOTE);
|
|
539 |
iWaitDialog->SetCallback(this);
|
|
540 |
iWaitDialog->RunLD();
|
|
541 |
idialogOn = ETrue;
|
|
542 |
LOGSTRING("CDiagNetCoveragePlugin::ShowProgressNoteL()");
|
|
543 |
}
|
|
544 |
|
|
545 |
void CDiagNetCoveragePlugin::DialogDismissedL( TInt aButtonId )
|
|
546 |
{
|
|
547 |
LOGSTRING2("CDiagNetCoveragePlugin::DialogDismissedL() = %d",aButtonId);
|
|
548 |
|
|
549 |
if (aButtonId == ENetcoverageTestCancel && idialogOn)
|
|
550 |
{
|
|
551 |
// cancel the tests based on which Async Call the dialog is dismissed
|
|
552 |
|
|
553 |
LOGSTRING2("CDiagNetCoveragePlugin::DialogDismissed @ iState= %d",iState);
|
|
554 |
if (iState == EStateWaitForBandType)
|
|
555 |
iTelephony->CancelAsync(CTelephony::EGetCurrentNetworkInfoCancel);
|
|
556 |
else if (iState == EStateWaitForSignalStrength)
|
|
557 |
iTelephony->CancelAsync(CTelephony::EGetSignalStrengthCancel);
|
|
558 |
iState = EStateTestCancel;
|
|
559 |
idialogOn = EFalse;
|
|
560 |
iWaitDialog = NULL;
|
|
561 |
|
|
562 |
}
|
|
563 |
}
|
|
564 |
|
|
565 |
// ----------------------------------------------------------------------------
|
|
566 |
// ----------------------------------------------------------------------------
|
|
567 |
// ----------------------------------------------------------------------------
|
|
568 |
|
|
569 |
TBool CDiagNetCoveragePlugin::ShowMessageQueryL( TInt aResourceId, TInt &aButtonId )
|
|
570 |
{
|
|
571 |
LOGSTRING( "CDiagNetCoveragePlugin::ShowMessageQueryL IN" )
|
|
572 |
CAknMessageQueryDialog* dlg = NULL;
|
|
573 |
TBool result = EFalse;
|
|
574 |
|
|
575 |
// Create CAknMessageQueryDialog instance
|
|
576 |
dlg = new ( ELeave ) CAknMessageQueryDialog();
|
|
577 |
|
|
578 |
dlg->PrepareLC( aResourceId );
|
|
579 |
|
|
580 |
CEikButtonGroupContainer& cba = dlg->ButtonGroupContainer();
|
|
581 |
|
|
582 |
switch ( aResourceId )
|
|
583 |
{
|
|
584 |
case R_DIAG_MESSAGEQUERY_TITLE_NETCOVERAGE:
|
|
585 |
{
|
|
586 |
if ( SinglePluginExecution() )
|
|
587 |
{
|
|
588 |
cba.SetCommandSetL( R_CBA_NETCOVERAGE_SINGLE_EXECUTION );
|
|
589 |
}
|
|
590 |
else
|
|
591 |
{
|
|
592 |
cba.SetCommandSetL( R_CBA_NETCOVERAGE_GROUP_EXECUTION );
|
|
593 |
}
|
|
594 |
}
|
|
595 |
break;
|
|
596 |
|
|
597 |
default:
|
|
598 |
break;
|
|
599 |
}
|
|
600 |
|
|
601 |
result = RunWaitingDialogL( dlg, aButtonId );
|
|
602 |
|
|
603 |
LOGSTRING3( "CDiagNetCoveragePlugin::ShowMessageQueryL() OUT aButtonId=%d result=%d", aButtonId, result );
|
|
604 |
return result;
|
|
605 |
}
|
|
606 |
|
|
607 |
|
|
608 |
// End of File
|
|
609 |
|