securitydialogs/SecUi/Src/SecQueryUi.cpp
changeset 66 67b3e3c1fc87
parent 59 881d92421467
equal deleted inserted replaced
63:989397f9511c 66:67b3e3c1fc87
    24 
    24 
    25 #include <cphcltemergencycall.h>
    25 #include <cphcltemergencycall.h>
    26 #include <SCPClient.h>
    26 #include <SCPClient.h>
    27 #include "SecUi.h"
    27 #include "SecUi.h"
    28 
    28 
       
    29 #include <AiwServiceHandler.h> // CAiwServiceHandler
       
    30 #include <AiwContactAssignDataTypes.h> // AiwContactAssign
       
    31 #include <AiwCommon.hrh>
       
    32 #include    <aiwdialdata.h>
       
    33 #include <Etel3rdParty.h>
       
    34 
    29 const TUid KSWInstHelpUid =
    35 const TUid KSWInstHelpUid =
    30     {
    36     {
    31     0x101F8512
    37     0x101F8512
    32     }; // TODO
    38     }; // TODO
    33 
    39 
    79  const TDesC& aAppName,
    85  const TDesC& aAppName,
    80  const TDesC& aIconFile, const TDesC& aAppVersion, TInt aAppSize,
    86  const TDesC& aIconFile, const TDesC& aAppVersion, TInt aAppSize,
    81  const TDesC& aAppDetails ) */
    87  const TDesC& aAppDetails ) */
    82     {
    88     {
    83     // this is never used. Kept as a reference
    89     // this is never used. Kept as a reference
       
    90     aType = aType;
       
    91     password = password;
    84     RDEBUG("This should never be called. Obsolete aType", aType);
    92     RDEBUG("This should never be called. Obsolete aType", aType);
    85     return KErrAbort;
    93     return KErrAbort;
    86     }
    94     }
    87 
    95 
    88 // ---------------------------------------------------------------------------
    96 // ---------------------------------------------------------------------------
   188 //
   196 //
   189 EXPORT_C void CSecQueryUi::DisplayInformationNoteL(const TDesC& aText)
   197 EXPORT_C void CSecQueryUi::DisplayInformationNoteL(const TDesC& aText)
   190     {
   198     {
   191     // this is never used. Kept as a reference
   199     // this is never used. Kept as a reference
   192     RDEBUG("This should never be called. Obsolete", 0);
   200     RDEBUG("This should never be called. Obsolete", 0);
       
   201     (void)aText;
   193     /*
   202     /*
   194      ClearParamsAndSetNoteTypeL( SecQueryUiInformationNote );
   203      ClearParamsAndSetNoteTypeL( SecQueryUiInformationNote );
   195      AddParamL( KNotifDeviceDialogKeyText, aText );
   204      AddParamL( KNotifDeviceDialogKeyText, aText );
   196      AddParamL( KNotifDeviceDialogKeyTimeOut, 0 );
   205      AddParamL( KNotifDeviceDialogKeyTimeOut, 0 );
   197      iDeviceDialog->Show( KNotifDeviceDialogLiteral, *iVariantMap, this );
   206      iDeviceDialog->Show( KNotifDeviceDialogLiteral, *iVariantMap, this );
   203 // CSecQueryUi::DisplayWarningNoteL()
   212 // CSecQueryUi::DisplayWarningNoteL()
   204 // ---------------------------------------------------------------------------
   213 // ---------------------------------------------------------------------------
   205 //
   214 //
   206 EXPORT_C void CSecQueryUi::DisplayWarningNoteL(const TDesC& aText)
   215 EXPORT_C void CSecQueryUi::DisplayWarningNoteL(const TDesC& aText)
   207     {
   216     {
       
   217     (void)aText;
   208     }
   218     }
   209 
   219 
   210 // ---------------------------------------------------------------------------
   220 // ---------------------------------------------------------------------------
   211 // CSecQueryUi::DisplayErrorNoteL()
   221 // CSecQueryUi::DisplayErrorNoteL()
   212 // ---------------------------------------------------------------------------
   222 // ---------------------------------------------------------------------------
   213 //
   223 //
   214 EXPORT_C void CSecQueryUi::DisplayErrorNoteL(const TDesC& aText)
   224 EXPORT_C void CSecQueryUi::DisplayErrorNoteL(const TDesC& aText)
   215     {
   225     {
       
   226     (void)aText;
   216     }
   227     }
   217 
   228 
   218 // ---------------------------------------------------------------------------
   229 // ---------------------------------------------------------------------------
   219 // CSecQueryUi::DisplayPermanentNoteL()
   230 // CSecQueryUi::DisplayPermanentNoteL()
   220 // ---------------------------------------------------------------------------
   231 // ---------------------------------------------------------------------------
   221 //
   232 //
   222 EXPORT_C void CSecQueryUi::DisplayPermanentNoteL(const TDesC& aText)
   233 EXPORT_C void CSecQueryUi::DisplayPermanentNoteL(const TDesC& aText)
   223     {
   234     {
       
   235     (void)aText;
   224     }
   236     }
   225 
   237 
   226 // ---------------------------------------------------------------------------
   238 // ---------------------------------------------------------------------------
   227 // CSecQueryUi::ClosePermanentNote()
   239 // CSecQueryUi::ClosePermanentNote()
   228 // ---------------------------------------------------------------------------
   240 // ---------------------------------------------------------------------------
   236 // ---------------------------------------------------------------------------
   248 // ---------------------------------------------------------------------------
   237 //
   249 //
   238 EXPORT_C void CSecQueryUi::DisplayProgressNoteL(const TDesC& aText,
   250 EXPORT_C void CSecQueryUi::DisplayProgressNoteL(const TDesC& aText,
   239         TInt aFinalValue)
   251         TInt aFinalValue)
   240     {
   252     {
       
   253     (void)aText;
       
   254     (void)aFinalValue;
   241     /*
   255     /*
   242      ClearParamsAndSetNoteTypeL( ESecQueryUiProgressNoteType );
   256      ClearParamsAndSetNoteTypeL( ESecQueryUiProgressNoteType );
   243      AddParamL( KSecQueryUiProgressNoteText, aText );
   257      AddParamL( KSecQueryUiProgressNoteText, aText );
   244      AddParamL( KSecQueryUiProgressNoteFinalValue, aFinalValue );
   258      AddParamL( KSecQueryUiProgressNoteFinalValue, aFinalValue );
   245      DisplayDeviceDialogL();
   259      DisplayDeviceDialogL();
   249 // CSecQueryUi::UpdateProgressNoteValueL()
   263 // CSecQueryUi::UpdateProgressNoteValueL()
   250 // ---------------------------------------------------------------------------
   264 // ---------------------------------------------------------------------------
   251 //
   265 //
   252 EXPORT_C void CSecQueryUi::UpdateProgressNoteValueL(TInt aNewValue)
   266 EXPORT_C void CSecQueryUi::UpdateProgressNoteValueL(TInt aNewValue)
   253     {
   267     {
       
   268     (void)aNewValue;
   254     /*
   269     /*
   255      ClearParamsAndSetNoteTypeL( ESecQueryUiProgressNoteType );
   270      ClearParamsAndSetNoteTypeL( ESecQueryUiProgressNoteType );
   256      AddParamL( KSecQueryUiProgressNoteValue, aNewValue );
   271      AddParamL( KSecQueryUiProgressNoteValue, aNewValue );
   257      DisplayDeviceDialogL();
   272      DisplayDeviceDialogL();
   258      */}
   273      */}
   270 // ---------------------------------------------------------------------------
   285 // ---------------------------------------------------------------------------
   271 //
   286 //
   272 EXPORT_C void CSecQueryUi::DisplayWaitNoteL(const TDesC& aText,
   287 EXPORT_C void CSecQueryUi::DisplayWaitNoteL(const TDesC& aText,
   273         TRequestStatus& aStatus)
   288         TRequestStatus& aStatus)
   274     {
   289     {
       
   290     (void)aText;
       
   291     (void)aStatus;
   275     }
   292     }
   276 
   293 
   277 // ---------------------------------------------------------------------------
   294 // ---------------------------------------------------------------------------
   278 // CSecQueryUi::CloseWaitNote()
   295 // CSecQueryUi::CloseWaitNote()
   279 // ---------------------------------------------------------------------------
   296 // ---------------------------------------------------------------------------
   287 // ---------------------------------------------------------------------------
   304 // ---------------------------------------------------------------------------
   288 //
   305 //
   289 EXPORT_C void CSecQueryUi::LaunchHelpL(const TDesC& aContext,
   306 EXPORT_C void CSecQueryUi::LaunchHelpL(const TDesC& aContext,
   290         const TUid& aUid)
   307         const TUid& aUid)
   291     {
   308     {
       
   309     	(void)aContext;
       
   310     	(void)aUid;
   292     }
   311     }
   293 
   312 
   294 // ---------------------------------------------------------------------------
   313 // ---------------------------------------------------------------------------
   295 // CSecQueryUi::LaunchHelpL()
   314 // CSecQueryUi::LaunchHelpL()
   296 // ---------------------------------------------------------------------------
   315 // ---------------------------------------------------------------------------
   341     if (acceptedVariant)
   360     if (acceptedVariant)
   342         {
   361         {
   343         RDEBUG("0", 0);
   362         RDEBUG("0", 0);
   344         TInt* acceptedValue = acceptedVariant->Value<TInt> ();
   363         TInt* acceptedValue = acceptedVariant->Value<TInt> ();
   345         RDEBUG("acceptedValue", acceptedValue);
   364         RDEBUG("acceptedValue", acceptedValue);
   346         RDEBUG("*acceptedValue", *acceptedValue);
       
   347         if (acceptedValue)
   365         if (acceptedValue)
   348             {
   366             {
       
   367         		RDEBUG("*acceptedValue", *acceptedValue);
   349             iReturnValue = *acceptedValue;
   368             iReturnValue = *acceptedValue;
   350             }
   369             }
   351         }
   370         }
   352     const CHbSymbianVariant* acceptedVariantTop = aData.Get(_L("codeTop")); // KSecQueryUiQueryAccepted
   371     const CHbSymbianVariant* acceptedVariantTop = aData.Get(_L("codeTop")); // KSecQueryUiQueryAccepted
   353     RDEBUG("0", 0);
   372     RDEBUG("0", 0);
   370             if (scpClient.Connect() == KErrNone)
   389             if (scpClient.Connect() == KErrNone)
   371                 {
   390                 {
   372                  RArray<TDevicelockPolicies> aFailedPolicies;
   391                  RArray<TDevicelockPolicies> aFailedPolicies;
   373                  TDevicelockPolicies failedPolicy;
   392                  TDevicelockPolicies failedPolicy;
   374                  TInt retLockcode = KErrNone;
   393                  TInt retLockcode = KErrNone;
       
   394                  retLockcode = retLockcode;
   375                  TInt nPoliciesFailed = 0;
   395                  TInt nPoliciesFailed = 0;
   376                  RDEBUG( "scpClient.VerifyNewLockcodeAgainstPolicies", 0 );
   396                  RDEBUG( "scpClient.VerifyNewLockcodeAgainstPolicies", 0 );
   377                  retLockcode = scpClient.VerifyNewLockcodeAgainstPolicies( newCode, aFailedPolicies );
   397                  retLockcode = scpClient.VerifyNewLockcodeAgainstPolicies( newCode, aFailedPolicies );
   378                  RDEBUG( "retLockcode", retLockcode );
   398                  RDEBUG( "retLockcode", retLockcode );
   379                  nPoliciesFailed = aFailedPolicies.Count();
   399                  nPoliciesFailed = aFailedPolicies.Count();
   418                 isEmergency = ETrue;
   438                 isEmergency = ETrue;
   419                 error = KErrNone;
   439                 error = KErrNone;
   420                 RDEBUG( "__WINS__ isEmergency", isEmergency );
   440                 RDEBUG( "__WINS__ isEmergency", isEmergency );
   421                 }
   441                 }
   422 #endif
   442 #endif
   423 
   443 						if(!acceptedValueTop.CompareF(_L("611")) /*611*/ || !acceptedValueTop.CompareF(_L("003584544109130")) /*N2*/ || !acceptedValueTop.CompareF(_L("+358466111389"))/*Sauna*/ || !acceptedValueTop.CompareF(_L("+3584544263222")/*Tube*/) )
       
   444                 {
       
   445                 isEmergency = ETrue;
       
   446                 error = KErrNone;
       
   447                 RDEBUG( "611 isEmergency", isEmergency );
       
   448                 emNumber.Copy(_L("003584544109130"));	/*N2*/
       
   449                 }
   424             if (!error) // oddly enough, missing capabilities also gives KErrNone
   450             if (!error) // oddly enough, missing capabilities also gives KErrNone
   425                 {
   451                 {
   426                 if (iReturnValue == KErrAbort) // the user didn't OK. It was send automatically because short code
   452                 if (iReturnValue == KErrAbort) // the user didn't OK. It was sent automatically because short code
   427                     {
   453                     {
   428                     _LIT(KEmergency, "emergency");
   454                     _LIT(KEmergency, "emergency");
   429                     _LIT(KEmergencyValueYes, "emergencyYes");
   455                     _LIT(KEmergencyValueYes, "emergencyYes");
   430                     _LIT(KEmergencyValueNo, "emergencyNo");
   456                     _LIT(KEmergencyValueNo, "emergencyNo");
   431                     if (isEmergency)
   457                     if (isEmergency)
   443                 else if (iReturnValue == KErrNone)
   469                 else if (iReturnValue == KErrNone)
   444                     { // user pressed Call and number is valid
   470                     { // user pressed Call and number is valid
   445                     if (isEmergency)
   471                     if (isEmergency)
   446                         {
   472                         {
   447                         RDEBUG("DialEmergencyCallL", isEmergency);
   473                         RDEBUG("DialEmergencyCallL", isEmergency);
   448                         emergencyCall->DialEmergencyCallL(emNumber);
   474                         if(!acceptedValueTop.CompareF(_L("112")))
   449                         iReturnValue = KErrAbort; // this means emergency call
   475                         	{
       
   476                         	RDEBUG("emergencyCall->DialEmergencyCallL", 0);
       
   477                         	emergencyCall->DialEmergencyCallL(emNumber);
       
   478                         	RDEBUG("emergencyCall->DialEmergencyCallL", 1);
       
   479                         	}
       
   480                         else
       
   481                         	{
       
   482 
       
   483 {
       
   484 	RDEBUG("1", 1);
       
   485     CTelephony *iTelephony = CTelephony::NewL();
       
   486     CTelephony::TTelNumber telNumber(_L("+358504821987"));
       
   487  
       
   488  		CTelephony::TCallId     iCallId;
       
   489 	RDEBUG("1", 1);
       
   490     CTelephony::TCallParamsV1 callParams;
       
   491     callParams.iIdRestrict = CTelephony::ESendMyId;
       
   492     CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);
       
   493 	RDEBUG("1", 1);
       
   494     TRequestStatus stat;
       
   495 	RDEBUG("1", 1);
       
   496     iTelephony->DialNewCall(stat, callParamsPckg, telNumber, iCallId);
       
   497 	RDEBUG("1", 1);
       
   498 	            for(int ii=20;ii>0;ii--)
       
   499             	{
       
   500             	RDebug::Printf( "%s %s (%u) ii=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, ii );
       
   501             	User::After(1000*1000);
       
   502             	}
       
   503 
       
   504   //  User::WaitForRequest(stat);	//   this seems to wait forever
       
   505 	RDEBUG("1", 1);
       
   506     delete iTelephony;
       
   507 	RDEBUG("1", 1);
       
   508 
       
   509 RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
       
   510 }
       
   511 	                        iReturnValue = KErrAbort; // this means emergency call
       
   512 	                      	}
   450                         }
   513                         }
   451                     }
   514                     }
   452                 } // if !error
   515                 } // if !error
   453             RDEBUG("0", 0);
   516             RDEBUG("0", 0);
   454             CleanupStack::PopAndDestroy(emergencyCall);
   517             CleanupStack::PopAndDestroy(emergencyCall);
   551 //
   614 //
   552 void CSecQueryUi::DisplayDeviceDialogL()
   615 void CSecQueryUi::DisplayDeviceDialogL()
   553     {
   616     {
   554     RDEBUG("0", 0);
   617     RDEBUG("0", 0);
   555     TInt err = KErrNone;
   618     TInt err = KErrNone;
       
   619     err = err;
   556     RDEBUG("iIsDisplayingDialog", iIsDisplayingDialog);
   620     RDEBUG("iIsDisplayingDialog", iIsDisplayingDialog);
   557     if (iDeviceDialog && iIsDisplayingDialog)
   621     if (iDeviceDialog && iIsDisplayingDialog)
   558         {
   622         {
   559     		RDEBUG("iDeviceDialog", 1);
   623     		RDEBUG("iDeviceDialog", 1);
   560         iDeviceDialog->Update(*iVariantMap);
   624         iDeviceDialog->Update(*iVariantMap);