What determines if a phone will accept a microphone in the audio jack - hardware or software? I have two Android phones: a Nexus S and a T-mobile G2. I just bought a new set of headphones that have a built-in microphone. The Nexus S seems to recognize audio input but the T-mobile G2 does not. Is it a hardware limitation or because I am running Android 2.3.6 on my G2 and Icecream Sandwich on my Nexus S?
Most likely it's a difference in the TRRS layout of the headset. 

For example, I have two "similar" headsets, one that came with Samsung Galaxy S and another that came with Samsung Galaxy Tab 10.1. Even though they look similar to the naked eye, if I use the Galaxy S one with my Tab, I only get mono sound due to a minor difference in the TRRS layout.

Sometimes I can remedy this by pulling the jack a little out of the plug, but it's very tricky to keep it in the correct position.

Anyway, you should test the jack with different headsets to verify that there's no physical damage to the jack.