logoalt Hacker News

uncircle06/16/20252 repliesview on HN

  public static final String DISALLOW_FUN
The default value is false. [...] Type: Boolean [...] Constant Value: "no_fun"

Source: https://developer.android.com/reference/android/os/UserManag...

---

How the hell did this pass code review? Are booleans strings on Android?


Replies

objclxt06/16/2025

> How the hell did this pass code review? Are booleans strings on Android?

You are misreading the documentation, it's a key/value API.

`DISALLOW_FUN` is the string key you pass to `setUserRestriction`, which takes a boolean value.

show 1 reply
stevepotter06/16/2025

Someone else pointed out the reason for the datatype. A more subtle problem is the use of double negatives. Boolean APIs like "disable" will throw off users of your API.