안드로이드에서 UserManager.isUserAGoat()는 언제 사용되는겁니까?
조회수 1834회
발생하는 문제 및 실행환경
Android 4.2 API를 공부하는 중인데 UserManager에 isUserAGoat()라는 메소드가 있더라고요
대충 해석해보니까 뭐 이걸 호출하는 사용자가 염소인지를 반환하는 메소드라는데 이거 대체 어쩔때 쓰는 겁니까
1 답변
-
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; } 이렇게 false를 반환하네요. 제 생각엔 이스터 에그같습니다.
실제로 사용하는 경우는 없을거에요.API21에서 보면 내용이 수정됐는데
/** * 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"); }
설치된 앱에 com.coffeestainstudios.goatsimulator 패키지가 포함되는지 체크하는 용도로 바뀌었네요.
댓글 입력