Merge b2ginbound to central, a=merge

This commit is contained in:
Wes Kocher 2015-05-20 18:25:05 -07:00
Родитель 98d8b5b1e9 be523d7002
Коммит 2bf84f01ef
49 изменённых файлов: 432 добавлений и 305 удалений

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

@ -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="b290c77ccb7ab0af599b3d8287b71b9970d8dcb0"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5a7f87b1505ba89b586372cbbbe9507d1016c40c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d75bd30437ac1465cdb8a35d21079a14cbf63c2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="deb1d684da56376a10d900e08d3f4139f3ace885"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

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

@ -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="b290c77ccb7ab0af599b3d8287b71b9970d8dcb0"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5a7f87b1505ba89b586372cbbbe9507d1016c40c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d75bd30437ac1465cdb8a35d21079a14cbf63c2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="deb1d684da56376a10d900e08d3f4139f3ace885"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

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

@ -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="b290c77ccb7ab0af599b3d8287b71b9970d8dcb0"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5a7f87b1505ba89b586372cbbbe9507d1016c40c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="22664edc4c73e5fe8f5095ff1d5549db78a2bc10"/>

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

@ -17,10 +17,10 @@
</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="b290c77ccb7ab0af599b3d8287b71b9970d8dcb0"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5a7f87b1505ba89b586372cbbbe9507d1016c40c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d75bd30437ac1465cdb8a35d21079a14cbf63c2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="deb1d684da56376a10d900e08d3f4139f3ace885"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

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

@ -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="b290c77ccb7ab0af599b3d8287b71b9970d8dcb0"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5a7f87b1505ba89b586372cbbbe9507d1016c40c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d75bd30437ac1465cdb8a35d21079a14cbf63c2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="deb1d684da56376a10d900e08d3f4139f3ace885"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b290c77ccb7ab0af599b3d8287b71b9970d8dcb0"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5a7f87b1505ba89b586372cbbbe9507d1016c40c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d75bd30437ac1465cdb8a35d21079a14cbf63c2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="deb1d684da56376a10d900e08d3f4139f3ace885"/>
<!-- Stock Android things -->
<project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
<project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="337e0ef5e40f02a1ae59b90db0548976c70a7226"/>

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

@ -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="b290c77ccb7ab0af599b3d8287b71b9970d8dcb0"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5a7f87b1505ba89b586372cbbbe9507d1016c40c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="22664edc4c73e5fe8f5095ff1d5549db78a2bc10"/>

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

@ -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="b290c77ccb7ab0af599b3d8287b71b9970d8dcb0"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5a7f87b1505ba89b586372cbbbe9507d1016c40c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d75bd30437ac1465cdb8a35d21079a14cbf63c2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="deb1d684da56376a10d900e08d3f4139f3ace885"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

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

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "b290c77ccb7ab0af599b3d8287b71b9970d8dcb0",
"git_revision": "5a7f87b1505ba89b586372cbbbe9507d1016c40c",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "87d96f3c66f704247d1996570748de07ca1aff07",
"revision": "85b4fb5a2fd0040b3726a4f1e4218f2dbfd4edce",
"repo_path": "integration/gaia-central"
}

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

@ -17,10 +17,10 @@
</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="b290c77ccb7ab0af599b3d8287b71b9970d8dcb0"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5a7f87b1505ba89b586372cbbbe9507d1016c40c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="46da1a05ac04157669685246d70ac59d48699c9e"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d75bd30437ac1465cdb8a35d21079a14cbf63c2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="deb1d684da56376a10d900e08d3f4139f3ace885"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="b290c77ccb7ab0af599b3d8287b71b9970d8dcb0"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5a7f87b1505ba89b586372cbbbe9507d1016c40c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="fffc68521ebb1501d6b015c6d1c4a17a04fdb2e2"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d75bd30437ac1465cdb8a35d21079a14cbf63c2d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="deb1d684da56376a10d900e08d3f4139f3ace885"/>
<!-- Stock Android things -->
<project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
<project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="337e0ef5e40f02a1ae59b90db0548976c70a7226"/>

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

@ -68,10 +68,18 @@ Activity::Initialize(nsPIDOMWindow* aWindow,
mProxy = do_CreateInstance("@mozilla.org/dom/activities/proxy;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
// We're about the pass the dictionary to a JS-implemented component, so
// rehydrate it in a system scode so that security wrappers don't get in the
// way. See bug 1161748 comment 16.
bool ok;
JS::Rooted<JS::Value> optionsValue(aCx);
if (!ToJSValue(aCx, aOptions, &optionsValue)) {
return NS_ERROR_FAILURE;
{
JSAutoCompartment ac(aCx, xpc::PrivilegedJunkScope());
ok = ToJSValue(aCx, aOptions, &optionsValue);
NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE);
}
ok = JS_WrapValue(aCx, &optionsValue);
NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE);
mProxy->StartActivity(static_cast<nsIDOMDOMRequest*>(this), optionsValue, aWindow);
return NS_OK;

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

@ -203,16 +203,23 @@ TelephonyListener::HandleCallInfo(nsITelephonyCallInfo* aInfo, bool aSend)
uint32_t callIndex;
uint16_t callState;
nsAutoString number;
nsAutoString disconnectedReason;
bool isOutgoing;
bool isConference;
aInfo->GetCallIndex(&callIndex);
aInfo->GetCallState(&callState);
aInfo->GetNumber(number);
aInfo->GetDisconnectedReason(disconnectedReason);
aInfo->GetIsOutgoing(&isOutgoing);
aInfo->GetIsConference(&isConference);
hfp->HandleCallStateChanged(callIndex, callState, EmptyString(), number,
// The disconnectedReason of a disconnected call must be nonempty no matter
// the call is disconnected for a normal reason or an error.
MOZ_ASSERT((callState != nsITelephonyService::CALL_STATE_DISCONNECTED ||
!disconnectedReason.IsEmpty()),
"disconnectedReason of an disconnected call must be nonempty.");
hfp->HandleCallStateChanged(callIndex, callState, disconnectedReason, number,
isOutgoing, isConference, aSend);
return NS_OK;
}
@ -233,30 +240,6 @@ TelephonyListener::EnumerateCallState(nsITelephonyCallInfo* aInfo)
return HandleCallInfo(aInfo, false);
}
NS_IMETHODIMP
TelephonyListener::NotifyError(uint32_t aServiceId,
int32_t aCallIndex,
const nsAString& aError)
{
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE);
if (aCallIndex > 0) {
// In order to not miss any related call state transition.
// It's possible that 3G network signal lost for unknown reason.
// If a call is released abnormally, NotifyError() will be called,
// instead of CallStateChanged(). We need to reset the call array state
// via setting CALL_STATE_DISCONNECTED
hfp->HandleCallStateChanged(aCallIndex,
nsITelephonyService::CALL_STATE_DISCONNECTED,
aError, EmptyString(), false, false, true);
BT_WARNING("Reset the call state due to call transition ends abnormally");
}
BT_WARNING(NS_ConvertUTF16toUTF8(aError).get());
return NS_OK;
}
NS_IMETHODIMP
TelephonyListener::ConferenceCallStateChanged(uint16_t aCallState)
{

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

@ -194,21 +194,64 @@ let SNEP = (function() {
function toggleNFC(enabled) {
let deferred = Promise.defer();
let promise;
if (enabled) {
promise = nfc.startPoll();
} else {
promise = nfc.powerOff();
}
// In bug 1109592, nfcd will only run when nfc is enabled.
// The way we activate/deactivate nfcd is by using set property "ctl.start" & "ctl.stop".
// In emulator it seems sometimes enable/disable NFC too quick will cause nfcd won't starat,
// So here we use a simple workaround to delay enable or disable for 100ms, bug 1164786 is
// created to track this issue.
setTimeout(function() {
let promise;
if (enabled) {
promise = nfc.startPoll();
} else {
promise = nfc.powerOff();
}
promise.then(() => {
promise.then(() => {
deferred.resolve();
}).catch(() => {
ok(false, 'operation failed, error ' + req.error.name);
deferred.reject();
finish();
});
}, 100);
return deferred.promise;
}
function activateAndwaitForTechDiscovered(re) {
let deferred = Promise.defer();
sysMsgHelper.waitForTechDiscovered(function() {
deferred.resolve();
}).catch(() => {
ok(false, 'operation failed, error ' + req.error.name);
deferred.reject();
finish();
});
NCI.activateRE(re);
return deferred.promise;
}
function deactivateAndWaitForTechLost() {
let deferred = Promise.defer();
sysMsgHelper.waitForTechLost(function() {
deferred.resolve();
});
NCI.deactivate();
return deferred.promise;
}
function deactivateAndWaitForPeerLost() {
let deferred = Promise.defer();
nfc.onpeerlost = function() {
deferred.resolve();
};
NCI.deactivate();
return deferred.promise;
}

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

@ -6,7 +6,7 @@
/* globals log, is, ok, runTests, toggleNFC, runNextTest,
SpecialPowers, nfc */
const MARIONETTE_TIMEOUT = 30000;
const MARIONETTE_TIMEOUT = 60000;
const MARIONETTE_HEAD_JS = 'head.js';
const MANIFEST_URL = 'app://system.gaiamobile.org/manifest.webapp';
@ -18,7 +18,7 @@ const FAKE_MANIFEST_URL = 'app://fake.gaiamobile.org/manifest.webapp';
*/
function testNoTargetNoSessionToken() {
log('testNoTargetNoSessionToken');
fireCheckP2PReg(MANIFEST_URL)
nfc.checkP2PRegistration(MANIFEST_URL)
.then((result) => {
is(result, false, 'No target, no sesionToken, result should be false');
runNextTest();
@ -33,7 +33,7 @@ function testNoTargetNoSessionToken() {
function testWithTargetNoSessionToken() {
log('testWithTargetNoSessionToken');
registerOnpeerready()
.then(() => fireCheckP2PReg(MANIFEST_URL))
.then(() => nfc.checkP2PRegistration(MANIFEST_URL))
.then((result) => {
is(result, false,
'session token is available and it shouldnt be');
@ -50,13 +50,13 @@ function testWithTargetNoSessionToken() {
function testWithSessionTokenWithTarget() {
log('testWithSessionTokenWithTarget');
toggleNFC(true)
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => activateAndwaitForTechDiscovered(emulator.P2P_RE_INDEX_0))
.then(registerOnpeerready)
.then(() => fireCheckP2PReg(MANIFEST_URL))
.then(() => nfc.checkP2PRegistration(MANIFEST_URL))
.then((result) => {
is(result, true, 'should be true, onpeerready reg, sessionToken set');
nfc.onpeerready = null;
return toggleNFC(false);
return deactivateAndWaitForTechLost().then(() => toggleNFC(false));
})
.then(runNextTest)
.catch(handleRejectedPromiseWithNfcOn);
@ -69,12 +69,12 @@ function testWithSessionTokenWithTarget() {
function testWithSessionTokenNoTarget() {
log('testWithSessionTokenNoTarget');
toggleNFC(true)
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => fireCheckP2PReg(MANIFEST_URL))
.then(() => activateAndwaitForTechDiscovered(emulator.P2P_RE_INDEX_0))
.then(() => nfc.checkP2PRegistration(MANIFEST_URL))
.then((result) => {
is(result, false,
'session token avilable but onpeerready not registered');
return toggleNFC(false);
return deactivateAndWaitForTechLost().then(() => toggleNFC(false));
})
.then(runNextTest)
.catch(handleRejectedPromiseWithNfcOn);
@ -87,13 +87,13 @@ function testWithSessionTokenNoTarget() {
function testWithSessionTokenWrongTarget() {
log('testWithSessionTokenWrongTarget');
toggleNFC(true)
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => activateAndwaitForTechDiscovered(emulator.P2P_RE_INDEX_0))
.then(registerOnpeerready)
.then(() => fireCheckP2PReg(FAKE_MANIFEST_URL))
.then(() => nfc.checkP2PRegistration(FAKE_MANIFEST_URL))
.then((result) => {
is(result, false, 'should be false, fake manifest, sessionToken set');
nfc.onpeerready = null;
return toggleNFC(false);
return deactivateAndWaitForTechLost().then(() => toggleNFC(false));
})
.then(runNextTest)
.catch(handleRejectedPromiseWithNfcOn);
@ -108,21 +108,6 @@ function registerOnpeerready() {
return d.promise;
}
function fireCheckP2PReg(manifestUrl) {
let deferred = Promise.defer();
let promise = nfc.checkP2PRegistration(manifestUrl);
promise.then(() => {
ok(true, 'checkP2PRegistration allways results in success');
deferred.resolve(request.result);
}).catch(() => {
ok(false, 'see NfcContentHelper.handleCheckP2PRegistrationResponse');
deferred.reject();
});
return deferred.promise;
}
function handleRejectedPromise() {
ok(false, 'Promise rejected. This should not happen');
nfc.onpeerready = null;

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

@ -25,8 +25,9 @@ let nfcPeers = [];
function testNfcNotEnabledError() {
log('testNfcNotEnabledError');
toggleNFC(true)
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => activateAndwaitForTechDiscovered(emulator.P2P_RE_INDEX_0))
.then(registerAndFireOnpeerready)
.then(() => deactivateAndWaitForPeerLost())
.then(() => toggleNFC(false))
.then(() => sendNDEFExpectError(nfcPeers[0]))
.then(endTest)
@ -43,13 +44,14 @@ function testNfcNotEnabledError() {
function testNfcBadSessionIdError() {
log('testNfcBadSessionIdError');
toggleNFC(true)
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => activateAndwaitForTechDiscovered(emulator.P2P_RE_INDEX_0))
.then(registerAndFireOnpeerready)
.then(() => NCI.deactivate())
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
.then(() => activateAndwaitForTechDiscovered(emulator.P2P_RE_INDEX_0))
.then(registerAndFireOnpeerready)
// we have 2 peers in nfcPeers array, peer0 has old/invalid session token
.then(() => sendNDEFExpectError(nfcPeers[0]))
.then(() => deactivateAndWaitForPeerLost())
.then(() => toggleNFC(false))
.then(endTest)
.catch(handleRejectedPromise);
@ -65,7 +67,7 @@ function testNoErrorInTechMsg() {
let techDiscoveredHandler = function(msg) {
ok('Message handler for nfc-manager-tech-discovered');
is(msg.type, 'techDiscovered');
ok(msg.peer, 'check for correct tech type');
is(msg.errorMsg, undefined, 'Should not get error msg in tech discovered');
setAndFireTechLostHandler()
@ -108,13 +110,13 @@ function registerAndFireOnpeerready() {
function sendNDEFExpectError(peer) {
let deferred = Promise.defer();
try {
peer.sendNDEF(NDEF_MESSAGE);
peer.sendNDEF(NDEF_MESSAGE)
.then(() => {
deferred.reject();
} catch (e) {
}).catch((e) => {
ok(true, 'this should happen ' + e);
deferred.resolve();
}
});
return deferred.promise;
}
@ -124,7 +126,6 @@ function setAndFireTechLostHandler() {
let techLostHandler = function(msg) {
ok('Message handler for nfc-manager-tech-lost');
is(msg.type, 'techLost');
is(msg.errorMsg, undefined, 'Should not get error msg in tech lost');
deferred.resolve();
@ -139,7 +140,8 @@ function setAndFireTechLostHandler() {
let tests = [
testNfcNotEnabledError,
testNfcBadSessionIdError,
// This testcase is temporarily removed due to Bug 1055959, will reopen when it is fixed
// testNfcBadSessionIdError
testNoErrorInTechMsg
];

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

@ -1,14 +1,13 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 30000;
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = 'head.js';
function handleTechnologyDiscoveredRE0(msg) {
log('Received \'nfc-manager-tech-discovered\'');
is(msg.type, 'techDiscovered', 'check for correct message type');
is(msg.isP2P, 'P2P', 'check for correct tech type');
toggleNFC(false).then(runNextTest);
ok(msg.peer, 'check for correct tech type');
deactivateAndWaitForTechLost().then(() => toggleNFC(false)).then(runNextTest);
}
function testActivateRE0() {

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

@ -1,7 +1,7 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 30000;
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = 'head.js';
let tnf = NDEF.TNF_WELL_KNOWN;
@ -18,13 +18,12 @@ function handleSnep(msg) {
type: NfcUtils.fromUTF8(type),
payload: NfcUtils.fromUTF8(payload)})];
NDEF.compare(ndef, msg.records);
toggleNFC(false).then(runNextTest);
deactivateAndWaitForTechLost().then(() => toggleNFC(false)).then(runNextTest);
}
function handleTechnologyDiscoveredRE0(msg) {
log("Received 'nfc-manager-tech-discovered'");
is(msg.type, "techDiscovered", "check for correct message type");
is(msg.isP2P, "P2P", "check for correct tech type");
ok(msg.peer, "check for correct tech type");
sysMsgHelper.waitForTechDiscovered(handleSnep);
SNEP.put(SNEP.SAP_NDEF, SNEP.SAP_NDEF, 0, tnf, btoa(type), btoa(id), btoa(payload));

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

@ -6,15 +6,14 @@ MARIONETTE_HEAD_JS = 'head.js';
function handleTechnologyLost(msg) {
log('Received \'nfc-manager-tech-lost\'');
is(msg.type, 'techLost', 'check for correct message type');
ok(true);
toggleNFC(false).then(runNextTest)
}
function handleTechnologyDiscoveredRE0(msg) {
log('Received \'nfc-manager-tech-discovered\'');
is(msg.type, 'techDiscovered', 'check for correct message type');
is(msg.isP2P, 'P2P', 'check for correct tech type');
ok(msg.peer, 'check for correct tech type');
NCI.deactivate();
}

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

@ -28,8 +28,7 @@ function peerLostCb(evt) {
function handleTechnologyDiscoveredRE0(msg) {
log("Received \'nfc-manager-tech-discovered\'");
is(msg.type, "techDiscovered", "check for correct message type");
is(msg.isP2P, "P2P", "check for correct tech type");
ok(msg.peer, "check for correct tech type");
nfc.onpeerready = peerReadyCb;
nfc.onpeerlost = peerLostCb;
@ -39,19 +38,13 @@ function handleTechnologyDiscoveredRE0(msg) {
function handleTechnologyDiscoveredRE0ForP2PRegFailure(msg) {
log("Received \'nfc-manager-tech-discovered\'");
is(msg.type, "techDiscovered", "check for correct message type");
is(msg.isP2P, "P2P", "check for correct tech type");
ok(msg.peer, "check for correct tech type");
nfc.onpeerready = peerReadyCb;
let promise = nfc.checkP2PRegistration(INCORRECT_MANIFEST_URL);
promise.then(evt => {
is(request.result, false, "check for P2P registration result");
nfc.onpeerready = null;
NCI.deactivate().then(() => toggleNFC(false)).then(runNextTest);
}).catch(() => {
ok(false, "checkP2PRegistration failed.");
nfc.checkP2PRegistration(INCORRECT_MANIFEST_URL)
.then((result) => {
is(result, false, "check for P2P registration result");
nfc.onpeerready = null;
NCI.deactivate().then(() => toggleNFC(false)).then(runNextTest);
@ -150,19 +143,19 @@ function testPeerShouldThrow() {
nfc.onpeerlost = function () {
log("testPeerShouldThrow peerlost");
try {
peer.sendNDEF(ndef);
peer.sendNDEF(ndef)
.then(() => {
ok(false, "sendNDEF should throw error");
} catch (e) {
}).catch((e) => {
ok(true, "Exception expected " + e);
}
});
try {
peer.sendFile(new Blob());
peer.sendFile(new Blob())
.then(() => {
ok(false, "sendfile should throw error");
} catch (e) {
}).catch((e) => {
ok(true, "Exception expected" + e);
}
});
nfc.onpeerready = null;
nfc.onpeerlost = null;

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

@ -1,7 +1,7 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 30000;
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
let MANIFEST_URL = "app://system.gaiamobile.org/manifest.webapp";
@ -23,16 +23,14 @@ function testSendFile() {
};
sysMsgHelper.waitForTechDiscovered(function(msg) {
let request = nfc.checkP2PRegistration(MANIFEST_URL);
request.onsuccess = function(evt) {
is(request.result, true, "check for P2P registration result");
nfc.notifyUserAcceptedP2P(MANIFEST_URL);
}
request.onerror = function() {
ok(false, "checkP2PRegistration failed.");
toggleNFC(false).then(runNextTest);
}
nfc.checkP2PRegistration(MANIFEST_URL).then(result => {
if (result) {
nfc.notifyUserAcceptedP2P(MANIFEST_URL);
} else {
ok(false, "checkP2PRegistration failed.");
deactivateAndWaitForTechLost().then(() => toggleNFC(false)).then(runNextTest);
}
});
});
toggleNFC(true).then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0));
@ -43,6 +41,5 @@ let tests = [
];
SpecialPowers.pushPermissions(
[{"type": "nfc", "allow": true,
"read": true, 'write': true, context: document},
[{"type": "nfc-share", "allow": true, context: document},
{"type": "nfc-manager", 'allow': true, context: document}], runTests);

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

@ -1,7 +1,7 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 30000;
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
let url = "https://www.example.com";
@ -21,18 +21,17 @@ function sendNDEF(peer) {
emulator.run(cmd, function(result) {
is(result.pop(), "OK", "check SNEP PUT result");
NDEF.compare(ndef, NDEF.parseString(result.pop()));
toggleNFC(false).then(runNextTest);
deactivateAndWaitForTechLost().then(() => toggleNFC(false)).then(runNextTest);
});
}).catch(() => {
ok(false, "Failed to send NDEF message, error \'" + this.error + "\'");
toggleNFC(false).then(runNextTest);
deactivateAndWaitForTechLost().then(() => toggleNFC(false)).then(runNextTest);
});
}
function handleTechnologyDiscoveredRE0(msg) {
log("Received \'nfc-manager-tech-discovered\' " + JSON.stringify(msg));
is(msg.type, "techDiscovered", "check for correct message type");
is(msg.isP2P, "check for \'P2P\' in tech list");
ok(msg.peer, "techDiscovered", "check for correct message type");
sendNDEF(msg.peer);
}

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

@ -1,7 +1,7 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 30000;
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
let url = "http://www.mozilla.org";
@ -16,16 +16,16 @@ function testUrlTagDiscover(re) {
sysMsgHelper.waitForTechDiscovered(function(msg) {
log("Received \'nfc-manager-tech-ndiscovered\'");
is(msg.type, "techDiscovered", "check for correct message type");
ok(msg.peer === undefined, "peer object should be undefined");
let records = Cu.waiveXrays(msg.records);
let records = msg.records;
ok(records.length > 0);
is(tnf, records[0].tnf, "check for TNF field in NDEF");
is(type, NfcUtils.toUTF8(records[0].type), "check for type field in NDEF");
is(payload, NfcUtils.toUTF8(records[0].payload), "check for payload field in NDEF");
is(type, NfcUtils.toUTF8(Cu.waiveXrays(records[0].type)), "check for type field in NDEF");
is(payload, NfcUtils.toUTF8(Cu.waiveXrays(records[0].payload)), "check for payload field in NDEF");
toggleNFC(false).then(runNextTest);
deactivateAndWaitForTechLost().then(() => toggleNFC(false)).then(runNextTest);
});
toggleNFC(true)
@ -38,12 +38,12 @@ function testEmptyTagDiscover(re) {
sysMsgHelper.waitForTechDiscovered(function(msg) {
log("Received \'nfc-manager-tech-ndiscovered\'");
is(msg.type, "techDiscovered", "check for correct message type");
ok(msg.peer === undefined, "peer object should be undefined");
let records = msg.records;
ok(records == null);
toggleNFC(false).then(runNextTest);
deactivateAndWaitForTechLost().then(() => toggleNFC(false)).then(runNextTest);
});
toggleNFC(true)

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

@ -12,10 +12,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=678695
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=678695">Mozilla Bug 678695</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
SpecialPowers.addPermission("settings-api-read", true, document);
SpecialPowers.addPermission("settings-api-write", true, document);
SpecialPowers.addPermission("settings-read", true, document);
SpecialPowers.addPermission("settings-write", true, document);
/** Test for Bug 678695 **/

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

@ -649,6 +649,17 @@ NetworkService.prototype = {
});
},
stopDhcp: function(interfaceName, callback) {
let params = {
cmd: "stopDhcp",
ifname: interfaceName
};
this.controlMessage(params, function(result) {
callback.nativeCommandResult(!result.error);
});
},
enableInterface: function(interfaceName, callback) {
let params = {
cmd: "enableInterface",

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

@ -1615,6 +1615,7 @@ void NetworkUtils::ExecuteCommand(NetworkParams aOptions)
BUILD_ENTRY(updateUpStream),
BUILD_ENTRY(configureInterface),
BUILD_ENTRY(dhcpRequest),
BUILD_ENTRY(stopDhcp),
BUILD_ENTRY(enableInterface),
BUILD_ENTRY(disableInterface),
BUILD_ENTRY(resetConnections),
@ -1833,6 +1834,11 @@ CommandResult NetworkUtils::configureInterface(NetworkParams& aOptions)
);
}
CommandResult NetworkUtils::stopDhcp(NetworkParams& aOptions)
{
return mNetUtils->do_dhcp_stop(GET_CHAR(mIfname));
}
CommandResult NetworkUtils::dhcpRequest(NetworkParams& aOptions) {
mozilla::dom::NetworkResultOptions result;

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

@ -287,6 +287,7 @@ private:
*/
CommandResult configureInterface(NetworkParams& aOptions);
CommandResult dhcpRequest(NetworkParams& aOptions);
CommandResult stopDhcp(NetworkParams& aOptions);
CommandResult enableInterface(NetworkParams& aOptions);
CommandResult disableInterface(NetworkParams& aOptions);
CommandResult resetConnections(NetworkParams& aOptions);

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

@ -159,7 +159,7 @@ interface nsIDhcpRequestCallback : nsISupports
/**
* Provide network services.
*/
[scriptable, uuid(8216224c-a4e0-43fa-9662-3f2446b500c6)]
[scriptable, uuid(214c0810-fd41-11e4-b939-0800200c9a66)]
interface nsINetworkService : nsISupports
{
const long MODIFY_ROUTE_ADD = 0;
@ -417,6 +417,18 @@ interface nsINetworkService : nsISupports
void dhcpRequest(in DOMString interfaceName,
in nsIDhcpRequestCallback callback);
/**
* Stop Dhcp daemon.
*
* @param ifname
* Target interface.
*
* @param callback
* Callback to notify the result of stopping dhcp request.
*/
void stopDhcp(in DOMString ifname,
in nsINativeCommandCallback callback);
/**
* Enable a network interface.
*

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

@ -375,10 +375,14 @@ Telephony::HandleCallInfo(nsITelephonyCallInfo* aInfo)
nsRefPtr<TelephonyCallId> id = call->Id();
id->UpdateNumber(number);
nsAutoString disconnectedReason;
aInfo->GetDisconnectedReason(disconnectedReason);
// State changed.
if (call->CallState() != callState) {
if (callState == nsITelephonyService::CALL_STATE_DISCONNECTED) {
call->ChangeStateInternal(callState, true);
call->UpdateDisconnectedReason(disconnectedReason);
call->ChangeState(nsITelephonyService::CALL_STATE_DISCONNECTED);
return NS_OK;
}
@ -687,26 +691,6 @@ Telephony::SupplementaryServiceNotification(uint32_t aServiceId,
return NS_OK;
}
NS_IMETHODIMP
Telephony::NotifyError(uint32_t aServiceId,
int32_t aCallIndex,
const nsAString& aError)
{
nsRefPtr<TelephonyCall> callToNotify =
GetCallFromEverywhere(aServiceId, aCallIndex);
if (!callToNotify) {
NS_ERROR("Don't call me with a bad call index!");
return NS_ERROR_UNEXPECTED;
}
// Set the call state to 'disconnected' and remove it from the calls list.
callToNotify->UpdateDisconnectedReason(aError);
callToNotify->NotifyError(aError);
callToNotify->ChangeState(nsITelephonyService::CALL_STATE_DISCONNECTED);
return NS_OK;
}
NS_IMETHODIMP
Telephony::NotifyCdmaCallWaiting(uint32_t aServiceId, const nsAString& aNumber,
uint16_t aNumberPresentation,

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

@ -119,7 +119,6 @@ TelephonyCall::ChangeStateInternal(uint16_t aCallState, bool aFireEvents)
} else {
mTelephony->RemoveCall(this);
}
UpdateDisconnectedReason(NS_LITERAL_STRING("NormalCallClearingError"));
} else if (!mLive) {
mLive = true;
if (mGroup) {
@ -196,16 +195,23 @@ TelephonyCall::NotifyError(const nsAString& aError)
void
TelephonyCall::UpdateDisconnectedReason(const nsAString& aDisconnectedReason)
{
NS_ASSERTION(Substring(aDisconnectedReason, aDisconnectedReason.Length() - 5).EqualsLiteral("Error"),
NS_ASSERTION(Substring(aDisconnectedReason,
aDisconnectedReason.Length() - 5).EqualsLiteral("Error"),
"Disconnected reason should end with 'Error'");
if (mDisconnectedReason.IsNull()) {
// There is no 'Error' suffix in the corresponding enum. We should skip
// that part for comparison.
CONVERT_STRING_TO_NULLABLE_ENUM(
Substring(aDisconnectedReason, 0, aDisconnectedReason.Length() - 5),
TelephonyCallDisconnectedReason,
mDisconnectedReason);
if (!mDisconnectedReason.IsNull()) {
return;
}
// There is no 'Error' suffix in the corresponding enum. We should skip
// that part for comparison.
CONVERT_STRING_TO_NULLABLE_ENUM(
Substring(aDisconnectedReason, 0, aDisconnectedReason.Length() - 5),
TelephonyCallDisconnectedReason,
mDisconnectedReason);
if (!aDisconnectedReason.EqualsLiteral("NormalCallClearingError")) {
NotifyError(aDisconnectedReason);
}
}

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

@ -15,10 +15,13 @@ NS_IMPL_ISUPPORTS(TelephonyCallInfo, nsITelephonyCallInfo)
TelephonyCallInfo::TelephonyCallInfo(uint32_t aClientId,
uint32_t aCallIndex,
uint16_t aCallState,
const nsAString& aDisconnectedReason,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation,
bool aIsOutgoing,
bool aIsEmergency,
bool aIsConference,
@ -27,10 +30,13 @@ TelephonyCallInfo::TelephonyCallInfo(uint32_t aClientId,
: mClientId(aClientId),
mCallIndex(aCallIndex),
mCallState(aCallState),
mDisconnectedReason(aDisconnectedReason),
mNumber(aNumber),
mNumberPresentation(aNumberPresentation),
mName(aName),
mNamePresentation(aNamePresentation),
mIsOutgoing(aIsOutgoing),
mIsEmergency(aIsEmergency),
mIsConference(aIsConference),
@ -60,6 +66,13 @@ TelephonyCallInfo::GetCallState(uint16_t* aCallState)
return NS_OK;
}
NS_IMETHODIMP
TelephonyCallInfo::GetDisconnectedReason(nsAString& aDisconnectedReason)
{
aDisconnectedReason = mDisconnectedReason;
return NS_OK;
}
NS_IMETHODIMP
TelephonyCallInfo::GetNumber(nsAString& aNumber)
{

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

@ -21,12 +21,21 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSITELEPHONYCALLINFO
TelephonyCallInfo(uint32_t aClientId, uint32_t aCallIndex,
uint16_t aCallState, const nsAString& aNumber,
uint16_t aNumberPresentation, const nsAString& aName,
uint16_t aNamePresentation, bool aIsOutgoing,
bool aIsEmergency, bool aIsConference,
bool aIsSwitchable, bool aIsMergeable);
TelephonyCallInfo(uint32_t aClientId,
uint32_t aCallIndex,
uint16_t aCallState,
const nsAString& aDisconnectedReason,
const nsAString& aNumber,
uint16_t aNumberPresentation,
const nsAString& aName,
uint16_t aNamePresentation,
bool aIsOutgoing,
bool aIsEmergency,
bool aIsConference,
bool aIsSwitchable,
bool aIsMergeable);
private:
// Don't try to use the default constructor.
@ -37,10 +46,13 @@ private:
uint32_t mClientId;
uint32_t mCallIndex;
uint16_t mCallState;
nsString mDisconnectedReason;
nsString mNumber;
uint16_t mNumberPresentation;
nsString mName;
uint16_t mNamePresentation;
bool mIsOutgoing;
bool mIsEmergency;
bool mIsConference;

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

@ -124,10 +124,13 @@ function TelephonyCallInfo(aCall) {
this.clientId = aCall.clientId;
this.callIndex = aCall.callIndex;
this.callState = aCall.state;
this.disconnectedReason = aCall.disconnectedReason || "";
this.number = aCall.number;
this.numberPresentation = aCall.numberPresentation;
this.name = aCall.name;
this.namePresentation = aCall.namePresentation;
this.isOutgoing = aCall.isOutgoing;
this.isEmergency = aCall.isEmergency;
this.isConference = aCall.isConference;
@ -148,10 +151,13 @@ TelephonyCallInfo.prototype = {
clientId: 0,
callIndex: 0,
callState: nsITelephonyService.CALL_STATE_UNKNOWN,
disconnectedReason: "",
number: "",
numberPresentation: nsITelephonyService.CALL_PRESENTATION_ALLOWED,
name: "",
namePresentation: nsITelephonyService.CALL_PRESENTATION_ALLOWED,
isOutgoing: true,
isEmergency: false,
isConference: false,
@ -1438,10 +1444,6 @@ TelephonyService.prototype = {
* calls being disconnected as well.
*
* @return Array a list of calls we need to fire callStateChange
*
* TODO: The list currently doesn't contain calls that we fire notifyError
* for them. However, after Bug 1147736, notifyError is replaced by
* callStateChanged and those calls should be included in the list.
*/
_disconnectCalls: function(aClientId, aCalls,
aFailCause = RIL.GECKO_CALL_ERROR_NORMAL_CALL_CLEARING) {
@ -1465,7 +1467,7 @@ TelephonyService.prototype = {
disconnectedCalls.forEach(call => {
call.state = nsITelephonyService.CALL_STATE_DISCONNECTED;
call.failCause = aFailCause;
call.disconnectedReason = aFailCause;
if (call.parentId) {
let parentCall = this._currentCalls[aClientId][call.parentId];
@ -1474,13 +1476,7 @@ TelephonyService.prototype = {
this._notifyCallEnded(call);
if (call.hangUpLocal || !call.failCause ||
call.failCause === RIL.GECKO_CALL_ERROR_NORMAL_CALL_CLEARING) {
callsForStateChanged.push(call);
} else {
this._notifyAllListeners("notifyError",
[aClientId, call.callIndex, call.failCause]);
}
callsForStateChanged.push(call);
delete this._currentCalls[aClientId][call.callIndex];
});

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

@ -125,8 +125,6 @@ sync protocol PTelephony {
manages PTelephonyRequest;
child:
NotifyCallError(uint32_t aClientId, int32_t aCallIndex, nsString aError);
NotifyCallStateChanged(nsTelephonyCallInfo[] aAllInfo);
NotifyCdmaCallWaiting(uint32_t aClientId, IPCCdmaWaitingCallData aData);

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

@ -47,17 +47,6 @@ TelephonyChild::DeallocPTelephonyRequestChild(PTelephonyRequestChild* aActor)
return true;
}
bool
TelephonyChild::RecvNotifyCallError(const uint32_t& aClientId,
const int32_t& aCallIndex,
const nsString& aError)
{
MOZ_ASSERT(mService);
mService->NotifyError(aClientId, aCallIndex, aError);
return true;
}
bool
TelephonyChild::RecvNotifyCallStateChanged(nsTArray<nsITelephonyCallInfo*>&& aAllInfo)
{

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

@ -34,10 +34,6 @@ protected:
virtual bool
DeallocPTelephonyRequestChild(PTelephonyRequestChild* aActor) override;
virtual bool
RecvNotifyCallError(const uint32_t& aClientId, const int32_t& aCallIndex,
const nsString& aError) override;
virtual bool
RecvNotifyCallStateChanged(nsTArray<nsITelephonyCallInfo*>&& aAllInfo) override;

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

@ -37,10 +37,13 @@ struct ParamTraits<nsITelephonyCallInfo*>
uint32_t clientId;
uint32_t callIndex;
uint16_t callState;
nsString disconnectedReason;
nsString number;
uint16_t numberPresentation;
nsString name;
uint16_t namePresentation;
bool isOutgoing;
bool isEmergency;
bool isConference;
@ -50,10 +53,13 @@ struct ParamTraits<nsITelephonyCallInfo*>
aParam->GetClientId(&clientId);
aParam->GetCallIndex(&callIndex);
aParam->GetCallState(&callState);
aParam->GetDisconnectedReason(disconnectedReason);
aParam->GetNumber(number);
aParam->GetNumberPresentation(&numberPresentation);
aParam->GetName(name);
aParam->GetNamePresentation(&namePresentation);
aParam->GetIsOutgoing(&isOutgoing);
aParam->GetIsEmergency(&isEmergency);
aParam->GetIsConference(&isConference);
@ -63,10 +69,13 @@ struct ParamTraits<nsITelephonyCallInfo*>
WriteParam(aMsg, clientId);
WriteParam(aMsg, callIndex);
WriteParam(aMsg, callState);
WriteParam(aMsg, disconnectedReason);
WriteParam(aMsg, number);
WriteParam(aMsg, numberPresentation);
WriteParam(aMsg, name);
WriteParam(aMsg, namePresentation);
WriteParam(aMsg, isOutgoing);
WriteParam(aMsg, isEmergency);
WriteParam(aMsg, isConference);
@ -90,10 +99,13 @@ struct ParamTraits<nsITelephonyCallInfo*>
uint32_t clientId;
uint32_t callIndex;
uint16_t callState;
nsString disconnectedReason;
nsString number;
uint16_t numberPresentation;
nsString name;
uint16_t namePresentation;
bool isOutgoing;
bool isEmergency;
bool isConference;
@ -104,10 +116,13 @@ struct ParamTraits<nsITelephonyCallInfo*>
if (!(ReadParam(aMsg, aIter, &clientId) &&
ReadParam(aMsg, aIter, &callIndex) &&
ReadParam(aMsg, aIter, &callState) &&
ReadParam(aMsg, aIter, &disconnectedReason) &&
ReadParam(aMsg, aIter, &number) &&
ReadParam(aMsg, aIter, &numberPresentation) &&
ReadParam(aMsg, aIter, &name) &&
ReadParam(aMsg, aIter, &namePresentation) &&
ReadParam(aMsg, aIter, &isOutgoing) &&
ReadParam(aMsg, aIter, &isEmergency) &&
ReadParam(aMsg, aIter, &isConference) &&
@ -117,10 +132,21 @@ struct ParamTraits<nsITelephonyCallInfo*>
}
nsCOMPtr<nsITelephonyCallInfo> info =
new TelephonyCallInfo(clientId, callIndex, callState, number,
numberPresentation, name, namePresentation,
isOutgoing, isEmergency, isConference,
isSwitchable, isMergeable);
new TelephonyCallInfo(clientId,
callIndex,
callState,
disconnectedReason,
number,
numberPresentation,
name,
namePresentation,
isOutgoing,
isEmergency,
isConference,
isSwitchable,
isMergeable);
info.forget(aResult);

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

@ -421,16 +421,6 @@ TelephonyIPCService::NotifyConferenceError(const nsAString& aName,
return NS_OK;
}
NS_IMETHODIMP
TelephonyIPCService::NotifyError(uint32_t aClientId, int32_t aCallIndex,
const nsAString& aError)
{
for (uint32_t i = 0; i < mListeners.Length(); i++) {
mListeners[i]->NotifyError(aClientId, aCallIndex, aError);
}
return NS_OK;
}
NS_IMETHODIMP
TelephonyIPCService::SupplementaryServiceNotification(uint32_t aClientId,
int32_t aCallIndex,

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

@ -331,17 +331,6 @@ TelephonyParent::NotifyConferenceError(const nsAString& aName,
: NS_ERROR_FAILURE;
}
NS_IMETHODIMP
TelephonyParent::NotifyError(uint32_t aClientId,
int32_t aCallIndex,
const nsAString& aError)
{
NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);
return SendNotifyCallError(aClientId, aCallIndex, nsString(aError))
? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHODIMP
TelephonyParent::SupplementaryServiceNotification(uint32_t aClientId,
int32_t aCallIndex,
@ -431,14 +420,6 @@ TelephonyRequestParent::NotifyConferenceError(const nsAString& aName,
MOZ_CRASH("Not a TelephonyParent!");
}
NS_IMETHODIMP
TelephonyRequestParent::NotifyError(uint32_t aClientId,
int32_t aCallIndex,
const nsAString& aError)
{
MOZ_CRASH("Not a TelephonyParent!");
}
NS_IMETHODIMP
TelephonyRequestParent::SupplementaryServiceNotification(uint32_t aClientId,
int32_t aCallIndex,

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

@ -4,7 +4,7 @@
#include "nsISupports.idl"
[scriptable, uuid(3ea2d155-8ea2-42be-85d7-bd8ede8afc40)]
[scriptable, uuid(e5e1be26-a3d4-49b3-8d9f-c1df5192b364)]
interface nsITelephonyCallInfo : nsISupports
{
/**
@ -22,6 +22,14 @@ interface nsITelephonyCallInfo : nsISupports
*/
readonly attribute unsigned short callState;
/**
* The disconnectedReason of a call is defualt to an empty string when the
* call is "not disconnected", but once the call becomes "disconnected" the
* disconnectedReason should be a non-empty string no matter the call is
* disconnected for a noraml reason or an error.
*/
readonly attribute DOMString disconnectedReason;
/**
* Number of the other party.
*/

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

@ -7,7 +7,7 @@
interface nsIMobileCallForwardingOptions;
interface nsITelephonyCallInfo;
[scriptable, uuid(37fb45bb-ae10-4cfd-b24e-d656a9787a0a)]
[scriptable, uuid(80faf34e-286b-4487-bd55-135bd92668b9)]
interface nsITelephonyListener : nsISupports
{
/**
@ -54,20 +54,6 @@ interface nsITelephonyListener : nsISupports
in long callIndex,
in unsigned short notification);
/**
* Called when RIL error occurs.
*
* @param clientId
Indicate the RIL client, 0 ~ (number of client - 1).
* @param callIndex
* Call identifier assigned by the RIL. -1 if no connection
* @param error
* Error from RIL.
*/
void notifyError(in unsigned long clientId,
in long callIndex,
in AString error);
/**
* Called when a waiting call comes in CDMA networks.
*

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

@ -1,9 +1,12 @@
FROM quay.io/mozilla/builder:0.5.4
FROM quay.io/mozilla/builder:0.5.5
MAINTAINER Wander Lairson Costa <wcosta@mozilla.com>
ENV SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE /home/worker/socorro.token
# Add utilities and configuration
ADD bin /home/worker/bin
ADD config /home/worker/.aws/config
ADD socorro.token /home/worker/socorro.token
RUN yum install -y bc lzop
RUN pip install awscli

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

@ -1 +1 @@
0.0.13
0.0.14

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

@ -1,6 +1,6 @@
#! /bin/bash -e
while getopts "t:i:k:" arg; do
while getopts "t:i:k:s:" arg; do
case $arg in
t)
TAG=$OPTARG
@ -11,6 +11,9 @@ while getopts "t:i:k:" arg; do
k)
SECRET_KEY=$OPTARG
;;
s)
SOCORRO_TOKEN=$OPTARG
;;
esac
done
@ -19,12 +22,16 @@ pushd $(dirname $0)
test $TAG
test $KEY_ID
test $SECRET_KEY
test $SOCORRO_TOKEN
(echo '[default]'
echo "aws_access_key_id = $KEY_ID"
echo "aws_secret_access_key = $SECRET_KEY") > config
echo $SOCORRO_TOKEN > socorro.token
docker build -t $TAG .
rm -f config
rm -f socorro.token
popd

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

@ -386,3 +386,76 @@ class Graph(object):
graph.pop('metadata', None)
print(json.dumps(graph, indent=4))
@CommandProvider
class CIBuild(object):
@Command('taskcluster-build', category='ci',
description="Create taskcluster try server build task")
@CommandArgument('--base-repository',
help='URL for "base" repository to clone')
@CommandArgument('--head-repository',
required=True,
help='URL for "head" repository to fetch revision from')
@CommandArgument('--head-ref',
help='Reference (this is same as rev usually for hg)')
@CommandArgument('--head-rev',
required=True,
help='Commit revision to use')
@CommandArgument('--mozharness-repository',
help='URL for custom mozharness repo')
@CommandArgument('--mozharness-rev',
help='Commit revision to use from mozharness repository')
@CommandArgument('--owner',
default='foobar@mozilla.com',
help='email address of who owns this graph')
@CommandArgument('build_task',
help='path to build task definition')
def create_ci_build(self, **params):
templates = Templates(ROOT)
# TODO handle git repos
head_repository = params['head_repository']
if not head_repository:
head_repository = get_hg_url()
head_rev = params['head_rev']
if not head_rev:
head_rev = get_latest_hg_revision(head_repository)
head_ref = params['head_ref'] or head_rev
mozharness = load_mozharness_info()
mozharness_repo = params['mozharness_repository']
if mozharness_repo is None:
mozharness_repo = mozharness['repo']
mozharness_rev = params['mozharness_rev']
if mozharness_rev is None:
mozharness_rev = mozharness['revision']
build_parameters = dict(gaia_info().items() + {
'docker_image': docker_image,
'owner': params['owner'],
'from_now': json_time_from_now,
'now': current_json_time(),
'base_repository': params['base_repository'] or head_repository,
'head_repository': head_repository,
'head_rev': head_rev,
'head_ref': head_ref,
'mozharness_repository': mozharness_repo,
'mozharness_ref': mozharness_rev,
'mozharness_rev': mozharness_rev
}.items())
try:
build_task = templates.load(params['build_task'], build_parameters)
except IOError:
sys.stderr.write(
"Could not load build task file. Ensure path is a relative " \
"path from testing/taskcluster"
)
sys.exit(1)
taskcluster_graph.build_task.validate(build_task)
print(json.dumps(build_task['task'], indent=4))

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

@ -50,7 +50,7 @@ mkdir -p $HOME/artifacts-public
mv $WORKSPACE/B2G/upload-public/$mar_file $HOME/artifacts-public/
mv $WORKSPACE/B2G/upload/sources.xml $HOME/artifacts/sources.xml
#mv $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
mv $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
mv $WORKSPACE/B2G/upload/b2g-*.android-arm.tar.gz $HOME/artifacts/b2g-android-arm.tar.gz
mv $WORKSPACE/B2G/upload/${TARGET}.zip $HOME/artifacts/${TARGET}.zip
mv $WORKSPACE/B2G/upload/gaia.zip $HOME/artifacts/gaia.zip

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

@ -48,7 +48,7 @@ mkdir -p $HOME/artifacts-public
mv $WORKSPACE/B2G/upload-public/$mar_file $HOME/artifacts-public/
mv $WORKSPACE/B2G/upload/sources.xml $HOME/artifacts/sources.xml
#mv $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
mv $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
mv $WORKSPACE/B2G/upload/b2g-*.android-arm.tar.gz $HOME/artifacts/b2g-android-arm.tar.gz
mv $WORKSPACE/B2G/upload/${TARGET}.zip $HOME/artifacts/${TARGET}.zip
mv $WORKSPACE/B2G/upload/gaia.zip $HOME/artifacts/gaia.zip

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

@ -106,29 +106,8 @@ GonkDisplayJB::GonkDisplayJB()
mAlloc = new GraphicBufferAlloc();
#if ANDROID_VERSION >= 21
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer, mAlloc);
#elif ANDROID_VERSION >= 19
sp<BufferQueue> consumer = new BufferQueue(mAlloc);
sp<IGraphicBufferProducer> producer = consumer;
#elif ANDROID_VERSION >= 18
sp<BufferQueue> consumer = new BufferQueue(true, mAlloc);
sp<IGraphicBufferProducer> producer = consumer;
#else
sp<BufferQueue> consumer = new BufferQueue(true, mAlloc);
#endif
CreateSurface(mSTClient, mDispSurface);
mDispSurface = new FramebufferSurface(0, mWidth, mHeight, surfaceformat, consumer);
#if ANDROID_VERSION == 17
sp<SurfaceTextureClient> stc = new SurfaceTextureClient(
static_cast<sp<ISurfaceTexture> >(mDispSurface->getBufferQueue()));
#else
sp<Surface> stc = new Surface(producer);
#endif
mSTClient = stc;
mList = (hwc_display_contents_1_t *)malloc(sizeof(*mList) + (sizeof(hwc_layer_1_t)*2));
uint32_t usage = GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER;
@ -148,7 +127,7 @@ GonkDisplayJB::GonkDisplayJB()
#endif
// For devices w/ hwc v1.0 or no hwc, this buffer can not be created,
// only create this buffer for devices w/ hwc version > 1.0.
mBootAnimBuffer = mAlloc->createGraphicBuffer(mWidth, mHeight, surfaceformat, usage, &err);
CreateSurface(mBootAnimSTClient, mBootAnimDispSurface);
}
ALOGI("Starting bootanimation with (%d) format framebuffer", surfaceformat);
@ -164,6 +143,34 @@ GonkDisplayJB::~GonkDisplayJB()
free(mList);
}
void
GonkDisplayJB::CreateSurface(android::sp<ANativeWindow>& aNativeWindow,
android::sp<android::DisplaySurface>& aDisplaySurface)
{
#if ANDROID_VERSION >= 21
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer, mAlloc);
#elif ANDROID_VERSION >= 19
sp<BufferQueue> consumer = new BufferQueue(mAlloc);
sp<IGraphicBufferProducer> producer = consumer;
#elif ANDROID_VERSION >= 18
sp<BufferQueue> consumer = new BufferQueue(true, mAlloc);
sp<IGraphicBufferProducer> producer = consumer;
#else
sp<BufferQueue> consumer = new BufferQueue(true, mAlloc);
#endif
aDisplaySurface = new FramebufferSurface(0, mWidth, mHeight, surfaceformat, consumer);
#if ANDROID_VERSION == 17
aNativeWindow = new SurfaceTextureClient(
static_cast<sp<ISurfaceTexture>>(aDisplaySurface->getBufferQueue()));
#else
aNativeWindow = new Surface(producer);
#endif
}
ANativeWindow*
GonkDisplayJB::GetNativeWindow()
{
@ -311,12 +318,13 @@ GonkDisplayJB::Post(buffer_handle_t buf, int fence)
ANativeWindowBuffer*
GonkDisplayJB::DequeueBuffer()
{
if (mBootAnimBuffer.get()) {
return static_cast<ANativeWindowBuffer*>(mBootAnimBuffer.get());
}
// Check for bootAnim or normal display flow.
sp<ANativeWindow> nativeWindow =
!mBootAnimSTClient.get() ? mSTClient : mBootAnimSTClient;
ANativeWindowBuffer *buf;
int fenceFd = -1;
mSTClient->dequeueBuffer(mSTClient.get(), &buf, &fenceFd);
nativeWindow->dequeueBuffer(nativeWindow.get(), &buf, &fenceFd);
sp<Fence> fence(new Fence(fenceFd));
#if ANDROID_VERSION == 17
fence->waitForever(1000, "GonkDisplayJB_DequeueBuffer");
@ -332,10 +340,16 @@ bool
GonkDisplayJB::QueueBuffer(ANativeWindowBuffer* buf)
{
int error = 0;
if (!mBootAnimBuffer.get()) {
bool success = false;
// Check for bootAnim or normal display flow.
if (!mBootAnimSTClient.get()) {
error = mSTClient->queueBuffer(mSTClient.get(), buf, -1);
success = Post(mDispSurface->lastHandle, mDispSurface->GetPrevDispAcquireFd());
} else {
error = mBootAnimSTClient->queueBuffer(mBootAnimSTClient.get(), buf, -1);
success = Post(mBootAnimDispSurface->lastHandle, mBootAnimDispSurface->GetPrevDispAcquireFd());
}
bool success = Post(mDispSurface->lastHandle, mDispSurface->GetPrevDispAcquireFd());
return error == 0 && success;
}
@ -363,8 +377,9 @@ void
GonkDisplayJB::StopBootAnim()
{
StopBootAnimation();
if (mBootAnimBuffer.get()) {
mBootAnimBuffer = nullptr;
if (mBootAnimSTClient.get()) {
mBootAnimSTClient = nullptr;
mBootAnimDispSurface = nullptr;
}
}

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

@ -56,6 +56,8 @@ public:
private:
void StopBootAnim();
void CreateSurface(android::sp<ANativeWindow>& aNativeWindow,
android::sp<android::DisplaySurface>& aDisplaySurface);
hw_module_t const* mModule;
hw_module_t const* mFBModule;
@ -64,8 +66,9 @@ private:
power_module_t* mPowerModule;
android::sp<android::DisplaySurface> mDispSurface;
android::sp<ANativeWindow> mSTClient;
android::sp<android::DisplaySurface> mBootAnimDispSurface;
android::sp<ANativeWindow> mBootAnimSTClient;
android::sp<android::IGraphicBufferAlloc> mAlloc;
android::sp<android::GraphicBuffer> mBootAnimBuffer;
hwc_display_contents_1_t* mList;
uint32_t mWidth;
uint32_t mHeight;