"There is an apparently new iOS 18 security feature that reboots iPhones that haven’t been unlocked in a few days, frustrating police by making it harder to break into suspects’ iPhones
…
Apple added “inactivity reboot” code in iOS 18.1 that triggers iPhones to restart after they’ve been locked for four days"
Well 4 years was the longest i could find, but usually they are more like 1-30 day sentences and the 4 year one is an outlier.
https://arstechnica.com/tech-policy/2020/02/man-who-refused-to-decrypt-hard-drives-is-free-after-four-years-in-jail/
Chelsea Manning was held for 62 days for refusing to reveal a source, so not a password but similar reason for the charge https://www.bbc.co.uk/news/world-us-canada-48223178
The spirit of the law seems to be that if its established the only reason to hold someone is a refusal to give information and its clear they will never comply, that alone is not justification for indefinitely detaining someone, but judges can interpret things how they want.