|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-64E8B920-CD45-4AFF-BD5B-8A7F70F0D59E" xml:lang="en"><title>Responding |
|
13 to Requests and Cancelling Requests</title><shortdesc>As shown in the previous Privacy Controller API code examples, |
|
14 a Privacy Controller has a pointer to a <apiname>CLbsPrivacyController</apiname> class. |
|
15 The Privacy Controller uses this pointer to respond to privacy requests and |
|
16 to cancel them. The simple outline code in this section shows how a Privacy |
|
17 Controller calls these functions. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
18 <section> <title>Responding to a request</title> <p>The code below |
|
19 shows how the observer class can respond to privacy requests by calling <xref href="GUID-DA9AD188-944E-36C0-98A6-4F9B6FB2A091.dita#GUID-DA9AD188-944E-36C0-98A6-4F9B6FB2A091/GUID-D3C37C92-5609-31F1-82AB-01AEC99671BB"><apiname>CLbsPrivacyController::RespondNetworkLocationRequest()</apiname></xref>. </p><codeblock xml:space="preserve">// Send a privacy response to the LBS subsystem |
|
20 void CMyLbsPrivacyControllerObserver::SendResponse(TUint aRequestId, |
|
21 CLbsPrivacyController::TRequestVerificationResult aResult) |
|
22 { |
|
23 // aRequestId is the ID of a privacy request that was previously received |
|
24 iController->RespondNetworkLocationRequest(aRequestId, aResult); |
|
25 }</codeblock> </section> |
|
26 <section><title>Cancelling a privacy verification request </title><p>The code |
|
27 below shows how the observer class can cancel privacy verification requests |
|
28 by calling <xref href="GUID-DA9AD188-944E-36C0-98A6-4F9B6FB2A091.dita#GUID-DA9AD188-944E-36C0-98A6-4F9B6FB2A091/GUID-C2FC9C84-DB18-3741-BD2F-AC214D679A13"><apiname>CLbsPrivacyController::CancelNetworkLocationRequest()</apiname></xref>.</p><p>There |
|
29 is no guarantee that a privacy request will be cancelled by calling <xref href="GUID-DA9AD188-944E-36C0-98A6-4F9B6FB2A091.dita#GUID-DA9AD188-944E-36C0-98A6-4F9B6FB2A091/GUID-C2FC9C84-DB18-3741-BD2F-AC214D679A13"><apiname>CLbsPrivacyController::CancelNetworkLocationRequest()</apiname></xref>. |
|
30 If a privacy request was first accepted and then later cancelled by a Privacy |
|
31 Controller, the network may accept the request before the cancel message is |
|
32 processed. The sequence diagrams in LBS <xref href="GUID-D857413A-D5A1-5F9F-A780-C980A9E0BEE0.dita">Privacy |
|
33 Controller</xref>r describe this situation in more detail.</p><codeblock xml:space="preserve">// Cancel a privacy response |
|
34 void CMyLbsPrivacyControllerObserver::CancelRequest(TUint aRequestId) |
|
35 { |
|
36 // aRequestId is the ID of a privacy request that was previously received |
|
37 iController->CancelNetworkLocationRequest(aRequestId); |
|
38 }</codeblock></section> |
|
39 </conbody></concept> |