I myself was surprised to find this method in the Android API 17. This is a method that is part of the UserManager class which is a brand-new class introduced in this API release.
Of course, after I saw the method I did some research on the Android developer page, searching for other mentions of this 'goat' term. Of course, I didn't, but I found another interesting method in a much older class.
In the ActivityManager class there is a method called isUserAMonkey which, as the official documentation states, "Returns "true" if the user interface is currently being messed with by a monkey. ".
It seemes that Google programmers decided to give us developers a new easter egg, this time using goats as a practical joke.
To be sure, I took a sneak peek inside the source code, to be sure that the isUserAGoat method is just an easter egg.
As you can see in this screenshot of the UserManager.java class source code, the implementation of the method is actually just a plain return false statement.
As this may seem funny at least for most people, I know some programming goats who won't be that happy they are being left out of the Android platform.

No comments:
Post a Comment