OSDN Git Service

Fix issue 2324029: In-call (and other) audio screwed up after using Pandora (ERD72).
authorEric Laurent <elaurent@google.com>
Mon, 14 Dec 2009 11:45:41 +0000 (03:45 -0800)
committerEric Laurent <elaurent@google.com>
Mon, 14 Dec 2009 11:45:41 +0000 (03:45 -0800)
commitda4cc34308d65730c404b669926a92e37b378555
treef6b554ebc694a89a7cc4bdce29ec1ba639e96074
parent54bb575e85d1e40efbfbb868f37553cdd8ed318f
Fix issue 2324029: In-call (and other) audio screwed up after using Pandora (ERD72).

The problem is due to spurious headset connection indications received from event observer when a 3.5mm headset w/o mic is connected.
In this particular case, The HeadsetObserver first received a valid indication of headset with mic connection, followed by a headset with mic disconnection and finally a headset w/o mic connection.
The HeadsetObserver delays the headset disconnection intent to leave time to music app to pause music before the output path is switched.
As the last headset w/o mic connection indication is received from the event observer before the intent corresponding to the spurious headset with mic disconnection is broadcast, the later is discarded. Results a state where the headset with mic is always considered as connected.

The fix consists in not canceling pending intents when a new headset state is received and carrying the HeadsetObserver state with the delayed message triggering the broacast of the disconnection intent.
services/java/com/android/server/HeadsetObserver.java