---
title: "Android UserManager.isUserAGoat() use case"  
description: "Android UserManager.isUserAGoat() use case"  
author: "Samuel Fernandes"  
published: 2015-04-23  
updated: 2015-04-23  
canonical: https://www.mindstick.com/forum/23116/android-usermanager-isuseragoat-use-case  
category: "android"  
tags: ["android", "java"]  
reading_time: 2 minutes  

---

# Android UserManager.isUserAGoat() use case

I was looking at the new [APIs](https://www.mindstick.com/articles/338302/types-of-apis-a-comprehensive-guide) introduced in [Android](https://www.mindstick.com/articles/13046/10-reasons-why-i-prefer-android-vs-iphone-ios) 4.2. While looking at the [UserManager](https://www.mindstick.com/forum/160223/explain-the-role-of-usermanager-and-rolemanager-in-asp-dot-net-core-identity) [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) I came across the following [method](https://www.mindstick.com/forum/166/webservice-method):\
[public](https://www.mindstick.com/blog/11097/java-access-modifiers-the-public-and-the-private-modifiers) [boolean](https://www.mindstick.com/forum/160332/how-does-the-boolean-function-work) isUserAGoat ()\
Used to [determine whether](https://www.mindstick.com/forum/161622/how-do-you-determine-whether-a-file-is-locked-or-in-use-by-another-process) the [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) making this call is [subject](https://yourviews.mindstick.com/view/259/physical-education-a-compulsory-subject-in-school-curriculum) to teleportations.\
Returns whether the user making this call is a goat.\
\
How and when should this be used?

## Replies

### Reply by Anonymous User

From their source, the method used to return false until it was changed in API 21.\

```
/** * 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 looks like the method has no real use for us as developers. Someone has previously stated that it might be an Easter egg.\
**Edit:**\
In API 21 the implementation was changed to check if there is an installed app with the package com.coffeestainstudios.goatsimulator\

```
/** * 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");}
```

Here is the updated source link : https://android.googlesource.com/platform/frameworks/base/+/android-5.0.0_r6/core/java/android/os/UserManager.java


---

Original Source: https://www.mindstick.com/forum/23116/android-usermanager-isuseragoat-use-case

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
