securitydialogs/SecUi/Src/SecQueryUi.cpp
changeset 17 8957df7b0072
parent 15 318c4eab2439
child 19 098e361762d2
equal deleted inserted replaced
15:318c4eab2439 17:8957df7b0072
    19 // #include <SecQueryUidefs.h>                          // SIF UI device dialog parameters
    19 // #include <SecQueryUidefs.h>                          // SIF UI device dialog parameters
    20 #include <hb/hbcore/hbsymbiandevicedialog.h>    // CHbDeviceDialog
    20 #include <hb/hbcore/hbsymbiandevicedialog.h>    // CHbDeviceDialog
    21 #include <hb/hbcore/hbsymbianvariant.h>         // CHbSymbianVariantMap
    21 #include <hb/hbcore/hbsymbianvariant.h>         // CHbSymbianVariantMap
    22 #include <apgicnfl.h>                           // CApaMaskedBitmap
    22 #include <apgicnfl.h>                           // CApaMaskedBitmap
    23 
    23 
       
    24 #include <CPhCltEmergencyCall.h>
       
    25 #include <SCPClient.h>
       
    26 #include "SecUiWait.h"
    24 
    27 
    25 // Variant map keys for notification device dialog
    28 // Variant map keys for notification device dialog
    26 _LIT( KNotifDeviceDialogLiteral, "com.nokia.hb.devicenotificationdialog/1.0" );
    29 _LIT( KNotifDeviceDialogLiteral, "com.nokia.hb.devicenotificationdialog/1.0" );
    27 _LIT( KNotifDeviceDialogKeyTimeOut, "timeout" );
    30 _LIT( KNotifDeviceDialogKeyTimeOut, "timeout" );
    28 _LIT( KNotifDeviceDialogKeyIconName, "iconName" );
    31 _LIT( KNotifDeviceDialogKeyIconName, "iconName" );
    85 /*
    88 /*
    86         const TDesC& aAppName,
    89         const TDesC& aAppName,
    87         const TDesC& aIconFile, const TDesC& aAppVersion, TInt aAppSize,
    90         const TDesC& aIconFile, const TDesC& aAppVersion, TInt aAppSize,
    88         const TDesC& aAppDetails ) */
    91         const TDesC& aAppDetails ) */
    89     {
    92     {
    90     RDebug::Printf( "%s %s (%u) aType=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aType );
    93 
    91     RDebug::Printf( "%s %s (%u) password=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
    94     RDEBUG( "This should never be called. Obsolete", 0 );
    92     TInt	ESecQueryUiInstallConfirmationQueryType=0x101;
    95     return KErrAbort ;
    93     ClearParamsAndSetNoteTypeL( ESecQueryUiInstallConfirmationQueryType );
    96     }
    94 
    97 
    95     AddParamL( _L("KSecQueryUiApplicationName"), _L("SecUi") );
    98 // ---------------------------------------------------------------------------
       
    99 // CSecQueryUi::SecQueryDialog()
       
   100 // ---------------------------------------------------------------------------
       
   101 //
       
   102 EXPORT_C TInt CSecQueryUi::SecQueryDialog(const TDesC& aCaption, TDes& aDataText, TInt aMinLength,TInt aMaxLength,TInt aMode)
       
   103     {
       
   104     	RDEBUG( "aCaption", 0 );
       
   105     RDebug::Print( aCaption );
       
   106     	RDEBUG( "aMode", aMode );
       
   107 
       
   108     ClearParamsAndSetNoteTypeL( aMode );
       
   109     AddParamL( _L("KSecQueryUiApplicationName"), aCaption );
    96 
   110 
    97 		_LIT(KTitle, "title");
   111 		_LIT(KTitle, "title");
    98     _LIT(KTitleValue1, "Enter PIN");
   112     // _LIT(KTitleValue1, "Enter PIN");
    99     _LIT(KTitleValue2, "Enter PIN with care");
   113    	AddParamL( KTitle, aCaption );
   100     _LIT(KTitleValue3, "Enter PIN last");
   114 		AddParamL( _L("MinLength"), aMinLength );
   101     if(aType==KMaxNumberOfPINAttempts)
   115 		AddParamL( _L("MaxLength"), aMaxLength );
   102     	AddParamL( KTitle, KTitleValue1 );
       
   103     else if(aType> KLastRemainingInputAttempt)
       
   104     	AddParamL( KTitle, KTitleValue2 );
       
   105     else
       
   106     	AddParamL( KTitle, KTitleValue3 );
       
   107     
   116     
   108 		_LIT( KCodeTop, "codeTop" );						_LIT( KCodeTopValue, "codeTop" );
   117 		_LIT( KCodeTop, "codeTop" );						_LIT( KCodeTopValue, "codeTop" );
   109     AddParamL( KCodeTop, KCodeTopValue );
   118     AddParamL( KCodeTop, KCodeTopValue );
   110 
   119 
   111 		RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   120 		if( aCaption.Find(_L("|"))>0 )
       
   121 			{
       
   122 				RDEBUG( "codeBottom aMode", aMode );
       
   123 			_LIT( KCodeBottom, "codeBottom" );						_LIT( KCodeBottomValue, "codeBottom" );
       
   124   	  AddParamL( KCodeBottom, KCodeBottomValue );
       
   125   		}
       
   126 
       
   127 			RDEBUG( "0", 0 );
   112 	  DisplayDeviceDialogL();
   128 	  DisplayDeviceDialogL();
   113     User::LeaveIfError( WaitUntilDeviceDialogClosed() );
   129 	  TInt error = WaitUntilDeviceDialogClosed();
   114     password.Copy(iPassword);
   130 	  	RDEBUG( "error", error );
   115     return( iReturnValue == KErrNone );
   131     User::LeaveIfError( error );
   116     }
   132 
   117 
       
   118 // ---------------------------------------------------------------------------
       
   119 // CSecQueryUi::SecQueryDialog()
       
   120 // ---------------------------------------------------------------------------
       
   121 //
       
   122 EXPORT_C TInt CSecQueryUi::SecQueryDialog(const TDesC& aCaption, TDes& aDataText, TInt aMinLength,TInt aMaxLength,TInt aMode)
       
   123     {
       
   124     RDebug::Printf( "%s %s (%u) aCaption=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
       
   125     RDebug::Print( aCaption );
       
   126     RDebug::Printf( "%s %s (%u) aMode=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, aMode );
       
   127 
       
   128     ClearParamsAndSetNoteTypeL( aMode );
       
   129     AddParamL( _L("KSecQueryUiApplicationName"), aCaption );
       
   130 
       
   131 		_LIT(KTitle, "title");
       
   132     // _LIT(KTitleValue1, "Enter PIN");
       
   133    	AddParamL( KTitle, aCaption );
       
   134     
       
   135 		_LIT( KCodeTop, "codeTop" );						_LIT( KCodeTopValue, "codeTop" );
       
   136     AddParamL( KCodeTop, KCodeTopValue );
       
   137 
       
   138 		RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
       
   139 	  DisplayDeviceDialogL();
       
   140     User::LeaveIfError( WaitUntilDeviceDialogClosed() );
       
   141     aDataText.Copy(iPassword);
   133     aDataText.Copy(iPassword);
   142     return( iReturnValue == KErrNone );
   134     	RDEBUG( "iReturnValue", iReturnValue );
       
   135     return iReturnValue;
   143     }
   136     }
   144 
   137 
   145 // ---------------------------------------------------------------------------
   138 // ---------------------------------------------------------------------------
   146 // CSecQueryUi::DisplayInformationNoteL()
   139 // CSecQueryUi::DisplayInformationNoteL()
   147 // ---------------------------------------------------------------------------
   140 // ---------------------------------------------------------------------------
   260 // CSecQueryUi::DoCancel()
   253 // CSecQueryUi::DoCancel()
   261 // ---------------------------------------------------------------------------
   254 // ---------------------------------------------------------------------------
   262 //
   255 //
   263 void CSecQueryUi::DoCancel()
   256 void CSecQueryUi::DoCancel()
   264     {
   257     {
   265     RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   258     	RDEBUG( "0", 0 );
   266     if( iWait && iWait->IsStarted() && iWait->CanStopNow() )
   259     if( iWait && iWait->IsStarted() && iWait->CanStopNow() )
   267         {
   260         {
   268         iCompletionCode = KErrCancel;
   261         iCompletionCode = KErrCancel;
   269         iWait->AsyncStop();
   262         iWait->AsyncStop();
   270         }
   263         }
       
   264     	RDEBUG( "0", 0 );
   271     }
   265     }
   272 
   266 
   273 // ---------------------------------------------------------------------------
   267 // ---------------------------------------------------------------------------
   274 // CSecQueryUi::RunL()
   268 // CSecQueryUi::RunL()
   275 // ---------------------------------------------------------------------------
   269 // ---------------------------------------------------------------------------
   276 //
   270 //
   277 void CSecQueryUi::RunL()
   271 void CSecQueryUi::RunL()
   278     {
   272     {
   279     RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   273     	RDEBUG( "0", 0 );
   280     if( iWait )
   274     if( iWait )
   281         {
   275         {
   282         iWait->AsyncStop();
   276         iWait->AsyncStop();
   283         }
   277         }
       
   278     	RDEBUG( "0", 0 );
   284     }
   279     }
   285 
   280 
   286 // ---------------------------------------------------------------------------
   281 // ---------------------------------------------------------------------------
   287 // CSecQueryUi::DataReceived()
   282 // CSecQueryUi::DataReceived()
   288 // ---------------------------------------------------------------------------
   283 // ---------------------------------------------------------------------------
   289 //
   284 //
   290 void CSecQueryUi::DataReceived( CHbSymbianVariantMap& aData )
   285 void CSecQueryUi::DataReceived( CHbSymbianVariantMap& aData )
   291     {
   286     {
   292     RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   287     	RDEBUG( "0", 0 );
   293     const CHbSymbianVariant* acceptedVariant = aData.Get( _L("accepted") );	// KSecQueryUiQueryAccepted
   288     const CHbSymbianVariant* acceptedVariant = aData.Get( _L("accepted") );	// KSecQueryUiQueryAccepted
       
   289     	RDEBUG( "0", 0 );
   294     if( acceptedVariant )
   290     if( acceptedVariant )
   295         {
   291         {
   296         TBool* acceptedValue = acceptedVariant->Value<TBool>();
   292     			RDEBUG( "0", 0 );
   297         if( acceptedValue && *acceptedValue )
   293         TInt* acceptedValue = acceptedVariant->Value<TInt>();
       
   294     			RDEBUG( "acceptedValue", acceptedValue );
       
   295     			RDEBUG( "*acceptedValue", *acceptedValue );
       
   296         if( acceptedValue )
   298             {
   297             {
   299             iReturnValue = KErrNone;
   298             iReturnValue = *acceptedValue;
   300             }
   299             }
   301         else
       
   302             {
       
   303             iReturnValue = KErrCancel;
       
   304             }
       
   305         }
   300         }
   306     const CHbSymbianVariant* acceptedVariantTop = aData.Get( _L("codeTop") );	// KSecQueryUiQueryAccepted
   301     const CHbSymbianVariant* acceptedVariantTop = aData.Get( _L("codeTop") );	// KSecQueryUiQueryAccepted
       
   302     	RDEBUG( "0", 0 );
   307     if( acceptedVariantTop )
   303     if( acceptedVariantTop )
   308         {
   304         {
   309         TPtrC acceptedValueTop = *acceptedVariantTop->Value<TDesC>();
   305         TPtrC acceptedValueTop = *acceptedVariantTop->Value<TDesC>();
   310         RDebug::Printf( "%s %s (%u) acceptedValueTop=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   306         	RDEBUG( "acceptedValueTop", 0 );
   311    	    RDebug::Print( acceptedValueTop );
   307    	    RDebug::Print( acceptedValueTop );
   312    	    iPassword.Copy(acceptedValueTop);
   308    	    iPassword.Copy(acceptedValueTop);
   313         }
   309    	    
       
   310    	    if(iReturnValue == KErrCompletion )	// the user didn't OK. It was send automatically because validating new lock code
       
   311    	    	{
       
   312 					_LIT( KInvalidNewLockCode, "invalidNewLockCode" );
       
   313 					_LIT( KInvalidNewLockCode0, "invalidNewLockCode#0" );
       
   314 					_LIT( KInvalidNewLockCode1, "invalidNewLockCode#1" );
       
   315 					_LIT( KInvalidNewLockCode2, "invalidNewLockCode#2" );
       
   316    				AddParamL( KInvalidNewLockCode, KInvalidNewLockCode0 );	// for starter
       
   317             RSCPClient scpClient;
       
   318             TSCPSecCode newCode;
       
   319             newCode.Copy( acceptedValueTop );
       
   320             	RDEBUG( "scpClient.Connect", 0 );
       
   321             if ( scpClient.Connect() == KErrNone )
       
   322                 {
       
   323                 /*
       
   324                 RArray<TDevicelockPolicies> aFailedPolicies;
       
   325                 TDevicelockPolicies failedPolicy;
       
   326                 TInt retLockcode = KErrNone;
       
   327 									RDEBUG( "scpClient.VerifyNewLockcodeAgainstPolicies", 0 );
       
   328                 retLockcode = scpClient.VerifyNewLockcodeAgainstPolicies( newCode, aFailedPolicies );
       
   329                 	RDEBUG( "retLockcode", retLockcode );
       
   330                 	RDEBUG( "aFailedPolicies.Count()", aFailedPolicies.Count() );
       
   331                 for(TInt i=0; i<aFailedPolicies.Count(); i++)
       
   332                 	{
       
   333                		failedPolicy = aFailedPolicies[i];
       
   334                 		RDEBUG( "failedPolicy", failedPolicy );
       
   335 									TBuf<0x100> KInvalidNewLockCodeX;	KInvalidNewLockCodeX.Zero();	KInvalidNewLockCodeX.Append(_L("invalidNewLockCode"));	KInvalidNewLockCodeX.Append(_L("#"));
       
   336 									KInvalidNewLockCodeX.AppendNum(failedPolicy);
       
   337                 	AddParamL( KInvalidNewLockCode, KInvalidNewLockCodeX );
       
   338                 	}
       
   339                 */
       
   340                 scpClient.Close();
       
   341                 }                                               
       
   342 						RDEBUG( "iDeviceDialog->Update", 0 );
       
   343 					iDeviceDialog->Update( *iVariantMap );
       
   344 					}	// KErrCompletion
       
   345 
       
   346 				if(acceptedValueTop.Length()<=4)	// TODO store aMinLenght and check it here, instead of "4"
       
   347 					{
       
   348 	   	    	RDEBUG( "CPhCltEmergencyCall", 0 );
       
   349 					CPhCltEmergencyCall* emergencyCall = CPhCltEmergencyCall::NewL( NULL );
       
   350 						RDEBUG( "PushL", 0 );
       
   351 					CleanupStack::PushL( emergencyCall );
       
   352 					TPhCltEmergencyNumber emNumber;
       
   353 					
       
   354 					// this relies on the fact that emergency has 3 digits, and password needs at least 4
       
   355 					TBool isEmergency( EFalse );
       
   356 						RDEBUG( "calling IsEmergencyPhoneNumber", 0 );
       
   357 					TInt error = emergencyCall->IsEmergencyPhoneNumber( acceptedValueTop, isEmergency );
       
   358 						RDEBUG( "error", error );
       
   359 						RDEBUG( "emNumber", 0 );
       
   360 					
       
   361 						RDEBUG( "isEmergency", isEmergency );
       
   362 					#ifdef __WINS__
       
   363 						RDEBUG( "__WINS__ checking", 0 );
       
   364 					if(!acceptedValueTop.CompareF(_L("112")) || !acceptedValueTop.CompareF(_L("911")) || !acceptedValueTop.CompareF(_L("555")) )
       
   365 						{
       
   366 							isEmergency = ETrue;
       
   367 							error = KErrNone;
       
   368 								RDEBUG( "__WINS__ isEmergency", isEmergency );
       
   369 						}
       
   370 					#endif
       
   371 	
       
   372 					if ( !error )	// oddly enough, missing capabilities also gives KErrNone
       
   373 						{
       
   374 		   	    if(iReturnValue == KErrAbort )	// the user didn't OK. It was send automatically because short code
       
   375 		   	    	{
       
   376 							_LIT( KEmergency, "emergency" );						_LIT( KEmergencyValueYes, "emergencyYes" );	_LIT( KEmergencyValueNo, "emergencyNo" );
       
   377 							if(isEmergency)
       
   378 								{
       
   379 									RDEBUG( "KEmergencyValueYes", 1 );
       
   380 		    				AddParamL( KEmergency, KEmergencyValueYes );
       
   381 								}
       
   382 							else
       
   383 								{
       
   384 									RDEBUG( "KEmergencyValueNo", 0 );
       
   385 		    				AddParamL( KEmergency, KEmergencyValueNo );
       
   386 								}
       
   387 							iDeviceDialog->Update( *iVariantMap );
       
   388 							}
       
   389 						else if(iReturnValue == KErrNone )
       
   390 							{	// user pressed Call and number is valid
       
   391 							if(isEmergency)
       
   392 								{
       
   393 									 RDEBUG( "DialEmergencyCallL", isEmergency );
       
   394 								emergencyCall->DialEmergencyCallL( emNumber );
       
   395 								iReturnValue = KErrAbort;	// this means emergency call
       
   396 								}
       
   397 							}
       
   398 						}	// if !error
       
   399 						RDEBUG( "0", 0 );
       
   400 					CleanupStack::PopAndDestroy( emergencyCall );
       
   401 					}	// lenght<3
       
   402 				}	// acceptedVariantTop
       
   403     	RDEBUG( "iReturnValue", iReturnValue );
   314     }
   404     }
   315 
   405 
   316 // ---------------------------------------------------------------------------
   406 // ---------------------------------------------------------------------------
   317 // CSecQueryUi::DeviceDialogClosed()
   407 // CSecQueryUi::DeviceDialogClosed()
   318 // ---------------------------------------------------------------------------
   408 // ---------------------------------------------------------------------------
   319 //
   409 //
   320 void CSecQueryUi::DeviceDialogClosed( TInt aCompletionCode )
   410 void CSecQueryUi::DeviceDialogClosed( TInt aCompletionCode )
   321     {
   411     {
   322     RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   412     	RDEBUG( "aCompletionCode", aCompletionCode );
   323     iCompletionCode = aCompletionCode;
   413     iCompletionCode = aCompletionCode;
   324     iIsDisplayingDialog = EFalse;
   414     iIsDisplayingDialog = EFalse;
   325 
   415 
   326     TRequestStatus* status( &iStatus );
   416     TRequestStatus* status( &iStatus );
       
   417     	RDEBUG( "0", 0 );
   327     User::RequestComplete( status, KErrNone );
   418     User::RequestComplete( status, KErrNone );
       
   419     	RDEBUG( "0", 0 );
   328     }
   420     }
   329 
   421 
   330 // ---------------------------------------------------------------------------
   422 // ---------------------------------------------------------------------------
   331 // CSecQueryUi::CSecQueryUi()
   423 // CSecQueryUi::CSecQueryUi()
   332 // ---------------------------------------------------------------------------
   424 // ---------------------------------------------------------------------------
   333 //
   425 //
   334 CSecQueryUi::CSecQueryUi() : CActive( CActive::EPriorityStandard )
   426 CSecQueryUi::CSecQueryUi() : CActive( CActive::EPriorityStandard )
   335     {
   427     {
   336     RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   428     	RDEBUG( "0", 0 );
   337     CActiveScheduler::Add( this );
   429     CActiveScheduler::Add( this );
   338     }
   430     }
   339 
   431 
   340 // ---------------------------------------------------------------------------
   432 // ---------------------------------------------------------------------------
   341 // CSecQueryUi::ConstructL()
   433 // CSecQueryUi::ConstructL()
   342 // ---------------------------------------------------------------------------
   434 // ---------------------------------------------------------------------------
   343 //
   435 //
   344 void CSecQueryUi::ConstructL()
   436 void CSecQueryUi::ConstructL()
   345     {
   437     {
   346     RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   438     	RDEBUG( "0", 0 );
   347     iWait = new( ELeave ) CActiveSchedulerWait;
   439     iWait = new( ELeave ) CActiveSchedulerWait;
   348     // iDeviceDialog is allocated later, first call of DisplayDeviceDialogL()
   440     // iDeviceDialog is allocated later, first call of DisplayDeviceDialogL()
   349     }
   441     }
   350 
   442 
   351 // ---------------------------------------------------------------------------
   443 // ---------------------------------------------------------------------------
   352 // CSecQueryUi::ClearParamsL()
   444 // CSecQueryUi::ClearParamsL()
   353 // ---------------------------------------------------------------------------
   445 // ---------------------------------------------------------------------------
   354 //
   446 //
   355 void CSecQueryUi::ClearParamsL()
   447 void CSecQueryUi::ClearParamsL()
   356     {
   448     {
       
   449     	RDEBUG( "0", 0 );
   357     if( iVariantMap )
   450     if( iVariantMap )
   358         {
   451         {
   359         delete iVariantMap;
   452         delete iVariantMap;
   360         iVariantMap = NULL;
   453         iVariantMap = NULL;
   361         }
   454         }
   366 // CSecQueryUi::ClearParamsAndSetNoteTypeL()
   459 // CSecQueryUi::ClearParamsAndSetNoteTypeL()
   367 // ---------------------------------------------------------------------------
   460 // ---------------------------------------------------------------------------
   368 //
   461 //
   369 void CSecQueryUi::ClearParamsAndSetNoteTypeL( TInt aType )
   462 void CSecQueryUi::ClearParamsAndSetNoteTypeL( TInt aType )
   370     {
   463     {
   371     RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   464     	RDEBUG( "aType", aType );
   372     ClearParamsL();
   465     ClearParamsL();
   373     AddParamL( _L("type"), aType );
   466     AddParamL( _L("type"), aType );
   374     }
   467     }
   375 
   468 
   376 // ---------------------------------------------------------------------------
   469 // ---------------------------------------------------------------------------
   377 // CSecQueryUi::AddParamL()
   470 // CSecQueryUi::AddParamL()
   378 // ---------------------------------------------------------------------------
   471 // ---------------------------------------------------------------------------
   379 //
   472 //
   380 void CSecQueryUi::AddParamL( const TDesC& aKey, TInt aValue )
   473 void CSecQueryUi::AddParamL( const TDesC& aKey, TInt aValue )
   381     {
   474     {
   382     RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   475     	RDEBUG( "aValue", aValue );
   383     CHbSymbianVariant* variant = NULL;
   476     CHbSymbianVariant* variant = NULL;
   384     variant = CHbSymbianVariant::NewL( &aValue, CHbSymbianVariant::EInt );
   477     variant = CHbSymbianVariant::NewL( &aValue, CHbSymbianVariant::EInt );
   385     iVariantMap->Add( aKey, variant );
   478     iVariantMap->Add( aKey, variant );
   386     }
   479     }
   387 
   480 
   389 // CSecQueryUi::AddParamL()
   482 // CSecQueryUi::AddParamL()
   390 // ---------------------------------------------------------------------------
   483 // ---------------------------------------------------------------------------
   391 //
   484 //
   392 void CSecQueryUi::AddParamL( const TDesC& aKey, const TDesC& aValue )
   485 void CSecQueryUi::AddParamL( const TDesC& aKey, const TDesC& aValue )
   393     {
   486     {
   394     RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   487     	RDEBUG( "0", 0 );
   395     CHbSymbianVariant* variant = NULL;
   488     CHbSymbianVariant* variant = NULL;
   396     variant = CHbSymbianVariant::NewL( &aValue, CHbSymbianVariant::EDes );
   489     variant = CHbSymbianVariant::NewL( &aValue, CHbSymbianVariant::EDes );
   397     iVariantMap->Add( aKey, variant );
   490     iVariantMap->Add( aKey, variant );
   398     }
   491     }
   399 
   492 
   409 // CSecQueryUi::DisplayDeviceDialogL()
   502 // CSecQueryUi::DisplayDeviceDialogL()
   410 // ---------------------------------------------------------------------------
   503 // ---------------------------------------------------------------------------
   411 //
   504 //
   412 void CSecQueryUi::DisplayDeviceDialogL()
   505 void CSecQueryUi::DisplayDeviceDialogL()
   413     {
   506     {
   414     RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   507     	RDEBUG( "0", 0 );
   415     if( iDeviceDialog && iIsDisplayingDialog )
   508     if( iDeviceDialog && iIsDisplayingDialog )
   416         {
   509         {
   417         iDeviceDialog->Update( *iVariantMap );
   510         iDeviceDialog->Update( *iVariantMap );
   418         }
   511         }
   419     else
   512     else
   421         if( !iDeviceDialog )
   514         if( !iDeviceDialog )
   422             {
   515             {
   423             iDeviceDialog = CHbDeviceDialog::NewL();
   516             iDeviceDialog = CHbDeviceDialog::NewL();
   424             }
   517             }
   425         _LIT( KSecQueryUiDeviceDialog, "com.nokia.secuinotificationdialog/1.0" );
   518         _LIT( KSecQueryUiDeviceDialog, "com.nokia.secuinotificationdialog/1.0" );
   426         RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   519         	RDEBUG( "Show", 0 );
   427         iDeviceDialog->Show( KSecQueryUiDeviceDialog, *iVariantMap, this );
   520         iDeviceDialog->Show( KSecQueryUiDeviceDialog, *iVariantMap, this );
   428         RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   521         	RDEBUG( "iIsDisplayingDialog", iIsDisplayingDialog );
   429         iIsDisplayingDialog = ETrue;
   522         iIsDisplayingDialog = ETrue;
   430         }
   523         	RDEBUG( "iIsDisplayingDialog", iIsDisplayingDialog );
       
   524         }
       
   525     	RDEBUG( "0", 0 );
   431     }
   526     }
   432 
   527 
   433 // ---------------------------------------------------------------------------
   528 // ---------------------------------------------------------------------------
   434 // CSecQueryUi::WaitUntilDeviceDialogClosed()
   529 // CSecQueryUi::WaitUntilDeviceDialogClosed()
   435 // ---------------------------------------------------------------------------
   530 // ---------------------------------------------------------------------------
   436 //
   531 //
   437 TInt CSecQueryUi::WaitUntilDeviceDialogClosed()
   532 TInt CSecQueryUi::WaitUntilDeviceDialogClosed()
   438     {
   533     {
   439     RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   534     	RDEBUG( "0", 0 );
   440     iCompletionCode = KErrInUse;
   535     iCompletionCode = KErrInUse;
   441     iReturnValue = KErrUnknown;
   536     iReturnValue = KErrUnknown;
   442     if( !IsActive() && iWait && !iWait->IsStarted() )
   537     if( !IsActive() && iWait && !iWait->IsStarted() )
   443         {
   538         {
   444         iStatus = KRequestPending;
   539         iStatus = KRequestPending;
   445         SetActive();
   540         SetActive();
       
   541         	RDEBUG( "Start", 0 );
   446         iWait->Start();
   542         iWait->Start();
   447         }
   543     			RDEBUG( "Started", 1 );
       
   544         }
       
   545     	RDEBUG( "iCompletionCode", iCompletionCode );
   448     return iCompletionCode;
   546     return iCompletionCode;
   449     }
   547     }
   450 
   548