From 187ed14a2168eea5e28d750973f4f683997ddfc0 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Thu, 10 Jul 2014 15:06:23 +0200 Subject: [PATCH] Bug 1016277 - Telephony AudioChannel policy: LIFO r=mchen --HG-- rename : dom/base/test/audio.ogg => dom/audiochannel/tests/audio.ogg --- dom/audiochannel/AudioChannelService.cpp | 98 ++++++++++++++++-- dom/audiochannel/AudioChannelService.h | 18 ++++ dom/audiochannel/tests/audio.ogg | Bin 0 -> 16521 bytes .../tests/file_telephonyPolicy.html | 18 ++++ dom/audiochannel/tests/mochitest.ini | 4 + .../tests/test_telephonyPolicy.html | 85 +++++++++++++++ 6 files changed, 212 insertions(+), 11 deletions(-) create mode 100644 dom/audiochannel/tests/audio.ogg create mode 100644 dom/audiochannel/tests/file_telephonyPolicy.html create mode 100644 dom/audiochannel/tests/test_telephonyPolicy.html diff --git a/dom/audiochannel/AudioChannelService.cpp b/dom/audiochannel/AudioChannelService.cpp index 94be1ecae2e3..3b2d8c57456d 100644 --- a/dom/audiochannel/AudioChannelService.cpp +++ b/dom/audiochannel/AudioChannelService.cpp @@ -151,6 +151,13 @@ AudioChannelService::RegisterType(AudioChannel aChannel, uint64_t aChildID, mChannelCounters[type].AppendElement(aChildID); if (XRE_GetProcessType() == GeckoProcessType_Default) { + + // We must keep the childIds in order to decide which app is allowed to play + // with then telephony channel. + if (aChannel == AudioChannel::Telephony) { + RegisterTelephonyChild(aChildID); + } + // Since there is another telephony registered, we can unregister old one // immediately. if (mDeferTelChannelTimer && aChannel == AudioChannel::Telephony) { @@ -234,15 +241,21 @@ AudioChannelService::UnregisterType(AudioChannel aChannel, // There are two reasons to defer the decrease of telephony channel. // 1. User can have time to remove device from his ear before music resuming. // 2. Give BT SCO to be disconnected before starting to connect A2DP. - if (XRE_GetProcessType() == GeckoProcessType_Default && - aChannel == AudioChannel::Telephony && - (mChannelCounters[AUDIO_CHANNEL_INT_TELEPHONY_HIDDEN].Length() + - mChannelCounters[AUDIO_CHANNEL_INT_TELEPHONY].Length()) == 1) { - mTimerElementHidden = aElementHidden; - mTimerChildID = aChildID; - mDeferTelChannelTimer = do_CreateInstance("@mozilla.org/timer;1"); - mDeferTelChannelTimer->InitWithCallback(this, 1500, nsITimer::TYPE_ONE_SHOT); - return; + if (XRE_GetProcessType() == GeckoProcessType_Default) { + + if (aChannel == AudioChannel::Telephony) { + UnregisterTelephonyChild(aChildID); + } + + if (aChannel == AudioChannel::Telephony && + (mChannelCounters[AUDIO_CHANNEL_INT_TELEPHONY_HIDDEN].Length() + + mChannelCounters[AUDIO_CHANNEL_INT_TELEPHONY].Length()) == 1) { + mTimerElementHidden = aElementHidden; + mTimerChildID = aChildID; + mDeferTelChannelTimer = do_CreateInstance("@mozilla.org/timer;1"); + mDeferTelChannelTimer->InitWithCallback(this, 1500, nsITimer::TYPE_ONE_SHOT); + return; + } } UnregisterTypeInternal(aChannel, aElementHidden, aChildID, aWithVideo); @@ -358,7 +371,7 @@ AudioChannelService::GetStateInternal(AudioChannel aChannel, uint64_t aChildID, if (CheckVolumeFadedCondition(newType, aElementHidden)) { return AUDIO_CHANNEL_STATE_FADED; } - return AUDIO_CHANNEL_STATE_NORMAL; + return CheckTelephonyPolicy(aChannel, aChildID); } // We are not visible, maybe we have to mute. @@ -387,7 +400,34 @@ AudioChannelService::GetStateInternal(AudioChannel aChannel, uint64_t aChildID, return AUDIO_CHANNEL_STATE_MUTED; } - return AUDIO_CHANNEL_STATE_NORMAL; + return CheckTelephonyPolicy(aChannel, aChildID); +} + +AudioChannelState +AudioChannelService::CheckTelephonyPolicy(AudioChannel aChannel, + uint64_t aChildID) +{ + // Only the latest childID is allowed to play with telephony channel. + if (aChannel != AudioChannel::Telephony) { + return AUDIO_CHANNEL_STATE_NORMAL; + } + + MOZ_ASSERT(!mTelephonyChildren.IsEmpty()); + +#if DEBUG + bool found = false; + for (uint32_t i = 0, len = mTelephonyChildren.Length(); i < len; ++i) { + if (mTelephonyChildren[i].mChildID == aChildID) { + found = true; + break; + } + } + + MOZ_ASSERT(found); +#endif + + return mTelephonyChildren.LastElement().mChildID == aChildID + ? AUDIO_CHANNEL_STATE_NORMAL : AUDIO_CHANNEL_STATE_MUTED; } bool @@ -986,3 +1026,39 @@ AudioChannelService::GetDefaultAudioChannelString(nsAString& aString) } } } + +void +AudioChannelService::RegisterTelephonyChild(uint64_t aChildID) +{ + for (uint32_t i = 0, len = mTelephonyChildren.Length(); i < len; ++i) { + if (mTelephonyChildren[i].mChildID == aChildID) { + ++mTelephonyChildren[i].mInstances; + + if (i != len - 1) { + TelephonyChild child = mTelephonyChildren[i]; + mTelephonyChildren.RemoveElementAt(i); + mTelephonyChildren.AppendElement(child); + } + + return; + } + } + + mTelephonyChildren.AppendElement(TelephonyChild(aChildID)); +} + +void +AudioChannelService::UnregisterTelephonyChild(uint64_t aChildID) +{ + for (uint32_t i = 0, len = mTelephonyChildren.Length(); i < len; ++i) { + if (mTelephonyChildren[i].mChildID == aChildID) { + if (!--mTelephonyChildren[i].mInstances) { + mTelephonyChildren.RemoveElementAt(i); + } + + return; + } + } + + MOZ_ASSERT(false, "This should not happen."); +} diff --git a/dom/audiochannel/AudioChannelService.h b/dom/audiochannel/AudioChannelService.h index c7e80d0febec..544fd38a7049 100644 --- a/dom/audiochannel/AudioChannelService.h +++ b/dom/audiochannel/AudioChannelService.h @@ -150,6 +150,11 @@ protected: void SetDefaultVolumeControlChannelInternal(int32_t aChannel, bool aHidden, uint64_t aChildID); + AudioChannelState CheckTelephonyPolicy(AudioChannel aChannel, + uint64_t aChildID); + void RegisterTelephonyChild(uint64_t aChildID); + void UnregisterTelephonyChild(uint64_t aChildID); + AudioChannelService(); virtual ~AudioChannelService(); @@ -225,6 +230,19 @@ protected: nsTArray mWithVideoChildIDs; + // Telephony Channel policy is "LIFO", the last app to require the resource is + // allowed to play. The others are muted. + struct TelephonyChild { + uint64_t mChildID; + uint32_t mInstances; + + explicit TelephonyChild(uint64_t aChildID) + : mChildID(aChildID) + , mInstances(1) + {} + }; + nsTArray mTelephonyChildren; + // mPlayableHiddenContentChildID stores the ChildID of the process which can // play content channel(s) in the background. // A background process contained content channel(s) will become playable: diff --git a/dom/audiochannel/tests/audio.ogg b/dom/audiochannel/tests/audio.ogg new file mode 100644 index 0000000000000000000000000000000000000000..d7f6a0ccf47fbc30e936b47e3f4d2cf8f4a90a16 GIT binary patch literal 16521 zcmeIZd011|*DoFv5fCYXB!&olAq<8PEJ1>bVgZu?fglHxm;|dB1|bky6sbjPEmK1V z1SC{~T1g;;lSB;=P^dGB3Qhg$0pS`kf%a&Bc9K=6IPs!g2`#0`gHeNQxpKKN6Zkx@T^I6b8MgIBevspJ= z^FNN+nl|8SYIjJZv&+o?bac=C&t_(e+sym>+9PHyXAZ&zfhaFh@?abM<*3T9uGc6) zUkF5cIo^rv9hT{jm@VL4Syz@5lXrFb!xcFVWtx=yr1?uyM2CLT2nw#Qe0X46$I30T zZC6*e5w>8;vO&3(OUOA5rSDS@(`vFCu?!$eBy~~%(=KW{6CH4z>4zr_o zDc_ud{milS#Y&tQD&Jq3SaLlwBC*us-Bwc)7J&fU(8I`Bb1% z{(Zs<#6Fb=whjbp57#k>FhPAebdc2f{^Y#siT=FvS|@V;1aUM zW1Dk?gTL+jVWlGw;3=`0HPK*LSb-$)g2y(e2z#IUl$4z2iVZ@se*=eK)!MpWC^e39 zw@s5rf7to#q978giW+n4~It9DnI$RNAFxO^fMRkd`b;|^j}jf zpq9Vol8HdnsOnP!gK4GsR%{D4fsWpm%$I1lI;C7`Pr2&-z^_3}F0bFm3Vnczaf+Gp z*q#_@7p%a>SgZ7%7`+`lgo@xzG0 zVZ@c+{<-{b{nUglyuSJa@cE||(9!C3wyPnap!dh%ZwTfK#5&aMtN-6U{%c<(&=+JI zw(fuG3v{&Z#ecV-|5yM2N#Os31i-X&TmimZ`-)1vJz~-p;ZbKBU+NeA8=@{NdiZc| z2y;&+?|N7cF465jn~MiGu7`>7Q8&Piu!SmMjQ=_Iw168qI4aUR7u-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g;fh3}^Rq}FG zMC48ug*_VxU$ht=?o4GiX||MA2;BM^61(VK8?+(Es`_J-cOA&^eSE8h*&7LB=O2eV z9`t^GJj9jl$Eh9LKPHxwYJ9}&T>QoKm{P46yzNUPn>1FfuxQoeTkYM=$^vD$^3eYP DFy$Y2 literal 0 HcmV?d00001 diff --git a/dom/audiochannel/tests/file_telephonyPolicy.html b/dom/audiochannel/tests/file_telephonyPolicy.html new file mode 100644 index 000000000000..f95b7d40ff86 --- /dev/null +++ b/dom/audiochannel/tests/file_telephonyPolicy.html @@ -0,0 +1,18 @@ + + + + + Test Telephony Channel Policy + + +

+ + + diff --git a/dom/audiochannel/tests/mochitest.ini b/dom/audiochannel/tests/mochitest.ini index 730e8f06a725..9cbe25785b41 100644 --- a/dom/audiochannel/tests/mochitest.ini +++ b/dom/audiochannel/tests/mochitest.ini @@ -1,7 +1,11 @@ [DEFAULT] support-files = + audio.ogg file_audio.html + file_telephonyPolicy.html AudioChannelChromeScript.js +[test_telephonyPolicy.html] +skip-if = (toolkit == 'gonk' || e10s) [test_audioChannelChange.html] skip-if = (toolkit != 'gonk') diff --git a/dom/audiochannel/tests/test_telephonyPolicy.html b/dom/audiochannel/tests/test_telephonyPolicy.html new file mode 100644 index 000000000000..aa9f2564fc24 --- /dev/null +++ b/dom/audiochannel/tests/test_telephonyPolicy.html @@ -0,0 +1,85 @@ + + + + + Test the Telephony Channel Policy + + + + +
+ + +