24 #include <UsbWatcherInternalCRKeys.h> |
24 #include <UsbWatcherInternalCRKeys.h> |
25 #include <cusbpersonalitynotifier.h> |
25 #include <cusbpersonalitynotifier.h> |
26 #include <UsbWatcherInternalPSKeys.h> |
26 #include <UsbWatcherInternalPSKeys.h> |
27 #include <e32property.h> |
27 #include <e32property.h> |
28 #include <startupdomainpskeys.h> //for global system state |
28 #include <startupdomainpskeys.h> //for global system state |
|
29 #include <featmgr.h> //FeatureManager |
29 |
30 |
30 #include "cusbwatcher.h" |
31 #include "cusbwatcher.h" |
31 #include "cusbactivestate.h" |
32 #include "cusbactivestate.h" |
32 #include "cusbactivepersonalityhandler.h" |
33 #include "cusbactivepersonalityhandler.h" |
33 #include "cusbwatchersession.h" |
34 #include "cusbwatchersession.h" |
1005 // ---------------------------------------------------------------------------- |
1006 // ---------------------------------------------------------------------------- |
1006 // |
1007 // |
1007 TInt CUsbWatcher::GetChargingPersonalityId( TInt& aPersonalityId ) |
1008 TInt CUsbWatcher::GetChargingPersonalityId( TInt& aPersonalityId ) |
1008 { |
1009 { |
1009 LOG_FUNC |
1010 LOG_FUNC |
1010 |
1011 |
1011 TInt ret = iPersonalityRepository->Get( |
1012 TUint32 chargingKey( KUsbWatcherChargingDefaultPersonality ); |
1012 KUsbWatcherChargingDefaultPersonality, aPersonalityId ); |
1013 // Check if it is now in certificate test mode |
|
1014 TRAPD(ret, FeatureManager::InitializeLibL()); |
|
1015 LOG1( "FeatureManager::InitializeLibL(): %d", ret ); |
|
1016 if ( KErrNone == ret ) |
|
1017 { |
|
1018 if( FeatureManager::FeatureSupported( |
|
1019 KFeatureIdEnableIsiCommunicationInUsbChargingMode ) ) |
|
1020 { |
|
1021 chargingKey = KUsbWatcherCertTestChargingPersonality; |
|
1022 LOG( "KFeatureIdEnableIsiCommunicationInUsbChargingMode true" ); |
|
1023 } |
|
1024 else |
|
1025 { |
|
1026 LOG( "KFeatureIdEnableIsiCommunicationInUsbChargingMode false" ); |
|
1027 } |
|
1028 FeatureManager::UnInitializeLib(); |
|
1029 } |
|
1030 |
|
1031 ret = iPersonalityRepository->Get( chargingKey, aPersonalityId ); |
|
1032 LOG2( "ret = %d ( aPersonalityId: %d )", ret, aPersonalityId ); |
1013 return ret; |
1033 return ret; |
1014 } |
1034 } |
1015 |
1035 |
1016 // ---------------------------------------------------------------------------- |
1036 // ---------------------------------------------------------------------------- |
1017 // Check if there is an observer with ask on connection suppression |
1037 // Check if there is an observer with ask on connection suppression |