diff -r ae942d28ec0e -r 2455ef1f5bbc javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60btdialog.cpp --- a/javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60btdialog.cpp Tue Aug 31 15:09:22 2010 +0300 +++ b/javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60btdialog.cpp Wed Sep 01 12:33:18 2010 +0100 @@ -23,13 +23,6 @@ #include "s60btdialog.h" #include "logger.h" -#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS -#include -#include -#include - -#define QUERY_BUF_LEN 512 -#endif using namespace java::bluetooth; @@ -51,9 +44,7 @@ void CS60BTDialog::ConstructL() { LOG(EJavaBluetooth, EInfo, "+ CS60BTDialog::ConstructL()"); -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS User::LeaveIfError(mNotifier.Connect()); -#endif LOG(EJavaBluetooth, EInfo, "- CS60BTDialog::ConstructL()"); } @@ -66,9 +57,7 @@ { CS60BTDialog* self = new(ELeave) CS60BTDialog; CleanupStack::PushL(self); -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS self->ConstructL(); -#endif return self; } @@ -81,11 +70,8 @@ { JELOG2(EJavaBluetooth); LOG(EJavaBluetooth, EInfo, "+ CS60BTDialog::~CS60BTDialog()"); - -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS DoCancel(); mNotifier.Close(); -#endif LOG(EJavaBluetooth, EInfo, "- CS60BTDialog::~CS60BTDialog()"); } @@ -101,42 +87,14 @@ JELOG2(EJavaBluetooth); LOG1(EJavaBluetooth, EInfo,"+ CS60BTDialog::ShowBTQueryDialog(): aQueryType = %d", aQueryType); - -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS mQueryParamsPckg().iMessageType = aQueryType; mQueryParamsPckg().iNameExists = ETrue; mQueryParamsPckg().iName.Copy(aAppName); mNotifier.StartNotifierAndGetResponse(mStatus, KBTGenericQueryNotifierUid, mQueryParamsPckg, mQueryResult); + User::WaitForRequest(mStatus); -#else - _LIT(KAppInfo,"Application %S cannot be used when Bluetooth is off Activate Bluetooth ?"); - _LIT(KAppInfomsg,"Change 'My phone's visibility' setting to 'Show to all'? Application '%S' cannot be used when the visibility is set as 'Hidden'."); - - TBuf queryBuf; - TInt err = KErrNone; - TBool userOpt; - - queryBuf.Zero(); - if (aQueryType == EBTIsOffJavaQuery) - { - queryBuf.Format(KAppInfo,&aAppName); - } - else if (aQueryType == EBTIsNotShownQuery) - { - queryBuf.Format(KAppInfomsg,&aAppName); - } - - TRAP(err, userOpt = ShowBTQueryHbDialogL(queryBuf)); - LOG1(EJavaBluetooth, EInfo," CS60BTDialog::ShowBTQueryDialog(): mQueryResult = %d", err); - - if (err != KErrNone ) - mQueryResult = EFalse; - else - mQueryResult = userOpt; -#endif - LOG1(EJavaBluetooth, EInfo,"- CS60BTDialog::ShowBTQueryDialog(): mQueryResult = %d", mQueryResult()); return mQueryResult(); } @@ -151,42 +109,6 @@ void CS60BTDialog::DoCancel() { LOG(EJavaBluetooth, EInfo, "+ CS60BTDialog::DoCancel()"); -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS mNotifier.CancelNotifier(KBTGenericQueryNotifierUid); -#endif LOG(EJavaBluetooth, EInfo, "- CS60BTDialog::DoCancel()"); } - -#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS - -TBool CS60BTDialog::ShowBTQueryHbDialogL(const TDesC& aBufData) -{ - TBool result = EFalse; - - CHbDeviceMessageBoxSymbian* messageBox - = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EQuestion); - CleanupStack::PushL(messageBox); - - messageBox->SetTextL(aBufData); - messageBox->SetTimeout(HbPopup::NoTimeout); - - // Read localised versions instead of hard coded values. - _LIT(KAllowButtonText, "Yes"); - _LIT(KDenyButtonText, "No"); - - messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::EAcceptButton, KAllowButtonText); - messageBox->SetButton(CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue); - messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::ERejectButton, KDenyButtonText); - messageBox->SetButton(CHbDeviceMessageBoxSymbian::ERejectButton, ETrue); - - if (messageBox->ExecL() == CHbDeviceMessageBoxSymbian::EAcceptButton) - result = ETrue; - else - result = EFalse; - - messageBox->Close(); - CleanupStack::PopAndDestroy(messageBox); - - return result; -} -#endif