author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 02 Feb 2010 00:45:40 +0200 | |
changeset 28 | 92cfb77afb61 |
parent 23 | 50974a8b132e |
child 44 | 0b68a1b0c15e |
permissions | -rw-r--r-- |
5 | 1 |
/* |
2 |
* Copyright (c) 2002 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 the License "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: CSysInfoService class implementation |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
19 |
#include <w32std.h> |
5 | 20 |
#include <hal.h> |
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
21 |
#include <featmgr.h> |
5 | 22 |
#include <bldvariant.hrh> |
23 |
#include <PtiEngine.h> |
|
24 |
#include <driveinfo.h> |
|
25 |
||
26 |
||
27 |
#include <centralrepository.h> |
|
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
28 |
#include <hwrmvibrasdkcrkeys.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
29 |
#include <settingsinternalcrkeys.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
30 |
#include <hwrmlightdomaincrkeys.h> |
5 | 31 |
#include <AknFepInternalCRKeys.h> |
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
32 |
#include <ir_sock.h> |
5 | 33 |
#include <btserversdkcrkeys.h> |
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
34 |
#include <sysutildomaincrkeys.h> |
5 | 35 |
|
36 |
#include <e32property.h> |
|
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
37 |
#include <hwrmdomainpskeys.h> |
5 | 38 |
#include <NetworkHandlingDomainPSKeys.h> |
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
39 |
#include <hwrmpowerstatesdkpskeys.h> |
5 | 40 |
#include <wlaninternalpskeys.h> |
41 |
#include <UikonInternalPSKeys.h> |
|
42 |
#include <btengsettings.h> |
|
43 |
||
44 |
#include <usbman.h> |
|
45 |
#include <AknsWallpaperUtils.h> |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
46 |
#include <AknUtils.h> |
5 | 47 |
|
48 |
#include "sysinfoservice.h" |
|
49 |
#include "sysinfo.h" |
|
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
50 |
#include "sysinfoutils.h" |
5 | 51 |
#include "entitykeys.h" |
52 |
#include "activerequests.h" |
|
53 |
#include "deviceinfo.h" |
|
54 |
#include "sysrange.h" |
|
55 |
||
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
56 |
#include <string.h> |
5 | 57 |
|
58 |
using namespace SysInfo; |
|
59 |
||
60 |
// CONSTANT DECLARATIONS |
|
61 |
const TInt KGranularity(2); |
|
62 |
const TInt KPhoneWlanMacAddressLength = 50; |
|
63 |
const TChar KPhoneWlanSeparator (':'); |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
64 |
const TUint KPrimaryCameraDisplayID = 2; |
5 | 65 |
_LIT(KWLanMACDataFormat, "%02x"); |
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
66 |
const TInt KPhoneLanguageLength = 20; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
67 |
const TInt KMimeTypeLength = 20; |
5 | 68 |
|
69 |
// -------------------------------------------------------------------- |
|
70 |
// CSysInfoService::CSysInfoService() |
|
71 |
// C++ default constructor. |
|
72 |
// -------------------------------------------------------------------- |
|
73 |
// |
|
74 |
EXPORT_C CSysInfoService::CSysInfoService():iFeatureManagerInitialized(EFalse) |
|
75 |
{ |
|
76 |
} |
|
77 |
||
78 |
// -------------------------------------------------------------------- |
|
79 |
// CSysInfoService::~CSysInfoService() |
|
80 |
// Destructor. |
|
81 |
// -------------------------------------------------------------------- |
|
82 |
// |
|
83 |
CSysInfoService::~CSysInfoService() |
|
84 |
{ |
|
85 |
//If initialized uninitialize. |
|
86 |
if(iFeatureManagerInitialized) |
|
87 |
FeatureManager::UnInitializeLib(); |
|
88 |
||
89 |
delete iDeviceInfo; |
|
90 |
||
91 |
// Cancel any ongoing asynchronous requests and |
|
92 |
// Deallocate resources. |
|
93 |
ActiveStore::ReleaseResources(); |
|
94 |
} |
|
95 |
||
96 |
// -------------------------------------------------------------------- |
|
97 |
// CSysInfoService::NewL() |
|
98 |
// Two-phased constructor. |
|
99 |
// -------------------------------------------------------------------- |
|
100 |
// |
|
101 |
EXPORT_C CSysInfoService* CSysInfoService::NewL () |
|
102 |
{ |
|
103 |
CSysInfoService* self = new (ELeave) CSysInfoService(); |
|
104 |
return self; |
|
105 |
} |
|
106 |
||
107 |
// -------------------------------------------------------------------- |
|
108 |
// CSysInfoService::SetInfoL() |
|
109 |
// Modifies the system attribute value specified in aRequest. |
|
110 |
// -------------------------------------------------------------------- |
|
111 |
// |
|
112 |
EXPORT_C void CSysInfoService::SetInfoL( const TDesC& aEntity, |
|
113 |
const TDesC& aKey, const CSysData* aInput ) |
|
114 |
{ |
|
115 |
if(!aInput) |
|
116 |
User::Leave(KErrArgument); |
|
117 |
||
118 |
if( !aEntity.CompareF(KGeneral) ) |
|
119 |
SetGeneralInfoL(aKey,aInput); |
|
120 |
else if( !aEntity.CompareF(KDisplay) ) |
|
121 |
SetDisplayInfoL(aKey,aInput); |
|
122 |
// Bluetooth and IR which require WriteDeviceData are not usergratable permissions, |
|
123 |
// hence this funtionality is not exposed currently. |
|
124 |
#ifdef _REQUIRE_WRITEDEVICEDATA_ |
|
125 |
else if( !aEntity.CompareF(KConnectivity) ) |
|
126 |
SetConnectivityInfoL(aKey,aInput); |
|
127 |
#endif |
|
128 |
else |
|
129 |
User::Leave(KErrNotFound); |
|
130 |
} |
|
131 |
||
132 |
// -------------------------------------------------------------------- |
|
133 |
// CSysInfoService::Cancel() |
|
134 |
// Cancels any outstanding requests and releases resources owned by them. |
|
135 |
// -------------------------------------------------------------------- |
|
136 |
// |
|
137 |
EXPORT_C void CSysInfoService::Cancel(TInt32 aTransID) |
|
138 |
{ |
|
139 |
ActiveStore::RemoveRequest(aTransID); |
|
140 |
} |
|
141 |
||
142 |
// -------------------------------------------------------------------- |
|
143 |
// CSysInfoService::SetConnectivityInfoL() |
|
144 |
// Modifies the Connectivity Entity key values. |
|
145 |
// -------------------------------------------------------------------- |
|
146 |
// |
|
147 |
void CSysInfoService::SetConnectivityInfoL(const TDesC& aKey, |
|
148 |
const CSysData* aInput) |
|
149 |
{ |
|
150 |
//In Connectivity bluetooth, Infrared takes input argument of type EStatus. |
|
151 |
if( CSysData::EStatus != aInput->DataType() ) |
|
152 |
User::Leave(KErrArgument); |
|
153 |
||
154 |
TInt inputStatus = ((CStatus*)aInput)->Status(); |
|
155 |
||
156 |
if( !aKey.CompareF(KBlueTooth) ) |
|
157 |
{ |
|
158 |
CBTEngSettings* BtSettings = CBTEngSettings::NewLC(); |
|
159 |
if( inputStatus == EOn) |
|
160 |
User::LeaveIfError(BtSettings->SetPowerState( EBTPowerOn )); |
|
161 |
else if(inputStatus == EOff) |
|
162 |
User::LeaveIfError(BtSettings->SetPowerState( EBTPowerOff )); |
|
163 |
else |
|
164 |
User::Leave(KErrArgument); |
|
165 |
CleanupStack::PopAndDestroy(BtSettings); |
|
166 |
} |
|
167 |
||
168 |
else if( !aKey.CompareF(KInfraRed) ) |
|
169 |
{ |
|
170 |
if(inputStatus == EOn) |
|
171 |
User::LeaveIfError(RProperty::Set(KIrdaPropertyCategory, |
|
172 |
KIrdaStatus,TIrdaStatusCodes::EIrLoaded)); |
|
173 |
else if(inputStatus == EOff) |
|
174 |
User::LeaveIfError(RProperty::Set(KIrdaPropertyCategory, |
|
175 |
KIrdaStatus,TIrdaStatusCodes::EIrUnloaded)); |
|
176 |
else |
|
177 |
User::Leave(KErrArgument); |
|
178 |
} |
|
179 |
else |
|
180 |
User::Leave(KErrNotFound); |
|
181 |
} |
|
182 |
||
183 |
// -------------------------------------------------------------------- |
|
184 |
// CSysInfoService::SetGeneralInfoL() |
|
185 |
// Modifies the General Entity key values. |
|
186 |
// -------------------------------------------------------------------- |
|
187 |
// |
|
188 |
void CSysInfoService::SetGeneralInfoL(const TDesC& aKey, const CSysData* aInput) |
|
189 |
{ |
|
190 |
// for all General Entity keys input must be of type EStatus. |
|
191 |
if( aInput->DataType() != CSysData::EStatus ) |
|
192 |
User::Leave(KErrArgument); |
|
193 |
||
194 |
TInt inStatus = ((CStatus*)aInput)->Status(); |
|
195 |
||
196 |
if( !aKey.CompareF(KInputLanguage) ) |
|
197 |
{ |
|
198 |
CPtiEngine* PtiEngine; |
|
199 |
PtiEngine = CPtiEngine::NewL(); |
|
200 |
CleanupStack::PushL(PtiEngine); |
|
201 |
User::LeaveIfError(PtiEngine->ActivateLanguageL(inStatus)); |
|
202 |
CleanupStack::PopAndDestroy(PtiEngine); |
|
203 |
RepositoryUtil::SetRepositoryKeyL(KCRUidAknFep, |
|
204 |
KAknFepInputTxtLang,inStatus); |
|
205 |
} |
|
206 |
else if( !aKey.CompareF(KPridictiveText) ) |
|
207 |
{ |
|
208 |
if( EEnabled == inStatus || EDisabled == inStatus ) |
|
209 |
RepositoryUtil::SetRepositoryKeyL(KCRUidAknFep, |
|
210 |
KAknFepPredTxtFlag,inStatus); |
|
211 |
else |
|
212 |
User::Leave(KErrArgument); |
|
213 |
} |
|
214 |
else if( !aKey.CompareF(KVibraActive) ) |
|
215 |
{ |
|
216 |
if( EEnabled == inStatus || EDisabled == inStatus ) |
|
217 |
RepositoryUtil::SetRepositoryKeyL(KCRUidVibraCtrl, |
|
218 |
KVibraCtrlProfileVibraEnabled,inStatus); |
|
219 |
else |
|
220 |
User::Leave(KErrArgument); |
|
221 |
} |
|
222 |
else |
|
223 |
User::Leave(KErrNotFound); |
|
224 |
} |
|
225 |
||
226 |
// -------------------------------------------------------------------- |
|
227 |
// CSysInfoService::SetDisplayInfoL() |
|
228 |
// Modifies the Display Entity key values. |
|
229 |
// -------------------------------------------------------------------- |
|
230 |
// |
|
231 |
void CSysInfoService::SetDisplayInfoL(const TDesC& aKey, const CSysData* aInput) |
|
232 |
{ |
|
233 |
// Input validation. |
|
234 |
// For wallpaper input type must be EStingData and |
|
235 |
// for others keys input type must be EStatus. |
|
236 |
if( !aKey.CompareF(KWallpaper) ) |
|
237 |
{ |
|
238 |
if(aInput->DataType() != CSysData::EStringData) |
|
239 |
User::Leave(KErrArgument); |
|
240 |
} |
|
241 |
else if( aInput->DataType() != CSysData::EStatus ) |
|
242 |
User::Leave(KErrArgument); |
|
243 |
||
244 |
TInt inputStatus = 0; |
|
245 |
TPtrC inputString; |
|
246 |
//Read Input data into InputStatus, InputString. |
|
247 |
if( !aKey.CompareF(KWallpaper) ) |
|
248 |
{ |
|
249 |
((CStringData*)aInput)->StringData(inputString); |
|
250 |
} |
|
251 |
else |
|
252 |
{ |
|
253 |
inputStatus = ((CStatus*)aInput)->Status(); |
|
254 |
inputStatus = inputStatus; |
|
255 |
} |
|
256 |
||
257 |
//go thru Display entity keys. |
|
258 |
// Display Entity keys requiring WriteDeviceData are commented currently as these are not |
|
259 |
// usergrantable permissions. |
|
260 |
#ifdef _REQUIRE_WRITEDEVICEDATA_ |
|
261 |
if( !aKey.CompareF(KBrightness) ) |
|
262 |
{ |
|
263 |
if ( KBrightnessMax < inputStatus || KBrightnessMin > inputStatus ) |
|
264 |
User::Leave(KErrArgument); |
|
265 |
||
266 |
RepositoryUtil::SetRepositoryKeyL(KCRUidLightSettings, |
|
267 |
KLightIntensity,inputStatus); |
|
268 |
} |
|
269 |
else if( !aKey.CompareF(KScreenSaverTimeOut) ) |
|
270 |
{ |
|
271 |
if ( KScreenSaverTimeoutMax < inputStatus || |
|
272 |
KScreenSaverTimeoutMin > inputStatus ) |
|
273 |
User::Leave(KErrArgument); |
|
274 |
||
275 |
RepositoryUtil::SetRepositoryKeyL(KCRUidPersonalizationSettings, |
|
276 |
KSettingsScreenSaverPeriod,inputStatus); |
|
277 |
} |
|
278 |
else if( !aKey.CompareF(KAutoLockTime) ) |
|
279 |
{ |
|
280 |
if ( KAutoLockTimeoutMax < inputStatus || |
|
281 |
KAutoLockTimeoutMin > inputStatus ) |
|
282 |
User::Leave(KErrArgument); |
|
283 |
||
284 |
RepositoryUtil::SetRepositoryKeyL(KCRUidSecuritySettings, |
|
285 |
KSettingsAutoLockTime,inputStatus); |
|
286 |
} |
|
287 |
else if( !aKey.CompareF(KKeyGaurdTime) ) |
|
288 |
{ |
|
289 |
if ( KKeyGaurdTimeoutMax < inputStatus || |
|
290 |
KKeyGaurdTimeoutMin > inputStatus ) |
|
291 |
User::Leave(KErrArgument); |
|
292 |
||
293 |
RepositoryUtil::SetRepositoryKeyL(KCRUidSecuritySettings, |
|
294 |
KSettingsAutomaticKeyguardTime,inputStatus); |
|
295 |
} |
|
296 |
else if( !aKey.CompareF(KLightTimeOut) ) |
|
297 |
{ |
|
298 |
if ( KLightTimeoutMax < inputStatus || |
|
299 |
KLightTimeoutMin > inputStatus ) |
|
300 |
User::Leave(KErrArgument); |
|
301 |
||
302 |
RepositoryUtil::SetRepositoryKeyL(KCRUidLightSettings, |
|
303 |
KDisplayLightsTimeout,inputStatus); |
|
304 |
} |
|
305 |
#endif |
|
306 |
if( !aKey.CompareF(KWallpaper) ) |
|
307 |
{ |
|
308 |
User::LeaveIfError( |
|
309 |
AknsWallpaperUtils::SetIdleWallpaper(inputString,NULL,0)); |
|
310 |
} |
|
311 |
else |
|
312 |
User::Leave(KErrNotFound); |
|
313 |
} |
|
314 |
||
315 |
// -------------------------------------------------------------------- |
|
316 |
// CSysInfoService::GetInfoL() SYNC |
|
317 |
// Retrives the specified attribute value. |
|
318 |
// aOutput contains attribute value. |
|
319 |
// -------------------------------------------------------------------- |
|
320 |
// |
|
321 |
EXPORT_C void CSysInfoService::GetInfoL( const TDesC& aEntity, const TDesC& aKey, |
|
322 |
CSysData*& aOutput,const CSysData* aInput ) |
|
323 |
{ |
|
324 |
// retrieve data based Entity |
|
325 |
if( !aEntity.CompareF(KNetwork) ) |
|
326 |
GetNetworkInfoL(aKey,aOutput); |
|
327 |
||
328 |
else if( !aEntity.CompareF(KBattery) ) |
|
329 |
GetBatteryInfoL(aKey,aOutput); |
|
330 |
||
331 |
else if( !aEntity.CompareF(KConnectivity) ) |
|
332 |
GetConnectivittyInfoL(aKey,aOutput); |
|
333 |
||
334 |
else if( !aEntity.CompareF(KDisplay) ) |
|
335 |
GetDisplayInfoL(aKey,aOutput); |
|
336 |
||
337 |
else if( !aEntity.CompareF(KGeneral) ) |
|
338 |
GetGeneralInfoL(aKey,aOutput); |
|
339 |
||
340 |
else if( !aEntity.CompareF(KMemory) ) |
|
341 |
GetMemoryInfoL(aKey,aInput,aOutput); |
|
342 |
||
343 |
else if( !aEntity.CompareF(KDevice) ) |
|
344 |
GetDeviceInfoL(aKey,aOutput); |
|
345 |
||
346 |
else if( !aEntity.CompareF(KFeatures) ) |
|
347 |
GetFeatureInfoL(aKey,aOutput); |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
348 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
349 |
else if ( !aEntity.CompareF( KCameraInfo ) ) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
350 |
GetCameraDataL( aKey,aOutput ); |
5 | 351 |
|
352 |
else |
|
353 |
User::Leave(KErrNotFound); |
|
354 |
} |
|
355 |
||
356 |
// -------------------------------------------------------------------- |
|
357 |
// CSysInfoService::GetInfoL() ASYNC |
|
358 |
// Creates an appropriate active object to serve the purpose of the |
|
359 |
// specified system attribute. Adds created active object to |
|
360 |
// Active Store. |
|
361 |
// -------------------------------------------------------------------- |
|
362 |
// |
|
363 |
EXPORT_C void CSysInfoService::GetInfoL( const TDesC& aEntity, const TDesC& aKey, |
|
364 |
TInt32 aTransID, ISystemObserver* aCallback, |
|
365 |
const CSysData* aInput ) |
|
366 |
{ |
|
367 |
if(!aCallback) |
|
368 |
User::Leave(KErrGeneral); |
|
369 |
||
370 |
TSysRequest systemRequest(aEntity,aKey,aInput,aTransID,aCallback, |
|
371 |
TSysRequest::EASyncONESHOT); |
|
372 |
||
373 |
CActiveRequest* activeRequestObj; |
|
374 |
CActiveRequest::CreateActiveRequestL(systemRequest,activeRequestObj); |
|
375 |
||
376 |
//place handle on cleanupstack. |
|
377 |
CleanupStack::PushL(activeRequestObj); |
|
378 |
//Add request handle to active store. |
|
379 |
ActiveStore::AddRequestL(activeRequestObj); |
|
380 |
CleanupStack::Pop(activeRequestObj); |
|
381 |
//Issue request. |
|
382 |
TInt err = activeRequestObj->Request(); |
|
383 |
||
384 |
if( KErrNone != err) |
|
385 |
{ |
|
386 |
ActiveStore::RemoveRequest(aTransID); |
|
387 |
User::Leave(err); |
|
388 |
} |
|
389 |
} |
|
390 |
||
391 |
// -------------------------------------------------------------------- |
|
392 |
// CSysInfoService::GetNotificationL() ASYNC |
|
393 |
// Creates an appropriate active object to serve the purpose of the |
|
394 |
// specified system attribute. Adds created active object to |
|
395 |
// Active Store. |
|
396 |
// -------------------------------------------------------------------- |
|
397 |
// |
|
398 |
EXPORT_C void CSysInfoService::GetNotificationL( const TDesC& aEntity, |
|
399 |
const TDesC& aKey, TInt32 aTransID, |
|
400 |
ISystemObserver* aCallback, |
|
401 |
const CSysData* aInput ) |
|
402 |
{ |
|
403 |
if(!aCallback) |
|
404 |
User::Leave(KErrGeneral); |
|
405 |
||
406 |
TSysRequest systemRequest(aEntity,aKey,aInput,aTransID,aCallback, |
|
407 |
TSysRequest::ENotification); |
|
408 |
||
409 |
CActiveRequest* activeRequestObj; |
|
410 |
CActiveRequest::CreateActiveRequestL(systemRequest,activeRequestObj); |
|
411 |
||
412 |
//place handle on cleanupstack. |
|
413 |
CleanupStack::PushL(activeRequestObj); |
|
414 |
||
415 |
//Add request handle to active store. |
|
416 |
ActiveStore::AddRequestL(activeRequestObj); |
|
417 |
||
418 |
//Issue request. |
|
419 |
TInt err = activeRequestObj->Request(); |
|
420 |
||
421 |
if( KErrNone != err) |
|
422 |
{ |
|
423 |
//remove request handle on cleanup stack. |
|
424 |
CleanupStack::Pop(activeRequestObj); |
|
425 |
ActiveStore::RemoveRequest(aTransID); |
|
426 |
User::Leave(err); |
|
427 |
} |
|
428 |
||
429 |
//remove request handle on cleanup stack. |
|
430 |
CleanupStack::Pop(activeRequestObj); |
|
431 |
} |
|
432 |
||
433 |
// -------------------------------------------------------------------- |
|
434 |
// CSysInfoService::GetNetworkInfoL() |
|
435 |
// Retrives network related synchronous keys information. |
|
436 |
// returns CSysData. |
|
437 |
// -------------------------------------------------------------------- |
|
438 |
// |
|
439 |
void CSysInfoService::GetNetworkInfoL(TPtrC aKey,CSysData*& aSysData) |
|
440 |
{ |
|
441 |
TInt status = 0; |
|
442 |
if ( !aKey.CompareF(KRegistrationStatus) ) |
|
443 |
{ |
|
444 |
User::LeaveIfError(RProperty::Get(KPSUidNetworkInfo, |
|
445 |
KNWRegistrationStatus,status)); |
|
446 |
} |
|
28
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
447 |
else if( !aKey.CompareF(SysInfo::KNetworkMode) ) |
5 | 448 |
{ |
449 |
User::LeaveIfError(RProperty::Get(KPSUidNetworkInfo, |
|
450 |
KNWTelephonyNetworkMode,status)); |
|
451 |
} |
|
452 |
else |
|
453 |
{ |
|
454 |
User::Leave(KErrNotFound); |
|
455 |
} |
|
456 |
aSysData = CStatus::NewL((status-1)); |
|
457 |
} |
|
458 |
||
459 |
// -------------------------------------------------------------------- |
|
460 |
// CSysInfoService::GetBatteryInfoL() |
|
461 |
// Retrives battery related synchronous keys information. |
|
462 |
// On return aSysData consists of key value. |
|
463 |
// -------------------------------------------------------------------- |
|
464 |
// |
|
465 |
void CSysInfoService::GetBatteryInfoL(TPtrC aKey,CSysData*& aSysData) |
|
466 |
{ |
|
467 |
TInt status = 0; |
|
468 |
if( !aKey.CompareF(KChargingStatus) ) |
|
469 |
{ |
|
470 |
TInt chargeStatus = 0; |
|
471 |
User::LeaveIfError(RProperty::Get(KPSUidHWRMPowerState, |
|
472 |
KHWRMChargingStatus,chargeStatus)); |
|
473 |
// ChargeStatus is manupulated to give only these states Charging, |
|
474 |
// NotCharging and Unknown |
|
475 |
if ( EChargingStatusCharging == chargeStatus || |
|
476 |
EChargingStatusAlmostComplete == chargeStatus || |
|
477 |
EChargingStatusChargingContinued == chargeStatus ) |
|
478 |
status = ECharging; |
|
479 |
else if( EChargingStatusNotConnected == chargeStatus || |
|
480 |
EChargingStatusNotCharging == chargeStatus || |
|
481 |
EChargingStatusChargingComplete == chargeStatus ) |
|
482 |
status = ENotCharging; |
|
483 |
else |
|
484 |
status = EUnknown; |
|
485 |
} |
|
486 |
else |
|
487 |
User::Leave(KErrNotFound); |
|
488 |
aSysData = CStatus::NewL(status); |
|
489 |
} |
|
490 |
// -------------------------------------------------------------------- |
|
491 |
// CSysInfoService::GetMemoryInfoL() |
|
492 |
// Retrives memory related synchronous keys information. |
|
493 |
// On return aSysData consists of SA value. |
|
494 |
// -------------------------------------------------------------------- |
|
495 |
// |
|
496 |
void CSysInfoService::GetMemoryInfoL(const TDesC& aKey, const CSysData* aInput, |
|
497 |
CSysData*& aOutput) |
|
498 |
{ |
|
499 |
RFs Fs; |
|
500 |
CleanupClosePushL(Fs); |
|
501 |
User::LeaveIfError(Fs.Connect()); |
|
502 |
||
503 |
if ( !aKey.CompareF(KListDrives) ) |
|
504 |
{ |
|
505 |
TDriveList drives; |
|
506 |
User::LeaveIfError(Fs.DriveList(drives)); |
|
507 |
aOutput = CDriveList::NewL(drives); |
|
508 |
} |
|
509 |
else if( !aKey.CompareF(KDriveInfo) ) |
|
510 |
{ |
|
511 |
CDriveInfo* inputDrvInfo=NULL; |
|
512 |
if( aInput && CSysData::EDriveInfo == aInput->DataType()) |
|
513 |
inputDrvInfo = (CDriveInfo*) aInput; |
|
514 |
else |
|
515 |
User::Leave(KErrArgument); |
|
516 |
||
517 |
TInt drvNumber = inputDrvInfo->DriveNumber(); |
|
518 |
if ( !Fs.IsValidDrive(drvNumber) ) |
|
519 |
User::Leave(KErrNotFound); |
|
520 |
||
521 |
TVolumeInfo volumeInfo; |
|
522 |
User::LeaveIfError(Fs.Volume(volumeInfo,drvNumber)); |
|
523 |
aOutput = CDriveInfo::NewL(drvNumber,volumeInfo); |
|
524 |
} |
|
525 |
else if( !aKey.CompareF(KMemoryCard) ) |
|
526 |
{ |
|
527 |
TInt memoryCardState (-1); |
|
528 |
TInt defaultMemoryCard( 0 ); |
|
529 |
User::LeaveIfError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, defaultMemoryCard ) ); |
|
530 |
TUint driveStatus( 0 ); |
|
531 |
User::LeaveIfError( DriveInfo::GetDriveStatus( Fs, defaultMemoryCard, driveStatus ) ); |
|
532 |
if( driveStatus & DriveInfo::EDrivePresent ) |
|
533 |
memoryCardState = ETrue; |
|
534 |
else |
|
535 |
memoryCardState = EFalse; |
|
536 |
aOutput = CStatus::NewL(memoryCardState); |
|
537 |
||
538 |
} |
|
539 |
else |
|
540 |
User::Leave(KErrNotFound); |
|
541 |
||
542 |
CleanupStack::PopAndDestroy(&Fs); |
|
543 |
} |
|
544 |
||
545 |
// -------------------------------------------------------------------- |
|
546 |
// CSysInfoService::GetFeatureInfoL() |
|
547 |
// Retrives feature related synchronous keys information. |
|
548 |
// On return aSysData consists of key value. |
|
549 |
// -------------------------------------------------------------------- |
|
550 |
// |
|
551 |
void CSysInfoService::GetFeatureInfoL(TPtrC aKey,CSysData*& aSysData) |
|
552 |
{ |
|
553 |
TInt featureID(0); |
|
554 |
||
555 |
// Get the Feature ID to query feature manager. |
|
556 |
if( !aKey.CompareF(KBlueTooth) ) |
|
557 |
featureID = KFeatureIdBt; |
|
558 |
else if( !aKey.CompareF(KInfraRed) ) |
|
559 |
featureID = KFeatureIdIrda; |
|
560 |
else if( !aKey.CompareF(KCamera) ) |
|
561 |
featureID = KFeatureIdCamera; |
|
562 |
else if( !aKey.CompareF(KMemoryCard) ) |
|
563 |
featureID = KFeatureIdMmc; |
|
564 |
else if( !aKey.CompareF(KFMRadio) ) |
|
565 |
featureID = KFeatureIdFmRadio; |
|
566 |
else if( !aKey.CompareF(KQwerty) ) |
|
567 |
featureID = KFeatureIdQwertyInput; |
|
568 |
else if( !aKey.CompareF(KWLan) ) |
|
569 |
featureID = KFeatureIdProtocolWlan; |
|
570 |
else if( !aKey.CompareF(KUsb) ) |
|
571 |
featureID = KFeatureIdUsb; |
|
572 |
else if( !aKey.CompareF(KPen) ) |
|
573 |
featureID = KFeatureIdPenSupport; |
|
574 |
else if( !aKey.CompareF(KLED) ) |
|
575 |
featureID = KFeatureIdPenSupport; |
|
576 |
else if( !aKey.CompareF(KCoverUI) ) |
|
577 |
featureID = KFeatureIdCoverDisplay; |
|
578 |
else if( !aKey.CompareF(KSideVolumeKeys) ) |
|
579 |
featureID = KFeatureIdSideVolumeKeys; |
|
580 |
else if( !aKey.CompareF(KVibra) ) |
|
581 |
featureID = KFeatureIdVibra; |
|
28
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
582 |
else if( !aKey.CompareF(KVideoDecoder) ) |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
583 |
{ |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
584 |
MMMFDevVideoPlayObserverImpl obsImpl; |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
585 |
RArray<TUid> aDecoders; |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
586 |
CMMFDevVideoPlay *videoPlay=CMMFDevVideoPlay::NewL(obsImpl); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
587 |
//place object on cleanupstack. |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
588 |
CleanupStack::PushL(videoPlay); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
589 |
|
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
590 |
videoPlay->GetDecoderListL(aDecoders); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
591 |
CVideoDecDataList *decDataList=CVideoDecDataList::NewL(); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
592 |
for(int i=0;i<aDecoders.Count();i++) |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
593 |
{ |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
594 |
CVideoDecoderInfo *decoderInfo=videoPlay->VideoDecoderInfoLC(aDecoders[i]); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
595 |
CVideoDecDataList::CVideoDecData *data=new CVideoDecDataList::CVideoDecData(decoderInfo->Manufacturer(),decoderInfo->Identifier(),decoderInfo->MaxBitrate(),decoderInfo->Accelerated(),decoderInfo->Version().Name()); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
596 |
decDataList->AppendL(data); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
597 |
CleanupStack::PopAndDestroy(decoderInfo); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
598 |
} |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
599 |
|
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
600 |
aSysData = decDataList; |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
601 |
CleanupStack::PopAndDestroy(videoPlay); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
602 |
return; |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
603 |
} |
5 | 604 |
else |
605 |
User::Leave(KErrNotFound); |
|
606 |
||
607 |
//Initialize feature manager if not. |
|
608 |
if (!iFeatureManagerInitialized) |
|
609 |
{ |
|
610 |
FeatureManager::InitializeLibL(); |
|
611 |
iFeatureManagerInitialized = ETrue; |
|
612 |
} |
|
613 |
||
614 |
TBool isSupported = ETrue; |
|
615 |
// LED feature is read using HAL others feature manager. |
|
616 |
if( !aKey.CompareF(KLED) ) |
|
617 |
{ |
|
618 |
TInt NumLEDs(0); |
|
619 |
TInt Err = HAL::Get(HALData::ELEDs,NumLEDs); |
|
620 |
if( KErrNone == Err ) |
|
621 |
isSupported = ETrue; |
|
622 |
else if( KErrNotSupported == Err ) |
|
623 |
isSupported = EFalse; |
|
624 |
else |
|
625 |
User::Leave(Err); |
|
626 |
} |
|
627 |
else |
|
628 |
{ |
|
629 |
isSupported = FeatureManager::FeatureSupported(featureID); |
|
630 |
} |
|
631 |
||
632 |
aSysData = CStatus::NewL(isSupported); |
|
633 |
} |
|
634 |
||
635 |
// -------------------------------------------------------------------- |
|
636 |
// CSysInfoService::GetConnectivityInfoL() |
|
637 |
// Retrives Connectivity related synchronous keys information. |
|
638 |
// On return aSysData consists of key value. |
|
639 |
// -------------------------------------------------------------------- |
|
640 |
// |
|
641 |
void CSysInfoService::GetConnectivittyInfoL(TPtrC aKey,CSysData*& aSysData) |
|
642 |
{ |
|
643 |
if ( !aKey.CompareF(KBlueTooth) ) |
|
644 |
{ |
|
645 |
TInt bTPower = 0; |
|
646 |
RepositoryUtil::GetRepositoryKeyL(KCRUidBluetoothPowerState, |
|
647 |
KBTPowerState,bTPower); |
|
648 |
aSysData = CStatus::NewL(bTPower); |
|
649 |
} |
|
650 |
else if( !aKey.CompareF(KInfraRed) ) |
|
651 |
{ |
|
652 |
TInt IRStatus(0); |
|
653 |
TInt status(0); |
|
654 |
User::LeaveIfError(RProperty::Get(KIrdaPropertyCategory, |
|
655 |
KIrdaStatus,IRStatus)); |
|
656 |
||
657 |
// Map all possible Infra red status values to ON, OFF and UnKnown states. |
|
658 |
if ( TIrdaStatusCodes::EIrLoaded == IRStatus || |
|
659 |
TIrdaStatusCodes::EIrDiscoveredPeer == IRStatus || |
|
660 |
TIrdaStatusCodes::EIrBlocked == IRStatus || |
|
661 |
TIrdaStatusCodes::EIrLostPeer == IRStatus || |
|
662 |
TIrdaStatusCodes::EIrDisconnected == IRStatus ) |
|
663 |
status = EOn; |
|
664 |
else if( TIrdaStatusCodes::EIrUnloaded == IRStatus ) |
|
665 |
status = EOff; |
|
666 |
else |
|
667 |
status = EUnknown; |
|
668 |
||
669 |
aSysData = CStatus::NewL(status); |
|
670 |
} |
|
671 |
else if( !aKey.CompareF(KWLanMacAddress) ) |
|
672 |
{ |
|
673 |
//result format 00:18:0f:1e:96:a2. |
|
674 |
TBuf8<KPSWlanMacAddressLength> DesC8AddrText; |
|
675 |
TBuf<KPhoneWlanMacAddressLength> FormatedMacAddress; |
|
676 |
||
677 |
User::LeaveIfError(RProperty::Get(KPSUidWlan, |
|
678 |
KPSWlanMacAddress,DesC8AddrText)); |
|
679 |
for ( TInt i=0; i < KPSWlanMacAddressLength; i++ ) |
|
680 |
{ |
|
681 |
// Set separator |
|
682 |
if( i > 0 ) |
|
683 |
FormatedMacAddress.Append(KPhoneWlanSeparator); |
|
684 |
||
685 |
// Set data |
|
686 |
TBuf<10> FormatText; |
|
687 |
FormatText.Format(KWLanMACDataFormat,DesC8AddrText[i]); |
|
688 |
FormatedMacAddress.Append(FormatText); |
|
689 |
} |
|
690 |
aSysData = CStringData::NewL(FormatedMacAddress); |
|
691 |
} |
|
28
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
692 |
else if( !aKey.CompareF(KWirelessConnSupport) ) |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
693 |
{ |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
694 |
CDesCArray* connTypesDesArray; |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
695 |
connTypesDesArray = new (ELeave) CDesCArrayFlat(4); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
696 |
CleanupStack::PushL(connTypesDesArray); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
697 |
|
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
698 |
//Initialize the feature manager if not already done. |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
699 |
if (!iFeatureManagerInitialized) |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
700 |
{ |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
701 |
FeatureManager::InitializeLibL(); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
702 |
iFeatureManagerInitialized = ETrue; |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
703 |
} |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
704 |
|
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
705 |
if(FeatureManager::FeatureSupported(KFeatureIdBt)) |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
706 |
{ |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
707 |
connTypesDesArray->AppendL(KBT); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
708 |
} |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
709 |
if(FeatureManager::FeatureSupported(KFeatureIdIrda)) |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
710 |
{ |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
711 |
connTypesDesArray->AppendL(KIrda); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
712 |
} |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
713 |
if(FeatureManager::FeatureSupported(KFeatureIdProtocolWlan)) |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
714 |
{ |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
715 |
connTypesDesArray->AppendL(KWlan); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
716 |
} |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
717 |
if(FeatureManager::FeatureSupported(KFeatureIdProtocolGsm)) |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
718 |
{ |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
719 |
connTypesDesArray->AppendL(KGsm); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
720 |
} |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
721 |
if(FeatureManager::FeatureSupported(KFeatureIdProtocolWcdma)) |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
722 |
{ |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
723 |
connTypesDesArray->AppendL(KWcdma); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
724 |
} |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
725 |
if(FeatureManager::FeatureSupported(KFeatureIdProtocolCdma)) |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
726 |
{ |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
727 |
connTypesDesArray->AppendL(KCdma); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
728 |
} |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
729 |
|
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
730 |
//connTypesDesArray ownership passed to CStringList. |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
731 |
aSysData = CStringList::NewL(connTypesDesArray); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
732 |
CleanupStack::Pop(connTypesDesArray); |
92cfb77afb61
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
733 |
} |
5 | 734 |
else |
735 |
User::Leave(KErrNotFound); |
|
736 |
} |
|
737 |
||
738 |
// -------------------------------------------------------------------- |
|
739 |
// CSysInfoService::GetGeneralInfoL() |
|
740 |
// Retrives General Entity related synchronous keys information. |
|
741 |
// On return aSysData consists of key value. |
|
742 |
// -------------------------------------------------------------------- |
|
743 |
// |
|
744 |
void CSysInfoService::GetGeneralInfoL(TPtrC aKey,CSysData*& aSysData) |
|
745 |
{ |
|
746 |
if( !aKey.CompareF(KConnectedAccessories) ) |
|
747 |
{ |
|
748 |
aSysData = CAccList::NewL(); |
|
749 |
} |
|
750 |
else if( !aKey.CompareF(KInputLanguage) ) |
|
751 |
{ |
|
752 |
TInt inputLang = 0; |
|
753 |
RepositoryUtil::GetRepositoryKeyL(KCRUidAknFep, |
|
754 |
KAknFepInputTxtLang,inputLang); |
|
755 |
aSysData = CStatus::NewL(inputLang); |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
756 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
757 |
else if ( !aKey.CompareF( KDisplayLanguage ) ) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
758 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
759 |
HBufC* phoneLang = NULL; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
760 |
TBuf<KPhoneLanguageLength> language; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
761 |
TRAP_IGNORE(phoneLang = AknLangUtils::DisplayLanguageTagL()); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
762 |
language.Copy( phoneLang->Des() ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
763 |
delete phoneLang; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
764 |
aSysData = CStringData::NewL( language ); |
5 | 765 |
} |
766 |
else if( !aKey.CompareF(KSupportedLanguages) ) |
|
767 |
{ |
|
768 |
aSysData = CLanguageList::NewL(); |
|
769 |
} |
|
770 |
else if( !aKey.CompareF(KPridictiveText) ) |
|
771 |
{ |
|
772 |
TInt pridictiveText =0; |
|
773 |
RepositoryUtil::GetRepositoryKeyL(KCRUidAknFep, |
|
774 |
KAknFepPredTxtFlag,pridictiveText); |
|
775 |
aSysData = CStatus::NewL(pridictiveText); |
|
776 |
} |
|
777 |
else if( !aKey.CompareF(KVibraActive) ) |
|
778 |
{ |
|
779 |
TInt vibraState =0; |
|
780 |
RepositoryUtil::GetRepositoryKeyL(KCRUidVibraCtrl, |
|
781 |
KVibraCtrlProfileVibraEnabled,vibraState); |
|
782 |
aSysData = CStatus::NewL(vibraState); |
|
783 |
} |
|
784 |
else if( !aKey.CompareF(KFlipStatus) ) |
|
785 |
{ |
|
786 |
TInt flipState = 0; |
|
787 |
User::LeaveIfError(RProperty::Get(KPSUidHWRM, |
|
788 |
KHWRMFlipStatus,flipState)); |
|
789 |
if (flipState == EPSHWRMFlipOpen) |
|
790 |
flipState = EOpen; |
|
791 |
else if (flipState == EPSHWRMFlipClosed) |
|
792 |
flipState = EClosed; |
|
793 |
else |
|
794 |
flipState = EUnknown; |
|
795 |
||
796 |
aSysData = CStatus::NewL(flipState); |
|
797 |
} |
|
798 |
else if( !aKey.CompareF(KGripStatus) ) |
|
799 |
{ |
|
800 |
TInt gripState = 0; |
|
801 |
User::LeaveIfError(RProperty::Get(KPSUidHWRM, |
|
802 |
KHWRMGripStatus,gripState)); |
|
803 |
if (gripState == EPSHWRMGripOpen) |
|
804 |
gripState = EOpen; |
|
805 |
else if (gripState == EPSHWRMGripClosed) |
|
806 |
gripState = EClosed; |
|
807 |
else |
|
808 |
gripState = EUnknown; |
|
809 |
||
810 |
aSysData = CStatus::NewL(gripState); |
|
811 |
} |
|
812 |
else if( !aKey.CompareF(KAvailableUSBModes) ) |
|
813 |
{ |
|
814 |
GetAvailableUsbModesL(aSysData); |
|
815 |
} |
|
816 |
else if( !aKey.CompareF(KActiveUSBMode) ) |
|
817 |
{ |
|
818 |
RUsb usbsessn; |
|
819 |
||
820 |
CleanupClosePushL(usbsessn); |
|
821 |
User::LeaveIfError(usbsessn.Connect()); |
|
822 |
TInt activePersonality = 0; |
|
823 |
User::LeaveIfError(usbsessn.GetCurrentPersonalityId(activePersonality)); |
|
824 |
HBufC* activeUsbMode = NULL; |
|
825 |
User::LeaveIfError(usbsessn.GetDescription(activePersonality,activeUsbMode)); |
|
826 |
aSysData = CStringData::NewL(*activeUsbMode); |
|
827 |
CleanupStack::PopAndDestroy(&usbsessn); |
|
828 |
} |
|
829 |
else |
|
830 |
User::Leave(KErrNotFound); |
|
831 |
} |
|
832 |
||
833 |
// -------------------------------------------------------------------- |
|
834 |
// CSysInfoService::GetDisplayInfoL() |
|
835 |
// Retrives Display Entity related synchronous keys information. |
|
836 |
// On return aSysData consists of key value. |
|
837 |
// -------------------------------------------------------------------- |
|
838 |
// |
|
839 |
void CSysInfoService::GetDisplayInfoL(TPtrC aKey,CSysData*& aSysData) |
|
840 |
{ |
|
841 |
if( !aKey.CompareF(KBrightness) ) |
|
842 |
{ |
|
843 |
TInt brightness = 0; |
|
844 |
RepositoryUtil::GetRepositoryKeyL(KCRUidLightSettings, |
|
845 |
KLightIntensity,brightness); |
|
846 |
||
847 |
aSysData = CStatus::NewL(brightness); |
|
848 |
} |
|
849 |
else if( !aKey.CompareF(KKeyGaurdTime) ) |
|
850 |
{ |
|
851 |
TInt keygaurdtime = 0; |
|
852 |
RepositoryUtil::GetRepositoryKeyL(KCRUidSecuritySettings, |
|
853 |
KSettingsAutomaticKeyguardTime,keygaurdtime); |
|
854 |
||
855 |
aSysData = CStatus::NewL(keygaurdtime); |
|
856 |
} |
|
857 |
else if( !aKey.CompareF(KScreenSaverTimeOut) ) |
|
858 |
{ |
|
859 |
TInt screenSaverTimeOut = 0; |
|
860 |
RepositoryUtil::GetRepositoryKeyL(KCRUidPersonalizationSettings, |
|
861 |
KSettingsScreenSaverPeriod,screenSaverTimeOut); |
|
862 |
||
863 |
aSysData = CStatus::NewL(screenSaverTimeOut); |
|
864 |
} |
|
865 |
else if( !aKey.CompareF(KAutoLockTime) ) |
|
866 |
{ |
|
867 |
TInt autoLockTime = 0; |
|
868 |
RepositoryUtil::GetRepositoryKeyL(KCRUidSecuritySettings, |
|
869 |
KSettingsAutoLockTime,autoLockTime); |
|
870 |
||
871 |
aSysData = CStatus::NewL(autoLockTime); |
|
872 |
} |
|
873 |
else if( !aKey.CompareF(KAutoLockStatus) ) |
|
874 |
{ |
|
875 |
TInt keyLockState = 0; |
|
876 |
RepositoryUtil::GetRepositoryKeyL(KCRUidSecuritySettings, |
|
877 |
KSettingsAutolockStatus,keyLockState); |
|
878 |
||
879 |
aSysData = CStatus::NewL(keyLockState); |
|
880 |
} |
|
881 |
else if( !aKey.CompareF(KWallpaper) ) |
|
882 |
{ |
|
883 |
User::Leave(KErrNotSupported); |
|
884 |
} |
|
885 |
else if( !aKey.CompareF(KLightTimeOut) ) |
|
886 |
{ |
|
887 |
TInt lightTimeOut = 0; |
|
888 |
RepositoryUtil::GetRepositoryKeyL(KCRUidLightSettings, |
|
889 |
KDisplayLightsTimeout,lightTimeOut); |
|
890 |
||
891 |
aSysData = CStatus::NewL(lightTimeOut); |
|
892 |
} |
|
893 |
else if( !aKey.CompareF(KDisplayResolution) ) |
|
894 |
{ |
|
895 |
TInt xPixels(0); |
|
896 |
TInt yPixels(0); |
|
897 |
User::LeaveIfError(HAL::Get(HALData::EDisplayXPixels,xPixels)); |
|
898 |
User::LeaveIfError(HAL::Get(HALData::EDisplayYPixels,yPixels)); |
|
899 |
aSysData = CResolution::NewL(xPixels,yPixels); |
|
900 |
} |
|
901 |
else if( !aKey.CompareF(KDisplayOrientation) ) |
|
902 |
{ |
|
903 |
RWsSession session; |
|
904 |
CleanupClosePushL(session); |
|
905 |
User::LeaveIfError(session.Connect()); |
|
906 |
CWsScreenDevice *Device = new (ELeave) CWsScreenDevice(session); |
|
907 |
CleanupStack::PushL(Device); |
|
908 |
Device->Construct(); |
|
909 |
TPixelsTwipsAndRotation twipsRotation; |
|
910 |
Device->GetDefaultScreenSizeAndRotation(twipsRotation); |
|
911 |
aSysData = CStatus::NewL(twipsRotation.iRotation); |
|
912 |
CleanupStack::PopAndDestroy(2,&session); |
|
913 |
} |
|
914 |
else |
|
915 |
User::Leave(KErrNotFound); |
|
916 |
} |
|
917 |
||
918 |
// -------------------------------------------------------------------- |
|
919 |
// CSysInfoService::GetDeviceInfoL() |
|
920 |
// Retrives Device Entity related synchronous keys information. |
|
921 |
// On return aSysData consists of key value. |
|
922 |
// -------------------------------------------------------------------- |
|
923 |
// |
|
924 |
void CSysInfoService::GetDeviceInfoL(TPtrC aKey,CSysData*& aSysData) |
|
925 |
{ |
|
926 |
//if iDeviceInfo not instantiated before. Instantiate now. |
|
927 |
if( !iDeviceInfo ) |
|
928 |
iDeviceInfo = CDeviceInfo::NewL(); |
|
929 |
||
930 |
// read the requested key value. |
|
931 |
if ( !aKey.CompareF(KFirmwareVersion) ) |
|
932 |
aSysData = CStringData::NewL(iDeviceInfo->FirmwareVersion()); |
|
933 |
||
934 |
else if( !aKey.CompareF(KProductType) ) |
|
935 |
aSysData = CStringData::NewL(iDeviceInfo->ProductType()); |
|
936 |
||
937 |
else if( !aKey.CompareF(KManufacturer) ) |
|
938 |
aSysData = CStringData::NewL(iDeviceInfo->Manufaturer()); |
|
939 |
||
940 |
else if( !aKey.CompareF(KPhoneModel) ) |
|
941 |
aSysData = CStringData::NewL(iDeviceInfo->Model()); |
|
942 |
||
943 |
else if( !aKey.CompareF(KIMEI) ) |
|
944 |
aSysData = CStringData::NewL(iDeviceInfo->IMEI()); |
|
945 |
||
946 |
else if( !aKey.CompareF(KMachineID) ) |
|
947 |
aSysData = CStatus::NewL(iDeviceInfo->MachineId()); |
|
948 |
||
949 |
else if( !aKey.CompareF(KPlatformVersion) ) |
|
950 |
{ |
|
951 |
TInt majorVer(0); |
|
952 |
TInt minorVer(0); |
|
953 |
iDeviceInfo->GetPlatformVersion(majorVer,minorVer); |
|
954 |
aSysData = CVersion::NewL(majorVer,minorVer); |
|
955 |
} |
|
956 |
else |
|
957 |
User::Leave(KErrNotFound); |
|
958 |
} |
|
959 |
||
960 |
// -------------------------------------------------------------------- |
|
961 |
// CSysInfoService::GetAvailableUsbModesL() |
|
962 |
// Retrives available USB modes. |
|
963 |
// returns CSysData. |
|
964 |
// -------------------------------------------------------------------- |
|
965 |
// |
|
966 |
void CSysInfoService::GetAvailableUsbModesL(CSysData*& aSysData) |
|
967 |
{ |
|
968 |
RUsb usbsessn; |
|
969 |
CleanupClosePushL(usbsessn); |
|
970 |
User::LeaveIfError(usbsessn.Connect()); |
|
971 |
||
972 |
RArray<TInt> usbModes; |
|
973 |
CleanupClosePushL(usbModes); |
|
974 |
||
975 |
User::LeaveIfError(usbsessn.GetPersonalityIds(usbModes)); |
|
976 |
||
977 |
CDesCArray* usbModesDesArray; |
|
978 |
usbModesDesArray = new (ELeave) CDesCArrayFlat(KGranularity); |
|
979 |
CleanupStack::PushL(usbModesDesArray); |
|
980 |
||
981 |
HBufC* modeName = NULL; |
|
982 |
TInt Count = usbModes.Count(); |
|
983 |
for (TInt i=0; i<Count; i++) |
|
984 |
{ |
|
985 |
usbsessn.GetDescription(usbModes[i],modeName); |
|
986 |
//Creates own copy of the text. |
|
987 |
usbModesDesArray->AppendL(*modeName); |
|
988 |
// free allocated memory by GetDescription. |
|
989 |
delete modeName; |
|
990 |
} |
|
991 |
||
992 |
//UsbModesDesArray ownership passed to CStringList. |
|
993 |
aSysData = CStringList::NewL(usbModesDesArray); |
|
994 |
CleanupStack::Pop(usbModesDesArray); |
|
995 |
CleanupStack::PopAndDestroy(2,&usbsessn); |
|
996 |
} |
|
997 |
||
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
998 |
// -------------------------------------------------------------------- |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
999 |
// CSysInfoService::GetACameraDataL() |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1000 |
// Returns the readonly properties of camera - Media Types and Sizes Supported. |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1001 |
// returns CSysData. |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1002 |
// -------------------------------------------------------------------- |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1003 |
// |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1004 |
void CSysInfoService::GetCameraDataL( TPtrC aKey, CSysData*& aSysData ) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1005 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1006 |
if ( !aKey.CompareF( KCameraProperties ) ) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1007 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1008 |
CImagingConfigManager* cfgMgr = CImagingConfigManager::NewL(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1009 |
CleanupStack::PushL( cfgMgr ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1010 |
TImageQualitySet set; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1011 |
RPointerArray<CResolution> camResArr( KGranularity ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1012 |
CDesCArray* mimeArray= NULL; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1013 |
mimeArray = new (ELeave) CDesCArrayFlat( KGranularity ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1014 |
CleanupStack::PushL( mimeArray ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1015 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1016 |
CCameraResolutionList* resList= NULL; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1017 |
CStringList* mimeList= NULL; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1018 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1019 |
TInt totalLevels = cfgMgr->NumberOfImageQualityLevels(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1020 |
CArrayFixFlat<TUint>* levels = new (ELeave) CArrayFixFlat<TUint>( totalLevels ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1021 |
CleanupStack::PushL( levels ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1022 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1023 |
cfgMgr->GetImageQualityLevelsL( *levels, KPrimaryCameraDisplayID ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1024 |
TInt numLevels(levels->Count() ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1025 |
for ( int i=0; i<numLevels; i++ ) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1026 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1027 |
cfgMgr->GetImageQualitySet( set, levels->At(i), KPrimaryCameraDisplayID ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1028 |
if ( set.iCamcorderVisible > 0 ) |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1029 |
{ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1030 |
CResolution* camRes = CResolution::NewL( set.iImageWidth, set.iImageHeight ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1031 |
CleanupStack::PushL( camRes ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1032 |
camResArr.AppendL( camRes ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1033 |
CleanupStack::Pop( camRes ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1034 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1035 |
TText8* mimeType = set.iImageFileMimeType; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1036 |
TInt length = strlen( (const char *)mimeType ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1037 |
TPtrC8 mimeTypePtr( mimeType, length ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1038 |
TBuf8<KMimeTypeLength> mimeTypeBuf = mimeTypePtr; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1039 |
TBuf16<KMimeTypeLength> imageMimeType; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1040 |
imageMimeType.Copy( mimeTypeBuf ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1041 |
mimeArray->AppendL( imageMimeType ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1042 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1043 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1044 |
resList = CCameraResolutionList::NewL( camResArr ); //Ownership of camResArr is transferred to CCameraResolutionList |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1045 |
mimeList = CStringList::NewL( mimeArray ); //Ownership of mimeArray is transferred to CStringList |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1046 |
CleanupStack::PopAndDestroy( levels ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1047 |
CleanupStack::Pop( mimeArray ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1048 |
CleanupStack::PopAndDestroy( cfgMgr ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1049 |
camResArr.Reset(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1050 |
aSysData = CCameraInfo::NewL( resList, mimeList ); //Ownership of resList and mimeList is transferred to CCameraInfo |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1051 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1052 |
else |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1053 |
User::Leave( KErrNotFound ); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1054 |
} |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
1055 |
|
5 | 1056 |
// End of file. |