This definitely needs to be a thing. Samsung Galaxies did this up until Lollipop and it was so nice to have it automatically mute the sound. You could also select certain contacts who would still be able to call you as normal (such as my parents or husband at 3am if there is some sort of emergency - I would want my phone to ring for that, but not for a drunk and bored friend who is pocket dialing me).
This definitely needs to be a thing. Samsung Galaxies did this up until Lollipop and it was so nice to have it automatically mute the sound. You could also select certain contacts who would still be able to call you as normal (such as my parents or husband at 3am if there is some sort of emergency - I would want my phone to ring for that, but not for a drunk and bored friend who is pocket dialing me).