mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1157121 - Add speaker status checking. r=baku
This commit is contained in:
parent
ba68b15dce
commit
6945fdd8f7
@ -374,10 +374,19 @@ AudioChannelService::GetState(AudioChannelAgent* aAgent, bool aElementHidden)
|
||||
data->mState = GetStateInternal(data->mChannel, CONTENT_PROCESS_ID_MAIN,
|
||||
aElementHidden, oldElementHidden);
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
bool active = AnyAudioChannelIsActive();
|
||||
/** Only modify the speaker status when
|
||||
* (1) apps in the foreground.
|
||||
* (2) apps in the backgrund and inactive.
|
||||
* Notice : check the state when the visible status is stable, because there
|
||||
* has lantency in passing the visibility events.
|
||||
**/
|
||||
bool active = AnyAudioChannelIsActive();
|
||||
if (aElementHidden == oldElementHidden &&
|
||||
(!aElementHidden || (aElementHidden && !active))) {
|
||||
for (uint32_t i = 0; i < mSpeakerManager.Length(); i++) {
|
||||
mSpeakerManager[i]->SetAudioChannelActive(active);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return data->mState;
|
||||
|
@ -94,6 +94,22 @@ AudioChannelServiceChild::GetState(AudioChannelAgent* aAgent, bool aElementHidde
|
||||
data->mState = state;
|
||||
cc->SendAudioChannelChangedNotification();
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
/** Only modify the speaker status when
|
||||
* (1) apps in the foreground.
|
||||
* (2) apps in the backgrund and inactive.
|
||||
* Notice : modify only when the visible status is stable, because there
|
||||
* has lantency in passing the visibility events.
|
||||
**/
|
||||
bool active = AnyAudioChannelIsActive();
|
||||
if (aElementHidden == oldElementHidden &&
|
||||
(!aElementHidden || (aElementHidden && !active))) {
|
||||
for (uint32_t i = 0; i < mSpeakerManager.Length(); i++) {
|
||||
mSpeakerManager[i]->SetAudioChannelActive(active);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user