|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <btserviceapi.h> |
|
21 #include "BTSSSendListHandler.h" |
|
22 #include "btsendserviceprovider.h" |
|
23 #include <btfeaturescfg.h> // For Enterprise security settings |
|
24 #include <btnotif.h> // For Enterprise security notifier |
|
25 |
|
26 |
|
27 CBtSendServiceProvider* CBtSendServiceProvider::NewL() |
|
28 { |
|
29 CBtSendServiceProvider* self = new( ELeave ) CBtSendServiceProvider(); |
|
30 CleanupStack::PushL( self ); |
|
31 self->ConstructL(); |
|
32 CleanupStack::Pop(); |
|
33 return self; |
|
34 } |
|
35 |
|
36 void CBtSendServiceProvider::ConstructL() |
|
37 { |
|
38 if(BluetoothFeatures::EnterpriseEnablementL() != BluetoothFeatures::EEnabled) |
|
39 { |
|
40 RNotifier notifier; |
|
41 User::LeaveIfError(notifier.Connect()); |
|
42 CleanupClosePushL(notifier); |
|
43 User::LeaveIfError(notifier.StartNotifier(KBTEnterpriseItSecurityInfoNotifierUid, KNullDesC8)); |
|
44 CleanupStack::PopAndDestroy(¬ifier); |
|
45 |
|
46 //@TODO in old code we don't continue further what needs to be done here |
|
47 } |
|
48 iBTSendingService = CBTServiceAPI::NewL(); |
|
49 iConverter = CBTSSSendListHandler::NewL(); |
|
50 } |
|
51 |
|
52 CBtSendServiceProvider::CBtSendServiceProvider() |
|
53 { |
|
54 |
|
55 } |
|
56 |
|
57 |
|
58 CBtSendServiceProvider::~CBtSendServiceProvider() |
|
59 { |
|
60 if(iConverter) |
|
61 { |
|
62 delete iConverter; |
|
63 iConverter= NULL; |
|
64 } |
|
65 if(iBTSendingService) |
|
66 { |
|
67 delete iBTSendingService; |
|
68 iBTSendingService = NULL; |
|
69 } |
|
70 } |
|
71 |
|
72 |
|
73 int CBtSendServiceProvider::send(const QList<QVariant> &arguments) |
|
74 { |
|
75 TInt error = KErrNone; |
|
76 |
|
77 CBTServiceParameterList* parameterList = NULL; |
|
78 TRAP(error,parameterList= CBTServiceParameterList::NewL()); |
|
79 if (error) |
|
80 return error; |
|
81 iConverter->ConvertList( &arguments, parameterList); |
|
82 |
|
83 delete iConverter; |
|
84 iConverter = NULL; |
|
85 |
|
86 TRAP(error,iBTSendingService->StartSynchronousServiceL( EBTSendingService, parameterList )); |
|
87 if(error) |
|
88 return error; |
|
89 return error; |
|
90 } |