<!--
........................................................................................................................
Description:
    This rule script checks if the auto rotate ui feature is required to be activated on start up.

Feature:
    autorotateui

Dependencies:
    autorotateui_rotate.rul
........................................................................................................................
-->
<script xmlns="http://www.nokia.com/ns/cep/script/1.0/"
xmlns:cep="http://www.nokia.com/ns/cep/1.0/">

<!--
........................................................................................................................
Description:
    Activate orientation channel from sensor source.
........................................................................................................................
-->
    <if>
        <and>
            <!-- Context Framework status changes to 'Ready' -->
            <contextChanged>
                <contextRef source='ContextFramework' type='Status' value='Ready'/>
            </contextChanged>

            <!-- Sensor setting must be currently enabled -->
            <equals>
                <contextRef source='Sensor' type='Setting.Active' value='On'/>
            </equals>

            <!-- Turning interaction must be currently enabled -->
            <equals>
                <contextRef source='Sensor' type='Setting.TurningInteraction.AutoRotation' value='On'/>
            </equals>
        </and>
        <actions>
            <!-- Activate orientation channel (0x01) from sensor source (0x10282DF0) -->
            <sourceCommand uid='0x10282DF0'>
                <sensorCommand channelId='0x01' id='activate' featureId='fea.autorotateui'/>
            </sourceCommand>
        </actions>
    </if>

</script>
