Change naming. Fix applicationState query.

- change the name of the parameter to 'inBackground'.
- query for application in background, not just inactive.