I'm studying Android 4.2 API and I'm using isUserAGoat() in UserManager There's a method
It says it's a method to return whether the caller is a goat or not When do you use this?
java android usermanager
Looking at the source before the API 21 changed,
/**
* * Used to determine whether the user making this call is subject to
* * teleportations.
* * @return whether the user making this call is a goat
*/
public boolean isUserAGoat() {
return false;
}
It returns false like this way. I think it's Easter egg.
It won't actually be used.
If you look at API21, the contents have been modified
/**
* * Used to determine whether the user making this call is subject to
* * teleportations.
*
* * <p>As of {@link android.os.Build.VERSION_CODES#LOLLIPOP}, this method can
* * now automatically identify goats using advanced goat recognition technology.</p>
*
* * @return Returns true if the user making this call is a goat.
*/
public boolean isUserAGoat() {
return mContext.getPackageManager()
.isPackageAvailable("com.coffeestainstudios.goatsimulator");
}
It has been changed to check if the installed app includes the com.coffeestainstudios.goatssimulator package.
© 2024 OneMinuteCode. All rights reserved.