Subscribes a listener to process status changes.
The process went to background: user doesn't see the process anymore.
The process entered foreground: user can see the process but cannot interact with it.
The process became active: user can see the process and can interact with it.
Get the state of the process.