Merge "Fix for goat detection code" into rvc-dev am: 7588f0d7a0

Change-Id: I97d2a2008757aaa5c9eed65e0bf5c363cc915243
This commit is contained in:
TreeHugger Robot
2020-05-18 23:13:03 +00:00
committed by Automerger Merge Worker

View File

@@ -1729,9 +1729,15 @@ public class UserManager {
* <p>As of {@link android.os.Build.VERSION_CODES#LOLLIPOP}, this method can * <p>As of {@link android.os.Build.VERSION_CODES#LOLLIPOP}, this method can
* now automatically identify goats using advanced goat recognition technology.</p> * now automatically identify goats using advanced goat recognition technology.</p>
* *
* @return Returns true if the user making this call is a goat. * <p>As of {@link android.os.Build.VERSION_CODES#R}, this method always returns
* {@code false} in order to protect goat privacy.</p>
*
* @return Returns whether the user making this call is a goat.
*/ */
public boolean isUserAGoat() { public boolean isUserAGoat() {
if (mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.R) {
return false;
}
return mContext.getPackageManager() return mContext.getPackageManager()
.isPackageAvailable("com.coffeestainstudios.goatsimulator"); .isPackageAvailable("com.coffeestainstudios.goatsimulator");
} }