26
|
1 |
// Copyright (c) 2010 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 |
// Implements a utility class which read information from Central Repository
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
#include <centralrepository.h>
|
|
19 |
#include <usb/usblogger.h>
|
|
20 |
#ifdef SYMBIAN_FEATURE_MANAGER
|
|
21 |
#include <featureuids.h>
|
|
22 |
#include <featdiscovery.h>
|
|
23 |
#endif
|
|
24 |
#include "usbmanprivatecrkeys.h"
|
|
25 |
#include "UsbSettings.h"
|
|
26 |
#include "CPersonality.h"
|
|
27 |
#include "usbmancenrepmanager.h"
|
|
28 |
#include "CUsbDevice.h"
|
|
29 |
|
|
30 |
|
|
31 |
#ifdef __FLOG_ACTIVE
|
|
32 |
_LIT8(KLogComponent, "USBSVR");
|
|
33 |
#endif
|
|
34 |
|
|
35 |
_LIT(KUsbCenRepPanic, "UsbCenRep");
|
|
36 |
|
|
37 |
/**
|
|
38 |
* Panic codes for the USB Central Repository Manager
|
|
39 |
*/
|
|
40 |
enum TUsbCenRepPanic
|
|
41 |
{
|
|
42 |
ECenRepObserverNotStopped = 0,
|
|
43 |
ECenRepObserverAlreadySet,
|
|
44 |
ECenRepConfigError,
|
|
45 |
ECenRepFeatureManagerError,
|
|
46 |
};
|
|
47 |
|
|
48 |
// ---------------------------------------------------------------------------
|
|
49 |
// Private consctruction
|
|
50 |
// ---------------------------------------------------------------------------
|
|
51 |
//
|
|
52 |
CUsbManCenRepManager::CUsbManCenRepManager(CUsbDevice& aUsbDevice)
|
|
53 |
: iUsbDevice( aUsbDevice )
|
|
54 |
{
|
|
55 |
LOG_FUNC
|
|
56 |
}
|
|
57 |
|
|
58 |
// ---------------------------------------------------------------------------
|
|
59 |
// The first phase construction
|
|
60 |
// ---------------------------------------------------------------------------
|
|
61 |
//
|
|
62 |
CUsbManCenRepManager* CUsbManCenRepManager::NewL(CUsbDevice& aUsbDevice)
|
|
63 |
{
|
|
64 |
LOG_STATIC_FUNC_ENTRY
|
|
65 |
CUsbManCenRepManager* self = new (ELeave) CUsbManCenRepManager(aUsbDevice);
|
|
66 |
CleanupStack::PushL( self );
|
|
67 |
self->ConstructL();
|
|
68 |
CleanupStack::Pop( self );
|
|
69 |
return self;
|
|
70 |
}
|
|
71 |
|
|
72 |
// ---------------------------------------------------------------------------
|
|
73 |
// The second phase construction
|
|
74 |
// ---------------------------------------------------------------------------
|
|
75 |
//
|
|
76 |
void CUsbManCenRepManager::ConstructL()
|
|
77 |
{
|
|
78 |
LOG_FUNC
|
|
79 |
// Open the Central Repository
|
|
80 |
iRepository = CRepository::NewL( KCRUidUSBManagerConfiguration );
|
|
81 |
CheckSignatureL();
|
|
82 |
}
|
|
83 |
|
|
84 |
// ---------------------------------------------------------------------------
|
|
85 |
// Deconstruction
|
|
86 |
// ---------------------------------------------------------------------------
|
|
87 |
//
|
|
88 |
CUsbManCenRepManager::~CUsbManCenRepManager()
|
|
89 |
{
|
|
90 |
LOG_FUNC
|
|
91 |
delete iRepository;
|
|
92 |
}
|
|
93 |
|
|
94 |
// ---------------------------------------------------------------------------
|
|
95 |
// Read specific Key whose value type is String
|
|
96 |
// ---------------------------------------------------------------------------
|
|
97 |
//
|
|
98 |
HBufC* CUsbManCenRepManager::ReadStringKeyLC( TUint32 aKeyId )
|
|
99 |
{
|
|
100 |
LOG_FUNC
|
|
101 |
HBufC* keyBuf = HBufC::NewLC( NCentralRepositoryConstants::KMaxUnicodeStringLength );
|
|
102 |
TPtr key = keyBuf->Des();
|
|
103 |
|
|
104 |
LEAVEIFERRORL( iRepository->Get( aKeyId, key ) );
|
|
105 |
LOGTEXT3(_L("LocSets: ReadStringKeyLC id: %x, val: %S"), aKeyId, &key );
|
|
106 |
|
|
107 |
return keyBuf;
|
|
108 |
}
|
|
109 |
|
|
110 |
// ---------------------------------------------------------------------------
|
|
111 |
// Read specific Key whose value type is TInt
|
|
112 |
// ---------------------------------------------------------------------------
|
|
113 |
//
|
|
114 |
TInt CUsbManCenRepManager::ReadKeyL( TUint32 aKeyId )
|
|
115 |
{
|
|
116 |
LOG_FUNC
|
|
117 |
TInt key;
|
|
118 |
|
|
119 |
LEAVEIFERRORL( iRepository->Get( aKeyId, key ) );
|
|
120 |
LOGTEXT3(_L("LocSets: ReadKeyL id: 0x%x, val: 0x%x"), aKeyId, key);
|
|
121 |
|
|
122 |
return key;
|
|
123 |
}
|
|
124 |
|
|
125 |
// ---------------------------------------------------------------------------
|
|
126 |
// Check wheather cenrep's version is supported by cenrep manager
|
|
127 |
// ---------------------------------------------------------------------------
|
|
128 |
//
|
|
129 |
void CUsbManCenRepManager::CheckSignatureL()
|
|
130 |
{
|
|
131 |
LOG_FUNC
|
|
132 |
iSignature = ReadKeyL( KUsbManConfigSign );
|
|
133 |
|
|
134 |
if ( iSignature < TUsbManagerSupportedVersionMin ||
|
|
135 |
iSignature > TUsbManagerSupportedVersionMax )
|
|
136 |
{
|
|
137 |
LEAVEL(KErrNotSupported);
|
|
138 |
}
|
|
139 |
}
|
|
140 |
|
|
141 |
// ---------------------------------------------------------------------------
|
|
142 |
// Read Device configuration table
|
|
143 |
// ---------------------------------------------------------------------------
|
|
144 |
//
|
|
145 |
void CUsbManCenRepManager::ReadDeviceConfigurationL(CUsbDevice::TUsbDeviceConfiguration& aDeviceConfig)
|
|
146 |
{
|
|
147 |
LOG_FUNC
|
|
148 |
//Only support version four right now.
|
|
149 |
__ASSERT_DEBUG( ( TUsbManagerSupportedVersionFour == iSignature ), _USB_PANIC( KUsbCenRepPanic, ECenRepConfigError ) );
|
|
150 |
|
|
151 |
//Shall only have on device configuration setting.
|
|
152 |
TUint32 devConfigCount = ReadKeyL( KUsbManDeviceCountIndexKey );
|
|
153 |
__ASSERT_DEBUG( ( devConfigCount == 1 ), _USB_PANIC( KUsbCenRepPanic, ECenRepConfigError ) );
|
|
154 |
|
|
155 |
RArray<TUint32> keyArray;
|
|
156 |
CleanupClosePushL( keyArray );
|
|
157 |
LEAVEIFERRORL( iRepository->FindL( KUsbManDevicePartialKey, KUsbManConfigKeyMask, keyArray ) );
|
|
158 |
|
|
159 |
TInt keyCount = keyArray.Count();
|
|
160 |
LOGTEXT2( _L("CUsbManCenRepManager::ReadDeviceConfigurationL keyCount of device config = %d"), keyCount );
|
|
161 |
|
|
162 |
//Get each extension type key value and store in iExtList array
|
|
163 |
for( TInt index = 0; index < keyCount; index++ )
|
|
164 |
{
|
|
165 |
TUint32 key = keyArray[index];
|
|
166 |
TUint32 fieldId = ( key & KUsbManConfigFieldMask );
|
|
167 |
LOGTEXT2( _L("CUsbManCenRepManager::ReadDeviceConfigurationL fieldId = %d"), fieldId );
|
|
168 |
if( fieldId == KUsbManDeviceVendorIdKey )
|
|
169 |
{
|
|
170 |
aDeviceConfig.iVendorId = ReadKeyL( key );
|
|
171 |
}
|
|
172 |
else if( fieldId == KUsbManDeviceManufacturerNameKey )
|
|
173 |
{
|
|
174 |
HBufC* manufacturer = ReadStringKeyLC( key );
|
|
175 |
TPtr manufacturerPtr = manufacturer->Des();
|
|
176 |
aDeviceConfig.iManufacturerName->Des().Copy( manufacturerPtr );
|
|
177 |
CleanupStack::PopAndDestroy( manufacturer );
|
|
178 |
}
|
|
179 |
else if( fieldId == KUsbManDeviceProductNameKey )
|
|
180 |
{
|
|
181 |
HBufC* product = ReadStringKeyLC( key );
|
|
182 |
TPtr productName = product->Des();
|
|
183 |
aDeviceConfig.iProductName->Des().Copy( productName );
|
|
184 |
CleanupStack::PopAndDestroy( product );
|
|
185 |
}
|
|
186 |
else
|
|
187 |
{
|
|
188 |
_USB_PANIC( KUsbCenRepPanic, ECenRepConfigError );
|
|
189 |
}
|
|
190 |
}
|
|
191 |
CleanupStack::PopAndDestroy( &keyArray );
|
|
192 |
}
|
|
193 |
|
|
194 |
|
|
195 |
// ---------------------------------------------------------------------------
|
|
196 |
// Read personality table
|
|
197 |
// ---------------------------------------------------------------------------
|
|
198 |
//
|
|
199 |
void CUsbManCenRepManager::ReadPersonalitiesL(RPointerArray<CPersonality>& aPersonalities)
|
|
200 |
{
|
|
201 |
LOG_FUNC
|
|
202 |
|
|
203 |
//Only support version four right now.
|
|
204 |
__ASSERT_DEBUG( ( TUsbManagerSupportedVersionFour == iSignature ), _USB_PANIC( KUsbCenRepPanic, ECenRepConfigError ) );
|
|
205 |
|
|
206 |
// Get the personality count.
|
|
207 |
TUint32 personalityCount = ReadKeyL( KUsbManDevicePersonalitiesCountIndexKey );
|
|
208 |
LOGTEXT2( _L("CUsbManCenRepManager::ReadPersonalitiesL personalityCount = %d"), personalityCount );
|
|
209 |
|
|
210 |
RArray<TUint32> keyArray;
|
|
211 |
CleanupClosePushL( keyArray );
|
|
212 |
|
|
213 |
|
|
214 |
// Go through all personalities and store them.
|
|
215 |
for( TInt personalityIdx = 0; personalityIdx < personalityCount; personalityIdx++ )
|
|
216 |
{
|
|
217 |
CPersonality* personality = CPersonality::NewL();
|
|
218 |
CleanupStack::PushL( personality );
|
|
219 |
|
|
220 |
// Find the keys belonging to the personality
|
|
221 |
TUint32 devicePersonalitiesKey = KUsbManDevicePersonalitiesPartialKey | ( personalityIdx << KUsbManPersonalitiesOffset );
|
|
222 |
LEAVEIFERRORL( iRepository->FindL( devicePersonalitiesKey, KUsbManConfigKeyMask, keyArray ) );
|
|
223 |
|
|
224 |
TInt keyCount = keyArray.Count();
|
|
225 |
LOGTEXT2( _L("CUsbManCenRepManager::ReadPersonalitiesL keyCount of personality = %d"), keyCount );
|
|
226 |
|
|
227 |
// Get each key value of the personality and store it.
|
|
228 |
for( TInt keyIdx = 0; keyIdx < keyCount; keyIdx++ )
|
|
229 |
{
|
|
230 |
TUint32 key = keyArray[keyIdx];
|
|
231 |
TUint32 fieldId = (key & KUsbManConfigFieldMask);
|
|
232 |
LOGTEXT2( _L("CUsbManCenRepManager::ReadPersonalitiesL key id of personality = %d"), fieldId );
|
|
233 |
switch( fieldId )
|
|
234 |
{
|
|
235 |
case KUsbManDevicePersonalitiesDeviceClassKey:
|
|
236 |
personality->SetDeviceClass(ReadKeyL( key ));
|
|
237 |
break;
|
|
238 |
case KUsbManDevicePersonalitiesDeviceSubClassKey:
|
|
239 |
personality->SetDeviceSubClass(ReadKeyL( key ));
|
|
240 |
break;
|
|
241 |
case KUsbManDevicePersonalitiesProtocolKey:
|
|
242 |
personality->SetDeviceProtocol(ReadKeyL( key ));
|
|
243 |
break;
|
|
244 |
case KUsbManDevicePersonalitiesNumConfigKey:
|
|
245 |
personality->SetNumConfigurations(ReadKeyL( key ));
|
|
246 |
break;
|
|
247 |
case KUsbManDevicePersonalitiesProductIdKey:
|
|
248 |
personality->SetProductId(ReadKeyL( key ));
|
|
249 |
break;
|
|
250 |
case KUsbManDevicePersonalitiesBcdDeviceKey:
|
|
251 |
personality->SetBcdDevice(ReadKeyL( key ));
|
|
252 |
break;
|
|
253 |
case KUsbManDevicePersonalitiesFeatureIdKey:
|
|
254 |
personality->SetFeatureId(ReadKeyL( key ));
|
|
255 |
break;
|
|
256 |
case KUsbManDevicePersonalitiesPersonalityIdKey:
|
|
257 |
personality->SetPersonalityId(ReadKeyL( key ));
|
|
258 |
ReadConfigurationsForPersonalityL( personality->PersonalityId(), *personality );
|
|
259 |
break;
|
|
260 |
case KUsbManDevicePersonalitiesPropertyKey:
|
|
261 |
personality->SetProperty(ReadKeyL( key ));
|
|
262 |
break;
|
|
263 |
case KUsbManDevicePersonalitiesDescriptionKey:
|
|
264 |
{
|
|
265 |
HBufC* description;
|
|
266 |
description = ReadStringKeyLC( key );
|
|
267 |
personality->SetDescription( description );
|
|
268 |
CleanupStack::PopAndDestroy( description );
|
|
269 |
break;
|
|
270 |
}
|
|
271 |
default:
|
|
272 |
_USB_PANIC( KUsbCenRepPanic, ECenRepConfigError );
|
|
273 |
break;
|
|
274 |
}
|
|
275 |
}
|
|
276 |
|
|
277 |
personality->SetVersion(iSignature);
|
|
278 |
|
|
279 |
//The following code is to check whether we support this personality.
|
|
280 |
if(personality->FeatureId() != KUsbManFeatureNotConfigurable)
|
|
281 |
{
|
|
282 |
if(!IsFeatureSupportedL(personality->FeatureId()))
|
|
283 |
{
|
|
284 |
CleanupStack::PopAndDestroy(personality);
|
|
285 |
continue;
|
|
286 |
}
|
|
287 |
}
|
|
288 |
|
|
289 |
//The following code is to check whether we support this personality. It will not include:
|
|
290 |
//1)the personality which contains single class which is not supported
|
|
291 |
//2)the personality which contains multiple classes which are all not supported
|
|
292 |
TBool isPersonalitySupport = EFalse;
|
|
293 |
TInt configurationCount = personality->PersonalityConfigs().Count();
|
|
294 |
for(TInt configurationIdx = 0; configurationIdx < configurationCount; ++configurationIdx)
|
|
295 |
{
|
|
296 |
const RPointerArray<CPersonalityConfigurations>& personalityConfigs = personality->PersonalityConfigs();
|
|
297 |
CPersonalityConfigurations *personalityConfigurations = personalityConfigs[configurationIdx];
|
|
298 |
TInt classesCount = personalityConfigurations->Classes().Count();
|
|
299 |
if(0 != classesCount)
|
|
300 |
{
|
|
301 |
isPersonalitySupport = ETrue;
|
|
302 |
break;
|
|
303 |
}
|
|
304 |
}
|
|
305 |
|
|
306 |
if(isPersonalitySupport)
|
|
307 |
{
|
|
308 |
LOGTEXT2( _L("CUsbManCenRepManager::ReadPersonalitiesL Personality ID: %d is supported"), personality->PersonalityId() );
|
|
309 |
aPersonalities.Append( personality );
|
|
310 |
CleanupStack::Pop( personality );
|
|
311 |
}
|
|
312 |
else
|
|
313 |
{
|
|
314 |
LOGTEXT2( _L("CUsbManCenRepManager::ReadPersonalitiesL Personality ID: %d is not supported"), personality->PersonalityId() );
|
|
315 |
CleanupStack::PopAndDestroy(personality);
|
|
316 |
}
|
|
317 |
}
|
|
318 |
CleanupStack::PopAndDestroy( &keyArray );
|
|
319 |
}
|
|
320 |
|
|
321 |
// ---------------------------------------------------------------------------
|
|
322 |
// Read configuration table for specific personality
|
|
323 |
// ---------------------------------------------------------------------------
|
|
324 |
//
|
|
325 |
void CUsbManCenRepManager::ReadConfigurationsForPersonalityL(TInt aPersonalityId, CPersonality& aPersonality)
|
|
326 |
{
|
|
327 |
LOG_FUNC
|
|
328 |
RArray<TUint32> configArray;
|
|
329 |
CleanupClosePushL(configArray);
|
|
330 |
|
|
331 |
//Only support version four right now.
|
|
332 |
__ASSERT_DEBUG( ( TUsbManagerSupportedVersionFour == iSignature ), _USB_PANIC( KUsbCenRepPanic, ECenRepConfigError ) );
|
|
333 |
|
|
334 |
LEAVEIFERRORL( iRepository->FindEqL( KUsbManDeviceConfigurationsPartialKey, KUsbManConfigFirstEntryMask, aPersonalityId, configArray ) );
|
|
335 |
|
|
336 |
// Get the configuration count.
|
|
337 |
TUint32 configCount = configArray.Count();
|
|
338 |
TUint32 totalConfigCount = ReadKeyL( KUsbManDeviceConfigurationsCountIndexKey );
|
|
339 |
|
|
340 |
LOGTEXT4( _L("ReadConfigurationsForPersonalityL: aPersonalityId = %d total configCount = %d configArray.Count() = %d"), aPersonalityId, totalConfigCount, configArray.Count());
|
|
341 |
|
|
342 |
//This is intend to handle one special case that key 0x2ff00's value
|
|
343 |
// equal our target personality id.
|
|
344 |
if(totalConfigCount == aPersonalityId)
|
|
345 |
{
|
|
346 |
--configCount;
|
|
347 |
}
|
|
348 |
|
|
349 |
TInt keyCount = 0;
|
|
350 |
if(TUsbManagerSupportedVersionFour == iSignature)
|
|
351 |
{
|
|
352 |
keyCount = KUsbManDeviceConfigurationsKeyCountVersionFour;
|
|
353 |
}
|
|
354 |
|
|
355 |
// Go through all configurations belonging to this personality 'aPersonalityId'
|
|
356 |
for ( TInt configIdx = 0; configIdx < configCount; configIdx++ )
|
|
357 |
{
|
|
358 |
CPersonalityConfigurations* config = new ( ELeave ) CPersonalityConfigurations;
|
|
359 |
CleanupStack::PushL( config );
|
|
360 |
TUint32 key = configArray[configIdx];
|
|
361 |
|
|
362 |
// Get each key value in the configuration and store it
|
|
363 |
for ( TInt keyIdx = 0; keyIdx < keyCount; keyIdx++ )
|
|
364 |
{
|
|
365 |
TUint32 fieldId = ( (key + keyIdx ) & KUsbManConfigFieldMask );
|
|
366 |
TInt keyValue = -1;
|
|
367 |
LOGTEXT4( _L("ReadConfigurationsForPersonalityL fieldId = %d configIdx = %d keyIdx = %d"), fieldId, configIdx, keyIdx );
|
|
368 |
|
|
369 |
if(KUsbManDeviceConfigurationsPersonalityIdKey == fieldId)
|
|
370 |
{
|
|
371 |
TRAPD( err, keyValue = ReadKeyL( key + keyIdx ) );
|
|
372 |
if( err == KErrNone )
|
|
373 |
{
|
|
374 |
__ASSERT_DEBUG( ( keyValue == aPersonalityId ), _USB_PANIC( KUsbCenRepPanic, ECenRepConfigError ) );
|
|
375 |
config->SetPersonalityId( keyValue );
|
|
376 |
}
|
|
377 |
}
|
|
378 |
else if(KUsbManDeviceConfigurationsIdKey == fieldId)
|
|
379 |
{
|
|
380 |
TRAPD( err, keyValue = ReadKeyL( key + keyIdx ) );
|
|
381 |
if( err == KErrNone )
|
|
382 |
{
|
|
383 |
config->SetConfigId(keyValue);
|
|
384 |
}
|
|
385 |
}
|
|
386 |
else if(KUsbManDeviceConfigurationsClassUidsKey == fieldId)
|
|
387 |
{
|
|
388 |
HBufC* keyValueBuf = ReadStringKeyLC( key + keyIdx );
|
|
389 |
TPtr keyPtr = keyValueBuf->Des();
|
|
390 |
|
|
391 |
RArray<TUint> classUids;
|
|
392 |
CleanupClosePushL( classUids );
|
|
393 |
|
|
394 |
iUsbDevice.ConvertUidsL( keyPtr, classUids );
|
|
395 |
TInt uidsCnt = classUids.Count();
|
|
396 |
|
|
397 |
// Get featureId of each class and store each class.
|
|
398 |
TInt featureId = KUsbManFeatureNotConfigurable;
|
|
399 |
CPersonalityConfigurations::TUsbClasses usbClass;
|
|
400 |
for ( TInt uidIdx = 0; uidIdx < uidsCnt; uidIdx++ )
|
|
401 |
{
|
|
402 |
usbClass.iClassUid = TUid::Uid( classUids[uidIdx] );
|
|
403 |
usbClass.iFeatureId = featureId; // By default
|
|
404 |
if ( IsClassConfigurableL( classUids[uidIdx], featureId ) )
|
|
405 |
{
|
|
406 |
usbClass.iFeatureId = featureId;
|
|
407 |
if(IsFeatureSupportedL(featureId))
|
|
408 |
{
|
|
409 |
config->AppendClassesL( usbClass );
|
|
410 |
}
|
|
411 |
}
|
|
412 |
else
|
|
413 |
{
|
|
414 |
config->AppendClassesL( usbClass );
|
|
415 |
}
|
|
416 |
}
|
|
417 |
|
|
418 |
CleanupStack::PopAndDestroy( &classUids ); // close uid array
|
|
419 |
CleanupStack::PopAndDestroy( keyValueBuf );
|
|
420 |
}
|
|
421 |
else
|
|
422 |
{
|
|
423 |
_USB_PANIC( KUsbCenRepPanic, ECenRepConfigError );
|
|
424 |
}
|
|
425 |
}
|
|
426 |
aPersonality.AppendPersonalityConfigsL( config );
|
|
427 |
|
|
428 |
CleanupStack::Pop( config );
|
|
429 |
}
|
|
430 |
|
|
431 |
CleanupStack::PopAndDestroy( &configArray );
|
|
432 |
}
|
|
433 |
|
|
434 |
// ---------------------------------------------------------------------------
|
|
435 |
// Check the class belonging to a personality configurable or not.
|
|
436 |
// ---------------------------------------------------------------------------
|
|
437 |
//
|
|
438 |
TBool CUsbManCenRepManager::IsClassConfigurableL(TUint aClassId, TInt& aFeatureId)
|
|
439 |
{
|
|
440 |
LOG_FUNC
|
|
441 |
TBool classConfigurable = EFalse;
|
|
442 |
RArray<TUint32> keyArray;
|
|
443 |
CleanupClosePushL(keyArray);
|
|
444 |
|
|
445 |
TInt err = iRepository->FindEqL( KUsbManDeviceConfigurableClassesPartialKey, KUsbManConfigFirstEntryMask, (TInt)aClassId, keyArray );
|
|
446 |
LOGTEXT3( _L("CUsbManCenRepManager::IsClassConfigurableL: aClassId = 0x%x err = %d "), aClassId, err);
|
|
447 |
switch ( err )
|
|
448 |
{
|
|
449 |
case KErrNotFound:
|
|
450 |
break;
|
|
451 |
case KErrNone:
|
|
452 |
{
|
|
453 |
__ASSERT_DEBUG( ( keyArray.Count() == 1 ), _USB_PANIC( KUsbCenRepPanic, ECenRepConfigError ) );
|
|
454 |
// The array size always is 1, so here using 0 as index.
|
|
455 |
aFeatureId = ReadKeyL( keyArray[0] | KUsbManDeviceConfigurableClassesFeatureIdKey );
|
|
456 |
classConfigurable = ETrue;
|
|
457 |
break;
|
|
458 |
}
|
|
459 |
default:
|
|
460 |
LEAVEL( err );
|
|
461 |
break;
|
|
462 |
}
|
|
463 |
|
|
464 |
CleanupStack::PopAndDestroy( &keyArray );
|
|
465 |
return classConfigurable;
|
|
466 |
}
|
|
467 |
|
|
468 |
// ---------------------------------------------------------------------------
|
|
469 |
// Check the class belonging to a personality support or not.
|
|
470 |
// ---------------------------------------------------------------------------
|
|
471 |
//
|
|
472 |
TBool CUsbManCenRepManager::IsFeatureSupportedL(TInt aFeatureId)
|
|
473 |
{
|
|
474 |
LOG_FUNC
|
|
475 |
#ifdef SYMBIAN_FEATURE_MANAGER
|
|
476 |
if(CFeatureDiscovery::IsFeatureSupportedL(TUid::Uid(aFeatureId)))
|
|
477 |
{
|
|
478 |
LOGTEXT2( _L("CUsbManCenRepManager::IsFeatureSupportedL featureId = 0x%x supported"), aFeatureId );
|
|
479 |
return ETrue;
|
|
480 |
}
|
|
481 |
else
|
|
482 |
{
|
|
483 |
LOGTEXT2( _L("CUsbManCenRepManager::IsFeatureSupportedL featureId = 0x%x not supported"), aFeatureId );
|
|
484 |
return EFalse;
|
|
485 |
}
|
|
486 |
#else
|
|
487 |
_USB_PANIC( KUsbCenRepPanic, ECenRepFeatureManagerError )
|
|
488 |
#endif
|
|
489 |
}
|