Merge b2ginbound to central, a=merge

This commit is contained in:
Wes Kocher 2015-08-12 14:52:11 -07:00
Родитель 5ea13b10fe 16dfbc45e6
Коммит 8d78b6eed8
20 изменённых файлов: 88 добавлений и 311 удалений

Просмотреть файл

@ -413,7 +413,10 @@ ContentPermissionPrompt.prototype = {
type: type,
permissions: permissions,
id: requestId,
origin: principal.origin,
// This system app uses the origin from permission events to
// compare against the mozApp.origin of app windows, so we
// are not concerned with origin suffixes here (appId, etc).
origin: principal.originNoSuffix,
isApp: isApp,
remember: remember,
isGranted: isGranted,

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6fef72357971934c8774578044ea7a442be3a75d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="52f3ea58df38e5427f6afeb636bc6ad01d24022f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -110,7 +110,7 @@
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="6a1bb59af65b6485b1090522f66fac95c3f9e22c"/>
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="69d524e80cdf3981006627c65ac85f3a871238a3"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5a48c04c4bb5f079bc757e29864a42427378e051"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="ae5b9f6ee834f685cefa35554058490d99198783"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
<project name="platform/system/extras" path="system/extras" revision="576f57b6510de59c08568b53c0fb60588be8689e"/>
<project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
<project name="platform/system/netd" path="system/netd" revision="a6531f7befb49b1c81bc0de7e51c5482b308e1c5"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6fef72357971934c8774578044ea7a442be3a75d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="52f3ea58df38e5427f6afeb636bc6ad01d24022f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -115,7 +115,7 @@
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="6a1bb59af65b6485b1090522f66fac95c3f9e22c"/>
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="cfcef469537869947abb9aa1d656774cc2678d4c"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5a48c04c4bb5f079bc757e29864a42427378e051"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="ae5b9f6ee834f685cefa35554058490d99198783"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
<project name="platform/system/extras" path="system/extras" revision="10e78a05252b3de785f88c2d0b9ea8a428009c50"/>
<project name="platform/system/media" path="system/media" revision="188b3e51e0a2ce1e16dc8067edef7be3d2365ad9"/>
<project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>

Просмотреть файл

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6fef72357971934c8774578044ea7a442be3a75d"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="52f3ea58df38e5427f6afeb636bc6ad01d24022f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6fef72357971934c8774578044ea7a442be3a75d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="52f3ea58df38e5427f6afeb636bc6ad01d24022f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4713c3b346985f56c515909cd68dcc50597b1c51"/>
@ -118,7 +118,7 @@
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="842e33e43a55ea44833b9e23e4d180fa17c843af"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5db24726f0f42124304195a6bdea129039eeeaeb"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="930ae098543881f47eac054677726ee4b998b2f8"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="ae5b9f6ee834f685cefa35554058490d99198783"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
<project name="platform_system_core" path="system/core" remote="b2g" revision="542d1f59dc331b472307e5bd043101d14d5a3a3e"/>
<project name="platform/system/extras" path="system/extras" revision="18c1180e848e7ab8691940481f5c1c8d22c37b3e"/>
<project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6fef72357971934c8774578044ea7a442be3a75d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="52f3ea58df38e5427f6afeb636bc6ad01d24022f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -115,7 +115,7 @@
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="6a1bb59af65b6485b1090522f66fac95c3f9e22c"/>
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="b562b01c93de9578d5db537b6a602a38e1aaa0ce"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="387f03e815f57d536dd922706db1622bddba8d81"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="ae5b9f6ee834f685cefa35554058490d99198783"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
<project name="platform/system/extras" path="system/extras" revision="5356165f67f4a81c2ef28671c13697f1657590df"/>
<project name="platform/system/media" path="system/media" revision="be0e2fe59a8043fa5200f75697df9220a99abe9d"/>
<project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6fef72357971934c8774578044ea7a442be3a75d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="52f3ea58df38e5427f6afeb636bc6ad01d24022f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -126,7 +126,7 @@
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="2c0d193349c55337e37196a7f2d5cef37753ed3e"/>
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="61a10cbd19d6b7fc052a8cb92dfa1b37b93754f3"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="9e892a67a01671f312c76b0880dedaa6ba478148"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="ae5b9f6ee834f685cefa35554058490d99198783"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
<project name="platform/system/extras" path="system/extras" revision="47fa016e2248b80aebd5928402c7409f8e0ca64e"/>
<project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
<project name="platform/system/media" path="system/media" revision="70bfebc66d9c6a4c614a8c7efde90e8e7e1d8641"/>

Просмотреть файл

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6fef72357971934c8774578044ea7a442be3a75d"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="52f3ea58df38e5427f6afeb636bc6ad01d24022f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6fef72357971934c8774578044ea7a442be3a75d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="52f3ea58df38e5427f6afeb636bc6ad01d24022f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -109,7 +109,7 @@
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="6a1bb59af65b6485b1090522f66fac95c3f9e22c"/>
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="69d524e80cdf3981006627c65ac85f3a871238a3"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5a48c04c4bb5f079bc757e29864a42427378e051"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="ae5b9f6ee834f685cefa35554058490d99198783"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
<project name="platform/system/extras" path="system/extras" revision="576f57b6510de59c08568b53c0fb60588be8689e"/>
<project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
<project name="platform/system/netd" path="system/netd" revision="a6531f7befb49b1c81bc0de7e51c5482b308e1c5"/>

Просмотреть файл

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "6fef72357971934c8774578044ea7a442be3a75d",
"git_revision": "52f3ea58df38e5427f6afeb636bc6ad01d24022f",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "0fa143d87b0b96ddd6196c2915e4b53cceb427db",
"revision": "5c7a65a426564c027d8b9a0f61f247e659fae58d",
"repo_path": "integration/gaia-central"
}

Просмотреть файл

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6fef72357971934c8774578044ea7a442be3a75d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="52f3ea58df38e5427f6afeb636bc6ad01d24022f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="4713c3b346985f56c515909cd68dcc50597b1c51"/>
@ -118,7 +118,7 @@
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="842e33e43a55ea44833b9e23e4d180fa17c843af"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="5db24726f0f42124304195a6bdea129039eeeaeb"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="930ae098543881f47eac054677726ee4b998b2f8"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="ae5b9f6ee834f685cefa35554058490d99198783"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
<project name="platform_system_core" path="system/core" remote="b2g" revision="542d1f59dc331b472307e5bd043101d14d5a3a3e"/>
<project name="platform/system/extras" path="system/extras" revision="18c1180e848e7ab8691940481f5c1c8d22c37b3e"/>
<project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6fef72357971934c8774578044ea7a442be3a75d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="52f3ea58df38e5427f6afeb636bc6ad01d24022f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -126,7 +126,7 @@
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="2c0d193349c55337e37196a7f2d5cef37753ed3e"/>
<project name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="61a10cbd19d6b7fc052a8cb92dfa1b37b93754f3"/>
<project name="platform/prebuilts/tools" path="prebuilts/tools" revision="9e892a67a01671f312c76b0880dedaa6ba478148"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="ae5b9f6ee834f685cefa35554058490d99198783"/>
<project name="platform_system_bluetoothd" path="system/bluetoothd" remote="b2g" revision="58bf825bb7a0aa981237993db731236a1f19c492"/>
<project name="platform/system/extras" path="system/extras" revision="47fa016e2248b80aebd5928402c7409f8e0ca64e"/>
<project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="3c5405863d2002f665ef2b901abb3853c420129b"/>
<project name="platform/system/media" path="system/media" revision="70bfebc66d9c6a4c614a8c7efde90e8e7e1d8641"/>

Просмотреть файл

@ -7,7 +7,6 @@
#include "Telephony.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/AudioChannelBinding.h"
#include "mozilla/dom/CallEvent.h"
#include "mozilla/dom/MozMobileConnectionBinding.h"
#include "mozilla/dom/Promise.h"
@ -21,7 +20,6 @@
#include "nsServiceManagerUtils.h"
#include "nsThreadUtils.h"
#include "AudioChannelService.h"
#include "CallsList.h"
#include "TelephonyCall.h"
#include "TelephonyCallGroup.h"
@ -64,12 +62,8 @@ public:
};
Telephony::Telephony(nsPIDOMWindow* aOwner)
: DOMEventTargetHelper(aOwner),
mIsAudioStartPlaying(false),
mAudioAgentNotify(nsIAudioChannelAgent::AUDIO_AGENT_NOTIFY),
mHaveDispatchedInterruptBeginEvent(false)
: DOMEventTargetHelper(aOwner)
{
MOZ_ASSERT(aOwner);
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aOwner);
MOZ_ASSERT(global);
@ -78,7 +72,6 @@ Telephony::Telephony(nsPIDOMWindow* aOwner)
MOZ_ASSERT(!rv.Failed());
mReadyPromise = promise;
mMuted = AudioChannelService::IsAudioChannelMutedByDefault();
}
Telephony::~Telephony()
@ -525,61 +518,6 @@ Telephony::StopTone(const Optional<uint32_t>& aServiceId, ErrorResult& aRv)
aRv = mService->StopTone(serviceId);
}
void
Telephony::OwnAudioChannel(ErrorResult& aRv)
{
if (mAudioAgent) {
return;
}
mAudioAgent = do_CreateInstance("@mozilla.org/audiochannelagent;1");
MOZ_ASSERT(mAudioAgent);
aRv = mAudioAgent->Init(GetParentObject(),
(int32_t)AudioChannel::Telephony, this);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
aRv = HandleAudioAgentState();
if (NS_WARN_IF(aRv.Failed())) {
return;
}
}
nsresult
Telephony::HandleAudioAgentState()
{
if (!mAudioAgent) {
return NS_OK;
}
Nullable<OwningTelephonyCallOrTelephonyCallGroup> activeCall;
GetActive(activeCall);
nsresult rv;
// Only stop agent when the call is disconnected.
if ((!mCalls.Length() && !mGroup->CallsArray().Length()) &&
mIsAudioStartPlaying) {
mIsAudioStartPlaying = false;
rv = mAudioAgent->NotifyStoppedPlaying(mAudioAgentNotify);
mAudioAgent = nullptr;
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
} else if (!activeCall.IsNull() && !mIsAudioStartPlaying) {
mIsAudioStartPlaying = true;
float volume = 1.0;
bool muted = false;
rv = mAudioAgent->NotifyStartedPlaying(mAudioAgentNotify, &volume, &muted);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = WindowVolumeChanged(volume, muted);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
}
return NS_OK;
}
bool
Telephony::GetMuted(ErrorResult& aRv) const
{
@ -653,78 +591,13 @@ Telephony::GetReady(ErrorResult& aRv) const
return promise.forget();
}
// nsIAudioChannelAgentCallback
NS_IMETHODIMP
Telephony::WindowVolumeChanged(float aVolume, bool aMuted)
{
// Check the limitation of the network connection
if (mCalls.Length() > 1 ||
(mCalls.Length() == 1 && mGroup->CallsArray().Length())) {
return NS_ERROR_FAILURE;
}
ErrorResult rv;
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
nsRefPtr<Promise> promise = Promise::Create(global, rv);
if (NS_WARN_IF(rv.Failed())) {
return rv.StealNSResult();
}
// Check the single call or conference call
bool isSingleCall = mCalls.Length();
nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
if (isSingleCall) {
rv = aMuted ? mCalls[0]->Hold(callback) : mCalls[0]->Resume(callback);
} else {
rv = aMuted ? mGroup->Hold(callback) : mGroup->Resume(callback);
}
if (NS_WARN_IF(rv.Failed())) {
return rv.StealNSResult();
}
// These events will be triggered when the telephony is interrupted by other
// audio channel.
if (mMuted != aMuted) {
mMuted = aMuted;
// We should not dispatch "mozinterruptend" when the system app initializes
// the telephony audio from muted to unmuted at the first time. The event
// "mozinterruptend" must be dispatched after the "mozinterruptbegin".
if (!mHaveDispatchedInterruptBeginEvent && mMuted) {
DispatchTrustedEvent(NS_LITERAL_STRING("mozinterruptbegin"));
mHaveDispatchedInterruptBeginEvent = mMuted;
} else if (mHaveDispatchedInterruptBeginEvent && !mMuted) {
DispatchTrustedEvent(NS_LITERAL_STRING("mozinterruptend"));
mHaveDispatchedInterruptBeginEvent = mMuted;
}
}
return NS_OK;
}
NS_IMETHODIMP
Telephony::WindowAudioCaptureChanged()
{
// Do nothing
return NS_OK;
}
// nsITelephonyListener
NS_IMETHODIMP
Telephony::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo** aAllInfo)
{
nsresult rv;
for (uint32_t i = 0; i < aLength; ++i) {
rv = HandleCallInfo(aAllInfo[i]);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
}
rv = HandleAudioAgentState();
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
HandleCallInfo(aAllInfo[i]);
}
return NS_OK;
}
@ -732,8 +605,7 @@ Telephony::CallStateChanged(uint32_t aLength, nsITelephonyCallInfo** aAllInfo)
NS_IMETHODIMP
Telephony::EnumerateCallState(nsITelephonyCallInfo* aInfo)
{
uint32_t currentCallNum = 1;
return CallStateChanged(currentCallNum, &aInfo);
return HandleCallInfo(aInfo);
}
NS_IMETHODIMP

Просмотреть файл

@ -11,7 +11,6 @@
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/telephony/TelephonyCommon.h"
#include "nsIAudioChannelAgent.h"
#include "nsITelephonyCallInfo.h"
#include "nsITelephonyService.h"
@ -32,7 +31,6 @@ class TelephonyDialCallback;
class OwningTelephonyCallOrTelephonyCallGroup;
class Telephony final : public DOMEventTargetHelper,
public nsIAudioChannelAgentCallback,
private nsITelephonyListener
{
/**
@ -46,8 +44,6 @@ class Telephony final : public DOMEventTargetHelper,
friend class telephony::TelephonyDialCallback;
// The audio agent is needed to communicate with the audio channel service.
nsCOMPtr<nsIAudioChannelAgent> mAudioAgent;
nsCOMPtr<nsITelephonyService> mService;
nsRefPtr<Listener> mListener;
@ -58,15 +54,8 @@ class Telephony final : public DOMEventTargetHelper,
nsRefPtr<Promise> mReadyPromise;
bool mIsAudioStartPlaying;
uint32_t mAudioAgentNotify;
bool mHaveDispatchedInterruptBeginEvent;
bool mMuted;
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIAUDIOCHANNELAGENTCALLBACK
NS_DECL_NSITELEPHONYLISTENER
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(Telephony,
@ -105,15 +94,6 @@ public:
void
StopTone(const Optional<uint32_t>& aServiceId, ErrorResult& aRv);
// In the audio channel architecture, the system app needs to know the state
// of every audio channel, including the telephony. Therefore, when a
// telephony call is activated , the audio channel service would notify the
// system app about that. And we need a agent to communicate with the audio
// channel service. We would follow the call states to make a correct
// notification.
void
OwnAudioChannel(ErrorResult& aRv);
bool
GetMuted(ErrorResult& aRv) const;
@ -233,10 +213,6 @@ private:
nsresult
HandleCallInfo(nsITelephonyCallInfo* aInfo);
// Check the call states to decide whether need to send the notificaiton.
nsresult
HandleAudioAgentState();
};
} // namespace dom

Просмотреть файл

@ -324,10 +324,34 @@ TelephonyCall::Hold(ErrorResult& aRv)
return nullptr;
}
if (mCallState != nsITelephonyService::CALL_STATE_CONNECTED) {
NS_WARNING(nsPrintfCString("Hold non-connected call is rejected!"
" (State: %u)", mCallState).get());
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
return promise.forget();
}
if (mGroup) {
NS_WARNING("Hold a call in conference is rejected!");
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
return promise.forget();
}
if (!mSwitchable) {
NS_WARNING("Hold a non-switchable call is rejected!");
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
return promise.forget();
}
nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
aRv = Hold(callback);
if (NS_WARN_IF(aRv.Failed())) {
return nullptr;
aRv = mTelephony->Service()->HoldCall(mServiceId, mCallIndex, callback);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
if (mSecondId) {
// No state transition when we switch two numbers within one TelephonyCall
// object. Otherwise, the state here will be inconsistent with the backend
// RIL and will never be right.
return promise.forget();
}
return promise.forget();
@ -341,77 +365,28 @@ TelephonyCall::Resume(ErrorResult& aRv)
return nullptr;
}
nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
aRv = Resume(callback);
if (NS_WARN_IF(aRv.Failed())) {
return nullptr;
}
return promise.forget();
}
nsresult
TelephonyCall::Hold(nsITelephonyCallback* aCallback)
{
if (mCallState != nsITelephonyService::CALL_STATE_CONNECTED) {
NS_WARNING(nsPrintfCString("Hold non-connected call is rejected!"
" (State: %u)", mCallState).get());
aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
if (mGroup) {
NS_WARNING("Hold a call in conference is rejected!");
aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
if (!mSwitchable) {
NS_WARNING("Hold a non-switchable call is rejected!");
aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
nsresult rv = mTelephony->Service()->HoldCall(mServiceId, mCallIndex, aCallback);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
if (mSecondId) {
// No state transition when we switch two numbers within one TelephonyCall
// object. Otherwise, the state here will be inconsistent with the backend
// RIL and will never be right.
return NS_OK;
}
return NS_OK;
}
nsresult
TelephonyCall::Resume(nsITelephonyCallback* aCallback)
{
if (mCallState != nsITelephonyService::CALL_STATE_HELD) {
NS_WARNING("Resume non-held call is rejected!");
aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
return NS_ERROR_DOM_INVALID_STATE_ERR;
NS_WARNING(nsPrintfCString("Resume non-held call is rejected!"
" (State: %u)", mCallState).get());
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
return promise.forget();
}
if (mGroup) {
NS_WARNING("Resume a call in conference is rejected!");
aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
return NS_ERROR_DOM_INVALID_STATE_ERR;
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
return promise.forget();
}
if (!mSwitchable) {
NS_WARNING("Resume a non-switchable call is rejected!");
aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
return NS_ERROR_DOM_INVALID_STATE_ERR;
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
return promise.forget();
}
nsresult rv = mTelephony->Service()->ResumeCall(mServiceId, mCallIndex, aCallback);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
aRv = mTelephony->Service()->ResumeCall(mServiceId, mCallIndex, callback);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
return NS_OK;
}
return promise.forget();
}

Просмотреть файл

@ -12,7 +12,6 @@
#include "mozilla/dom/TelephonyCallBinding.h"
#include "mozilla/dom/TelephonyCallId.h"
#include "mozilla/dom/telephony/TelephonyCommon.h"
#include "nsITelephonyService.h"
class nsPIDOMWindow;
@ -186,12 +185,6 @@ private:
~TelephonyCall();
nsresult
Hold(nsITelephonyCallback* aCallback);
nsresult
Resume(nsITelephonyCallback* aCallback);
void
ChangeStateInternal(uint16_t aCallState, bool aFireEvents);

Просмотреть файл

@ -347,12 +347,16 @@ TelephonyCallGroup::Hold(ErrorResult& aRv)
return nullptr;
}
nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
aRv = Hold(callback);
if (NS_WARN_IF(aRv.Failed())) {
return nullptr;
if (mCallState != nsITelephonyService::CALL_STATE_CONNECTED) {
NS_WARNING("Holding a non-connected call is rejected!");
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
return promise.forget();
}
nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
aRv = mTelephony->Service()->HoldConference(mCalls[0]->ServiceId(),
callback);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
return promise.forget();
}
@ -366,47 +370,15 @@ TelephonyCallGroup::Resume(ErrorResult& aRv)
return nullptr;
}
nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
aRv = Resume(callback);
if (NS_WARN_IF(aRv.Failed())) {
return nullptr;
}
return promise.forget();
}
nsresult
TelephonyCallGroup::Hold(nsITelephonyCallback* aCallback)
{
if (mCallState != nsITelephonyService::CALL_STATE_CONNECTED) {
NS_WARNING("Holding a non-connected call is rejected!");
aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
nsresult rv = mTelephony->Service()->HoldConference(mCalls[0]->ServiceId(),
aCallback);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return NS_OK;
}
nsresult
TelephonyCallGroup::Resume(nsITelephonyCallback* aCallback)
{
if (mCallState != nsITelephonyService::CALL_STATE_HELD) {
NS_WARNING("Resuming a non-held call is rejected!");
aCallback->NotifyError(NS_LITERAL_STRING("InvalidStateError"));
return NS_ERROR_DOM_INVALID_STATE_ERR;
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
return promise.forget();
}
nsresult rv = mTelephony->Service()->ResumeConference(mCalls[0]->ServiceId(),
aCallback);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return NS_OK;
nsCOMPtr<nsITelephonyCallback> callback = new TelephonyCallback(promise);
aRv = mTelephony->Service()->ResumeConference(mCalls[0]->ServiceId(),
callback);
NS_ENSURE_TRUE(!aRv.Failed(), nullptr);
return promise.forget();
}

Просмотреть файл

@ -30,8 +30,6 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TelephonyCallGroup,
DOMEventTargetHelper)
friend class Telephony;
nsPIDOMWindow*
GetParentObject() const
{
@ -110,12 +108,6 @@ private:
explicit TelephonyCallGroup(nsPIDOMWindow* aOwner);
~TelephonyCallGroup();
nsresult
Hold(nsITelephonyCallback* aCallback);
nsresult
Resume(nsITelephonyCallback* aCallback);
nsresult
NotifyCallsChanged(TelephonyCall* aCall);

Просмотреть файл

@ -49,12 +49,6 @@ interface Telephony : EventTarget {
[Throws]
void stopTone(optional unsigned long serviceId);
// Calling this method, the app will be treated as owner of the telephony
// calls from the AudioChannel policy.
[Throws,
CheckAllPermissions="audio-channel-telephony"]
void ownAudioChannel();
[Throws]
attribute boolean muted;

Просмотреть файл

@ -34,7 +34,7 @@
#include <rmsdef.h>
#endif
#if defined(MOZ_B2G) && !defined(MOZ_CRASHREPORTER)
#if defined(MOZ_WIDGET_GONK) && !defined(MOZ_CRASHREPORTER)
#include <sys/syscall.h>
#endif
@ -196,7 +196,7 @@ void nsProfileLock::FatalSignalHandler(int signo
}
}
#ifdef MOZ_B2G
#ifdef MOZ_WIDGET_GONK
switch (signo) {
case SIGQUIT:
case SIGILL:
@ -302,7 +302,7 @@ static bool IsSymlinkStaleLock(struct in_addr* aAddr, const char* aFileName,
// so the process that created this obsolete lock must be gone
return true;
}
char *after = nullptr;
pid_t pid = strtol(colon, &after, 0);
if (pid != 0 && *after == '\0')
@ -312,7 +312,7 @@ static bool IsSymlinkStaleLock(struct in_addr* aAddr, const char* aFileName,
// Remote lock: give up even if stuck.
return false;
}
// kill(pid,0) is a neat trick to check if a
// process exists
if (kill(pid, 0) == 0 || errno != ESRCH)
@ -489,7 +489,7 @@ nsresult nsProfileLock::Lock(nsIFile* aProfileDir,
rv = lockFile->Append(LOCKFILE_NAME);
if (NS_FAILED(rv))
return rv;
#if defined(XP_MACOSX)
// First, try locking using fcntl. It is more reliable on
// a local machine, but may not be supported by an NFS server.
@ -501,7 +501,7 @@ nsresult nsProfileLock::Lock(nsIFile* aProfileDir,
// assume we tried an NFS that does not support it. Now, try with symlink.
rv = LockWithSymlink(lockFile, false);
}
if (NS_SUCCEEDED(rv))
{
// Check for the old-style lock used by pre-mozilla 1.3 builds.