|
1 // Copyright (c) 2007-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 // |
|
15 |
|
16 /** |
|
17 @internalComponent |
|
18 @released |
|
19 */ |
|
20 |
|
21 #include "ssmuiproviderdll.h" |
|
22 #include "ssmpanic.h" |
|
23 #include <e32property.h> |
|
24 #include <f32file.h> |
|
25 |
|
26 const TUid KPSStartupUid = {0x2000E65E}; |
|
27 const TUid KSecurityPinNotifierUid = {0x2000E667}; |
|
28 const TUid KScreenOutputChannel = {0x10009D48}; |
|
29 const TUid KEmergencyCallPropertyCategory = {0x2001032C}; |
|
30 |
|
31 const TUint KEmergencyCallPropertyKey = 0x0101; |
|
32 const TUint KSimStatusPropertyKey = 0x0102; |
|
33 |
|
34 const TUid KSecurityStatusPropertyCategory = {0x2000E664}; |
|
35 |
|
36 const TUid KRFStatusPropertyCategory = {0x2000D75B}; |
|
37 const TUint KRFStatusPropertyKey = 0x2001D2A9; |
|
38 const TUid KValidateRTCPropertyCategory = {0x2000D75B}; |
|
39 const TUint KValidateRTCPropertyKey = 0x2001D2AB; |
|
40 |
|
41 _LIT(KTsyModuleName, "mm.tsy"); |
|
42 _LIT(KTsyPhoneName, "GsmPhone1"); |
|
43 |
|
44 CSsmUiSpecific::CSsmUiSpecific() |
|
45 : iReferenceCount(1) |
|
46 { |
|
47 } |
|
48 |
|
49 EXPORT_C CSsmUiSpecific::~CSsmUiSpecific() |
|
50 { |
|
51 } |
|
52 |
|
53 EXPORT_C TUid CSsmUiSpecific::StartupPSUid() |
|
54 { |
|
55 return KPSStartupUid; |
|
56 } |
|
57 |
|
58 EXPORT_C TUid CSsmUiSpecific::SecurityPinNotifierUid() |
|
59 { |
|
60 return KSecurityPinNotifierUid; |
|
61 } |
|
62 |
|
63 EXPORT_C TUint CSsmUiSpecific::EmergencyCallPropertyKey() |
|
64 { |
|
65 return KEmergencyCallPropertyKey; |
|
66 } |
|
67 |
|
68 EXPORT_C TUid CSsmUiSpecific::EmergencyCallPropertyCategory() |
|
69 { |
|
70 return KEmergencyCallPropertyCategory; |
|
71 } |
|
72 |
|
73 EXPORT_C TBool CSsmUiSpecific::IsSimSupported() |
|
74 { |
|
75 return ETrue; |
|
76 } |
|
77 |
|
78 EXPORT_C void CSsmUiSpecific::SetSecurityStatus(const TStrtSecurityStatus& aSecurityStatus) |
|
79 { |
|
80 iStrtSecurityStatus = aSecurityStatus; |
|
81 } |
|
82 |
|
83 EXPORT_C TStrtSecurityStatus CSsmUiSpecific::SecurityStatus() const |
|
84 { |
|
85 return iStrtSecurityStatus; |
|
86 } |
|
87 |
|
88 EXPORT_C CSsmUiSpecific* CSsmUiSpecific::InstanceL() |
|
89 { |
|
90 CSsmUiSpecific* self; |
|
91 |
|
92 //Check Tls data |
|
93 if (NULL == Dll::Tls()) |
|
94 { |
|
95 //Instantiate CSsmUiSpecific if TLS is null |
|
96 self = new (ELeave) CSsmUiSpecific(); |
|
97 CleanupStack::PushL(self); |
|
98 |
|
99 //Copy CSsmUiSpecific pointer in TLS |
|
100 User::LeaveIfError(Dll::SetTls(self)); |
|
101 CleanupStack::Pop(self); |
|
102 } |
|
103 else |
|
104 { |
|
105 //CSsmUiSpecific has already been instantiated |
|
106 self = static_cast<CSsmUiSpecific*>(Dll::Tls()); |
|
107 ++self->iReferenceCount; |
|
108 } |
|
109 return self; |
|
110 } |
|
111 |
|
112 EXPORT_C void CSsmUiSpecific::Release() |
|
113 { |
|
114 TAny* tlsPtr = Dll::Tls(); |
|
115 __ASSERT_DEBUG(NULL != tlsPtr, User::Panic(KPanicSsmUiSpecific, KErrNotFound)); |
|
116 |
|
117 CSsmUiSpecific* self = static_cast<CSsmUiSpecific*>(tlsPtr); |
|
118 if (0 == --self->iReferenceCount) |
|
119 { |
|
120 Dll::FreeTls(); |
|
121 delete self; |
|
122 } |
|
123 } |
|
124 |
|
125 EXPORT_C TUid CSsmUiSpecific::ScreenOutputChannelUid() |
|
126 { |
|
127 return KScreenOutputChannel; |
|
128 } |
|
129 |
|
130 EXPORT_C TUint CSsmUiSpecific::SimStatusPropertyKey() |
|
131 { |
|
132 return KSimStatusPropertyKey; |
|
133 } |
|
134 |
|
135 EXPORT_C TBool CSsmUiSpecific::IsSimStateChangeAllowed() |
|
136 { |
|
137 return ETrue; |
|
138 } |
|
139 |
|
140 EXPORT_C TBool CSsmUiSpecific::IsAmaStarterSupported() |
|
141 { |
|
142 return ETrue; |
|
143 } |
|
144 |
|
145 EXPORT_C HBufC* CSsmUiSpecific::GetTsyModuleNameL() |
|
146 { |
|
147 HBufC* tstModuleName = KTsyModuleName().AllocL(); |
|
148 return tstModuleName; |
|
149 } |
|
150 |
|
151 EXPORT_C TUid CSsmUiSpecific::StarterPSUid() |
|
152 { |
|
153 return KSecurityStatusPropertyCategory; |
|
154 } |
|
155 |
|
156 EXPORT_C HBufC* CSsmUiSpecific::PhoneTsyNameL() |
|
157 { |
|
158 HBufC* tsyPhoneName = KTsyPhoneName().AllocL(); |
|
159 return tsyPhoneName; |
|
160 } |
|
161 |
|
162 EXPORT_C TBool CSsmUiSpecific::IsSimPresent() |
|
163 { |
|
164 return ETrue; |
|
165 } |
|
166 |
|
167 EXPORT_C TBool CSsmUiSpecific::IsSimlessOfflineSupported() |
|
168 { |
|
169 return ETrue; |
|
170 } |
|
171 |
|
172 EXPORT_C TBool CSsmUiSpecific::IsNormalBoot() |
|
173 { |
|
174 return ETrue; |
|
175 } |
|
176 |
|
177 EXPORT_C TBool CSsmUiSpecific::IsSimChangedReset() |
|
178 { |
|
179 return ETrue; |
|
180 } |
|
181 |
|
182 EXPORT_C TUint CSsmUiSpecific::RFStatusPropertyKey() |
|
183 { |
|
184 return KRFStatusPropertyKey; |
|
185 } |
|
186 |
|
187 EXPORT_C TUid CSsmUiSpecific::RFStatusPropertyCategory() |
|
188 { |
|
189 return KRFStatusPropertyCategory; |
|
190 } |
|
191 EXPORT_C TUint CSsmUiSpecific::ValidateRTCPropertyKey() |
|
192 { |
|
193 return KValidateRTCPropertyKey; |
|
194 } |
|
195 |
|
196 EXPORT_C TUid CSsmUiSpecific::ValidateRTCPropertyCategory() |
|
197 { |
|
198 return KValidateRTCPropertyCategory; |
|
199 } |
|
200 |
|
201 EXPORT_C TInt CSsmUiSpecific::PhoneMemoryRootDriveId() |
|
202 { |
|
203 return EDriveC; |
|
204 } |
|
205 |