State Aware Component

The state aware component session, RSsmStateAwareSession, provides an API for use by components that must be system state aware. A system state aware component is notified of changes to the system state through this API.

The declaration of RSsmStateAwareSession is as defined in the following class:


class RSsmStateAwareSession
{
    public:
        IMPORT_C TInt Connect( TDmDomainId aId );
           IMPORT_C void Close();
           IMPORT_C TSsmState State() const;
           IMPORT_C void RequestStateNotification( TRequestStatus& aStatus );
           IMPORT_C void RequestStateNotificationCancel();
           IMPORT_C void AcknowledgeStateNotification( TInt aError );
           IMPORT_C void AcknowledgeAndRequestStateNotification( TInt aError, TRequestStatus& aStatus );
}

The following table lists the various methods of RSsmStateAwareSession and their description.

Method Description

RSsmStateAwareSession::Connect()

This method connects the 'R' class so that it is ready for use. The aDomainId parameter is used to specify at which position in the system state domain hierarchy this client must be inserted. The position in the domain hierarchy determines the order in which clients are notified of state changes.

RSsmStateAwareSession::State()

This method returns the current system state. The RSsmStateAwareSession::RequestStateNotification() method completes the aStatus when the system state has changed from its current value.

RSsmStateAwareSession::RequestStateNotificationCancel()

This method cancels the previous request for state notification on this RSsmStateAwareSession.

RSsmStateAwareSession::AcknowledgeStateNotification()

This method is used to signal that the client has reacted appropriately to the notified state change. The aError value is used to pass back information about the success of the actions performed by this client, such as successful initialisation of elements during a staged start-up.

RSsmStateAwareSession::AcknowledgeAndRequestStateNotification()

This method provides clients to acknowledge a state change notification and request notification of subsequent changes without the risk of the client missing a later update to the system state. It combines the functions of AcknowledgeStateNotification() and RequestStateNotification() into a single method call.

AcknowledgeStateNotification() or AcknowledgeAndRequestStateNotification()

This method is called after a client has requested and received the notification of a state change to acknowledge that the client has responded to the state notification.

Note: A time-out exists for this acknowledgement, so clients of this API have to complete the necessary tasks for the state notification and must acknowledge the transition at the earliest.