Skip to content Skip to sidebar Skip to footer

Action_headset_plug Broadcast Delay

I have my own BroadcastReceiver instance for Intent.ACTION_HEADSET_PLUG action. There is about 1-2 seconds delay between actual physical unplugging a headset and a moment when my B

Solution 1:

Handling AudioManager.ACTION_AUDIO_BECOMING_NOISY broadcast did the trick :) Its intent is broadcast directly after headset is unplugged without any delay.

Solution 2:

You are out of luck.

The delay is hardcoded in the framework, look in

frameworks/base/services/java/com/android/server/HeadsetObserver.java

The delay is 1000 ms, due to the risk of having garbage in the audio pipeline.

Post a Comment for "Action_headset_plug Broadcast Delay"