android.app.ActivityManager.isUserAMonkey() - Returns "true" if the user interface is currently being messed with by a monkey.