|
1 /* |
|
2 * Copyright (c) 2010 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 positioning settings plugin helper private class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "possettingspluginhelper_p.h" |
|
20 #include "possettingspluginhelper.h" |
|
21 #include <epos_cposmodules.h> |
|
22 #include <lbs/epos_cposmoduleidlist.h> |
|
23 #include <featmgr.h> |
|
24 |
|
25 //--------------------------------------------------------------------- |
|
26 // PosSettingsPluginHelperPrivate::isPositionPsyAvailable() |
|
27 // (other items were commented in a header). |
|
28 //--------------------------------------------------------------------- |
|
29 bool PosSettingsPluginHelperPrivate::isPositionPsyAvailable() |
|
30 { |
|
31 TInt cnt = 0; |
|
32 TInt err2 = KErrGeneral; |
|
33 CPosModules* posModules; |
|
34 TRAPD(err1, posModules = CPosModules::OpenL();); |
|
35 if(!posModules) |
|
36 { |
|
37 User::Leave( KErrGeneral ); |
|
38 } |
|
39 else |
|
40 { |
|
41 TRAP(err2, |
|
42 CPosModuleIdList* idList = posModules->ModuleIdListLC(); |
|
43 cnt = idList->Count(); |
|
44 CleanupStack::PopAndDestroy( idList );); |
|
45 } |
|
46 if(err1==KErrNone && err2 ==KErrNone && cnt) //if no error and there |
|
47 return true; |
|
48 else |
|
49 return false; |
|
50 } |
|
51 |
|
52 //--------------------------------------------------------------------- |
|
53 // PosSettingsPluginHelperPrivate::isFeatureFlagEnabled() |
|
54 // (other items were commented in a header). |
|
55 //--------------------------------------------------------------------- |
|
56 bool PosSettingsPluginHelperPrivate::isFeatureFlagEnabled() |
|
57 { |
|
58 TBool flag = EFalse; |
|
59 TRAPD(err, |
|
60 FeatureManager::InitializeLibL(); |
|
61 if ( FeatureManager::FeatureSupported( KFeatureIdFfLocationsysuiHidePositioningMenu ) ) |
|
62 { |
|
63 flag = ETrue; |
|
64 } |
|
65 FeatureManager::UnInitializeLib(); |
|
66 ); |
|
67 if(err==KErrNone && flag) |
|
68 return true; |
|
69 else |
|
70 return false; |
|
71 } |
|
72 |
|
73 // End of file |