Android java.lang.SecurityException Injecting to another application requires INJECT_EVENTS permission

Looks like I fixed it myself. Using a slightly higher sleep of 5 seconds did fix the issue. Guess the emulator is just quite slow.