sysstatemgmt/systemstateplugins/adptplugin/src/miscadaptationref.cpp
branchRCL_3
changeset 22 8cb079868133
parent 21 ccb4f6b3db21
equal deleted inserted replaced
21:ccb4f6b3db21 22:8cb079868133
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description: This adaptation plugin implementation is for test/reference purposes.   
    13 // Description:
    14 // The loading of this plugin is controlled through test macro defined in the iby file "ssmcompatibility.iby".
       
    15 // If the macro "TEST_SSM_MACRO" is not defined, original plugins are loaded and this plugin is not loaded.
       
    16 // If the test P & S key is set in the test code, the calls are routed to the reference or dummy implementations.
       
    17 // Else the actual plugins are loaded and the calls are routed to the actual implementations.
       
    18 // The test P & S key which it looks for is KMiscPluginPropertyKey(0x2000E658)
       
    19 //
    14 //
    20 
    15 
    21 #include "ssmdebug.h"
       
    22 #include "miscadaptationref.h"
    16 #include "miscadaptationref.h"
    23 #include <ssm/startupadaptationcommands.h>
    17 #include <ssm/startupadaptationcommands.h>
    24 #include <e32property.h> 
       
    25 
    18 
    26 _LIT(KTestCmdSecurityCheckTestFile, "c:\\cmdsecuritychecktest\\pinchecksecuritycaseno.txt");
    19 _LIT(KTestCmdSecurityCheckTestFile, "c:\\cmdsecuritychecktest\\pinchecksecuritycaseno.txt");
    27 
    20 
    28 const TUint32 KMiscPluginPropertyKey = 0x2000E658;
       
    29 const TUid KPropertyCategory={0x2000D75B};              // tcustomcmd_server SID = KSsmServerName SID (changed in tcustomcmd_server.mmp file)
       
    30 /**
    21 /**
    31  Function to create new Misc Adaptation Plugin. Used for a collection of activities.
    22  Function to create new Misc Adaptation Plugin. Used for a collection of activities.
    32 
    23 
    33  @return	new instance of MEmergencyCallRfAdaptation for Miscellaneous Adaptations.
    24  @return	new instance of MEmergencyCallRfAdaptation for Miscellaneous Adaptations.
    34 
    25 
    49 	}
    40 	}
    50 
    41 
    51 CMiscAdaptationRef::~CMiscAdaptationRef()
    42 CMiscAdaptationRef::~CMiscAdaptationRef()
    52 	{
    43 	{
    53 	iFs.Close();
    44 	iFs.Close();
    54 	iSaaMiscAdaptationLib.Close();
       
    55 	}
    45 	}
    56 
    46 
    57 CMiscAdaptationRef::CMiscAdaptationRef()
    47 CMiscAdaptationRef::CMiscAdaptationRef()
    58 	{
    48 	{
    59 	}
    49 	}
    60 
    50 
    61 void CMiscAdaptationRef::ConstructL()
    51 void CMiscAdaptationRef::ConstructL()
    62 	{
    52 	{
    63 	DEBUGPRINT1A("Loading Actual plugins");
       
    64     _LIT(KSaaMiscAdaptationDLL, "saamiscadaptation.dll");
       
    65     User::LeaveIfError(iSaaMiscAdaptationLib.Load(KSaaMiscAdaptationDLL));
       
    66     iSaaMiscAdaptationDll = (MMiscAdaptation *)(iSaaMiscAdaptationLib.Lookup(1)());   
       
    67     
       
    68 	iTestCaseNum = 1;
    53 	iTestCaseNum = 1;
    69 	User::LeaveIfError(iFs.Connect());
    54 	User::LeaveIfError(iFs.Connect());
    70 	}
    55 	}
    71 
    56 
    72 /** 
    57 /** 
    73  Deletes and frees memory allocated.
    58  Deletes and frees memory allocated.
    74 */
    59 */
    75 void CMiscAdaptationRef::Release()
    60 void CMiscAdaptationRef::Release()
    76 	{
    61 	{
    77 	if(!IsTestPsKeyDefined())
       
    78 	    {
       
    79 	    DEBUGPRINT1A("Release :: Calling Actual plugins functions (saamiscadaptation.dll)");
       
    80 	    iSaaMiscAdaptationDll->Release();
       
    81 	    }
       
    82 	delete this;
    62 	delete this;
    83 	}
    63 	}
    84 
    64 
    85 /**
    65 /**
    86  Get the start-up mode from the Cooperating System.
    66  Get the start-up mode from the Cooperating System.
    87  Reference implementation completes the request with KErrNone. This is required for automated testing.
    67  Reference implementation completes with KErrNone as a cooperating system does not exist on Techview/H4 hrp.
    88  Actual plugins return expected values and this can be verified by manual testing
       
    89 
    68 
    90  @param aModePckg should contain start-up of the Cooperating System on completion
    69  @param aModePckg should contain start-up of the Cooperating System on completion
    91  @param aStatus to complete when the operation has finished
    70  @param aStatus to complete when the operation has finished
    92 
    71 
    93  @see TRequestStatus
    72  @see TRequestStatus
    94 */
    73 */
    95 void CMiscAdaptationRef::GetGlobalStartupMode(TDes8& aModePckg, TRequestStatus& aStatus)
    74 void CMiscAdaptationRef::GetGlobalStartupMode(TDes8& /*aModePckg*/, TRequestStatus& aStatus)
    96 	{
    75 	{
    97 	if(!IsTestPsKeyDefined())
    76 	aStatus = KRequestPending;
    98 	    {
    77 	TRequestStatus* status = &aStatus;
    99 	    DEBUGPRINT1A("GetGlobalStartupMode :: Calling Actual plugins functions (saamiscadaptation.dll)");
    78 	User::RequestComplete(status, KErrNone);
   100         iSaaMiscAdaptationDll->GetGlobalStartupMode(aModePckg,aStatus);
       
   101 	    }
       
   102 	else
       
   103 	    {
       
   104 	    DEBUGPRINT1A("GetGlobalStartupMode :: Calling ref plugins functions (miscadaptationref.dll)");
       
   105         aStatus = KRequestPending;
       
   106         TRequestStatus* status = &aStatus;
       
   107         User::RequestComplete(status, KErrNone);        
       
   108 	    }
       
   109 	}
    79 	}
   110 
    80 
   111 /**
    81 /**
   112  Prepare language codes stored in the SIM in preferred language lists. The next call should be GetSimLanguagesL()
    82  Prepare language codes stored in the SIM in preferred language lists. The next call should be GetSimLanguagesL()
   113  Reference implementation completes with KErrNotSupported. This is required for automated testing.
    83  Reference implementation completes with KErrNotSupported as SIM support is not available on Techview/H4 hrp.
   114  Actual plugins return expected values and this can be verified by manual testing
    84 
   115  
       
   116  @param aPriority priority for which the language lists need to be prepared
    85  @param aPriority priority for which the language lists need to be prepared
   117  @param aSizePckg on return contains the size of the buffer, which a client should allocate and pass as one of the parameters (TInt aCount) to GetSimLanguagesL()
    86  @param aSizePckg on return contains the size of the buffer, which a client should allocate and pass as one of the parameters (TInt aCount) to GetSimLanguagesL()
   118  @param aStatus to complete when the operation has finished
    87  @param aStatus to complete when the operation has finished
   119 
    88 
   120  @see TSsmLanguageListPriority
    89  @see TSsmLanguageListPriority
   121  @see TRequestStatus
    90  @see TRequestStatus
   122  @see GetSimLanguagesL
    91  @see GetSimLanguagesL
   123 */
    92 */
   124 void CMiscAdaptationRef::PrepareSimLanguages(TSsmLanguageListPriority aPriority, TDes8& aSizePckg, TRequestStatus& aStatus)
    93 void CMiscAdaptationRef::PrepareSimLanguages(TSsmLanguageListPriority /*aPriority*/, TDes8& /*aSizePckg*/, TRequestStatus& aStatus)
   125 	{
    94 	{
   126 	if(!IsTestPsKeyDefined())
    95 	aStatus = KRequestPending;
   127         {
    96 	TRequestStatus* status = &aStatus;
   128         DEBUGPRINT1A("PrepareSimLanguages :: Calling Actual plugins functions (saamiscadaptation.dll)");
    97 	// No support for SIM on H4hrp/Techview.
   129         iSaaMiscAdaptationDll->PrepareSimLanguages(aPriority,aSizePckg,aStatus);
    98 	User::RequestComplete(status, KErrNotSupported);
   130         }
       
   131     else
       
   132         {
       
   133         DEBUGPRINT1A("PrepareSimLanguages :: Calling ref plugins functions (miscadaptationref.dll)");
       
   134         aStatus = KRequestPending;
       
   135         TRequestStatus* status = &aStatus;
       
   136         // No support for SIM on H4hrp/Techview.
       
   137         User::RequestComplete(status, KErrNotSupported);
       
   138         }
       
   139 	}
    99 	}
   140 
   100 
   141 /**
   101 /**
   142  Get language codes stored in the SIM in preferred language lists. PrepareSimLanguages() call should precede this call.
   102  Get language codes stored in the SIM in preferred language lists. PrepareSimLanguages() call should precede this call.
   143  Reference implementation completes with KErrNotSupported.  This is required for automated testing.
   103  Reference implementation completes with KErrNotSupported as SIM support is not available on Techview/H4 hrp.
   144  Actual plugins return expected values and this can be verified by manual testing
   104 
   145  
       
   146  @param aBuf should contain the language lists on completion
   105  @param aBuf should contain the language lists on completion
   147  @param aCount to contain the count of the languages
   106  @param aCount to contain the count of the languages
   148 
   107 
   149  @see PrepareSimLanguages
   108  @see PrepareSimLanguages
   150 */
   109 */
   151 void CMiscAdaptationRef::GetSimLanguagesL(CBufBase* aBuf, TInt aCount)
   110 void CMiscAdaptationRef::GetSimLanguagesL(CBufBase* /*aBuf*/, TInt /*aCount*/)
   152 	{
   111 	{
   153 	if(!IsTestPsKeyDefined())
   112 	User::Leave(KErrNotSupported);
   154         {
   113 	}
   155         DEBUGPRINT1A("GetSimLanguagesL :: Calling Actual plugins functions (saamiscadaptation.dll)");
   114 
   156         iSaaMiscAdaptationDll->GetSimLanguagesL(aBuf,aCount);
   115 void CMiscAdaptationRef::GetHiddenReset(TDes8& /*aHiddenResetPckg*/, TRequestStatus& aStatus)
   157         }
   116 	{
   158     else
   117 	aStatus = KRequestPending;
   159         {
   118 	TRequestStatus* status = &aStatus;
   160         DEBUGPRINT1A("GetSimLanguagesL :: Calling ref plugins functions (miscadaptationref.dll)");
   119 	// No support for Reset in HRP/Techview.
   161         User::Leave(KErrNotSupported);
   120 	User::RequestComplete(status, KErrNotSupported);
   162         }	
       
   163 	}
       
   164 
       
   165 void CMiscAdaptationRef::GetHiddenReset(TDes8& aHiddenResetPckg, TRequestStatus& aStatus)
       
   166 	{
       
   167 	if(!IsTestPsKeyDefined())
       
   168         {
       
   169         DEBUGPRINT1A("GetHiddenReset :: Calling Actual plugins functions (saamiscadaptation.dll)");
       
   170         iSaaMiscAdaptationDll->GetHiddenReset(aHiddenResetPckg,aStatus);
       
   171         }
       
   172     else
       
   173         {
       
   174         DEBUGPRINT1A("GetHiddenReset :: Calling ref plugins functions (miscadaptationref.dll)");
       
   175         aStatus = KRequestPending;
       
   176         TRequestStatus* status = &aStatus;
       
   177         // No support for Reset in HRP/Techview.
       
   178         User::RequestComplete(status, KErrNotSupported);        
       
   179         }
       
   180 	}
   121 	}
   181 
   122 
   182 
   123 
   183 /**
   124 /**
   184   Cancel the outstanding request. Reference implementation completes the requests immediately so there is nothing to Cancel.
   125   Cancel the outstanding request. Reference implementation completes the requests immediately so there is nothing to Cancel.
   185   On a device, Cancel() needs an implementation as the Request might be outstanding and it needs to be cancelled.
   126   On a device, Cancel() needs an implementation as the Request might be outstanding and it needs to be cancelled.
   186 */
   127 */
   187 void CMiscAdaptationRef::Cancel()
   128 void CMiscAdaptationRef::Cancel()
   188 	{
   129 	{
   189 	if(!IsTestPsKeyDefined())
       
   190         {
       
   191         DEBUGPRINT1A("Cancel :: Calling Actual plugins functions (saamiscadaptation.dll)");
       
   192         iSaaMiscAdaptationDll->Cancel();
       
   193         }
       
   194 	}
   130 	}
   195 
   131 
   196 /**
   132 /**
   197  Request the next security state.
   133  Request the next security state.
   198  Reference implementation would always return 'KErrNotSupported'.  This is required for automated testing.
   134  Techview/H4hrp does not support SIM operations so a reference implementation would always return 'KErrNotSupported'.
   199  Actual plugins return expected values and this can be verified by manual testing
       
   200   
       
   201  The function is modified to suit testing needs for PinCheck Security Command.
   135  The function is modified to suit testing needs for PinCheck Security Command.
   202  A real implementation is intended to differ a lot based on the runtime changes/events on the device.
   136  A real implementation is intended to differ a lot based on the runtime changes/events on the device.
   203  
   137  
   204  Each switch case represents a PIN Check security plug-in functionality in different status are as follows..
   138  Each switch case represents a PIN Check security plug-in functionality in different status are as follows..
   205  
   139  
   219 
   153 
   220  @see TRequestStatus
   154  @see TRequestStatus
   221 */
   155 */
   222 void CMiscAdaptationRef::SecurityStateChange(TInt aState, TDes8& aResponsePckg, TRequestStatus& aStatus)
   156 void CMiscAdaptationRef::SecurityStateChange(TInt aState, TDes8& aResponsePckg, TRequestStatus& aStatus)
   223 	{
   157 	{
   224 	if(!IsTestPsKeyDefined())
   158 	aStatus = KRequestPending;
   225         {
   159 	TRequestStatus* status = &aStatus;
   226         DEBUGPRINT1A("SecurityStateChange:: Calling Actual plugins functions (saamiscadaptation.dll)");
   160 	StartupAdaptation::TSecurityStateInfo info = StartupAdaptation::EYes;
   227         iSaaMiscAdaptationDll->SecurityStateChange(aState,aResponsePckg,aStatus);
   161 	
   228         }
   162 	//Read Test case number from the file 
   229     else
   163 	TInt err = iFile.Open(iFs, KTestCmdSecurityCheckTestFile, EFileRead);
   230         {
   164 	if (err == KErrNone)
   231         DEBUGPRINT1A("SecurityStateChange:: Calling ref plugins functions (miscadaptationref.dll)");
   165 		{
   232         aStatus = KRequestPending;
   166 		TRAP(err,iTestCaseNum = iFile.ReadInt32L());
   233         TRequestStatus* status = &aStatus;
   167 		iFile.Close();
   234         StartupAdaptation::TSecurityStateInfo info = StartupAdaptation::EYes;
   168 		if(err)
   235         
   169 			{
   236         //Read Test case number from the file 
   170 			RDebug::Printf("Error while reading tst case number from the file pinchecksecuritycaseno.txt");
   237         TInt err = iFile.Open(iFs, KTestCmdSecurityCheckTestFile, EFileRead);
   171 			User::RequestComplete(status, err);
   238         if (err == KErrNone)
   172 			return;
   239             {
   173 			}
   240             TRAP(err,iTestCaseNum = iFile.ReadInt32L());
   174 		}	
   241             iFile.Close();
   175 	switch(iTestCaseNum)
   242             if(err)
   176 		{
   243                 {
   177 		case EPINCHECK01:
   244                 RDebug::Printf("Error while reading tst case number from the file pinchecksecuritycaseno.txt");
   178 			switch(aState)
   245                 User::RequestComplete(status, err);
   179 			{
   246                 return;
   180 			case StartupAdaptation::ESIMPresent:
   247                 }
   181 				info = StartupAdaptation::EYes;
   248             }   
   182 				break;
   249         switch(iTestCaseNum)
   183             case StartupAdaptation::ESIMInvalid:
   250             {
   184                 info = StartupAdaptation::ENo;
   251             case EPINCHECK01:
   185                 break;
   252                 switch(aState)
   186 			case StartupAdaptation::ESIMRejected:
   253                 {
   187 				info = StartupAdaptation::ENo;
   254                 case StartupAdaptation::ESIMPresent:
   188 				break;
   255                     info = StartupAdaptation::EYes;
   189 			case StartupAdaptation::ESIMBlocked:
   256                     break;
   190 				info = StartupAdaptation::ENo;
   257                 case StartupAdaptation::ESIMInvalid:
   191 				break;
   258                     info = StartupAdaptation::ENo;
   192 			case StartupAdaptation::EPINRequired:
   259                     break;
   193 				info = StartupAdaptation::EPIN1Required;
   260                 case StartupAdaptation::ESIMRejected:
   194 				break;
   261                     info = StartupAdaptation::ENo;
   195 			case StartupAdaptation::ESIMLock:
   262                     break;
   196 				info = StartupAdaptation::ESimLockOk;
   263                 case StartupAdaptation::ESIMBlocked:
   197 				break;
   264                     info = StartupAdaptation::ENo;
   198 			case StartupAdaptation::ESecurityCheckOK:
   265                     break;
   199 				info = StartupAdaptation::EYes;	
   266                 case StartupAdaptation::EPINRequired:
   200 				break;	
   267                     info = StartupAdaptation::EPIN1Required;
   201 			case StartupAdaptation::ESecurityCheckFailed:
   268                     break;
   202 				info = StartupAdaptation::EYes;
   269                 case StartupAdaptation::ESIMLock:
   203 				break;	
   270                     info = StartupAdaptation::ESimLockOk;
   204 			default:
   271                     break;
   205 				break;
   272                 case StartupAdaptation::ESecurityCheckOK:
   206 			}
   273                     info = StartupAdaptation::EYes; 
   207 			break;
   274                     break;  
   208 		case EPINCHECK02:
   275                 case StartupAdaptation::ESecurityCheckFailed:
   209 			switch(aState)
   276                     info = StartupAdaptation::EYes;
   210 			{
   277                     break;  
   211 			case StartupAdaptation::ESIMPresent:
   278                 default:
   212 				info = StartupAdaptation::EYes;
   279                     break;
   213 				break;
   280                 }
   214             case StartupAdaptation::ESIMInvalid:
   281                 break;
   215                 info = StartupAdaptation::ENo;
   282             case EPINCHECK02:
   216                 break;
   283                 switch(aState)
   217 			case StartupAdaptation::ESIMRejected:
   284                 {
   218 				info = StartupAdaptation::EYes;
   285                 case StartupAdaptation::ESIMPresent:
   219 				break;
   286                     info = StartupAdaptation::EYes;
   220 			case StartupAdaptation::ESecurityCheckFailed:
   287                     break;
   221 				info = StartupAdaptation::EYes;
   288                 case StartupAdaptation::ESIMInvalid:
   222 				break;	
   289                     info = StartupAdaptation::ENo;
   223 			default:
   290                     break;
   224 			break;
   291                 case StartupAdaptation::ESIMRejected:
   225 			}
   292                     info = StartupAdaptation::EYes;
   226 			break;
   293                     break;
   227 		case EPINCHECK03:
   294                 case StartupAdaptation::ESecurityCheckFailed:
   228 			switch(aState)
   295                     info = StartupAdaptation::EYes;
   229 			{
   296                     break;  
   230 			case StartupAdaptation::ESIMPresent:
   297                 default:
   231 				info = StartupAdaptation::EYes;
   298                 break;
   232 				break;
   299                 }
   233             case StartupAdaptation::ESIMInvalid:
   300                 break;
   234                 info = StartupAdaptation::ENo;
   301             case EPINCHECK03:
   235                 break;
   302                 switch(aState)
   236 			case StartupAdaptation::ESIMRejected:
   303                 {
   237 				info = StartupAdaptation::ENo;
   304                 case StartupAdaptation::ESIMPresent:
   238 				break;
   305                     info = StartupAdaptation::EYes;
   239 			case StartupAdaptation::ESIMBlocked:
   306                     break;
   240 				info = StartupAdaptation::EPUK1Required;
   307                 case StartupAdaptation::ESIMInvalid:
   241 				break;	
   308                     info = StartupAdaptation::ENo;
   242 			case StartupAdaptation::ESIMLock:
   309                     break;
   243 				info = StartupAdaptation::ESimLockOk;
   310                 case StartupAdaptation::ESIMRejected:
   244 				break;
   311                     info = StartupAdaptation::ENo;
   245 			case StartupAdaptation::ESecurityCheckOK:
   312                     break;
   246 				info = StartupAdaptation::EYes;	
   313                 case StartupAdaptation::ESIMBlocked:
   247 				break;	
   314                     info = StartupAdaptation::EPUK1Required;
   248 			case StartupAdaptation::ESecurityCheckFailed:
   315                     break;  
   249 				info = StartupAdaptation::EYes;
   316                 case StartupAdaptation::ESIMLock:
   250 				break;	
   317                     info = StartupAdaptation::ESimLockOk;
   251 			default:
   318                     break;
   252 				break;
   319                 case StartupAdaptation::ESecurityCheckOK:
   253 			}
   320                     info = StartupAdaptation::EYes; 
   254 			break;
   321                     break;  
   255 		case EPINCHECK04:
   322                 case StartupAdaptation::ESecurityCheckFailed:
   256 			switch(aState)
   323                     info = StartupAdaptation::EYes;
   257 			{
   324                     break;  
   258 			case StartupAdaptation::ESIMPresent:
   325                 default:
   259 				info = StartupAdaptation::EYes;
   326                     break;
   260 				break;
   327                 }
   261             case StartupAdaptation::ESIMInvalid:
   328                 break;
   262                 info = StartupAdaptation::ENo;
   329             case EPINCHECK04:
   263                 break;
   330                 switch(aState)
   264 			case StartupAdaptation::ESIMRejected:
   331                 {
   265 				info = StartupAdaptation::ENo;
   332                 case StartupAdaptation::ESIMPresent:
   266 				break;
   333                     info = StartupAdaptation::EYes;
   267 			case StartupAdaptation::ESIMBlocked:
   334                     break;
   268 				info = StartupAdaptation::EPUK1Required;
   335                 case StartupAdaptation::ESIMInvalid:
   269 				break;	
   336                     info = StartupAdaptation::ENo;
   270 			case StartupAdaptation::ESIMLock:
   337                     break;
   271 				info = StartupAdaptation::ESimLockOk;
   338                 case StartupAdaptation::ESIMRejected:
   272 				break;
   339                     info = StartupAdaptation::ENo;
   273 			case StartupAdaptation::ESecurityCheckOK:
   340                     break;
   274 				info = StartupAdaptation::EYes;	
   341                 case StartupAdaptation::ESIMBlocked:
   275 				break;	
   342                     info = StartupAdaptation::EPUK1Required;
   276 			case StartupAdaptation::ESecurityCheckFailed:
   343                     break;  
   277 				info = StartupAdaptation::EYes;
   344                 case StartupAdaptation::ESIMLock:
   278 				break;	
   345                     info = StartupAdaptation::ESimLockOk;
   279 			default:
   346                     break;
   280 				break;
   347                 case StartupAdaptation::ESecurityCheckOK:
   281 			}	
   348                     info = StartupAdaptation::EYes; 
   282 			break;
   349                     break;  
   283 		case EPINCHECK05:
   350                 case StartupAdaptation::ESecurityCheckFailed:
   284 			switch(aState)
   351                     info = StartupAdaptation::EYes;
   285 			{
   352                     break;  
   286 			case StartupAdaptation::ESIMPresent:
   353                 default:
   287 				info = StartupAdaptation::EYes;
   354                     break;
   288 				break;
   355                 }   
   289             case StartupAdaptation::ESIMInvalid:
   356                 break;
   290                 info = StartupAdaptation::ENo;
   357             case EPINCHECK05:
   291                 break;
   358                 switch(aState)
   292 			case StartupAdaptation::ESIMRejected:
   359                 {
   293 				info = StartupAdaptation::ENo;
   360                 case StartupAdaptation::ESIMPresent:
   294 				break;
   361                     info = StartupAdaptation::EYes;
   295 			case StartupAdaptation::ESIMBlocked:
   362                     break;
   296 				info = StartupAdaptation::EUPUKRequired;
   363                 case StartupAdaptation::ESIMInvalid:
   297 				break;	
   364                     info = StartupAdaptation::ENo;
   298 			case StartupAdaptation::ESIMLock:
   365                     break;
   299 				info = StartupAdaptation::ESimLockRestrictionOn;
   366                 case StartupAdaptation::ESIMRejected:
   300 				break;
   367                     info = StartupAdaptation::ENo;
   301 			case StartupAdaptation::ESecurityCheckOK:
   368                     break;
   302 				info = StartupAdaptation::EYes;	
   369                 case StartupAdaptation::ESIMBlocked:
   303 				break;	
   370                     info = StartupAdaptation::EUPUKRequired;
   304 			case StartupAdaptation::ESecurityCheckFailed:
   371                     break;  
   305 				info = StartupAdaptation::EYes;
   372                 case StartupAdaptation::ESIMLock:
   306 				break;	
   373                     info = StartupAdaptation::ESimLockRestrictionOn;
   307 			default:
   374                     break;
   308 				break;	
   375                 case StartupAdaptation::ESecurityCheckOK:
   309 			}	
   376                     info = StartupAdaptation::EYes; 
   310 			break;
   377                     break;  
   311 		case EPINCHECK06:
   378                 case StartupAdaptation::ESecurityCheckFailed:
   312 			switch(aState)
   379                     info = StartupAdaptation::EYes;
   313 			{
   380                     break;  
   314 			case StartupAdaptation::ESIMPresent:
   381                 default:
   315 				info = StartupAdaptation::EYes;
   382                     break;  
   316 				break;
   383                 }   
   317             case StartupAdaptation::ESIMInvalid:
   384                 break;
   318                 info = StartupAdaptation::ENo;
   385             case EPINCHECK06:
   319                 break;
   386                 switch(aState)
   320 			case StartupAdaptation::ESIMRejected:
   387                 {
   321 				info = StartupAdaptation::ENo;
   388                 case StartupAdaptation::ESIMPresent:
   322 				break;
   389                     info = StartupAdaptation::EYes;
   323 			case StartupAdaptation::ESIMBlocked:
   390                     break;
   324 				info = StartupAdaptation::EUPUKRequired;
   391                 case StartupAdaptation::ESIMInvalid:
   325 				break;	
   392                     info = StartupAdaptation::ENo;
   326 			case StartupAdaptation::ESIMLock:
   393                     break;
   327 				info = StartupAdaptation::ESimLockRestrictionPending;
   394                 case StartupAdaptation::ESIMRejected:
   328 				break;
   395                     info = StartupAdaptation::ENo;
   329 			case StartupAdaptation::ESecurityCheckOK:
   396                     break;
   330 				info = StartupAdaptation::EYes;	
   397                 case StartupAdaptation::ESIMBlocked:
   331 				break;	
   398                     info = StartupAdaptation::EUPUKRequired;
   332 			case StartupAdaptation::ESecurityCheckFailed:
   399                     break;  
   333 				info = StartupAdaptation::EYes;	
   400                 case StartupAdaptation::ESIMLock:
   334 				break;	
   401                     info = StartupAdaptation::ESimLockRestrictionPending;
   335 			default:
   402                     break;
   336 				break;	
   403                 case StartupAdaptation::ESecurityCheckOK:
   337 			}
   404                     info = StartupAdaptation::EYes; 
   338 			break;
   405                     break;  
   339 		case EPINCHECK07:
   406                 case StartupAdaptation::ESecurityCheckFailed:
   340 			switch(aState)
   407                     info = StartupAdaptation::EYes; 
   341 			{
   408                     break;  
   342 			case StartupAdaptation::ESIMPresent:
   409                 default:
   343 				info = StartupAdaptation::EYes;
   410                     break;  
   344 				break;
   411                 }
   345             case StartupAdaptation::ESIMInvalid:
   412                 break;
   346                 info = StartupAdaptation::ENo;
   413             case EPINCHECK07:
   347                 break;
   414                 switch(aState)
   348 			case StartupAdaptation::ESIMRejected:
   415                 {
   349 				info = StartupAdaptation::ENo;
   416                 case StartupAdaptation::ESIMPresent:
   350 				break;
   417                     info = StartupAdaptation::EYes;
   351 			case StartupAdaptation::ESIMBlocked:
   418                     break;
   352 				info = StartupAdaptation::EUPUKRequired;
   419                 case StartupAdaptation::ESIMInvalid:
   353 				break;	
   420                     info = StartupAdaptation::ENo;
   354 			case StartupAdaptation::ESIMLock:
   421                     break;
   355 				info = StartupAdaptation::ESimLockRestricted;
   422                 case StartupAdaptation::ESIMRejected:
   356 				break;
   423                     info = StartupAdaptation::ENo;
   357 			case StartupAdaptation::ESecurityCheckOK:
   424                     break;
   358 				info = StartupAdaptation::EYes;	
   425                 case StartupAdaptation::ESIMBlocked:
   359 				break;	
   426                     info = StartupAdaptation::EUPUKRequired;
   360 			case StartupAdaptation::ESecurityCheckFailed:
   427                     break;  
   361 				info = StartupAdaptation::EYes;	
   428                 case StartupAdaptation::ESIMLock:
   362 				break;	
   429                     info = StartupAdaptation::ESimLockRestricted;
   363 			default:
   430                     break;
   364 				break;	
   431                 case StartupAdaptation::ESecurityCheckOK:
   365 			}
   432                     info = StartupAdaptation::EYes; 
   366 			break;
   433                     break;  
   367 		case EPINCHECK08:
   434                 case StartupAdaptation::ESecurityCheckFailed:
   368 		switch(aState)
   435                     info = StartupAdaptation::EYes; 
   369 			{
   436                     break;  
   370 			case StartupAdaptation::ESIMPresent:
   437                 default:
   371 				info = StartupAdaptation::EYes;
   438                     break;  
   372 				break;
   439                 }
   373 			case StartupAdaptation::ESIMInvalid:
   440                 break;
   374 			    info = StartupAdaptation::ENo;
   441             case EPINCHECK08:
   375 			    break;
   442             switch(aState)
   376 			case StartupAdaptation::ESIMRejected:
   443                 {
   377 				info = StartupAdaptation::ENo;
   444                 case StartupAdaptation::ESIMPresent:
   378 				break;
   445                     info = StartupAdaptation::EYes;
   379 			case StartupAdaptation::ESIMBlocked:
   446                     break;
   380 				info = StartupAdaptation::ENo;
   447                 case StartupAdaptation::ESIMInvalid:
   381 				break;
   448                     info = StartupAdaptation::ENo;
   382 			case StartupAdaptation::EPINRequired:
   449                     break;
   383 				info = StartupAdaptation::EPIN1Required;
   450                 case StartupAdaptation::ESIMRejected:
   384 				break;
   451                     info = StartupAdaptation::ENo;
   385 			case StartupAdaptation::ESIMLock:
   452                     break;
   386 				info = StartupAdaptation::ESimLockOk;
   453                 case StartupAdaptation::ESIMBlocked:
   387 				break;
   454                     info = StartupAdaptation::ENo;
   388 			case StartupAdaptation::ESecurityCheckOK:
   455                     break;
   389 				info = StartupAdaptation::EYes;	
   456                 case StartupAdaptation::EPINRequired:
   390 				break;	
   457                     info = StartupAdaptation::EPIN1Required;
   391 			case StartupAdaptation::ESecurityCheckFailed:
   458                     break;
   392 				info = StartupAdaptation::EYes;	
   459                 case StartupAdaptation::ESIMLock:
   393 				break;	
   460                     info = StartupAdaptation::ESimLockOk;
   394 			default:
   461                     break;
   395 				break;
   462                 case StartupAdaptation::ESecurityCheckOK:
   396 			}	
   463                     info = StartupAdaptation::EYes; 
   397 			break;	
   464                     break;  
   398 		default:
   465                 case StartupAdaptation::ESecurityCheckFailed:
   399 			break;
   466                     info = StartupAdaptation::EYes; 
   400 		}
   467                     break;  
   401 	TPckgBuf<StartupAdaptation::TSecurityStateInfo> securityStateInfoResult(info);
   468                 default:
   402 	aResponsePckg = securityStateInfoResult;	
   469                     break;
   403 	User::RequestComplete(status, KErrNone);
   470                 }   
   404 	}
   471                 break;  
   405 
   472             default:
       
   473                 break;
       
   474             }
       
   475         TPckgBuf<StartupAdaptation::TSecurityStateInfo> securityStateInfoResult(info);
       
   476         aResponsePckg = securityStateInfoResult;    
       
   477         User::RequestComplete(status, KErrNone);
       
   478         }
       
   479 	}
       
   480 
       
   481 /**
       
   482     Helper function to check for P&S Key
       
   483 */
       
   484 TBool CMiscAdaptationRef::IsTestPsKeyDefined()
       
   485     {
       
   486     TBool testPsKeyDefined = EFalse;
       
   487     TInt result = RProperty::Get(KPropertyCategory, KMiscPluginPropertyKey, testPsKeyDefined);
       
   488     DEBUGPRINT3(_L("KMiscPluginPropertyKey %d Error %d"), testPsKeyDefined, result);
       
   489     if ((KErrNone != result) && (KErrNotFound != result))
       
   490         {
       
   491         //Could not retrieve property value. Tests might fail 
       
   492         DEBUGPRINT1A("IsTestPsKeyDefined ERROR :: Could not retrieve property value)");
       
   493         }
       
   494     return testPsKeyDefined;
       
   495     }
       
   496