Small crash fix when installing custom ringtones

Use `getApplicationContext()` in case the original context (generally
MainActivity) is destroyed
Add tests for `getWorkState()`

And add a `tearDown()` method