phoneapp/silenceactionplugin/data/silence.rul
branchRCL_3
changeset 5 2a26698d78ba
parent 0 5f000ab63145
equal deleted inserted replaced
4:24062c24fe38 5:2a26698d78ba
     1 <script xmlns="http://www.nokia.com/ns/cep/script/1.0/"
     1 <script xmlns="http://www.nokia.com/ns/cep/script/1.0/"
     2 xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
     2 xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
     3     <!-- Must have sensor interaction active -->
     3 
       
     4     <!-- Check if we have incoming call and we receive display down orientation event -->
     4     <if>
     5     <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>
     6         <and>
    15             <!-- Must have a ringin call and receive new double tap event or orientation event from sensor -->
     7             <!-- Must have a ringin call and receive orientation event from sensor -->
    16             <equals>
     8             <equals>
    17                 <contextRef source='Call' type='State'/>
     9                 <contextRef source='Call' type='State'/>
    18                 <string>Ringing</string>
    10                 <string>Ringing</string>
    19             </equals>
    11             </equals>
    20             <or>
    12             <equals>
    21                 <and>
    13                 <contextRef source='Sensor' type='Setting.Active'/>
    22                     <!-- Check that double tap interaction is set -->
    14                 <string>On</string>
    23                     <equals>
    15             </equals>
    24                         <contextRef source='Sensor' type='Setting.TappingInteraction.SilenceCalls'/>
    16             <!-- Check that turning interaction is set -->
    25                         <string>On</string>
    17             <equals>
    26                     </equals>
    18                 <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceCalls'/>
    27                     <contextUpdated>
    19                 <string>On</string>
    28                         <contextRef source='Sensor' type='Event.DoubleTap'/>
    20             </equals>
    29         	          </contextUpdated>
    21             <!-- ...and previous orientation is not 'Undefined' ... -->
    30                 </and>
    22             <notEqual>
    31     	          <and>
    23                 <contextRef source='Sensor' type='Event.Orientation.Previous'/>
    32                     <!-- Check that turning interaction is set -->
    24                 <string>Undefined</string>
    33                     <equals>
    25             </notEqual>
    34                         <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceCalls'/>
    26             <contextChanged>
    35                         <string>On</string>
    27                 <contextRef source='Sensor' type='Event.Orientation'/>
    36                     </equals>
    28             </contextChanged>
    37                     <!-- ...and previous orientation is not 'Undefined' ... -->
    29             <equals>
    38                     <notEqual>
    30                 <contextRef source='Sensor' type='Event.Orientation'/>
    39                         <contextRef source='Sensor' type='Event.Orientation.Previous'/>
    31                 <string>DisplayDownwards</string>
    40                         <string>Undefined</string>
    32             </equals>
    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>
    33         </and>
    52         <actions>
    34         <actions>
       
    35             <!-- DEBUG -->
       
    36             <!-- <publishContext><contextRef source="Test" type="Log" value="silence.rul - 01 silence call only"/></publishContext> -->
       
    37 
    53             <!-- Silence ringing tone -->
    38             <!-- Silence ringing tone -->
    54             <Phone Command='Silence'/>
    39             <Phone Command='Silence'/>
    55             <!-- Vibra feedback -->
    40             <!-- Vibra feedback -->
    56             <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
    41             <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
    57         </actions>
    42         </actions>
    58     </elseIf>
    43     </if>
    59     <!-- Check if we just have incoming call -->
    44 
    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>
    45 </script>