phoneapp/silenceactionplugin/data/silence.rul
changeset 0 5f000ab63145
child 15 2a26698d78ba
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 <script xmlns="http://www.nokia.com/ns/cep/script/1.0/"
       
     2 xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
       
     3     <!-- Must have sensor interaction active -->
       
     4     <if>
       
     5         <equals>
       
     6             <contextRef source='Sensor' type='Setting.Active'/>
       
     7             <string>Off</string>
       
     8         </equals>
       
     9         <actions>
       
    10         </actions>
       
    11     </if>
       
    12     <!-- Check if we have incoming call and we receive a double tap event -->
       
    13     <elseIf>
       
    14         <and>
       
    15             <!-- Must have a ringin call and receive new double tap event or orientation event from sensor -->
       
    16             <equals>
       
    17                 <contextRef source='Call' type='State'/>
       
    18                 <string>Ringing</string>
       
    19             </equals>
       
    20             <or>
       
    21                 <and>
       
    22                     <!-- Check that double tap interaction is set -->
       
    23                     <equals>
       
    24                         <contextRef source='Sensor' type='Setting.TappingInteraction.SilenceCalls'/>
       
    25                         <string>On</string>
       
    26                     </equals>
       
    27                     <contextUpdated>
       
    28                         <contextRef source='Sensor' type='Event.DoubleTap'/>
       
    29         	          </contextUpdated>
       
    30                 </and>
       
    31     	          <and>
       
    32                     <!-- Check that turning interaction is set -->
       
    33                     <equals>
       
    34                         <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceCalls'/>
       
    35                         <string>On</string>
       
    36                     </equals>
       
    37                     <!-- ...and previous orientation is not 'Undefined' ... -->
       
    38                     <notEqual>
       
    39                         <contextRef source='Sensor' type='Event.Orientation.Previous'/>
       
    40                         <string>Undefined</string>
       
    41                     </notEqual>
       
    42 		                <contextChanged>
       
    43 		                    <contextRef source='Sensor' type='Event.Orientation'/>
       
    44 		    	    	    </contextChanged>
       
    45     	        	    <equals>
       
    46                         <contextRef source='Sensor' type='Event.Orientation'/>
       
    47                     	  <string>DisplayDownwards</string>
       
    48     	              </equals>
       
    49     	          </and>
       
    50             </or>
       
    51         </and>
       
    52         <actions>
       
    53             <!-- Silence ringing tone -->
       
    54             <Phone Command='Silence'/>
       
    55             <!-- Vibra feedback -->
       
    56             <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
       
    57         </actions>
       
    58     </elseIf>
       
    59     <!-- Check if we just have incoming call -->
       
    60     <elseIf>
       
    61         <and>
       
    62             <!-- Check that the feature has not yet been enabled -->
       
    63             <notEqual>
       
    64                 <contextRef source='Sensor' type='Event.AutoRotateAndDoubleTap'/>
       
    65                 <string>Enabled</string>
       
    66             </notEqual>
       
    67             <equals>
       
    68                 <contextRef source='Call' type='State'/>
       
    69                 <string>Ringing</string>
       
    70             </equals>
       
    71         </and>
       
    72         <actions>
       
    73             <!-- Activate double tap events from sensor -->
       
    74             <publishContext>
       
    75                 <contextRef source='Sensor'
       
    76                     type='Event'
       
    77                     value='DoubleTap.Activate'/>
       
    78             </publishContext>
       
    79             <!-- Activate orientation events from sensor -->
       
    80             <publishContext>
       
    81                 <contextRef source='Sensor'
       
    82                     type='Event'
       
    83                     value='Orientation.Activate'/>
       
    84             </publishContext>
       
    85             
       
    86             <!-- Mark feature as 'Enabled' -->
       
    87             <publishContext>
       
    88                 <contextRef source="Sensor" type="Event.AutoRotateAndDoubleTap" value="Enabled"/>
       
    89             </publishContext>
       
    90         
       
    91         </actions>
       
    92     </elseIf>
       
    93     <!-- If we have call in 'Connected' or 'Disconnected' state -->
       
    94     <elseIf>
       
    95         <!-- Check that the feature has not already been disabled -->
       
    96         <and>
       
    97             <notEqual>
       
    98                 <contextRef source='Sensor' type='Event.AutoRotateAndDoubleTap'/>
       
    99                 <string>Disabled</string>
       
   100             </notEqual>
       
   101             <or>
       
   102                 <equals>
       
   103                     <contextRef source='Call' type='State'/>
       
   104                     <string>Connected</string>
       
   105                 </equals>
       
   106                 <equals>
       
   107                     <contextRef source='Call' type='State'/>
       
   108                     <string>Disconnected</string>
       
   109                 </equals>
       
   110             </or>
       
   111         </and>
       
   112         <actions>
       
   113             <!-- Deactivate double tap events from sensor -->
       
   114             <publishContext>
       
   115                 <contextRef source='Sensor'
       
   116                     type='Event'
       
   117                     value='DoubleTap.Deactivate'/>
       
   118             </publishContext>
       
   119             <!-- Deactivate orientation events from sensor -->
       
   120             <publishContext>
       
   121                 <contextRef source='Sensor'
       
   122                     type='Event'
       
   123                     value='Orientation.Deactivate'/>
       
   124             </publishContext>
       
   125             
       
   126             <!-- Mark feature as 'Disabled' -->
       
   127             <publishContext>
       
   128                 <contextRef source="Sensor" type="Event.AutoRotateAndDoubleTap" value="Disabled"/>
       
   129             </publishContext>
       
   130         
       
   131         </actions>
       
   132     </elseIf>
       
   133 </script>