title: How to disable the wired headset programmatically in Java
body: <p>Please refer my question here. This question is an extension to that:</p>
  
  <p><a href="https://stackoverflow.com/questions/20947960/how-to-check-and-redirect-audio-between-wired-headset-and-speaker-phone">How to check and redirect audio between wired headset and speaker phone?</a></p>
  
  <p>I was able to partially solve my problem by including the permissions </p>
  
  <pre><code>  &lt;uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /&gt;
  </code></pre>
  
  <p>in my  Android Manifest for that same piece of code. Now, I am able to enable and disable the phone speakers, but I am not able to turn off my wired headset connection programmatically, <em>when the wired headset is still physically connected to the phone</em>. </p>
  
  <p>Can someone please help me here? Is there a specific intent I can use to <strong>disable</strong> and <strong>enable</strong> the wired headset connection?</p>