Use latest build tools and gradle plugin
Have the receiver check for the current status instead
Never set ringer to silent mode on disconnect, even if the phone used to be on silent before it connected