psmservices/psmserver/src/server/psmsrvsession.cpp
branchRCL_3
changeset 12 4a5c47a50617
parent 0 4e1aa6a622a0
child 21 ccb4f6b3db21
equal deleted inserted replaced
10:66ecddbca914 12:4a5c47a50617
     1 /*
     1 /*
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007-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".
    13 *
    13 *
    14 * Description:  PSM Server session
    14 * Description:  PSM Server session
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 #include <e32property.h>
       
    19 #include <connect/sbdefs.h>
    19 #include <psmsettingsprovider.h>
    20 #include <psmsettingsprovider.h>
    20 #include "psmmanager.h"
    21 #include "psmmanager.h"
    21 #include "psmsrvserver.h"
    22 #include "psmsrvserver.h"
    22 #include "psmsrvsession.h"
    23 #include "psmsrvsession.h"
    23 #include "psmsrvmessage.h"
    24 #include "psmsrvmessage.h"
   165 
   166 
   166             if( ( mode > EPsmsrvPartialMode ) || ( mode < EPsmsrvModeNormal ) )
   167             if( ( mode > EPsmsrvPartialMode ) || ( mode < EPsmsrvModeNormal ) )
   167                 {
   168                 {
   168                 User::Leave( KErrArgument );
   169                 User::Leave( KErrArgument );
   169                 }
   170                 }
   170 
   171 			
       
   172             TInt keyVal = -1;
       
   173             User::LeaveIfError( RProperty::Get( KUidSystemCategory, conn::KUidBackupRestoreKey, keyVal ) );
       
   174 			//if backup or restore is in progress, change in power save mode
       
   175 			//is not allowed as it will not be possible to do write
       
   176 			//operation in cenrep and it would leave the device in unstable power saving mode state
       
   177             if( (( keyVal & conn::KBURPartTypeMask ) != conn::EBURNormal ) 
       
   178 				&& (( keyVal & conn::KBURPartTypeMask ) != conn::EBURUnset ))
       
   179 				{
       
   180 				User::Leave( KErrNotSupported );
       
   181 				}
       
   182 			
   171             iNotifyModeMessage->Initialize( aMessage );
   183             iNotifyModeMessage->Initialize( aMessage );
   172             iPsmManager.NotifyPowerSaveModeChangeL( mode );
   184             iPsmManager.NotifyPowerSaveModeChangeL( mode );
   173             break;
   185             break;
   174             }
   186             }
   175         case EPsmServerChangeSettings: // For PSM settings
   187         case EPsmServerChangeSettings: // For PSM settings