18 |
18 |
19 |
19 |
20 // INCLUDE FILES |
20 // INCLUDE FILES |
21 #include <rmmcustomapi.h> |
21 #include <rmmcustomapi.h> |
22 #include <startupdomainpskeys.h> |
22 #include <startupdomainpskeys.h> |
23 #include <centralrepository.h> |
23 #include <centralrepository.h> |
24 #include <SSSettingsPrivatePSKeys.h> // SSSettings Pub&Sub keys. |
24 #include <SSSettingsPrivatePSKeys.h> // sssettings pub&sub keys. |
25 #include <SSSettingsPrivateCRKeys.h> // SSSettings CentRep keys. |
25 #include <SSSettingsPrivateCRKeys.h> // sssettings centrep keys. |
26 #include <PSVariables.h> |
26 #include <PSVariables.h> |
27 |
27 |
28 #include "CSSSettingsAlsNotifier.h" |
28 #include "CSSSettingsAlsNotifier.h" |
29 #include "CSSSettingsActiveObject.h" |
29 #include "CSSSettingsActiveObject.h" |
30 #include "SSSettingsLogger.h" |
30 #include "SSSettingsLogger.h" |
31 |
31 |
32 // ================= MEMBER FUNCTIONS ======================= |
32 // ================= MEMBER FUNCTIONS ======================= |
33 // ----------------------------------------------------------------------------- |
33 // ----------------------------------------------------------------------------- |
34 // CSSSettingsAlsNotifier::CSSSettingsAlsNotifier |
34 // CSSSettingsAlsNotifier::CSSSettingsAlsNotifier |
35 // ----------------------------------------------------------------------------- |
35 // ----------------------------------------------------------------------------- |
486 __SSSLOGSTRING1("[SSS]--> CSSSettingsAlsNotifier::EnsureAlsStatus - KPSUidSIMStatusValue Error: %d", error); |
486 __SSSLOGSTRING1("[SSS]--> CSSSettingsAlsNotifier::EnsureAlsStatus - KPSUidSIMStatusValue Error: %d", error); |
487 |
487 |
488 if ( error == KErrNone ) |
488 if ( error == KErrNone ) |
489 { |
489 { |
490 // Make sure that SIM state is OK otherwise parameters coming from SIM are mess. |
490 // Make sure that SIM state is OK otherwise parameters coming from SIM are mess. |
491 if ( simState ==ESimUsable ) |
491 if ( simState ==ESimUsable ) |
492 { |
492 { |
493 // Get Als support from Product Profile. |
493 // Get Als support from Product Profile. |
494 error = CheckAlsSupportInProductProfile( iPPSupportAls ); |
494 error = CheckAlsSupportInProductProfile( iPPSupportAls ); |
495 if ( error == KErrNone ) |
495 if ( error == KErrNone ) |
496 { |
496 { |
512 return error; |
512 return error; |
513 } |
513 } |
514 |
514 |
515 // Open connection RCustomerServiceProfileCache. |
515 // Open connection RCustomerServiceProfileCache. |
516 RCustomerServiceProfileCache alsProfileCache; |
516 RCustomerServiceProfileCache alsProfileCache; |
517 error = alsProfileCache.Open(); |
517 error = alsProfileCache.Open(); |
518 if ( error != KErrNone ) |
518 if ( error != KErrNone ) |
519 { |
519 { |
520 return error; |
520 return error; |
521 } |
521 } |
522 |
522 |
523 // Get ALS CSP bit from cache. |
523 // Get ALS CSP bit from cache. |
524 iAlsCSPError = alsProfileCache.CspCPHSTeleservices( params ); |
524 iAlsCSPError = alsProfileCache.CspCPHSTeleservices( params ); |
525 |
525 |
526 if ( iAlsCSPError == KErrNone || iAlsCSPError == KErrNotSupported ) |
526 if ( iAlsCSPError == KErrNone || iAlsCSPError == KErrNotSupported ) |
527 { |
527 { |
528 // Checks CSP ALS support. |
528 // Checks CSP ALS support. |
529 iAlsCSPSupport = CheckIfAlsCSPSupported( params ); |
529 iAlsCSPSupport = CheckIfAlsCSPSupported( params ); |
530 } |
530 } |
531 // If ETEL/TSY responses with error KErrNotReady/KErrServerBusy then CSP value is not correct one |
531 // If ETEL/TSY responses with error KErrNotReady/KErrServerBusy then CSP value is not correct one |
532 // and iAlsStatusChecked is set to EFalse. |
532 // and iAlsStatusChecked is set to EFalse. |
533 else if ( iAlsCSPError == KErrNotReady || iAlsCSPError == KErrServerBusy ) |
533 else if ( iAlsCSPError == KErrNotReady || iAlsCSPError == KErrServerBusy ) |
534 { |
534 { |
535 iAlsStatusChecked = EFalse; |
535 iAlsStatusChecked = EFalse; |
536 alsProfileCache.Close(); |
536 alsProfileCache.Close(); |
537 return iAlsCSPError; |
537 return iAlsCSPError; |
538 } |
538 } |
539 // Close connection RCustomerServiceProfileCache. |
539 // Close connection RCustomerServiceProfileCache. |
540 alsProfileCache.Close(); |
540 alsProfileCache.Close(); |
541 |
541 |
542 // Save PP and SIM als values to P&S. |
542 // Save PP and SIM als values to P&S. |
543 if ( savePPSimAls ) |
543 if ( savePPSimAls ) |
544 { |
544 { |
545 error = RProperty::Set( KPSUidSSConfig, KSettingsPPSupportsALS, iPPSupportAls ); |
545 error = RProperty::Set( KPSUidSSConfig, KSettingsPPSupportsALS, iPPSupportAls ); |
575 // --------------------------------------------------------------------------- |
575 // --------------------------------------------------------------------------- |
576 // |
576 // |
577 TBool CSSSettingsAlsNotifier::CheckIfAlsCSPSupported( |
577 TBool CSSSettingsAlsNotifier::CheckIfAlsCSPSupported( |
578 const RMobilePhone::TCspCPHSTeleservices aContainer ) const |
578 const RMobilePhone::TCspCPHSTeleservices aContainer ) const |
579 { |
579 { |
580 TBool supported(EFalse); |
580 TBool supported(EFalse); |
581 |
581 |
582 if ( ( aContainer & RMobilePhone::KCspALS ) != 0 ) |
582 if ( ( aContainer & RMobilePhone::KCspALS ) != 0 ) |
583 { |
583 { |
584 supported = ETrue; |
584 supported = ETrue; |
585 } |
585 } |
586 return supported; |
586 return supported; |
587 } |
587 } |
588 |
588 |
589 // ----------------------------------------------------------------------------- |
589 // ----------------------------------------------------------------------------- |
662 __SSSLOGSTRING("[SSS]--> CSSSettingsAlsNotifier::HandleRefresh"); |
662 __SSSLOGSTRING("[SSS]--> CSSSettingsAlsNotifier::HandleRefresh"); |
663 TInt error = CheckAlsSupportInProductProfile( iPPSupportAls ); |
663 TInt error = CheckAlsSupportInProductProfile( iPPSupportAls ); |
664 if ( error == KErrNone ) |
664 if ( error == KErrNone ) |
665 { |
665 { |
666 error = RProperty::Set( |
666 error = RProperty::Set( |
667 KPSUidSSConfig, |
667 KPSUidSSConfig, |
668 KSettingsPPSupportsALS, |
668 KSettingsPPSupportsALS, |
669 iPPSupportAls ); |
669 iPPSupportAls ); |
670 } |
670 } |
671 |
671 |
672 if ( error != KErrNone ) |
672 if ( error != KErrNone ) |
673 { |
673 { |
674 return error; |
674 return error; |