alarmui/group/alarmui_snooze.rul
branchRCL_3
changeset 30 d68a4b5d5885
parent 27 55d60436f00b
child 67 1539a383d7b6
--- a/alarmui/group/alarmui_snooze.rul	Tue May 11 16:12:24 2010 +0300
+++ b/alarmui/group/alarmui_snooze.rul	Tue May 25 12:41:10 2010 +0300
@@ -11,9 +11,26 @@
     
     <!-- Snooze alarm when device is turned upside down -->
     <elseIf>
-		<contextChanged>
-		    <contextRef source='Sensor' type='Event.Orientation' value='DisplayDownwards'/>
-		</contextChanged>
+        <and>
+            <!-- Check that turning interaction is set -->
+            <equals>
+            	   <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceAlarm'/>
+                 <string>On</string>
+            </equals>
+                 <!-- ...and previous orientation is not 'Undefined' ... -->
+            <notEqual>
+                 <contextRef source='Sensor' type='Event.Orientation.Previous'/>
+                 <string>Undefined</string>
+            </notEqual>
+                 <!-- ...and we receive a new orientation event from sensors... -->
+	    <contextChanged>
+	         <contextRef source='Sensor' type='Event.Orientation'/>
+	    </contextChanged>
+    	    <equals>
+                 <contextRef source='Sensor' type='Event.Orientation'/>
+                 <string>DisplayDownwards</string>
+    	    </equals>
+        </and>
         <actions>
            <!-- snooze the alarm -->
             <AlarmUI.Snooze/>