How does in-pocket detection work?
There is an infrared/red-light sensor near your camera that detects whether the phone is in a pocket or bag. Online consensus is that depending on your phone manufacturer, there are varying degrees of success to how well it works.