How to route audio in android 4

view story

http://stackoverflow.com – I will quickly summarize. Samsung Galaxy S3, when I run some app with the headphones plugged and for some reason, if the app freezes or any other issue. The phone thinks that it have the headphones plugged yet. Although it's been unplugged. I am developing an app to fix this samsung firmware problem. AudioManager returns me "true" with the function isWiredHeadsetOn, with or without the plugged headphones. My question is that since old api of android, setRouting or setWiredHeadset are deprecated, and I don't know can I change the value of isWiredHeadsetOn to returns me false. I don't know i (HowTos)