Creating System State Manager policy plug-in

The System State Manager will have policy associated with a transition in system state or a system-wide property. The transition from one state to another is implicit. The SSM policy is defined by a system state policy plug-in and an associated command list resource file.

SSM policies implements MSsmStatePolicy interface to initialize, prepare and return a commandlist using CSsmCommandListResourceReader. It also implements MSsmConditionalCallback function to decide whether to include a command in a commandlist or not.

The system state manager policies derived are normal, start-up, fail and shutdown. All these policies are created using the MSsmStatePolicy interface.

Follow the steps given below to create a normal policy plug-in:


  1. Define a class that implements MSsmStatePolicy interface.

  2. Export the static method to create new normal state policy plug-in as shown in the code snippet:
    
    EXPORT_C MSsmStatePolicy* CGsaStatePolicyNormal::NewL()
    {
        CGsaStatePolicyNormal* self = new ( ELeave ) CGsaStatePolicyNormal; 
        CleanupStack::PushL(self);    
        self->ConstructL();    
        CleanupStack::Pop(self);   
        return self;
    }
    The code returns a new normal state policy plug-in.

The normal state policy plug-in is created.