phoneapp/silenceactionplugin/data/silence.rul
branchRCL_3
changeset 5 2a26698d78ba
parent 0 5f000ab63145
--- a/phoneapp/silenceactionplugin/data/silence.rul	Fri Mar 12 15:42:40 2010 +0200
+++ b/phoneapp/silenceactionplugin/data/silence.rul	Mon Mar 15 12:40:24 2010 +0200
@@ -1,133 +1,45 @@
 <script xmlns="http://www.nokia.com/ns/cep/script/1.0/"
 xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
-    <!-- Must have sensor interaction active -->
+
+    <!-- Check if we have incoming call and we receive display down orientation event -->
     <if>
-        <equals>
-            <contextRef source='Sensor' type='Setting.Active'/>
-            <string>Off</string>
-        </equals>
-        <actions>
-        </actions>
-    </if>
-    <!-- Check if we have incoming call and we receive a double tap event -->
-    <elseIf>
         <and>
-            <!-- Must have a ringin call and receive new double tap event or orientation event from sensor -->
+            <!-- Must have a ringin call and receive orientation event from sensor -->
             <equals>
                 <contextRef source='Call' type='State'/>
                 <string>Ringing</string>
             </equals>
-            <or>
-                <and>
-                    <!-- Check that double tap interaction is set -->
-                    <equals>
-                        <contextRef source='Sensor' type='Setting.TappingInteraction.SilenceCalls'/>
-                        <string>On</string>
-                    </equals>
-                    <contextUpdated>
-                        <contextRef source='Sensor' type='Event.DoubleTap'/>
-        	          </contextUpdated>
-                </and>
-    	          <and>
-                    <!-- Check that turning interaction is set -->
-                    <equals>
-                        <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceCalls'/>
-                        <string>On</string>
-                    </equals>
-                    <!-- ...and previous orientation is not 'Undefined' ... -->
-                    <notEqual>
-                        <contextRef source='Sensor' type='Event.Orientation.Previous'/>
-                        <string>Undefined</string>
-                    </notEqual>
-		                <contextChanged>
-		                    <contextRef source='Sensor' type='Event.Orientation'/>
-		    	    	    </contextChanged>
-    	        	    <equals>
-                        <contextRef source='Sensor' type='Event.Orientation'/>
-                    	  <string>DisplayDownwards</string>
-    	              </equals>
-    	          </and>
-            </or>
+            <equals>
+                <contextRef source='Sensor' type='Setting.Active'/>
+                <string>On</string>
+            </equals>
+            <!-- Check that turning interaction is set -->
+            <equals>
+                <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceCalls'/>
+                <string>On</string>
+            </equals>
+            <!-- ...and previous orientation is not 'Undefined' ... -->
+            <notEqual>
+                <contextRef source='Sensor' type='Event.Orientation.Previous'/>
+                <string>Undefined</string>
+            </notEqual>
+            <contextChanged>
+                <contextRef source='Sensor' type='Event.Orientation'/>
+            </contextChanged>
+            <equals>
+                <contextRef source='Sensor' type='Event.Orientation'/>
+                <string>DisplayDownwards</string>
+            </equals>
         </and>
         <actions>
+            <!-- DEBUG -->
+            <!-- <publishContext><contextRef source="Test" type="Log" value="silence.rul - 01 silence call only"/></publishContext> -->
+
             <!-- Silence ringing tone -->
             <Phone Command='Silence'/>
             <!-- Vibra feedback -->
             <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
         </actions>
-    </elseIf>
-    <!-- Check if we just have incoming call -->
-    <elseIf>
-        <and>
-            <!-- Check that the feature has not yet been enabled -->
-            <notEqual>
-                <contextRef source='Sensor' type='Event.AutoRotateAndDoubleTap'/>
-                <string>Enabled</string>
-            </notEqual>
-            <equals>
-                <contextRef source='Call' type='State'/>
-                <string>Ringing</string>
-            </equals>
-        </and>
-        <actions>
-            <!-- Activate double tap events from sensor -->
-            <publishContext>
-                <contextRef source='Sensor'
-                    type='Event'
-                    value='DoubleTap.Activate'/>
-            </publishContext>
-            <!-- Activate orientation events from sensor -->
-            <publishContext>
-                <contextRef source='Sensor'
-                    type='Event'
-                    value='Orientation.Activate'/>
-            </publishContext>
-            
-            <!-- Mark feature as 'Enabled' -->
-            <publishContext>
-                <contextRef source="Sensor" type="Event.AutoRotateAndDoubleTap" value="Enabled"/>
-            </publishContext>
-        
-        </actions>
-    </elseIf>
-    <!-- If we have call in 'Connected' or 'Disconnected' state -->
-    <elseIf>
-        <!-- Check that the feature has not already been disabled -->
-        <and>
-            <notEqual>
-                <contextRef source='Sensor' type='Event.AutoRotateAndDoubleTap'/>
-                <string>Disabled</string>
-            </notEqual>
-            <or>
-                <equals>
-                    <contextRef source='Call' type='State'/>
-                    <string>Connected</string>
-                </equals>
-                <equals>
-                    <contextRef source='Call' type='State'/>
-                    <string>Disconnected</string>
-                </equals>
-            </or>
-        </and>
-        <actions>
-            <!-- Deactivate double tap events from sensor -->
-            <publishContext>
-                <contextRef source='Sensor'
-                    type='Event'
-                    value='DoubleTap.Deactivate'/>
-            </publishContext>
-            <!-- Deactivate orientation events from sensor -->
-            <publishContext>
-                <contextRef source='Sensor'
-                    type='Event'
-                    value='Orientation.Deactivate'/>
-            </publishContext>
-            
-            <!-- Mark feature as 'Disabled' -->
-            <publishContext>
-                <contextRef source="Sensor" type="Event.AutoRotateAndDoubleTap" value="Disabled"/>
-            </publishContext>
-        
-        </actions>
-    </elseIf>
+    </if>
+
 </script>
\ No newline at end of file