alarmui/src/alarmutils.cpp
branchRCL_3
changeset 20 21239b3bcd78
parent 0 f979ecb2b13e
child 27 55d60436f00b
--- a/alarmui/src/alarmutils.cpp	Wed Mar 31 21:29:10 2010 +0300
+++ b/alarmui/src/alarmutils.cpp	Wed Apr 14 15:55:57 2010 +0300
@@ -48,6 +48,7 @@
 #include <wakeupalarm.h>
 #include <calalarm.h> // KUidAgendaModelAlarmCategory - the alarm category id for calendar alarms
 #include <AknUtils.h>
+#include <HWRMPowerStateSDKPSKeys.h>
 
 #ifndef SYMBIAN_CALENDAR_V2
 #include <agmalarm.h> // deprecated, use CalAlarm.h when SYMBIAN_CALENDAR_V2 flag is enabled
@@ -960,12 +961,20 @@
 void CAlarmUtils::DeviceShutdown()
     {
     TRACE_ENTRY_POINT;
-    iShutdownTimer->Cancel();
-    if( StarterConnect() )
-        {
-        iStarter.Shutdown();
-        iStarter.Close();
-        }    
+    
+    // charging state added for the err EMDN-835CW2.
+    TInt chargingState;
+    RProperty::Get( KPSUidHWRMPowerState, KHWRMChargingStatus , chargingState );
+    
+    if( IsDeviceInAlarmState() && ( chargingState != EChargingStatusCharging ) )
+        {       
+            iShutdownTimer->Cancel();
+            if( StarterConnect() )
+                {
+                iStarter.Shutdown();
+                iStarter.Close();
+                }    
+        }
     TRACE_EXIT_POINT;
     }