Merge b2ginbound to central, a=merge

This commit is contained in:
Wes Kocher 2015-10-06 12:14:33 -07:00
commit 408afc6759
43 changed files with 809 additions and 967 deletions

View File

@ -385,7 +385,7 @@ pref("urlclassifier.gethash.timeout_ms", 5000);
pref("urlclassifier.max-complete-age", 2700);
// Tracking protection
pref("privacy.trackingprotection.enabled", true);
pref("privacy.trackingprotection.enabled", false);
pref("privacy.trackingprotection.pbmode.enabled", false);
#endif

View File

@ -671,6 +671,7 @@ var settingsToObserve = {
'mms.debugging.enabled': false,
'network.debugging.enabled': false,
'privacy.donottrackheader.enabled': false,
'privacy.trackingprotection.enabled': false,
'ril.debugging.enabled': false,
'ril.radio.disabled': false,
'ril.mms.requestReadReport.enabled': {

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="60cdaa3d3424db3432dc903e7f9c6c8fa099c06d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0019347fbaedc9d54f2f3436fff17aeb22968174"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="60cdaa3d3424db3432dc903e7f9c6c8fa099c06d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0019347fbaedc9d54f2f3436fff17aeb22968174"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>

View File

@ -19,11 +19,11 @@
<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="60cdaa3d3424db3432dc903e7f9c6c8fa099c06d"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0019347fbaedc9d54f2f3436fff17aeb22968174"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="12ff7481566587aa4198cf1287598acb3a999973"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="065f6361461030d32c6dc08d716b013bfadab1d9"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<!-- Stock Android things -->

View File

@ -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="60cdaa3d3424db3432dc903e7f9c6c8fa099c06d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0019347fbaedc9d54f2f3436fff17aeb22968174"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f004530b30a63c08a16d82536858600446b2abf5"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="60cdaa3d3424db3432dc903e7f9c6c8fa099c06d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0019347fbaedc9d54f2f3436fff17aeb22968174"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -128,10 +128,10 @@
<!-- Emulator specific things -->
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="72ffdf71c68a96309212eb13d63560d66db14c9e"/>
<project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="8d4018ebd33ac3f1a043b2d54bc578028656a659"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="b2773dbc3cb24e70cff2b05522e9c959250400ac"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="6bbed5a99dd0f347bcee7fdde0463467fe3002f3"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="f37bd545063039e30a92f2550ae78c0e6e4e2d08"/>
<project name="platform_external_wpa_supplicant_8" path="external/wpa_supplicant_8" remote="b2g" revision="0c6a6547cd1fd302fa2b0f6e375654df36bf0ec4"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="7132bc11fbc68acfebcd509095562ca04fad5584"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="575799df119771fcfbe9c99c8eee43f8100cd9a2"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="5f4b68c799927b6e078f987b12722c3a6ccd4a45"/>
<project name="platform/development" path="development" revision="5968ff4e13e0d696ad8d972281fc27ae5a12829b"/>
<project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="6a1bb59af65b6485b1090522f66fac95c3f9e22c"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="60cdaa3d3424db3432dc903e7f9c6c8fa099c06d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0019347fbaedc9d54f2f3436fff17aeb22968174"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

View File

@ -19,11 +19,11 @@
<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="60cdaa3d3424db3432dc903e7f9c6c8fa099c06d"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0019347fbaedc9d54f2f3436fff17aeb22968174"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="12ff7481566587aa4198cf1287598acb3a999973"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="065f6361461030d32c6dc08d716b013bfadab1d9"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
<!-- Stock Android things -->

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="60cdaa3d3424db3432dc903e7f9c6c8fa099c06d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0019347fbaedc9d54f2f3436fff17aeb22968174"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>

View File

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "60cdaa3d3424db3432dc903e7f9c6c8fa099c06d",
"git_revision": "0019347fbaedc9d54f2f3436fff17aeb22968174",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "1de2dfa13b0b91c293111198011353c7bb86242d",
"revision": "32ae3240869f21601d31c7f71c4fd09c02239353",
"repo_path": "integration/gaia-central"
}

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="60cdaa3d3424db3432dc903e7f9c6c8fa099c06d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0019347fbaedc9d54f2f3436fff17aeb22968174"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>

View File

@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="60cdaa3d3424db3432dc903e7f9c6c8fa099c06d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0019347fbaedc9d54f2f3436fff17aeb22968174"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="31a7849fe9a8b743d6f5e5facc212f0ef9d57499"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f004530b30a63c08a16d82536858600446b2abf5"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="60cdaa3d3424db3432dc903e7f9c6c8fa099c06d"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0019347fbaedc9d54f2f3436fff17aeb22968174"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7e0fe55ac52323eace5a6119ab2b911fc4f64495"/>
@ -141,7 +141,7 @@
<default remote="caf" revision="refs/tags/android-5.1.0_r1" sync-j="4"/>
<!-- Nexus 5 specific things -->
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="fe7df1bc8dd0fd71571505d7be1c31a4ad1e40fb"/>
<project name="device-hammerhead" path="device/lge/hammerhead" remote="b2g" revision="31b5bafd0d234984f1133a3b3d08839521f2b718"/>
<project name="device-hammerhead" path="device/lge/hammerhead" remote="b2g" revision="844d9fe1c7114c6d586fbea611cbb7038413d762"/>
<project name="device_lge_hammerhead-kernel" path="device/lge/hammerhead-kernel" remote="b2g" revision="8b3ffcfdd3d3852eca5488628f8bb2a08acbffa7"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="5d0ae53d9588c3d70c005aec9be94af9a534de16"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="c15b6e266136cd0cdd9b94d0bbed1962d9dd6672"/>

View File

@ -86,11 +86,11 @@ AvStatusToSinkString(BluetoothA2dpConnectionState aState, nsAString& aString)
}
}
class BluetoothA2dpManager::InitA2dpResultHandler final
class BluetoothA2dpManager::InitResultHandler final
: public BluetoothA2dpResultHandler
{
public:
InitA2dpResultHandler(BluetoothProfileResultHandler* aRes)
InitResultHandler(BluetoothProfileResultHandler* aRes)
: mRes(aRes)
{ }
@ -172,7 +172,7 @@ BluetoothA2dpManager::InitA2dpInterface(BluetoothProfileResultHandler* aRes)
}
BluetoothA2dpManager* a2dpManager = BluetoothA2dpManager::Get();
sBtA2dpInterface->Init(a2dpManager, new InitA2dpResultHandler(aRes));
sBtA2dpInterface->Init(a2dpManager, new InitResultHandler(aRes));
}
BluetoothA2dpManager::~BluetoothA2dpManager()
@ -227,11 +227,11 @@ BluetoothA2dpManager::Get()
return sBluetoothA2dpManager;
}
class BluetoothA2dpManager::CleanupA2dpResultHandler final
class BluetoothA2dpManager::CleanupResultHandler final
: public BluetoothA2dpResultHandler
{
public:
CleanupA2dpResultHandler(BluetoothProfileResultHandler* aRes)
CleanupResultHandler(BluetoothProfileResultHandler* aRes)
: mRes(aRes)
{ }
@ -260,11 +260,11 @@ private:
nsRefPtr<BluetoothProfileResultHandler> mRes;
};
class BluetoothA2dpManager::CleanupA2dpResultHandlerRunnable final
class BluetoothA2dpManager::CleanupResultHandlerRunnable final
: public nsRunnable
{
public:
CleanupA2dpResultHandlerRunnable(BluetoothProfileResultHandler* aRes)
CleanupResultHandlerRunnable(BluetoothProfileResultHandler* aRes)
: mRes(aRes)
{ }
@ -289,11 +289,11 @@ BluetoothA2dpManager::DeinitA2dpInterface(BluetoothProfileResultHandler* aRes)
MOZ_ASSERT(NS_IsMainThread());
if (sBtA2dpInterface) {
sBtA2dpInterface->Cleanup(new CleanupA2dpResultHandler(aRes));
sBtA2dpInterface->Cleanup(new CleanupResultHandler(aRes));
} else if (aRes) {
// We dispatch a runnable here to make the profile resource handler
// behave as if A2DP was initialized.
nsRefPtr<nsRunnable> r = new CleanupA2dpResultHandlerRunnable(aRes);
nsRefPtr<nsRunnable> r = new CleanupResultHandlerRunnable(aRes);
if (NS_FAILED(NS_DispatchToMainThread(r))) {
BT_LOGR("Failed to dispatch cleanup-result-handler runnable");
}

View File

@ -47,11 +47,11 @@ protected:
virtual ~BluetoothA2dpManager();
private:
class CleanupA2dpResultHandler;
class CleanupA2dpResultHandlerRunnable;
class CleanupResultHandler;
class CleanupResultHandlerRunnable;
class ConnectResultHandler;
class DisconnectResultHandler;
class InitA2dpResultHandler;
class InitResultHandler;
class OnErrorProfileResultHandlerRunnable;
BluetoothA2dpManager();

View File

@ -118,11 +118,11 @@ BluetoothAvrcpManager::Reset()
mPlayStatus = ControlPlayStatus::PLAYSTATUS_STOPPED;
}
class BluetoothAvrcpManager::InitAvrcpResultHandler final
class BluetoothAvrcpManager::InitResultHandler final
: public BluetoothAvrcpResultHandler
{
public:
InitAvrcpResultHandler(BluetoothProfileResultHandler* aRes)
InitResultHandler(BluetoothProfileResultHandler* aRes)
: mRes(aRes)
{ }
@ -209,7 +209,7 @@ BluetoothAvrcpManager::InitAvrcpInterface(BluetoothProfileResultHandler* aRes)
}
BluetoothAvrcpManager* avrcpManager = BluetoothAvrcpManager::Get();
sBtAvrcpInterface->Init(avrcpManager, new InitAvrcpResultHandler(aRes));
sBtAvrcpInterface->Init(avrcpManager, new InitResultHandler(aRes));
}
BluetoothAvrcpManager::~BluetoothAvrcpManager()
@ -245,11 +245,11 @@ BluetoothAvrcpManager::Get()
return sBluetoothAvrcpManager;
}
class BluetoothAvrcpManager::CleanupAvrcpResultHandler final
class BluetoothAvrcpManager::CleanupResultHandler final
: public BluetoothAvrcpResultHandler
{
public:
CleanupAvrcpResultHandler(BluetoothProfileResultHandler* aRes)
CleanupResultHandler(BluetoothProfileResultHandler* aRes)
: mRes(aRes)
{ }
@ -285,25 +285,19 @@ private:
nsRefPtr<BluetoothProfileResultHandler> mRes;
};
class BluetoothAvrcpManager::CleanupAvrcpResultHandlerRunnable final
class BluetoothAvrcpManager::CleanupResultHandlerRunnable final
: public nsRunnable
{
public:
CleanupAvrcpResultHandlerRunnable(BluetoothProfileResultHandler* aRes)
CleanupResultHandlerRunnable(BluetoothProfileResultHandler* aRes)
: mRes(aRes)
{ }
{
MOZ_ASSERT(mRes);
}
NS_IMETHOD Run() override
{
sBtAvrcpInterface = nullptr;
if (sBtAvrcpInterface) {
sBtAvrcpInterface->Cleanup(new CleanupAvrcpResultHandler(mRes));
} else if (mRes) {
/* Not all backends support AVRCP. If it's not available
* we signal success from here.
*/
mRes->Deinit();
}
mRes->Deinit();
return NS_OK;
}
@ -319,11 +313,11 @@ BluetoothAvrcpManager::DeinitAvrcpInterface(BluetoothProfileResultHandler* aRes)
MOZ_ASSERT(NS_IsMainThread());
if (sBtAvrcpInterface) {
sBtAvrcpInterface->Cleanup(new CleanupAvrcpResultHandler(aRes));
sBtAvrcpInterface->Cleanup(new CleanupResultHandler(aRes));
} else if (aRes) {
// We dispatch a runnable here to make the profile resource handler
// behave as if A2DP was initialized.
nsRefPtr<nsRunnable> r = new CleanupAvrcpResultHandlerRunnable(aRes);
// behave as if AVRCP was initialized.
nsRefPtr<nsRunnable> r = new CleanupResultHandlerRunnable(aRes);
if (NS_FAILED(NS_DispatchToMainThread(r))) {
BT_LOGR("Failed to dispatch cleanup-result-handler runnable");
}

View File

@ -60,11 +60,11 @@ protected:
virtual ~BluetoothAvrcpManager();
private:
class CleanupAvrcpResultHandler;
class CleanupAvrcpResultHandlerRunnable;
class CleanupResultHandler;
class CleanupResultHandlerRunnable;
class ConnectRunnable;
class DisconnectRunnable;
class InitAvrcpResultHandler;
class InitResultHandler;
class OnErrorProfileResultHandlerRunnable;
BluetoothAvrcpManager();

View File

@ -170,129 +170,31 @@ public:
}
};
// Init operator class for ConnectionStateNotification
class BluetoothDaemonA2dpModule::ConnectionStateInitOp final
: private PDUInitOp
{
public:
ConnectionStateInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (BluetoothA2dpConnectionState& aArg1,
BluetoothAddress& aArg2) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read state */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read address */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonA2dpModule::ConnectionStateNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
ConnectionStateNotification::Dispatch(
&BluetoothA2dpNotificationHandler::ConnectionStateNotification,
ConnectionStateInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
// Init operator class for AudioStateNotification
class BluetoothDaemonA2dpModule::AudioStateInitOp final
: private PDUInitOp
{
public:
AudioStateInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (BluetoothA2dpAudioState& aArg1,
BluetoothAddress& aArg2) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read state */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read address */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonA2dpModule::AudioStateNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
AudioStateNotification::Dispatch(
&BluetoothA2dpNotificationHandler::AudioStateNotification,
AudioStateInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
// Init operator class for AudioConfigNotification
class BluetoothDaemonA2dpModule::AudioConfigInitOp final
: private PDUInitOp
{
public:
AudioConfigInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (BluetoothAddress& aArg1, uint32_t aArg2, uint8_t aArg3) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read address */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read sample rate */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
/* Read channel count */
rv = UnpackPDU(pdu, aArg3);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonA2dpModule::AudioConfigNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
AudioConfigNotification::Dispatch(
&BluetoothA2dpNotificationHandler::AudioConfigNotification,
AudioConfigInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
void

View File

@ -110,10 +110,6 @@ protected:
const BluetoothAddress&, uint32_t, uint8_t>
AudioConfigNotification;
class ConnectionStateInitOp;
class AudioStateInitOp;
class AudioConfigInitOp;
void ConnectionStateNtf(const DaemonSocketPDUHeader& aHeader,
DaemonSocketPDU& aPDU);

View File

@ -738,40 +738,13 @@ BluetoothDaemonAvrcpModule::VolumeChangeNtf(
UnpackPDUInitOp(aPDU));
}
// Init operator class for PassthroughCmdNotification
class BluetoothDaemonAvrcpModule::PassthroughCmdInitOp final
: private PDUInitOp
{
public:
PassthroughCmdInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (int& aArg1, int& aArg2) const
{
DaemonSocketPDU& pdu = GetPDU();
nsresult rv = UnpackPDU(pdu, UnpackConversion<uint8_t, int>(aArg1));
if (NS_FAILED(rv)) {
return rv;
}
rv = UnpackPDU(pdu, UnpackConversion<uint8_t, int>(aArg2));
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonAvrcpModule::PassthroughCmdNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
PassthroughCmdNotification::Dispatch(
&BluetoothAvrcpNotificationHandler::PassthroughCmdNotification,
PassthroughCmdInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
#endif

View File

@ -243,14 +243,13 @@ protected:
VolumeChangeNotification;
typedef mozilla::ipc::DaemonNotificationRunnable2<
NotificationHandlerWrapper, void, int, int>
NotificationHandlerWrapper, void, uint8_t, uint8_t, int, int>
PassthroughCmdNotification;
class GetElementAttrInitOp;
class GetPlayerAppAttrsTextInitOp;
class GetPlayerAppValueInitOp;
class GetPlayerAppValuesTextInitOp;
class PassthroughCmdInitOp;
class RemoteFeatureInitOp;
void RemoteFeatureNtf(const DaemonSocketPDUHeader& aHeader,

View File

@ -945,201 +945,40 @@ BluetoothDaemonCoreModule::DiscoveryStateChangedNtf(
UnpackPDUInitOp(aPDU));
}
// Init operator class for PinRequestNotification
class BluetoothDaemonCoreModule::PinRequestInitOp final
: private PDUInitOp
{
public:
PinRequestInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (BluetoothAddress& aArg1, BluetoothRemoteName& aArg2,
uint32_t& aArg3) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read remote address */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read remote name */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
/* Read CoD */
rv = UnpackPDU(pdu, aArg3);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonCoreModule::PinRequestNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
PinRequestNotification::Dispatch(
&BluetoothNotificationHandler::PinRequestNotification,
PinRequestInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
// Init operator class for SspRequestNotification
class BluetoothDaemonCoreModule::SspRequestInitOp final
: private PDUInitOp
{
public:
SspRequestInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (BluetoothAddress& aArg1, BluetoothRemoteName& aArg2,
uint32_t& aArg3, BluetoothSspVariant& aArg4,
uint32_t& aArg5) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read remote address */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read remote name */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
/* Read CoD */
rv = UnpackPDU(pdu, aArg3);
if (NS_FAILED(rv)) {
return rv;
}
/* Read pairing variant */
rv = UnpackPDU(pdu, aArg4);
if (NS_FAILED(rv)) {
return rv;
}
/* Read passkey */
rv = UnpackPDU(pdu, aArg5);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonCoreModule::SspRequestNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
SspRequestNotification::Dispatch(
&BluetoothNotificationHandler::SspRequestNotification,
SspRequestInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
// Init operator class for BondStateChangedNotification
class BluetoothDaemonCoreModule::BondStateChangedInitOp final
: private PDUInitOp
{
public:
BondStateChangedInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (BluetoothStatus& aArg1, BluetoothAddress& aArg2,
BluetoothBondState& aArg3) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read status */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read remote address */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
/* Read bond state */
rv = UnpackPDU(pdu, aArg3);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonCoreModule::BondStateChangedNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
BondStateChangedNotification::Dispatch(
&BluetoothNotificationHandler::BondStateChangedNotification,
BondStateChangedInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
// Init operator class for AclStateChangedNotification
class BluetoothDaemonCoreModule::AclStateChangedInitOp final
: private PDUInitOp
{
public:
AclStateChangedInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (BluetoothStatus& aArg1, BluetoothAddress& aArg2,
BluetoothAclState& aArg3) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read status */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read remote address */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
/* Read ACL state */
rv = UnpackPDU(pdu, aArg3);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonCoreModule::AclStateChangedNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
AclStateChangedNotification::Dispatch(
&BluetoothNotificationHandler::AclStateChangedNotification,
AclStateChangedInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
// Init operator class for DutModeRecvNotification

View File

@ -298,14 +298,10 @@ private:
NotificationHandlerWrapper, void, BluetoothStatus, uint16_t>
LeTestModeNotification;
class AclStateChangedInitOp;
class AdapterPropertiesInitOp;
class BondStateChangedInitOp;
class DeviceFoundInitOp;
class DutModeRecvInitOp;
class PinRequestInitOp;
class RemoteDevicePropertiesInitOp;
class SspRequestInitOp;
void AdapterStateChangedNtf(const DaemonSocketPDUHeader& aHeader,
DaemonSocketPDU& aPDU);

View File

@ -1568,56 +1568,13 @@ BluetoothDaemonGattModule::ClientScanResultNtf(
ClientScanResultInitOp(aPDU));
}
// Init operator class for ClientConnect/DisconnectNotification
class BluetoothDaemonGattModule::ClientConnectDisconnectInitOp final
: private PDUInitOp
{
public:
ClientConnectDisconnectInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (int& aArg1,
BluetoothGattStatus& aArg2,
int& aArg3,
BluetoothAddress& aArg4) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read connection ID */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read status */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
/* Read client interface */
rv = UnpackPDU(pdu, aArg3);
if (NS_FAILED(rv)) {
return rv;
}
/* Read address */
rv = UnpackPDU(pdu, aArg4);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonGattModule::ClientConnectNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
ClientConnectNotification::Dispatch(
&BluetoothGattNotificationHandler::ConnectNotification,
ClientConnectDisconnectInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
void
@ -1626,7 +1583,7 @@ BluetoothDaemonGattModule::ClientDisconnectNtf(
{
ClientDisconnectNotification::Dispatch(
&BluetoothGattNotificationHandler::DisconnectNotification,
ClientConnectDisconnectInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
void
@ -1737,56 +1694,13 @@ BluetoothDaemonGattModule::ClientExecuteWriteNtf(
UnpackPDUInitOp(aPDU));
}
// Init operator class for ClientReadRemoteRssiNotification
class BluetoothDaemonGattModule::ClientReadRemoteRssiInitOp final
: private PDUInitOp
{
public:
ClientReadRemoteRssiInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (int& aArg1,
BluetoothAddress& aArg2,
int& aArg3,
BluetoothGattStatus& aArg4) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read client interface */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read address */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
/* Read RSSI */
rv = UnpackPDU(pdu, aArg3);
if (NS_FAILED(rv)) {
return rv;
}
/* Read status */
rv = UnpackPDU(pdu, aArg4);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonGattModule::ClientReadRemoteRssiNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
ClientReadRemoteRssiNotification::Dispatch(
&BluetoothGattNotificationHandler::ReadRemoteRssiNotification,
ClientReadRemoteRssiInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
void
@ -1922,68 +1836,13 @@ BluetoothDaemonGattModule::ServerServiceDeletedNtf(
UnpackPDUInitOp(aPDU));
}
// Init operator class for ServerRequestReadNotification
class BluetoothDaemonGattModule::ServerRequestReadInitOp final
: private PDUInitOp
{
public:
ServerRequestReadInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (int& aArg1,
int& aArg2,
BluetoothAddress& aArg3,
BluetoothAttributeHandle& aArg4,
int& aArg5,
bool& aArg6) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read connection ID */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read trans ID */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
/* Read address */
rv = UnpackPDU(pdu, aArg3);
if (NS_FAILED(rv)) {
return rv;
}
/* Read attribute handle */
rv = UnpackPDU(pdu, aArg4);
if (NS_FAILED(rv)) {
return rv;
}
/* Read offset */
rv = UnpackPDU(pdu, aArg5);
if (NS_FAILED(rv)) {
return rv;
}
/* Read isLong */
rv = UnpackPDU(pdu, aArg6);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonGattModule::ServerRequestReadNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
ServerRequestReadNotification::Dispatch(
&BluetoothGattNotificationHandler::RequestReadNotification,
ServerRequestReadInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
// Init operator class for ServerRequestWriteNotification
@ -2069,56 +1928,13 @@ BluetoothDaemonGattModule::ServerRequestWriteNtf(
ServerRequestWriteInitOp(aPDU));
}
// Init operator class for ServerRequestExecuteWriteNotification
class BluetoothDaemonGattModule::ServerRequestExecuteWriteInitOp final
: private PDUInitOp
{
public:
ServerRequestExecuteWriteInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (int& aArg1,
int& aArg2,
BluetoothAddress& aArg3,
bool& aArg4) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read connection ID */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read trans ID */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
/* Read address */
rv = UnpackPDU(pdu, aArg3);
if (NS_FAILED(rv)) {
return rv;
}
/* Read execute write */
rv = UnpackPDU(pdu, aArg4);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonGattModule::ServerRequestExecuteWriteNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
ServerRequestExecuteWriteNotification::Dispatch(
&BluetoothGattNotificationHandler::RequestExecuteWriteNotification,
ServerRequestExecuteWriteInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
void

View File

@ -681,14 +681,10 @@ protected:
BluetoothGattStatus, int>
ServerResponseConfirmationNotification;
class ClientScanResultInitOp;
class ClientConnectDisconnectInitOp;
class ClientReadRemoteRssiInitOp;
class ClientGetDeviceTypeInitOp;
class ClientScanResultInitOp;
class ServerConnectionInitOp;
class ServerRequestReadInitOp;
class ServerRequestWriteInitOp;
class ServerRequestExecuteWriteInitOp;
void ClientRegisterNtf(const DaemonSocketPDUHeader& aHeader,
DaemonSocketPDU& aPDU);

View File

@ -777,44 +777,13 @@ BluetoothDaemonHandsfreeModule::ConnectionStateNtf(
ConnectionStateInitOp(aPDU));
}
// Init operator class for AudioStateNotification
class BluetoothDaemonHandsfreeModule::AudioStateInitOp final
: private PDUInitOp
{
public:
AudioStateInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (BluetoothHandsfreeAudioState& aArg1,
BluetoothAddress& aArg2) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read state */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read address */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonHandsfreeModule::AudioStateNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
AudioStateNotification::Dispatch(
&BluetoothHandsfreeNotificationHandler::AudioStateNotification,
AudioStateInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
// Init operator class for VoiceRecognitionNotification
@ -1381,44 +1350,13 @@ BluetoothDaemonHandsfreeModule::KeyPressedNtf(
KeyPressedInitOp(aPDU));
}
// Init operator class for WbsNotification
class BluetoothDaemonHandsfreeModule::WbsInitOp final
: private PDUInitOp
{
public:
WbsInitOp(DaemonSocketPDU& aPDU)
: PDUInitOp(aPDU)
{ }
nsresult
operator () (BluetoothHandsfreeWbsConfig& aArg1, BluetoothAddress& aArg2) const
{
DaemonSocketPDU& pdu = GetPDU();
/* Read state */
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
/* Read address */
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
void
BluetoothDaemonHandsfreeModule::WbsNtf(
const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
{
WbsNotification::Dispatch(
&BluetoothHandsfreeNotificationHandler::WbsNotification,
WbsInitOp(aPDU));
UnpackPDUInitOp(aPDU));
}
void

View File

@ -314,7 +314,6 @@ protected:
WbsNotification;
class ConnectionStateInitOp;
class AudioStateInitOp;
class VoiceRecognitionInitOp;
class AnswerCallInitOp;
class HangupCallInitOp;
@ -330,7 +329,6 @@ protected:
class VolumeInitOp;
class UnknownAtInitOp;
class KeyPressedInitOp;
class WbsInitOp;
void ConnectionStateNtf(const DaemonSocketPDUHeader& aHeader,
DaemonSocketPDU& aPDU);

View File

@ -1890,9 +1890,11 @@ BluetoothServiceBluedroid::AdapterStateChangedNotification(bool aState)
if (!mEnabled) {
static void (* const sDeinitManager[])(BluetoothProfileResultHandler*) = {
BluetoothHfpManager::DeinitHfpInterface,
// Cleanup interfaces in opposite order to initialization.
BluetoothGattManager::DeinitGattInterface,
BluetoothAvrcpManager::DeinitAvrcpInterface,
BluetoothA2dpManager::DeinitA2dpInterface,
BluetoothGattManager::DeinitGattInterface
BluetoothHfpManager::DeinitHfpInterface
};
// Return error if BluetoothService is unavailable

View File

@ -916,6 +916,8 @@ BrowserElementChild.prototype = {
// Pass along the position where the context menu should be located
menuData.clientX = e.clientX;
menuData.clientY = e.clientY;
menuData.screenX = e.screenX;
menuData.screenY = e.screenY;
// The value returned by the contextmenu sync call is true if the embedder
// called preventDefault() on its contextmenu event.

View File

@ -2211,10 +2211,9 @@ TelephonyService.prototype = {
aFailCause = RIL.GECKO_CALL_ERROR_NORMAL_CALL_CLEARING) {
if (DEBUG) debug("_disconnectCalls: " + JSON.stringify(aCalls));
// Child cannot live without parent. Let's find all the calls that need to
// be disconnected.
// In addition to the disconnected call itself, its decedent calls should be
// treated as disconnected calls as well.
let disconnectedCalls = aCalls.slice();
for (let call in aCalls) {
while (call.childId) {
call = this._currentCalls[aClientId][call.childId];
@ -2231,8 +2230,8 @@ TelephonyService.prototype = {
call.state = nsITelephonyService.CALL_STATE_DISCONNECTED;
call.disconnectedReason = aFailCause;
if (call.parentId) {
let parentCall = this._currentCalls[aClientId][call.parentId];
let parentCall = this._currentCalls[aClientId][call.parentId];
if (parentCall) {
delete parentCall.childId;
}

View File

@ -99,6 +99,121 @@ var emulator = (function() {
};
}());
/**
* Modem Helper
*
* TODO: Should select which modem here to support multi-SIM
*/
function modemHelperGenerator() {
function Modem(aClientID) {
this.clientID = aClientID;
}
Modem.prototype = {
clientID: 0,
voiceTypeToTech: function(aVoiceType) {
switch(aVoiceType) {
case "gsm":
case "gprs":
case "edge":
return "gsm";
case "umts":
case "hsdpa":
case "hsupa":
case "hspa":
case "hspa+":
return "wcdma";
case "is95a":
case "is95b":
case "1xrtt":
return "cdma";
case "evdo0":
case "evdoa":
case "evdob":
return "evdo";
case "ehrpd":
return "ehrpd";
case "lte":
return "lte";
default:
return null;
}
},
isCDMA: function() {
var mobileConn = navigator.mozMobileConnections[this.clientID];
var tech = mobileConn && this.voiceTypeToTech(mobileConn.voice.type);
return tech === "cdma" || tech === "evdo" || tech == "ehrpd";
},
isGSM: function() {
var mobileConn = navigator.mozMobileConnections[this.clientID];
var tech = mobileConn && this.voiceTypeToTech(mobileConn.voice.type);
return tech === "gsm" || tech === "wcdma" || tech === "lte";
},
/**
* @return Promise:
*/
changeTech: function(aTech, aMask) {
let target = navigator.mozMobileConnections[this.clientID];
let mask = aMask || {
gsm: "gsm",
wcdma: "gsm/wcdma",
cdma: "cdma",
evdo: "evdo0",
ehrpd: "ehrpd",
lte: "lte"
}[aTech];
let waitForExpectedTech = () => {
return new Promise((aResolve, aReject) => {
let listener = aEvent => {
log("MobileConnection[" + this.clientID + "] " +
"received event 'voicechange'");
if (aTech === this.voiceTypeToTech(target.voice.type)) {
target.removeEventListener("voicechange", listener);
aResolve();
}
};
target.addEventListener("voicechange", listener);
});
};
// TODO: Should select a modem here to support multi-SIM
let changeToExpectedTech = () => {
return Promise.resolve()
.then(() => emulator.runCmd("modem tech " + aTech + " " + mask))
.then(() => emulator.runCmd("modem tech"))
.then(result => is(result[0], aTech + " " + mask,
"Check modem 'tech/preferred mask'"));
}
return aTech === this.voiceTypeToTech(target.voice.type)
? Promise.resolve()
: Promise.all([waitForExpectedTech(), changeToExpectedTech()]);
}
};
let modems = [];
for (let i = 0; i < navigator.mozMobileConnections.length; ++i) {
modems.push(new Modem(i));
}
return modems;
}
let Modems = modemHelperGenerator();
let Modem = Modems[0];
/**
* Telephony related helper functions.
*/
@ -276,70 +391,6 @@ var emulator = (function() {
});
}
/**
* @param aVoiceType
* The voice type of a mobileConnection, which can be obtained from
* |<mobileConnection>.voice.type|.
* @return A string with format of the emulator voice tech.
*/
function voiceTypeToTech(aVoiceType) {
switch(aVoiceType) {
case "gsm":
case "gprs":
case "edge":
return "gsm";
case "umts":
case "hsdpa":
case "hsupa":
case "hspa":
case "hspa+":
return "wcdma";
case "is95a":
case "is95b":
case "1xrtt":
return "cdma";
case "evdo0":
case "evdoa":
case "evdob":
return "evdo";
case "ehrpd":
case "lte":
return "lte";
default:
return null;
}
}
/**
* @return Promise
*/
function changeModemTech(aTech, aPreferredMask) {
let mobileConn = navigator.mozMobileConnections[0];
function isTechMatched() {
return aTech === voiceTypeToTech(mobileConn.voice.type);
}
let promise1 = isTechMatched() ? Promise.resolve()
: waitForEvent(mobileConn,
"voicechange",
isTechMatched);
let promise2 = Promise.resolve()
.then(() => emulator.runCmd("modem tech " + aTech + " " + aPreferredMask))
.then(() => emulator.runCmd("modem tech"))
.then(result => is(result[0],
aTech + " " + aPreferredMask,
"Check modem 'tech/preferred mask'"));
return Promise.all([promise1, promise2]);
}
/**
* @return Promise
*/
@ -361,7 +412,7 @@ var emulator = (function() {
return Promise.all(hangUpPromises)
.then(() => {
return emulator.runCmd("gsm clear").then(waitForNoCall);
return emulator.runCmd("telephony clear").then(waitForNoCall);
})
.then(waitForNoCall);
}
@ -423,6 +474,11 @@ var emulator = (function() {
checkState(null, [], "", []);
}
/****************************************************************************
**** Check Functions ****
****************************************************************************/
/**
* Convenient helper to compare two call lists (order is not important).
*/
@ -478,7 +534,7 @@ var emulator = (function() {
* @return Promise
*/
function checkEmulatorCallList(expectedCallList) {
return emulator.runCmd("gsm list").then(result => {
return emulator.runCmd("telephony list").then(result => {
log("Call list is now: " + result);
for (let i = 0; i < expectedCallList.length; ++i) {
is(result[i], expectedCallList[i], "emulator calllist");
@ -532,8 +588,168 @@ var emulator = (function() {
}
/**
* Request utility functions.
* The factory function for creating an expected call.
*
* @param aReference
* The reference of the telephonyCall object.
* @param aNumber
* The call number.
* @param aConference
* Shows whether the call belongs to the conference.
* @param aDirection
* The direction of the call, "in" for inbound, and "out" for outbound.
* @param aState
* The expected state of the call.
* @param aEmulatorState
* The state logged in emulator now, may be different from aState.
* @param aDisconnectedReason
* The disconnected reason if the call becomed disconnected.
*/
function createExptectedCall(aReference, aNumber, aConference, aDirection,
aState, aEmulatorState, aDisconnectedReason) {
return {
reference: aReference,
number: aNumber,
conference: aConference,
direction: aDirection,
state: aState,
emulatorState: aEmulatorState,
disconnectedReason: aDisconnectedReason
};
}
/**
* Check telephony.active
*
* @param aExpectedCalls
* An array of expected calls.
* @param aExpectedCallsInConference
* An array of expected calls in the conference.
*/
function checkActive(aExpectedCalls, aExpectedCallsInConference) {
// Get the active call
let calls = aExpectedCalls && aExpectedCalls.filter(aExpectedCall => {
return aExpectedCall.state === "connected" ||
aExpectedCall.state === "alerting" ||
aExpectedCall.state === "dialing";
});
ok(calls.length < 2, "Too many actives call in telephony.calls");
let activeCall = calls.length ? calls[0].reference : null;
// Get the active conference
let callsInConference = aExpectedCallsInConference || [];
let activeConference = callsInConference.length &&
callsInConference[0].state === "connected"
? navigator.mozTelephony.conferenceGroup
: null;
// Check telephony.active
ok(!(activeCall && activeConference),
"An active call cannot coexist with an active conference call.");
is(telephony.active, activeCall || activeConference, "check Active");
}
/**
* Check whether the data in telephony and emulator meets our expectation.
*
* NOTE: Conference call is not supported in this function yet, so related
* checks are skipped.
*
* Fulfill params:
* {
* reference, -- the reference of the call object instance.
* number, -- the call number.
* conference, -- shows whether it belongs to the conference.
* direction, -- "in" for inbound, and "out" for outbound.
* state, -- the call state.
* emulatorState, -- the call state logged in emulator now.
* disconnectedReason, -- the disconnected reason of a disconnected call.
* }
*
* @param aExpectedCalls
* An array of call records.
* @return Promise
*/
function equals(aExpectedCalls) {
// Classify calls
let callsInTelephony = [];
let CallsInConference = [];
aExpectedCalls.forEach(function(aCall) {
if (aCall.state === "disconnected") {
is(aCall.disconnectedReason,
aCall.reference.disconnectedReason,
"Check disconnectedReason");
return;
}
if (aCall.conference) {
CallsInConference.push(aCall);
return;
}
callsInTelephony.push(aCall);
ok(!aCall.secondId, "For a telephony call, the secondId must be null");
});
// Check the active connection
checkActive(callsInTelephony, CallsInConference);
// Check telephony.calls
is(telephony.calls.length,
callsInTelephony.length,
"Check telephony.calls.length");
callsInTelephony.forEach(aExpectedCall => {
let number = aExpectedCall.number;
let call = telephony.calls.find(aCall => aCall.id.number === number);
if (!call) {
ok(false, "telephony.calls lost the call(number: " + number + ")");
return;
}
is(call, aExpectedCall.reference,
"Check the object reference of number:" + number);
is(call.state, aExpectedCall.state,
"Check call.state of number:" + number);
});
// Check conference.calls
// NOTE: This function doesn't support conference call now, so the length of
// |CallsInConference| should be 0, and the conference state shoul be "".
is(conference.state, "", "Conference call is not supported yet.");
is(CallsInConference.length, 0, "Conference call is not supported yet.");
// Check the emulator call list
// NOTE: Conference is not supported yet, so |CallsInConference| is ignored.
let strings = callsInTelephony.map(aCall => {
// The emulator doesn't have records for disconnected calls.
if (aCall.emulatorState === "disconnected") {
return null;
}
let state = {
alerting: "ringing",
connected: "active",
held: "held",
incoming: "incoming"
}[aCall.state];
state = aCall.emulatorState || state;
let prefix = (aCall.direction === "in") ? "inbound from "
: "outbound to ";
return state ? (prefix + aCall.number + " : " + state) : null;
});
return checkEmulatorCallList(strings.filter(aString => aString));
}
/****************************************************************************
**** Request utility functions ****
****************************************************************************/
/**
* Make an outgoing call.
@ -558,7 +774,13 @@ var emulator = (function() {
is(outCall.state, "dialing");
is(outCall.serviceId, serviceId);
})
.then(() => waitForNamedStateEvent(outCall, "alerting"));
.then(() => {
// A CDMA call goes to connected state directly when the operator find
// its callee, which makes the "connected" state in CDMA calls behaves
// like the "alerting" state in GSM calls.
let state = Modems[serviceId].isGSM() ? "alerting" : "connected";
return waitForNamedStateEvent(outCall, state);
});
}
/**
@ -581,7 +803,13 @@ var emulator = (function() {
is(outCall.id.number, number);
is(outCall.state, "dialing");
})
.then(() => waitForNamedStateEvent(outCall, "alerting"))
.then(() => {
// Similar to function |dial|, a CDMA call directly goes to connected
// state when the operator find its callee.
let state = Modems[outCall.serviceId].isGSM() ? "alerting"
: "connected";
return waitForNamedStateEvent(outCall, state);
})
.then(() => {
is(outCall.emergency, true, "check emergency");
return outCall;
@ -651,19 +879,23 @@ var emulator = (function() {
/**
* Hold a call.
*
* @param call
* @param aCall
* A TelephonyCall object.
* @param aWaitForEvent
* Decide whether to wait for the state event.
* @return Promise<TelephonyCall>
*/
function hold(call) {
function hold(aCall, aWaitForEvent = true) {
log("Putting the call on hold.");
let promises = [];
promises.push(waitForNamedStateEvent(call, "held"));
promises.push(call.hold());
if (aWaitForEvent) {
promises.push(waitForNamedStateEvent(aCall, "held"));
}
promises.push(aCall.hold());
return Promise.all(promises).then(() => call);
return Promise.all(promises).then(() => aCall);
}
/**
@ -673,7 +905,7 @@ var emulator = (function() {
* A TelephonyCall object.
* @return Promise<TelephonyCall>
*/
function resume(call) {
function resume(call, aWaitForEvent = true) {
log("Resuming the held call.");
let promises = [];
@ -721,8 +953,10 @@ var emulator = (function() {
numberPresentation = numberPresentation || "";
name = name || "";
namePresentation = namePresentation || "";
emulator.runCmd("gsm call " + number + "," + numberPresentation + "," + name +
"," + namePresentation);
emulator.runCmd("telephony call " + number +
"," + numberPresentation +
"," + name +
"," + namePresentation);
return waitForEvent(telephony, "incoming")
.then(event => {
@ -747,9 +981,14 @@ var emulator = (function() {
function remoteAnswer(call) {
log("Remote answering the call: " + call.id.number);
emulator.runCmd("gsm accept " + call.id.number);
emulator.runCmd("telephony accept " + call.id.number);
return waitForNamedStateEvent(call, "connected");
// A CDMA call goes to connected state directly when the operator find its
// callee, which makes the "connected" state in CDMA calls behaves like the
// "alerting" state in GSM calls, so we don't have to wait for the call to
// change to "connected" state here for CDMA calls.
return Modem.isCDMA() ? Promise.resolve()
: waitForNamedStateEvent(call, "connected");
}
/**
@ -762,7 +1001,7 @@ var emulator = (function() {
function remoteHangUp(call) {
log("Remote hanging up the call: " + call.id.number);
emulator.runCmd("gsm cancel " + call.id.number);
emulator.runCmd("telephony cancel " + call.id.number);
return waitForNamedStateEvent(call, "disconnected");
}
@ -1216,7 +1455,6 @@ var emulator = (function() {
this.gWaitForNamedStateEvent = waitForNamedStateEvent;
this.gWaitForStateChangeEvent = waitForStateChangeEvent;
this.gCheckInitialState = checkInitialState;
this.gChangeModemTech = changeModemTech;
this.gClearCalls = clearCalls;
this.gOutCallStrPool = outCallStrPool;
this.gInCallStrPool = inCallStrPool;
@ -1244,6 +1482,25 @@ var emulator = (function() {
this.gSetupConference = setupConference;
this.gSetRadioEnabled = setRadioEnabled;
this.gSetRadioEnabledAll = setRadioEnabledAll;
// Telephony helper
this.TelephonyHelper = {
dial: dial,
answer: answer,
hangUp: hangUp,
hold: hold,
resume: resume,
equals: equals,
createExptectedCall: createExptectedCall
};
// Remote Utils, TODO: This should be an array for multi-SIM scenarios
this.Remotes = [{
dial: remoteDial,
answer: remoteAnswer,
hangUp: remoteHangUp
}];
this.Remote = this.Remotes[0];
}());
function _startTest(permissions, test) {

View File

@ -24,6 +24,8 @@ qemu = true
[test_dtmf.js]
[test_emergency.js]
[test_emergency_label.js]
[test_gsm_cdma_incoming_basic_operations.js]
[test_gsm_cdma_outgoing_basic_operations.js]
[test_incall_mmi_call_hold.js]
[test_incall_mmi_call_waiting.js]
[test_incall_mmi_conference.js]
@ -31,7 +33,6 @@ qemu = true
[test_incoming_already_connected.js]
[test_incoming_already_held.js]
[test_incoming_answer_hangup_oncallschanged.js]
[test_incoming_basic_operations.js]
[test_incoming_onstatechange.js]
[test_mmi_call_barring.js]
[test_mmi_call_forwarding.js]
@ -52,7 +53,6 @@ qemu = true
[test_outgoing_answer_radio_off.js]
[test_outgoing_auto_hold.js]
[test_outgoing_badNumber.js]
[test_outgoing_basic_operations.js]
[test_outgoing_busy.js]
[test_outgoing_from_stk.js]
[test_outgoing_onstatechange.js]
@ -64,3 +64,4 @@ qemu = true
[test_system_message_telephony_call_ended.js]
[test_TelephonyUtils.js]
[test_temporary_clir.js]

View File

@ -78,7 +78,7 @@ function test_oneCall() {
let p = waitForStateChanged(aAllInfo => {
return aAllInfo[0].callState === Ci.nsITelephonyService.CALL_STATE_CONNECTED;
});
emulator.runCmd("gsm accept " + number);
emulator.runCmd("telephony accept " + number);
return p;
})
.then(() => {
@ -87,7 +87,7 @@ function test_oneCall() {
})
.then(() => {
let p = TelephonyUtils.waitForNoCalls();
emulator.runCmd("gsm cancel " + number);
emulator.runCmd("telephony cancel " + number);
return p;
});
}

View File

@ -24,7 +24,7 @@ startTest(function() {
// Disable the Hold function of the emulator, then hold the active call,
// where the hold request will fail and the call will remain active.
.then(() => emulator.runCmd("gsm disable hold"))
.then(() => emulator.runCmd("telephony disable hold"))
.then(() => gHold(inCall))
.then(() => ok(false, "This hold request should be rejected."),
() => log("This hold request is rejected as expected."))
@ -33,7 +33,7 @@ startTest(function() {
// Enable the Hold function of the emulator, then hold the active call,
// where the hold request should succeed and the call should become held.
.then(() => emulator.runCmd("gsm enable hold"))
.then(() => emulator.runCmd("telephony enable hold"))
.then(() => gHold(inCall))
.then(() => log("This hold request is resolved as expected."),
() => ok(false, "This hold request should be resolved."))
@ -47,6 +47,6 @@ startTest(function() {
// Clean Up
.catch(error => ok(false, "Promise reject: " + error))
.then(() => emulator.runCmd("gsm enable hold"))
.then(() => emulator.runCmd("telephony enable hold"))
.then(finish);
});

View File

@ -0,0 +1,170 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 90000;
MARIONETTE_HEAD_JS = 'head.js';
/******************************************************************************
**** Basic Operations ****
******************************************************************************/
const IncomingNumber = "1111110000";
function exptectedCall(aCall, aState, aEmulatorState = null) {
let disconnectedReason = aState === "disconnected" ? "NormalCallClearing"
: null;
return TelephonyHelper.createExptectedCall(aCall, IncomingNumber, false,
"in", aState, aEmulatorState,
disconnectedReason);
}
function incoming(aNumber) {
let ret;
return Remote.dial(aNumber)
.then(call => ret = call)
.then(() => TelephonyHelper.equals([exptectedCall(ret, "incoming")]))
.then(() => ret);
}
function answer(aCall) {
let call = exptectedCall(aCall, "connected");
return TelephonyHelper.answer(aCall)
.then(() => TelephonyHelper.equals([call]))
.then(() => aCall);
}
function hold(aCall) {
// Since a CDMA call doesn't have any notification for its state changing to
// "held" state, a telephonyCall is still remains in "connected" state when
// the call actually goes to "held" state, and we shouldn't wait for the state
// change event here.
let state = Modem.isGSM() ? "held" : "connected";
let call = exptectedCall(aCall, state,"held");
return TelephonyHelper.hold(aCall, Modem.isGSM())
.then(() => TelephonyHelper.equals([call]))
.then(() => aCall);
}
function resume(aCall) {
// Similar to the hold case, there is no notification for a CDMA call's state
// change. Besides, a CDMA call still remains in "connected" state here, so we
// have to use |hold()| function here to resume the call. Otherwise, if we use
// |resume()| function, we'll get an invalid state error.
let call = exptectedCall(aCall, "connected");
return Modem.isGSM() ? TelephonyHelper.resume(aCall)
: TelephonyHelper.hold(aCall, false)
.then(() => TelephonyHelper.equals([call]))
.then(() => aCall);
}
function hangUp(aCall) {
let call = exptectedCall(aCall, "disconnected");
return TelephonyHelper.hangUp(aCall)
.then(() => TelephonyHelper.equals([call]))
.then(() => aCall);
}
function remoteHangUp(aCall) {
let call = exptectedCall(aCall, "disconnected");
return Remote.hangUp(aCall)
.then(() => TelephonyHelper.equals([call]))
.then(() => aCall);
}
/******************************************************************************
**** Testcases ****
******************************************************************************/
function testIncomingReject() {
log("= testIncomingReject =");
return incoming(IncomingNumber)
.then(call => hangUp(call));
}
function testIncomingCancel() {
log("= testIncomingCancel =");
return incoming(IncomingNumber)
.then(call => remoteHangUp(call));
}
function testIncomingAnswerHangUp() {
log("= testIncomingAnswerHangUp =");
return incoming(IncomingNumber)
.then(call => answer(call))
.then(call => hangUp(call));
}
function testIncomingAnswerRemoteHangUp() {
log("= testIncomingAnswerRemoteHangUp =");
return incoming(IncomingNumber)
.then(call => answer(call))
.then(call => remoteHangUp(call));
}
function testIncomingAnswerHoldHangUp() {
log("= testIncomingAnswerHoldHangUp =");
return incoming(IncomingNumber)
.then(call => answer(call))
.then(call => hold(call))
.then(call => hangUp(call));
}
function testIncomingAnswerHoldRemoteHangUp() {
log("= testIncomingAnswerHoldRemoteHangUp =");
return incoming(IncomingNumber)
.then(call => answer(call))
.then(call => hold(call))
.then(call => remoteHangUp(call));
}
function testIncomingAnswerHoldResumeHangUp() {
log("= testIncomingAnswerHoldResumeHangUp =");
return incoming(IncomingNumber)
.then(call => answer(call))
.then(call => hold(call))
.then(call => resume(call))
.then(call => hangUp(call));
}
function testIncomingAnswerHoldResumeRemoteHangUp() {
log("= testIncomingAnswerHoldResumeRemoteHangUp =");
return incoming(IncomingNumber)
.then(call => answer(call))
.then(call => hold(call))
.then(call => resume(call))
.then(call => remoteHangUp(call));
}
/******************************************************************************
**** Test Launcher ****
******************************************************************************/
function runTestSuite(aTech, aTechMask) {
return Promise.resolve()
// Setup Environment
.then(() => Modem.changeTech(aTech, aTechMask))
// Tests
.then(() => testIncomingReject())
.then(() => testIncomingCancel())
.then(() => testIncomingAnswerHangUp())
.then(() => testIncomingAnswerRemoteHangUp())
.then(() => testIncomingAnswerHoldHangUp())
.then(() => testIncomingAnswerHoldRemoteHangUp())
.then(() => testIncomingAnswerHoldResumeHangUp())
.then(() => testIncomingAnswerHoldResumeRemoteHangUp())
// Restore Environment
.then(() => Modem.changeTech("wcdma"));
}
startTest(function() {
return Promise.resolve()
.then(() => runTestSuite("cdma"))
.then(() => runTestSuite("wcdma"))
.catch(error => ok(false, "Promise reject: " + error))
.then(finish);
});

View File

@ -0,0 +1,174 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 90000;
MARIONETTE_HEAD_JS = 'head.js';
/******************************************************************************
**** Basic Operations ****
******************************************************************************/
const OutgoingNumber = "5555551111";
function exptectedCall(aCall, aState, aEmulatorState = null) {
let disconnectedReason = aState === "disconnected" ? "NormalCallClearing"
: null;
return TelephonyHelper.createExptectedCall(aCall, OutgoingNumber, false,
"out", aState, aEmulatorState,
disconnectedReason);
}
function outgoing(aNumber) {
let ret;
// Since a CDMA call doesn't have "alerting" state, it directly goes to
// "connected" state instead.
let state = Modem.isCDMA() ? "connected" : "alerting";
return TelephonyHelper.dial(aNumber)
.then(call => ret = call)
.then(() => TelephonyHelper.equals([exptectedCall(ret, state)]))
.then(() => ret);
}
function remoteAnswer(aCall) {
let call = exptectedCall(aCall, "connected");
return Remote.answer(aCall)
.then(() => TelephonyHelper.equals([call]))
.then(() => aCall);
}
function hold(aCall) {
// Since a CDMA call doesn't have any notification for its state changing to
// "held" state, a telephonyCall is still remains in "connected" state when
// the call actually goes to "held" state, and we shouldn't wait for the state
// change event here.
let state = Modem.isGSM() ? "held" : "connected";
let call = exptectedCall(aCall, state, "held");
return TelephonyHelper.hold(aCall, Modem.isGSM())
.then(() => TelephonyHelper.equals([call]))
.then(() => aCall);
}
function resume(aCall) {
// Similar to the hold case, there is no notification for a CDMA call's state
// change. Besides, a CDMA call still remains in "connected" state here, so we
// have to use |hold()| function here to resume the call. Otherwise, if we use
// |resume()| function, we'll get an invalid state error.
let call = exptectedCall(aCall, "connected");
return Modem.isGSM() ? TelephonyHelper.resume(aCall)
: TelephonyHelper.hold(aCall, false)
.then(() => TelephonyHelper.equals([call]))
.then(() => aCall);
}
function hangUp(aCall) {
let call = exptectedCall(aCall, "disconnected");
return TelephonyHelper.hangUp(aCall)
.then(() => TelephonyHelper.equals([call]))
.then(() => aCall);
}
function remoteHangUp(aCall) {
let call = exptectedCall(aCall, "disconnected");
return Remote.hangUp(aCall)
.then(() => TelephonyHelper.equals([call]))
.then(() => aCall);
}
/******************************************************************************
**** Testcases ****
******************************************************************************/
function testOutgoingReject() {
log("= testOutgoingReject =");
return outgoing(OutgoingNumber)
.then(call => remoteHangUp(call));
}
function testOutgoingCancel() {
log("= testOutgoingCancel =");
return outgoing(OutgoingNumber)
.then(call => hangUp(call));
}
function testOutgoingAnswerHangUp() {
log("= testOutgoingAnswerHangUp =");
return outgoing(OutgoingNumber)
.then(call => remoteAnswer(call))
.then(call => hangUp(call));
}
function testOutgoingAnswerRemoteHangUp() {
log("= testOutgoingAnswerRemoteHangUp =");
return outgoing(OutgoingNumber)
.then(call => remoteAnswer(call))
.then(call => remoteHangUp(call));
}
function testOutgoingAnswerHoldHangUp() {
log("= testOutgoingAnswerHoldHangUp =");
return outgoing(OutgoingNumber)
.then(call => remoteAnswer(call))
.then(call => hold(call))
.then(call => hangUp(call));
}
function testOutgoingAnswerHoldRemoteHangUp() {
log("= testOutgoingAnswerHoldRemoteHangUp =");
return outgoing(OutgoingNumber)
.then(call => remoteAnswer(call))
.then(call => hold(call))
.then(call => remoteHangUp(call));
}
function testOutgoingAnswerHoldResumeHangUp() {
log("= testOutgoingAnswerHoldResumeHangUp =");
return outgoing(OutgoingNumber)
.then(call => remoteAnswer(call))
.then(call => hold(call))
.then(call => resume(call))
.then(call => hangUp(call));
}
function testOutgoingAnswerHoldResumeRemoteHangUp() {
log("= testOutgoingAnswerHoldResumeRemoteHangUp =");
return outgoing(OutgoingNumber)
.then(call => remoteAnswer(call))
.then(call => hold(call))
.then(call => resume(call))
.then(call => remoteHangUp(call));
}
/******************************************************************************/
/*** Test Launcher ***/
/******************************************************************************/
function runTestSuite(aTech, aTechMask) {
return Promise.resolve()
// Setup Environment
.then(() => Modem.changeTech(aTech, aTechMask))
// Tests
.then(() => testOutgoingReject())
.then(() => testOutgoingCancel())
.then(() => testOutgoingAnswerHangUp())
.then(() => testOutgoingAnswerRemoteHangUp())
.then(() => testOutgoingAnswerHoldHangUp())
.then(() => testOutgoingAnswerHoldRemoteHangUp())
.then(() => testOutgoingAnswerHoldResumeHangUp())
.then(() => testOutgoingAnswerHoldResumeRemoteHangUp())
// Restore Environment
.then(() => Modem.changeTech("wcdma"));
}
startTest(function() {
return Promise.resolve()
.then(() => runTestSuite("cdma"))
.then(() => runTestSuite("wcdma"))
.catch(error => ok(false, "Promise reject: " + error))
.then(finish);
});

View File

@ -1,123 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 90000;
MARIONETTE_HEAD_JS = 'head.js';
const inNumber = "5555552222";
const inInfo = gInCallStrPool(inNumber);
var inCall;
function incoming() {
return gRemoteDial(inNumber)
.then(call => inCall = call)
.then(() => gCheckAll(null, [inCall], "", [], [inInfo.incoming]))
.then(() => is(inCall.disconnectedReason, null));
}
function answer() {
return gAnswer(inCall)
.then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]))
.then(() => is(inCall.disconnectedReason, null));
}
function hold() {
return gHold(inCall)
.then(() => gCheckAll(null, [inCall], "", [], [inInfo.held]))
.then(() => is(inCall.disconnectedReason, null));
}
function resume() {
return gResume(inCall)
.then(() => gCheckAll(inCall, [inCall], "", [], [inInfo.active]))
.then(() => is(inCall.disconnectedReason, null));
}
function hangUp() {
return gHangUp(inCall)
.then(() => gCheckAll(null, [], "", [], []))
.then(() => is(inCall.disconnectedReason, "NormalCallClearing"));
}
function remoteHangUp() {
return gRemoteHangUp(inCall)
.then(() => gCheckAll(null, [], "", [], []))
.then(() => is(inCall.disconnectedReason, "NormalCallClearing"));
}
// Test cases.
function testIncomingReject() {
log("= testIncomingReject =");
return incoming()
.then(() => hangUp());
}
function testIncomingCancel() {
log("= testIncomingCancel =");
return incoming()
.then(() => remoteHangUp());
}
function testIncomingAnswerHangUp() {
log("= testIncomingAnswerHangUp =");
return incoming()
.then(() => answer())
.then(() => hangUp());
}
function testIncomingAnswerRemoteHangUp() {
log("= testIncomingAnswerRemoteHangUp =");
return incoming()
.then(() => answer())
.then(() => remoteHangUp());
}
function testIncomingAnswerHoldHangUp() {
log("= testIncomingAnswerHoldHangUp =");
return incoming()
.then(() => answer())
.then(() => hold())
.then(() => hangUp());
}
function testIncomingAnswerHoldRemoteHangUp() {
log("= testIncomingAnswerHoldRemoteHangUp =");
return incoming()
.then(() => answer())
.then(() => hold())
.then(() => remoteHangUp());
}
function testIncomingAnswerHoldResumeHangUp() {
log("= testIncomingAnswerHoldResumeHangUp =");
return incoming()
.then(() => answer())
.then(() => hold())
.then(() => resume())
.then(() => hangUp());
}
function testIncomingAnswerHoldResumeRemoteHangUp() {
log("= testIncomingAnswerHoldResumeRemoteHangUp =");
return incoming()
.then(() => answer())
.then(() => hold())
.then(() => resume())
.then(() => remoteHangUp());
}
startTest(function() {
Promise.resolve()
.then(() => testIncomingReject())
.then(() => testIncomingCancel())
.then(() => testIncomingAnswerHangUp())
.then(() => testIncomingAnswerRemoteHangUp())
.then(() => testIncomingAnswerHoldHangUp())
.then(() => testIncomingAnswerHoldRemoteHangUp())
.then(() => testIncomingAnswerHoldResumeHangUp())
.then(() => testIncomingAnswerHoldResumeRemoteHangUp())
.catch(error => ok(false, "Promise reject: " + error))
.then(finish);
});

View File

@ -39,7 +39,7 @@ var settings = [
startTest(function() {
let promise = settings.reduce((aPromise, aSetting) => {
return aPromise.then(() => gChangeModemTech(aSetting.tech, aSetting.mask));
return aPromise.then(() => Modem.changeTech(aSetting.tech, aSetting.mask));
}, Promise.resolve());
return promise
@ -47,7 +47,7 @@ startTest(function() {
.catch(error => ok(false, "Promise reject: " + error))
// Switch to the default modem tech
.then(() => gChangeModemTech("wcdma", "gsm/wcdma"))
.then(() => Modem.changeTech("wcdma", "gsm/wcdma"))
.catch(error => ok(false, "Fetal Error: Promise reject: " + error))
.then(finish);

View File

@ -37,7 +37,7 @@ function testAutoHoldCallFailed() {
const callNumber2 = "0900000012";
return Promise.resolve()
.then(() => emulator.runCmd("gsm disable hold"))
.then(() => emulator.runCmd("telephony disable hold"))
.then(() => gDial(callNumber1))
.then(call => { outCall1 = call; })
.then(() => gRemoteAnswer(outCall1))
@ -51,7 +51,7 @@ function testAutoHoldCallFailed() {
return gRemoteHangUpCalls([outCall2]);
}, () => log("The second |dial()| is rejected as expected."))
.then(() => gRemoteHangUpCalls([outCall1]))
.then(() => emulator.runCmd("gsm enable hold"));
.then(() => emulator.runCmd("telephony enable hold"));
}
function testAutoHoldConferenceCall() {
@ -87,7 +87,7 @@ startTest(function() {
.then(() => testAutoHoldConferenceCall())
.catch(error => {
ok(false, "Promise reject: " + error);
emulator.runCmd("gsm enable hold");
emulator.runCmd("telephony enable hold");
})
.then(finish);
});

View File

@ -1,123 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 90000;
MARIONETTE_HEAD_JS = 'head.js';
const outNumber = "5555551111";
const outInfo = gOutCallStrPool(outNumber);
var outCall;
function outgoing() {
return gDial(outNumber)
.then(call => outCall = call)
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.ringing]))
.then(() => is(outCall.disconnectedReason, null));
}
function answer() {
return gRemoteAnswer(outCall)
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
.then(() => is(outCall.disconnectedReason, null));
}
function hangUp() {
return gHangUp(outCall)
.then(() => gCheckAll(null, [], "", [], []))
.then(() => is(outCall.disconnectedReason, "NormalCallClearing"));
}
function remoteHangUp() {
return gRemoteHangUp(outCall)
.then(() => gCheckAll(null, [], "", [], []))
.then(() => is(outCall.disconnectedReason, "NormalCallClearing"));
}
function hold() {
return gHold(outCall)
.then(() => gCheckAll(null, [outCall], "", [], [outInfo.held]))
.then(() => is(outCall.disconnectedReason, null));
}
function resume() {
return gResume(outCall)
.then(() => gCheckAll(outCall, [outCall], "", [], [outInfo.active]))
.then(() => is(outCall.disconnectedReason, null));
}
// Test cases.
function testOutgoingReject() {
log("= testOutgoingReject =");
return outgoing()
.then(() => remoteHangUp());
}
function testOutgoingCancel() {
log("= testOutgoingCancel =");
return outgoing()
.then(() => hangUp());
}
function testOutgoingAnswerHangUp() {
log("= testOutgoingAnswerHangUp =");
return outgoing()
.then(() => answer())
.then(() => hangUp());
}
function testOutgoingAnswerRemoteHangUp() {
log("= testOutgoingAnswerRemoteHangUp =");
return outgoing()
.then(() => answer())
.then(() => remoteHangUp());
}
function testOutgoingAnswerHoldHangUp() {
log("= testOutgoingAnswerHoldHangUp =");
return outgoing()
.then(() => answer())
.then(() => hold())
.then(() => hangUp());
}
function testOutgoingAnswerHoldRemoteHangUp() {
log("= testOutgoingAnswerHoldRemoteHangUp =");
return outgoing()
.then(() => answer())
.then(() => hold())
.then(() => remoteHangUp());
}
function testOutgoingAnswerHoldResumeHangUp() {
log("= testOutgoingAnswerHoldResumeHangUp =");
return outgoing()
.then(() => answer())
.then(() => hold())
.then(() => resume())
.then(() => hangUp());
}
function testOutgoingAnswerHoldResumeRemoteHangUp() {
log("= testOutgoingAnswerHoldResumeRemoteHangUp =");
return outgoing()
.then(() => answer())
.then(() => hold())
.then(() => resume())
.then(() => remoteHangUp());
}
startTest(function() {
Promise.resolve()
.then(() => testOutgoingReject())
.then(() => testOutgoingCancel())
.then(() => testOutgoingAnswerHangUp())
.then(() => testOutgoingAnswerRemoteHangUp())
.then(() => testOutgoingAnswerHoldHangUp())
.then(() => testOutgoingAnswerHoldRemoteHangUp())
.then(() => testOutgoingAnswerHoldResumeHangUp())
.then(() => testOutgoingAnswerHoldResumeRemoteHangUp())
.catch(error => ok(false, "Promise reject: " + error))
.then(finish);
});

View File

@ -19,7 +19,7 @@ startTest(function() {
is(event.call.error.name, "BusyError");
is(event.call.disconnectedReason, "Busy");
});
let p2 = emulator.runCmd("gsm busy " + outNumber);
let p2 = emulator.runCmd("telephony busy " + outNumber);
return Promise.all([p1, p2]);
})
.then(() => gCheckAll(null, [], "", [], []))

View File

@ -1023,6 +1023,41 @@ public:
WarnAboutTrailingData();
return NS_OK;
}
template<typename T1, typename T2, typename T3, typename T4,
typename T5, typename T6>
nsresult operator () (T1& aArg1, T2& aArg2, T3& aArg3, T4& aArg4,
T5& aArg5, T6& aArg6) const
{
DaemonSocketPDU& pdu = GetPDU();
nsresult rv = UnpackPDU(pdu, aArg1);
if (NS_FAILED(rv)) {
return rv;
}
rv = UnpackPDU(pdu, aArg2);
if (NS_FAILED(rv)) {
return rv;
}
rv = UnpackPDU(pdu, aArg3);
if (NS_FAILED(rv)) {
return rv;
}
rv = UnpackPDU(pdu, aArg4);
if (NS_FAILED(rv)) {
return rv;
}
rv = UnpackPDU(pdu, aArg5);
if (NS_FAILED(rv)) {
return rv;
}
rv = UnpackPDU(pdu, aArg6);
if (NS_FAILED(rv)) {
return rv;
}
WarnAboutTrailingData();
return NS_OK;
}
};
} // namespace DaemonSocketPDUHelpers