|
1 /* |
|
2 * Copyright (c) 2006, 2007 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: Implementation of Status Manager |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <e32base.h> |
|
21 #include <lbtstatuspskeys.h> |
|
22 #include "lbtstatusmanager.h" |
|
23 #include "lbtlogger.h" |
|
24 |
|
25 // ======== MEMBER FUNCTIONS ======== |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CLbtStatusManager::NewL |
|
29 // CLbtStatusManager instantiation method. |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 CLbtStatusManager* CLbtStatusManager::NewL() |
|
33 { |
|
34 CLbtStatusManager* self = new ( ELeave ) CLbtStatusManager; |
|
35 CleanupStack::PushL( self ); |
|
36 self->ConstructL(); |
|
37 CleanupStack::Pop(); |
|
38 return self; |
|
39 } |
|
40 |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // CLbtStatusManager::~CLbtStatusManager |
|
44 // Destructor |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 CLbtStatusManager::~CLbtStatusManager() |
|
48 { |
|
49 iStatusInfo.Close(); |
|
50 } |
|
51 |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // CLbtStatusManager::ReportLocationAcquisitionStatus |
|
55 // |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 void CLbtStatusManager::ReportLocationAcquisitionStatus( |
|
59 TAcquisitionStatus aStatus ) |
|
60 { |
|
61 TInt msg; |
|
62 if( KErrNone == aStatus ) |
|
63 { |
|
64 msg = iStatusInfo.Set( ELbtLocationTriggeringSupervisionSuccessful ); |
|
65 } |
|
66 else |
|
67 { |
|
68 msg = iStatusInfo.Set( ELbtLocationTriggeringSupervisionFailed ); |
|
69 } |
|
70 |
|
71 iLastLocAcqStatus = aStatus; |
|
72 if( KErrNone != msg ) |
|
73 { |
|
74 LOG1("Error updating status info:%d",msg); |
|
75 } |
|
76 } |
|
77 |
|
78 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // CLbtStatusManager::ReportLocationAcquisitionStatus |
|
81 // |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 TBool CLbtStatusManager::LocationAcqSuccess() |
|
85 { |
|
86 if( KErrNone == iLastLocAcqStatus ) |
|
87 { |
|
88 return ETrue; |
|
89 } |
|
90 return EFalse; |
|
91 } |
|
92 |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // CLbtStatusManager::CLbtStatusManager |
|
96 // Constructor |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 CLbtStatusManager::CLbtStatusManager() |
|
100 { |
|
101 } |
|
102 |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // CLbtStatusManager::ConstructL |
|
106 // 2nd phase constructor |
|
107 // ----------------------------------------------------------------------------- |
|
108 // |
|
109 void CLbtStatusManager::ConstructL() |
|
110 { |
|
111 User::LeaveIfError( iStatusInfo.Attach( |
|
112 KPSUidLbtStatusInformation, |
|
113 KLbtLocationTriggeringSupervisionStatus, |
|
114 EOwnerThread ) ); |
|
115 } |