sysstatemgmt/ssmpolicyplugins/ssmshutdownpolicy/src/ssmshutdownpolicy.cpp
changeset 16 ef634fd8dac3
parent 0 4e1aa6a622a0
child 52 d6b9e89d80a3
equal deleted inserted replaced
13:cef4ff1e6c4f 16:ef634fd8dac3
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 #include <ssm/ssmclayer.h>
    19 #include <ssm/ssmclayer.h>
    20 #include <ssm/ssmstate.h>
    20 #include <ssm/ssmstate.h>
    21 #include <ssm/ssmstatetransition.h>
    21 #include <ssm/ssmstatetransition.h>
    22 #include <ssm/starterclient.h>
    22 #include <ssm/starterclient.h>
    23 #include <ssm/starterdomaincrkeys.h>
    23 #include <ssm/starterdomaincrkeys.h>
       
    24 #include <ssm/ssmuiproviderdll.h>
    24 
    25 
    25 #include "ssmsubstateext.hrh"
    26 #include "ssmsubstateext.hrh"
    26 #include "ssmmapperutility.h"
    27 #include "ssmmapperutility.h"
    27 #include "ssmshutdownpolicy.h"
    28 #include "ssmshutdownpolicy.h"
    28 #include "trace.h"
    29 #include "trace.h"
   213 
   214 
   214     CRepository* repository =
   215     CRepository* repository =
   215         CRepository::NewLC( iUtil->CrUid( KCRUidStartup ) );
   216         CRepository::NewLC( iUtil->CrUid( KCRUidStartup ) );
   216     TInt errorCode = repository->Set( KStartupReason, aReasonCode );
   217     TInt errorCode = repository->Set( KStartupReason, aReasonCode );
   217     ERROR( errorCode, "Failed to set KStartupReason CenRep key" );
   218     ERROR( errorCode, "Failed to set KStartupReason CenRep key" );
       
   219 
       
   220 	if( KErrDiskFull == errorCode )
       
   221 		{
       
   222 		//Need not to put on CleanupStack, it's not calling any leaving function and
       
   223 		//it's handled by reference count
       
   224 		CSsmUiSpecific* ssmUiSpecific = CSsmUiSpecific::InstanceL();
       
   225 		//Free complete reserve space
       
   226 		errorCode = ssmUiSpecific->FreeReservedPhoneMemorySpace( 0 );
       
   227 		if( KErrNone == errorCode )
       
   228 			{
       
   229 			errorCode = repository->Set( KStartupReason, aReasonCode );
       
   230 			ERROR( errorCode, "Failed to set KStartupReason CenRep key after freeing the memory" );
       
   231 			}
       
   232 		CSsmUiSpecific::Release();
       
   233 		}
       
   234     
   218     CleanupStack::PopAndDestroy( repository );
   235     CleanupStack::PopAndDestroy( repository );
   219     User::LeaveIfError( errorCode );
   236     User::LeaveIfError( errorCode );
   220     }
   237     }