cellular/SSSettings/src/RSSSettings.cpp
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
    21 // INCLUDE FILES
    21 // INCLUDE FILES
    22 #include    <bldvariant.hrh> // for feature definitions
    22 #include    <bldvariant.hrh> // for feature definitions
    23 #include    <e32base.h>
    23 #include    <e32base.h>
    24 #include    <rmmcustomapi.h>
    24 #include    <rmmcustomapi.h>
    25 #include    <mmtsy_names.h>
    25 #include    <mmtsy_names.h>
    26 #include    <PSVariables.h> 
    26 #include    <PSVariables.h>
    27 #include    <startupdomainpskeys.h>
    27 #include    <startupdomainpskeys.h>
    28 #include    <centralrepository.h> // central repository 
    28 #include    <centralrepository.h>       // Central repository
    29 #include    <sssettingsprivatecrkeys.h> // settings central repository keys. 
    29 #include    <SSSettingsPrivateCRKeys.h>  // Settings Central Repository keys.
    30 #include    <telservicesinternalcrkeys.h>
    30 #include    <telservicesinternalcrkeys.h>
    31 #include    <telservicesvariant.hrh>
    31 #include    <telservicesvariant.hrh>
    32 
    32 
    33 #include    "rsssettings.h" 
    33 #include    "RSSSettings.h"
    34 #include    "msssettingsobserver.h" 
    34 #include    "MSSSettingsObserver.h"
    35 #include    "csssettingsnotifier.h" 
    35 #include    "CSSSettingsNotifier.h"
    36 #include    "csssettingsalsnotifier.h" 
    36 #include    "CSSSettingsAlsNotifier.h"
    37 #include    "sssettingslogger.h" 
    37 #include    "SSSettingsLogger.h"
    38 
    38 
    39 // CONSTANTS
    39 // CONSTANTS
    40 _LIT( KPanicCat, "SSSettings" );
    40 _LIT( KPanicCat, "SSSettings" );
    41 #define KSSSettingsTSYName KMmTsyModuleName
    41 #define KSSSettingsTSYName KMmTsyModuleName
    42 const TInt KSSSettingsTSYNameMaxLength( 80 );
    42 const TInt KSSSettingsTSYNameMaxLength( 80 );
   498     __ASSERT_DEBUG( aSetting <= KSSSettingsLastSetting, 
   498     __ASSERT_DEBUG( aSetting <= KSSSettingsLastSetting, 
   499                     Panic( SSSettingsPanicInvalidRequest ) );
   499                     Panic( SSSettingsPanicInvalidRequest ) );
   500 
   500 
   501     TInt error(KErrNone);
   501     TInt error(KErrNone);
   502     TInt value(0);
   502     TInt value(0);
       
   503     if ( error != KErrNone )
       
   504         {
       
   505         return error;
       
   506         }
   503 
   507 
   504     // If Get fails, we try to save the default data.
   508     // If Get fails, we try to save the default data.
   505     switch ( aSetting )
   509     switch ( aSetting )
   506         {
   510         {
   507         case ESSSettingsCug:
   511         case ESSSettingsCug:
   700     __SSSLOGSTRING1("[SSS]    RSSSettings::IsALSSupported simAlsValue value:  %d", aSimAlsValue );
   704     __SSSLOGSTRING1("[SSS]    RSSSettings::IsALSSupported simAlsValue value:  %d", aSimAlsValue );
   701     __SSSLOGSTRING1("[SSS]    RSSSettings::IsALSSupported alsCSPSupport value: %d", aAlsCspSupport );
   705     __SSSLOGSTRING1("[SSS]    RSSSettings::IsALSSupported alsCSPSupport value: %d", aAlsCspSupport );
   702     __SSSLOGSTRING1("[SSS]    RSSSettings::IsALSSupported alsCSPError value: %d", aAlsCspError );
   706     __SSSLOGSTRING1("[SSS]    RSSSettings::IsALSSupported alsCSPError value: %d", aAlsCspError );
   703     
   707     
   704     // When PP ALS is on and used SIM card suppports CSP ALS then alsCSPSupport returns EFALSE and alsCSPError KErrNotSupported but ALS functionality
   708     // When PP ALS is on and used SIM card suppports CSP ALS then alsCSPSupport returns EFALSE and alsCSPError KErrNotSupported but ALS functionality
   705     // needs to be shown therefore KErrNone is returned.
   709 	// needs to be shown therefore KErrNone is returned.
   706     if ( aPpAlsValue && !aSimAlsValue && aAlsCspSupport == FALSE && aAlsCspError == KErrNotSupported  )
   710     if ( aPpAlsValue && !aSimAlsValue && aAlsCspSupport == FALSE && aAlsCspError == KErrNotSupported  )
   707         {
   711         {
   708         error = KErrNone;
   712         error = KErrNone;
   709         }          
   713     	}		   
   710     else if ( aPpAlsValue && aSimAlsValue && aAlsCspSupport == FALSE )
   714     else if ( aPpAlsValue && aSimAlsValue && aAlsCspSupport == FALSE )
   711         {
   715     	{
   712         error = KErrNone;
   716     	error = KErrNone;
   713         }
   717     	}
   714     else if ( aPpAlsValue && aSimAlsValue && aAlsCspSupport == TRUE  )
   718     else if ( aPpAlsValue && aSimAlsValue && aAlsCspSupport == TRUE  )
   715         {
   719         {
   716         error = KErrNone;
   720     	error = KErrNone;
   717         }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
   721     	}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
   718     else if ( aPpAlsValue && !aSimAlsValue && aAlsCspSupport == FALSE  )
   722     else if ( aPpAlsValue && !aSimAlsValue && aAlsCspSupport == FALSE  )
   719         {
   723     	{
   720         error = KErrNone;
   724     	error = KErrNone;
   721         }
   725     	}
   722     else if ( aPpAlsValue && !aSimAlsValue && aAlsCspSupport == TRUE  )
   726     else if ( aPpAlsValue && !aSimAlsValue && aAlsCspSupport == TRUE  )
   723         {
   727     	{
   724         error = KErrNone;
   728     	error = KErrNone;
   725         }
   729     	}
   726     else if ( !aPpAlsValue && aSimAlsValue && aAlsCspSupport == TRUE  )
   730     else if ( !aPpAlsValue && aSimAlsValue && aAlsCspSupport == TRUE  )
   727         {
   731     	{
   728         error = KErrNone;
   732     	error = KErrNone;
   729         }
   733     	}
   730     else if ( !aPpAlsValue && aSimAlsValue && aAlsCspSupport == FALSE  )
   734     else if ( !aPpAlsValue && aSimAlsValue && aAlsCspSupport == FALSE  )
   731         {
   735    		{
   732         error = KErrNotSupported;
   736     	error = KErrNotSupported;
   733         }
   737    		}
   734     else if ( !aPpAlsValue && !aSimAlsValue && aAlsCspSupport == TRUE  )
   738     else if ( !aPpAlsValue && !aSimAlsValue && aAlsCspSupport == TRUE  )
   735         {
   739 		{
   736         error = KErrNone;
   740 		error = KErrNone;
   737         }
   741 		}
   738                             
   742 							
   739     return error;   
   743    	return error;   
   740     }
   744     }
   741     
   745     
   742 // ---------------------------------------------------------
   746 // ---------------------------------------------------------
   743 // RSSSettings::Set
   747 // RSSSettings::Set
   744 // ---------------------------------------------------------
   748 // ---------------------------------------------------------
   754 
   758 
   755     __ASSERT_DEBUG( aSetting <= KSSSettingsLastSetting, 
   759     __ASSERT_DEBUG( aSetting <= KSSSettingsLastSetting, 
   756                     Panic( SSSettingsPanicInvalidRequest ) );
   760                     Panic( SSSettingsPanicInvalidRequest ) );
   757 
   761 
   758     TInt error(KErrNone);
   762     TInt error(KErrNone);
       
   763     if ( error != KErrNone )
       
   764         {
       
   765         return error;
       
   766         }
   759 
   767 
   760     switch ( aSetting )
   768     switch ( aSetting )
   761         {
   769         {
   762         case ESSSettingsCug:
   770         case ESSSettingsCug:
   763             {
   771             {