|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // The asynchronous callbacks used by the Network Gateway |
|
15 // |
|
16 // |
|
17 |
|
18 #include <lbs/lbsnetprotocolbase.h> |
|
19 |
|
20 #include "netgatewayasynccallback.h" |
|
21 #include "lbsdevloggermacros.h" |
|
22 |
|
23 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
24 #include "lbsnetextintversions.h" |
|
25 #endif |
|
26 |
|
27 |
|
28 /** |
|
29 @file |
|
30 @internalComponent |
|
31 @released |
|
32 */ |
|
33 |
|
34 CRejectPrivacyRequestCallback* CRejectPrivacyRequestCallback::NewL() |
|
35 { |
|
36 return new(ELeave) CRejectPrivacyRequestCallback; |
|
37 } |
|
38 |
|
39 CRejectPrivacyRequestCallback::CRejectPrivacyRequestCallback() : CAsyncCallBack(EPriorityHigh) |
|
40 { |
|
41 } |
|
42 |
|
43 CRejectPrivacyRequestCallback::~CRejectPrivacyRequestCallback() |
|
44 { |
|
45 Cancel(); |
|
46 } |
|
47 |
|
48 void CRejectPrivacyRequestCallback::CallBack(CLbsNetworkProtocolBase* aProtocol, |
|
49 const TLbsNetSessionId& aSessionId) |
|
50 { |
|
51 Cancel(); |
|
52 iProtocol = aProtocol; |
|
53 iSessionId = aSessionId; |
|
54 CAsyncCallBack::CallBack(); |
|
55 } |
|
56 |
|
57 void CRejectPrivacyRequestCallback::RunL() |
|
58 { |
|
59 __ASSERT_DEBUG(iProtocol, User::Invariant()); |
|
60 if(!iProtocol) |
|
61 { |
|
62 return; |
|
63 } |
|
64 |
|
65 CLbsNetworkProtocolBase2* networkProtocolExt = reinterpret_cast<CLbsNetworkProtocolBase2*> |
|
66 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
67 (iProtocol->ExtendedInterface(CLbsNetworkProtocolBase::EExtInterface2,0,0)); |
|
68 #else |
|
69 (iProtocol->ExtendedInterface(ELbsNetExtInterface2,0,0)); |
|
70 #endif |
|
71 |
|
72 |
|
73 if (networkProtocolExt != NULL) |
|
74 { |
|
75 networkProtocolExt->RespondPrivacyRequest(iSessionId, CLbsNetworkProtocolBase::EPrivacyResponseRejected, KErrAccessDenied); |
|
76 } |
|
77 else |
|
78 { |
|
79 iProtocol->RespondPrivacyRequest(iSessionId, CLbsNetworkProtocolBase::EPrivacyResponseRejected); |
|
80 } |
|
81 |
|
82 LBSLOG(ELogP9, "->A CLbsNetworkProtocolBase::RespondPrivacyRequest() ProtocolModule\n"); |
|
83 LBSLOG(ELogP9, " > TLbsNetMtLrReponseMsg msg.SessionId() = \n"); |
|
84 LBSLOG_SESSIONID(iSessionId); |
|
85 LBSLOG2(ELogP9, " > TLbsNetMtLrReponseMsg msg.Response() = %d", CLbsNetworkProtocolBase::EPrivacyResponseRejected); |
|
86 } |