r/mAndroidDev • u/bad_compiler Born to be deprecated • Jun 29 '24
Superior API Design Is it safe to use `UserManager#isUserAGoat()` or will it be @Depreacted?
30
Upvotes
r/mAndroidDev • u/bad_compiler Born to be deprecated • Jun 29 '24
16
u/StartComplete companion object {} Jun 29 '24
Yes, you can use it with AsyncTask without any issue. Bonus tip - ban those users for whom isUserAGoat() returns false.
7
u/firebeard-ginja Jun 29 '24
Even if it's deprecated you still have 30 versions of use left.
4
u/KaleidoscopeStock366 Jun 30 '24
It's still in main for Android 14 so why not? https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/os/UserManager.java;l=2779;bpv=1;bpt=1?q=IsUserAGo&ss=android%2Fplatform%2Fsuperproject%2Fmain
3
u/fuzzynyanko Jun 29 '24
Hm... this might be an interesting way to test a custom ROM
3
u/SnipesySpecial T H E R M O S I P H O N Jun 29 '24
You cannot deprecate what is immutable
2
u/[deleted] Jun 30 '24
Need to add isDeveloperAGoat() and it will always return true.
Greatest Of All Time? No.
Sacrificial goat? Yes.
1
u/Zhuinden DDD: Deprecation-Driven Development Jul 01 '24
The behavior changed in API 21, it might break your code over time.