inaka/galgo — pull request #5 by tslamic (2014-11-23 11:10:58+00:00)
Title: Explicitly check for SYSTEM_ALERT_WINDOW permission.

Trying to use Galgo without the permission
```

```

causes it to crash with the following exception:

```
java.lang.RuntimeException: Unable to create service com.inaka.galgo.GalgoService: android.view.WindowManager$BadTokenException:
```

This checks if an appropriate permission is set. If not, it throws an `IllegalStateException` with a more descriptive message:

```
java.lang.IllegalStateException: in order to use Galgo, please add the permission android.permission.SYSTEM_ALERT_WINDOW to your AndroidManifest.xml
```