зеркало из https://github.com/mozilla/gecko-dev.git
Bug 889730 - Switch states of Headphone are not only On/Off but Headset/Headphone. r=baku
This commit is contained in:
Родитель
54595a2f9d
Коммит
df04ea4684
|
@ -41,13 +41,7 @@ AudioChannelManager::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
|
|||
void
|
||||
AudioChannelManager::Notify(const SwitchEvent& aEvent)
|
||||
{
|
||||
if (aEvent.status() == SWITCH_STATE_ON ||
|
||||
aEvent.status() == SWITCH_STATE_HEADSET ||
|
||||
aEvent.status() == SWITCH_STATE_HEADPHONE) {
|
||||
mState = SWITCH_STATE_ON;
|
||||
} else {
|
||||
mState = SWITCH_STATE_OFF;
|
||||
}
|
||||
mState = aEvent.status();
|
||||
|
||||
DispatchTrustedEvent(NS_LITERAL_STRING("headphoneschange"));
|
||||
}
|
||||
|
|
|
@ -43,7 +43,8 @@ public:
|
|||
|
||||
bool Headphones() const
|
||||
{
|
||||
return mState == hal::SWITCH_STATE_ON;
|
||||
MOZ_ASSERT(mState != hal::SWITCH_STATE_UNKNOWN);
|
||||
return mState != hal::SWITCH_STATE_OFF;
|
||||
}
|
||||
|
||||
IMPL_EVENT_HANDLER(headphoneschange)
|
||||
|
|
Загрузка…
Ссылка в новой задаче