• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Disable headphones, leave microphone enabled

Zinefer

Lurker
Apr 6, 2011
1
0
I have a broken HTC Hero. The built in microphone does not work.

I can get around this problem using the headset jack and plugging in a microphone.

However this routes the sound to the headphones. I have tried modifying ToggleHeadset2...
Code:
//setDeviceConnectionState(DEVICE_IN_WIRED_HEADSET, DEVICE_STATE_UNAVAILABLE, "");
setDeviceConnectionState(DEVICE_OUT_WIRED_HEADSET, DEVICE_STATE_UNAVAILABLE, "");
setDeviceConnectionState(DEVICE_OUT_EARPIECE, DEVICE_STATE_AVAILABLE, "");

I thought commenting that line would leave the microphone enabled. This however seems not to be the case.

If anyone could send some code my way that would get this done quick and dirty like I'd be eternally grateful.

Thanks!
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones