Mute the external microphone when a headphone is plugged in? I'm running Gingerbread on my Samsung Galaxy S II. I dock it on my dash in my car and plug a 3.5mm cord from the phone to my stereo aux input.

I often listen to music from my phone through my car stereo, but when a call comes in and I answer it, there is terrible feedback on the other end because the caller hears both my speakers and the audio from the phone.

Is there anything I can do about this other than to switch to a traditional headset?
You could make use of e.g. Tasker -- an automation tool which can react on different situations and handle a lot of things (basically, sometimes I think 80% of questions like "How can I...with Android?" could be answered by "Use Tasker!". Though it doesn't come "cheap", on the developers website you can get a 7-day trial to check first. It's worth every cent of its 5 bucks!).

So with tasker, you do simple math:

condition + task = profile


For your case, it's probably something like...

Profile "docked-in-car"


Conditions: (they are always connected by AND with Tasker)

"headphones plugged"
"docked"

Tasks:

"audio -> mic mute"
optionally: "keyguard off"
optionally: "display timeout 0" (as it is connected to a power source, so you can continually see what's displayed)
most likely: "start app -> [music-app]".



Save &amp; go. Now, when you dock your SGS2 and plug in the 3.5mm cord, mic should be muted -- and additionally some other nice actions executed.