alarmui/src/alarmutils.cpp
branchRCL_3
changeset 20 21239b3bcd78
parent 0 f979ecb2b13e
child 27 55d60436f00b
equal deleted inserted replaced
19:1984aceb8774 20:21239b3bcd78
    46 #include <clockdomaincrkeys.h>
    46 #include <clockdomaincrkeys.h>
    47 #include <CalendarInternalCRKeys.h>
    47 #include <CalendarInternalCRKeys.h>
    48 #include <wakeupalarm.h>
    48 #include <wakeupalarm.h>
    49 #include <calalarm.h> // KUidAgendaModelAlarmCategory - the alarm category id for calendar alarms
    49 #include <calalarm.h> // KUidAgendaModelAlarmCategory - the alarm category id for calendar alarms
    50 #include <AknUtils.h>
    50 #include <AknUtils.h>
       
    51 #include <HWRMPowerStateSDKPSKeys.h>
    51 
    52 
    52 #ifndef SYMBIAN_CALENDAR_V2
    53 #ifndef SYMBIAN_CALENDAR_V2
    53 #include <agmalarm.h> // deprecated, use CalAlarm.h when SYMBIAN_CALENDAR_V2 flag is enabled
    54 #include <agmalarm.h> // deprecated, use CalAlarm.h when SYMBIAN_CALENDAR_V2 flag is enabled
    54 #endif // SYMBIAN_CALENDAR_V2
    55 #endif // SYMBIAN_CALENDAR_V2
    55 #include <calsession.h>
    56 #include <calsession.h>
   958 // ---------------------------------------------------------
   959 // ---------------------------------------------------------
   959 //
   960 //
   960 void CAlarmUtils::DeviceShutdown()
   961 void CAlarmUtils::DeviceShutdown()
   961     {
   962     {
   962     TRACE_ENTRY_POINT;
   963     TRACE_ENTRY_POINT;
   963     iShutdownTimer->Cancel();
   964     
   964     if( StarterConnect() )
   965     // charging state added for the err EMDN-835CW2.
   965         {
   966     TInt chargingState;
   966         iStarter.Shutdown();
   967     RProperty::Get( KPSUidHWRMPowerState, KHWRMChargingStatus , chargingState );
   967         iStarter.Close();
   968     
   968         }    
   969     if( IsDeviceInAlarmState() && ( chargingState != EChargingStatusCharging ) )
       
   970         {       
       
   971             iShutdownTimer->Cancel();
       
   972             if( StarterConnect() )
       
   973                 {
       
   974                 iStarter.Shutdown();
       
   975                 iStarter.Close();
       
   976                 }    
       
   977         }
   969     TRACE_EXIT_POINT;
   978     TRACE_EXIT_POINT;
   970     }
   979     }
   971 
   980 
   972 // ---------------------------------------------------------
   981 // ---------------------------------------------------------
   973 // 
   982 //