зеркало из https://github.com/mozilla/gecko-dev.git
Merge b2g-inbound to m-c a=merge
This commit is contained in:
Коммит
27ed3df1f2
|
@ -12,10 +12,10 @@
|
|||
<!--original fetch url was https://git.mozilla.org/releases-->
|
||||
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
||||
<!-- B2G specific things. -->
|
||||
<project name="platform_build" path="build" remote="b2g" revision="1865c6639c51f0290d5778adef146147d5d6a5f0">
|
||||
<project name="platform_build" path="build" remote="b2g" revision="53a59364ce4f14068034c8d6fe01f4f6b9f78f23">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="afcdd36f13e75adcdebe57d842a277fd587faf28"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e424c85eda87a40c0fa64d6a779c3fa368bf770b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -23,7 +23,7 @@
|
|||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<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="76a2d31804463dcb49e2fd852c8c2e27a89e9e46"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>
|
||||
<!-- 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"/>
|
||||
|
@ -127,9 +127,9 @@
|
|||
<!-- Stock Android things -->
|
||||
<project name="platform/external/icu4c" path="external/icu4c" revision="2bb01561780583cc37bc667f0ea79f48a122d8a2"/>
|
||||
<!-- dolphin specific things -->
|
||||
<project name="device/sprd" path="device/sprd" revision="66f858de575b95e334f32f6c7ac9d1cd85e9f0d8"/>
|
||||
<project name="device/sprd" path="device/sprd" revision="9a1f8e59b0cbf91d99b02f836b5197a822eadf1a"/>
|
||||
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="4e58336019b5cbcfd134caf55b142236cf986618"/>
|
||||
<project name="platform/frameworks/av" path="frameworks/av" revision="cbd80d8c03fc639dd810b17c4b682c67abc06ee8"/>
|
||||
<project name="platform/frameworks/av" path="frameworks/av" revision="facca8d3e35431b66f85a4eb42bc6c5b24bd04da"/>
|
||||
<project name="platform/hardware/akm" path="hardware/akm" revision="6d3be412647b0eab0adff8a2768736cf4eb68039"/>
|
||||
<project groups="invensense" name="platform/hardware/invensense" path="hardware/invensense" revision="e6d9ab28b4f4e7684f6c07874ee819c9ea0002a2"/>
|
||||
<project name="platform/hardware/ril" path="hardware/ril" revision="865ce3b4a2ba0b3a31421ca671f4d6c5595f8690"/>
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
<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="afcdd36f13e75adcdebe57d842a277fd587faf28"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e424c85eda87a40c0fa64d6a779c3fa368bf770b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="a567a787b5ac3e0cb663aa6464b18a24ec764409"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="76a2d31804463dcb49e2fd852c8c2e27a89e9e46"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="afcdd36f13e75adcdebe57d842a277fd587faf28"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e424c85eda87a40c0fa64d6a779c3fa368bf770b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="76a2d31804463dcb49e2fd852c8c2e27a89e9e46"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
<!--original fetch url was https://git.mozilla.org/releases-->
|
||||
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
||||
<!-- B2G specific things. -->
|
||||
<project name="platform_build" path="build" remote="b2g" revision="1865c6639c51f0290d5778adef146147d5d6a5f0">
|
||||
<project name="platform_build" path="build" remote="b2g" revision="53a59364ce4f14068034c8d6fe01f4f6b9f78f23">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="afcdd36f13e75adcdebe57d842a277fd587faf28"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e424c85eda87a40c0fa64d6a779c3fa368bf770b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -23,7 +23,7 @@
|
|||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<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="76a2d31804463dcb49e2fd852c8c2e27a89e9e46"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>
|
||||
<!-- 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"/>
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
<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="afcdd36f13e75adcdebe57d842a277fd587faf28"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e424c85eda87a40c0fa64d6a779c3fa368bf770b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="a567a787b5ac3e0cb663aa6464b18a24ec764409"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="76a2d31804463dcb49e2fd852c8c2e27a89e9e46"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="afcdd36f13e75adcdebe57d842a277fd587faf28"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e424c85eda87a40c0fa64d6a779c3fa368bf770b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="76a2d31804463dcb49e2fd852c8c2e27a89e9e46"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "670b42b547f817727fc98f2983c606e8cc8766af",
|
||||
"revision": "2b76279a1d0770938d1ed660f40faba07b2a5e19",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
<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="afcdd36f13e75adcdebe57d842a277fd587faf28"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e424c85eda87a40c0fa64d6a779c3fa368bf770b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="76a2d31804463dcb49e2fd852c8c2e27a89e9e46"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
<project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
|
||||
|
|
|
@ -15,7 +15,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="afcdd36f13e75adcdebe57d842a277fd587faf28"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e424c85eda87a40c0fa64d6a779c3fa368bf770b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="afcdd36f13e75adcdebe57d842a277fd587faf28"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="e424c85eda87a40c0fa64d6a779c3fa368bf770b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="76a2d31804463dcb49e2fd852c8c2e27a89e9e46"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
<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="afcdd36f13e75adcdebe57d842a277fd587faf28"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="e424c85eda87a40c0fa64d6a779c3fa368bf770b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="3bb61a27cd2941b2ba9b616a11aaa44269210396"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="76a2d31804463dcb49e2fd852c8c2e27a89e9e46"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="d59843c1d66bd8d93c6012efda47fa447b99813c"/>
|
||||
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
|
|
|
@ -26,8 +26,10 @@ class MOZ_STACK_CLASS nsViewportInfo
|
|||
{
|
||||
public:
|
||||
nsViewportInfo(const mozilla::ScreenIntSize& aDisplaySize,
|
||||
bool aAllowZoom = true, bool aAllowDoubleTapZoom = true) :
|
||||
mDefaultZoom(1.0),
|
||||
const mozilla::CSSToScreenScale& aDefaultZoom,
|
||||
bool aAllowZoom,
|
||||
bool aAllowDoubleTapZoom) :
|
||||
mDefaultZoom(aDefaultZoom),
|
||||
mAutoSize(true),
|
||||
mAllowZoom(aAllowZoom),
|
||||
mAllowDoubleTapZoom(aAllowDoubleTapZoom)
|
||||
|
|
|
@ -7501,15 +7501,27 @@ nsIDocument::AdoptNode(nsINode& aAdoptedNode, ErrorResult& rv)
|
|||
nsViewportInfo
|
||||
nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
|
||||
{
|
||||
nsPresContext* context = mPresShell->GetPresContext();
|
||||
float fullZoom = context ? context->GetFullZoom() : 1.0;
|
||||
fullZoom = (fullZoom == 0.0) ? 1.0 : fullZoom;
|
||||
CSSToScreenScale defaultScale = CSSToLayoutDeviceScale(fullZoom) *
|
||||
LayoutDeviceToScreenScale(1.0);
|
||||
|
||||
// In cases where the width of the CSS viewport is less than or equal to the width
|
||||
// of the display (i.e. width <= device-width) then we disable double-tap-to-zoom
|
||||
// behaviour. See bug 941995 for details.
|
||||
|
||||
switch (mViewportType) {
|
||||
case DisplayWidthHeight:
|
||||
return nsViewportInfo(aDisplaySize);
|
||||
return nsViewportInfo(aDisplaySize,
|
||||
defaultScale,
|
||||
/*allowZoom*/ true,
|
||||
/*allowDoubleTapZoom*/ true);
|
||||
case DisplayWidthHeightNoZoom:
|
||||
return nsViewportInfo(aDisplaySize, /*allowZoom*/ false, /*allowDoubleTapZoom*/ false);
|
||||
return nsViewportInfo(aDisplaySize,
|
||||
defaultScale,
|
||||
/*allowZoom*/ false,
|
||||
/*allowDoubleTapZoom*/ false);
|
||||
case Unknown:
|
||||
{
|
||||
nsAutoString viewport;
|
||||
|
@ -7529,7 +7541,10 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
|
|||
{
|
||||
// We're making an assumption that the docType can't change here
|
||||
mViewportType = DisplayWidthHeight;
|
||||
return nsViewportInfo(aDisplaySize, /*allowZoom*/true, /*allowDoubleTapZoom*/false);
|
||||
return nsViewportInfo(aDisplaySize,
|
||||
defaultScale,
|
||||
/*allowZoom*/true,
|
||||
/*allowDoubleTapZoom*/false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7538,7 +7553,10 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
|
|||
GetHeaderData(nsGkAtoms::handheldFriendly, handheldFriendly);
|
||||
if (handheldFriendly.EqualsLiteral("true")) {
|
||||
mViewportType = DisplayWidthHeight;
|
||||
return nsViewportInfo(aDisplaySize, /*allowZoom*/true, /*allowDoubleTapZoom*/false);
|
||||
return nsViewportInfo(aDisplaySize,
|
||||
defaultScale,
|
||||
/*allowZoom*/true,
|
||||
/*allowDoubleTapZoom*/false);
|
||||
}
|
||||
|
||||
// Bug 940036. This is bad. When FirefoxOS was built, apps installed
|
||||
|
@ -7561,7 +7579,10 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
|
|||
"ImplicitMetaViewportTagFallback");
|
||||
}
|
||||
mViewportType = DisplayWidthHeightNoZoom;
|
||||
return nsViewportInfo(aDisplaySize, /*allowZoom*/false, /*allowDoubleTapZoom*/false);
|
||||
return nsViewportInfo(aDisplaySize,
|
||||
defaultScale,
|
||||
/*allowZoom*/false,
|
||||
/*allowDoubleTapZoom*/false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7652,8 +7673,11 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
|
|||
if (mValidHeight && !aDisplaySize.IsEmpty()) {
|
||||
size.width = size.height * aDisplaySize.width / aDisplaySize.height;
|
||||
} else {
|
||||
// Stretch CSS pixel size of viewport to keep device pixel size
|
||||
// unchanged after full zoom applied.
|
||||
// See bug 974242.
|
||||
size.width = Preferences::GetInt("browser.viewport.desktopWidth",
|
||||
kViewportDefaultScreenWidth);
|
||||
kViewportDefaultScreenWidth) / fullZoom;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7664,10 +7688,13 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
|
|||
size.height = size.width;
|
||||
}
|
||||
}
|
||||
// Now convert the scale into device pixels per CSS pixel.
|
||||
|
||||
// Now convert the scale into device pixels per CSS pixel base on this formula
|
||||
// CSSPixel x widget scale x full zoom = LayoutDevicePixel
|
||||
nsIWidget *widget = nsContentUtils::WidgetForDocument(this);
|
||||
CSSToLayoutDeviceScale pixelRatio = widget ? widget->GetDefaultScale()
|
||||
: CSSToLayoutDeviceScale(1.0f);
|
||||
CSSToLayoutDeviceScale pixelRatio = CSSToLayoutDeviceScale(
|
||||
(widget ? widget->GetDefaultScale().scale : 1.0f) * fullZoom);
|
||||
|
||||
CSSToScreenScale scaleFloat = mScaleFloat * pixelRatio;
|
||||
CSSToScreenScale scaleMinFloat = mScaleMinFloat * pixelRatio;
|
||||
CSSToScreenScale scaleMaxFloat = mScaleMaxFloat * pixelRatio;
|
||||
|
|
|
@ -328,6 +328,13 @@ TabChildBase::HandlePossibleViewportChange(const ScreenIntSize& aOldScreenSize)
|
|||
metrics.SetScrollId(viewId);
|
||||
}
|
||||
|
||||
if (nsIPresShell* shell = document->GetShell()) {
|
||||
if (nsPresContext* context = shell->GetPresContext()) {
|
||||
metrics.mDevPixelsPerCSSPixel = CSSToLayoutDeviceScale(
|
||||
(float)nsPresContext::AppUnitsPerCSSPixel() / context->AppUnitsPerDevPixel());
|
||||
}
|
||||
}
|
||||
|
||||
metrics.mCumulativeResolution = metrics.GetZoom() / metrics.mDevPixelsPerCSSPixel * ScreenToLayerScale(1);
|
||||
// This is the root layer, so the cumulative resolution is the same
|
||||
// as the resolution.
|
||||
|
@ -757,6 +764,8 @@ TabChild::HandleEvent(nsIDOMEvent* aEvent)
|
|||
// This meta data may or may not have been a meta viewport tag. If it was,
|
||||
// we should handle it immediately.
|
||||
HandlePossibleViewportChange(mInnerSize);
|
||||
} else if (eventType.EqualsLiteral("FullZoomChange")) {
|
||||
HandlePossibleViewportChange(mInnerSize);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -1468,6 +1477,7 @@ TabChild::ActorDestroy(ActorDestroyReason why)
|
|||
(mTabChildGlobal->mMessageManager.get())->Disconnect();
|
||||
mTabChildGlobal->mMessageManager = nullptr;
|
||||
}
|
||||
|
||||
if (Id() != 0) {
|
||||
NestedTabChildMap().erase(Id());
|
||||
}
|
||||
|
@ -2533,6 +2543,7 @@ TabChild::InitTabChildGlobal(FrameScriptLoading aScriptLoading)
|
|||
root->SetParentTarget(scope);
|
||||
|
||||
chromeHandler->AddEventListener(NS_LITERAL_STRING("DOMMetaAdded"), this, false);
|
||||
chromeHandler->AddEventListener(NS_LITERAL_STRING("FullZoomChange"), this, false);
|
||||
}
|
||||
|
||||
if (aScriptLoading != DONT_LOAD_SCRIPTS && !mTriedBrowserInit) {
|
||||
|
|
|
@ -56,6 +56,9 @@ this.SystemMessagePermissionsTable = {
|
|||
"bluetooth-opp-transfer-start": {
|
||||
"bluetooth": []
|
||||
},
|
||||
"cellbroadcast-received": {
|
||||
"cellbroadcast": []
|
||||
},
|
||||
"connection": { },
|
||||
"captive-portal": {
|
||||
"wifi-manage": []
|
||||
|
|
|
@ -10,9 +10,8 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
|||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://gre/modules/PhoneNumberUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
|
||||
const RIL_MMSSERVICE_CONTRACTID = "@mozilla.org/mms/rilmmsservice;1";
|
||||
const RIL_MMSSERVICE_CID = Components.ID("{217ddd76-75db-4210-955d-8806cd8d87f9}");
|
||||
|
@ -54,6 +53,7 @@ const _HTTP_STATUS_USER_CANCELLED = -1;
|
|||
const _HTTP_STATUS_RADIO_DISABLED = -2;
|
||||
const _HTTP_STATUS_NO_SIM_CARD = -3;
|
||||
const _HTTP_STATUS_ACQUIRE_TIMEOUT = -4;
|
||||
const _HTTP_STATUS_FAILED_TO_ROUTE = -5;
|
||||
|
||||
// Non-standard MMS status for internal use.
|
||||
const _MMS_ERROR_MESSAGE_DELETED = -1;
|
||||
|
@ -63,6 +63,7 @@ const _MMS_ERROR_SIM_CARD_CHANGED = -4;
|
|||
const _MMS_ERROR_SHUTDOWN = -5;
|
||||
const _MMS_ERROR_USER_CANCELLED_NO_REASON = -6;
|
||||
const _MMS_ERROR_SIM_NOT_MATCHED = -7;
|
||||
const _MMS_ERROR_FAILED_TO_ROUTE = -8;
|
||||
|
||||
const CONFIG_SEND_REPORT_NEVER = 0;
|
||||
const CONFIG_SEND_REPORT_DEFAULT_NO = 1;
|
||||
|
@ -158,6 +159,10 @@ XPCOMUtils.defineLazyServiceGetter(this, "gRil",
|
|||
"@mozilla.org/ril;1",
|
||||
"nsIRadioInterfaceLayer");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gNetworkManager",
|
||||
"@mozilla.org/network/manager;1",
|
||||
"nsINetworkManager");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "MMS", function() {
|
||||
let MMS = {};
|
||||
Cu.import("resource://gre/modules/MmsPduHelper.jsm", MMS);
|
||||
|
@ -202,6 +207,7 @@ function MmsConnection(aServiceId) {
|
|||
this.serviceId = aServiceId;
|
||||
this.radioInterface = gRil.getRadioInterface(aServiceId);
|
||||
this.pendingCallbacks = [];
|
||||
this.hostsToRoute = [];
|
||||
this.connectTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
this.disconnectTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
};
|
||||
|
@ -216,7 +222,8 @@ MmsConnection.prototype = {
|
|||
|
||||
setApnSetting: function(network) {
|
||||
this.mmsc = network.mmsc;
|
||||
this.mmsProxy = network.mmsProxy;
|
||||
// Workaround an xpconnect issue with undefined string objects. See bug 808220.
|
||||
this.mmsProxy = (network === "undefined") ? undefined : network.mmsProxy;
|
||||
this.mmsPort = network.mmsPort;
|
||||
},
|
||||
|
||||
|
@ -252,6 +259,12 @@ MmsConnection.prototype = {
|
|||
/** MMS network connection reference count. */
|
||||
refCount: 0,
|
||||
|
||||
// cache of hosts to be accessed when this connection is alive.
|
||||
hostsToRoute: null,
|
||||
|
||||
// cache of the networkInterface acquired during this connection.
|
||||
networkInterface: null,
|
||||
|
||||
connectTimer: null,
|
||||
|
||||
disconnectTimer: null,
|
||||
|
@ -274,9 +287,29 @@ MmsConnection.prototype = {
|
|||
*/
|
||||
onDisconnectTimerTimeout: function() {
|
||||
if (DEBUG) debug("onDisconnectTimerTimeout: deactivate the MMS data call.");
|
||||
if (this.connected) {
|
||||
this.radioInterface.deactivateDataCallByType("mms");
|
||||
|
||||
if (!this.connected) {
|
||||
return;
|
||||
}
|
||||
|
||||
let deactivateMmsDataCall = (aError) => {
|
||||
if (aError) debug("Failed to removeHostRoute: " + aError);
|
||||
|
||||
// Clear cache.
|
||||
this.hostsToRoute = [];
|
||||
this.networkInterface = null;
|
||||
|
||||
this.radioInterface.deactivateDataCallByType("mms");
|
||||
};
|
||||
|
||||
let promises =
|
||||
this.hostsToRoute.map(function(aHost) {
|
||||
return gNetworkManager.removeHostRoute(this.networkInterface, aHost);
|
||||
}, this);
|
||||
|
||||
return Promise.all(promises)
|
||||
.then(() => deactivateMmsDataCall(),
|
||||
(aError) => deactivateMmsDataCall(aError));
|
||||
},
|
||||
|
||||
init: function() {
|
||||
|
@ -393,6 +426,10 @@ MmsConnection.prototype = {
|
|||
if (DEBUG) debug("acquire: buffer the MMS request and setup the MMS data call.");
|
||||
this.radioInterface.setupDataCallByType("mms");
|
||||
|
||||
// Clear cache when setup new connection.
|
||||
this.hostsToRoute = [];
|
||||
this.networkInterface = null;
|
||||
|
||||
// Set a timer to clear the buffered MMS requests if the
|
||||
// MMS network fails to be connected within a time period.
|
||||
this.connectTimer.
|
||||
|
@ -429,6 +466,34 @@ MmsConnection.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper to ensure the routing of each transaction.
|
||||
*
|
||||
* @param url
|
||||
* Optional url for retrieving mms.
|
||||
*
|
||||
* @return a Promise resolved if added or rejected, otherwise.
|
||||
*/
|
||||
ensureRouting: function(url) {
|
||||
let host = this.mmsProxy;
|
||||
|
||||
if (!this.mmsProxy) {
|
||||
host = url;
|
||||
}
|
||||
|
||||
try {
|
||||
let uri = Services.io.newURI(host, null, null);
|
||||
host = uri.host;
|
||||
} catch (e) {}
|
||||
|
||||
return gNetworkManager.addHostRoute(this.networkInterface, host)
|
||||
.then(() => {
|
||||
if (this.hostsToRoute.indexOf(host) < 0) {
|
||||
this.hostsToRoute.push(host);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
shutdown: function() {
|
||||
Services.obs.removeObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
|
||||
Services.obs.removeObserver(this, kNetworkConnStateChangedTopic);
|
||||
|
@ -467,6 +532,8 @@ MmsConnection.prototype = {
|
|||
|
||||
this.connected = connected;
|
||||
if (!this.connected) {
|
||||
this.hostsToRoute = [];
|
||||
this.networkInterface = null;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -474,10 +541,13 @@ MmsConnection.prototype = {
|
|||
// which is going to be used for the HTTP requests later.
|
||||
this.setApnSetting(network);
|
||||
|
||||
// Cache connected network.
|
||||
this.networkInterface = network;
|
||||
|
||||
if (DEBUG) debug("Got the MMS network connected! Resend the buffered " +
|
||||
"MMS requests: number: " + this.pendingCallbacks.length);
|
||||
this.connectTimer.cancel();
|
||||
this.flushPendingCallbacks(_HTTP_STATUS_ACQUIRE_CONNECTION_SUCCESS)
|
||||
this.flushPendingCallbacks(_HTTP_STATUS_ACQUIRE_CONNECTION_SUCCESS);
|
||||
break;
|
||||
}
|
||||
case NS_XPCOM_SHUTDOWN_OBSERVER_ID: {
|
||||
|
@ -646,13 +716,23 @@ XPCOMUtils.defineLazyGetter(this, "gMmsTransactionHelper", function() {
|
|||
url = mmsConnection.mmsc;
|
||||
}
|
||||
|
||||
if (DEBUG) debug("sendRequest: register proxy filter to " + url);
|
||||
let proxyFilter = new MmsProxyFilter(mmsConnection, url);
|
||||
gpps.registerFilter(proxyFilter, 0);
|
||||
let startTransaction = function () {
|
||||
if (DEBUG) debug("sendRequest: register proxy filter to " + url);
|
||||
let proxyFilter = new MmsProxyFilter(mmsConnection, url);
|
||||
gpps.registerFilter(proxyFilter, 0);
|
||||
|
||||
cancellable.xhr = this.sendHttpRequest(mmsConnection, method,
|
||||
url, istream, proxyFilter,
|
||||
cancellable.done.bind(cancellable));
|
||||
cancellable.xhr = this.sendHttpRequest(mmsConnection, method,
|
||||
url, istream, proxyFilter,
|
||||
cancellable.done.bind(cancellable));
|
||||
}.bind(this);
|
||||
|
||||
mmsConnection.ensureRouting(url)
|
||||
.then(() => startTransaction(),
|
||||
(aError) => {
|
||||
debug("Failed to ensureRouting: " + aError);
|
||||
|
||||
cancellable.done(_HTTP_STATUS_FAILED_TO_ROUTE);
|
||||
});
|
||||
}).bind(this));
|
||||
|
||||
return cancellable;
|
||||
|
@ -817,6 +897,8 @@ XPCOMUtils.defineLazyGetter(this, "gMmsTransactionHelper", function() {
|
|||
return _MMS_ERROR_RADIO_DISABLED;
|
||||
case _HTTP_STATUS_NO_SIM_CARD:
|
||||
return _MMS_ERROR_NO_SIM_CARD;
|
||||
case _HTTP_STATUS_FAILED_TO_ROUTE:
|
||||
return _MMS_ERROR_FAILED_TO_ROUTE;
|
||||
case HTTP_STATUS_OK:
|
||||
return MMS.MMS_PDU_ERROR_OK;
|
||||
default:
|
||||
|
|
|
@ -263,8 +263,8 @@ NfcMessageHandler::InitializeNotification(const Parcel& aParcel, EventOptions& a
|
|||
aOptions.mMajorVersion = aParcel.readInt32();
|
||||
aOptions.mMinorVersion = aParcel.readInt32();
|
||||
|
||||
if (aOptions.mMajorVersion != NFCD_MAJOR_VERSION &&
|
||||
aOptions.mMinorVersion != NFCD_MAJOR_VERSION) {
|
||||
if (aOptions.mMajorVersion != NFCD_MAJOR_VERSION ||
|
||||
aOptions.mMinorVersion != NFCD_MINOR_VERSION) {
|
||||
CHROMIUM_LOG("NFCD version mismatched. majorVersion: %d, minorVersion: %d",
|
||||
aOptions.mMajorVersion, aOptions.mMinorVersion);
|
||||
}
|
||||
|
|
|
@ -22,39 +22,6 @@ this.DEBUG_ALL = false;
|
|||
this.DEBUG_CONTENT_HELPER = false || DEBUG_ALL;
|
||||
this.DEBUG_NFC = false || DEBUG_ALL;
|
||||
|
||||
// Current version
|
||||
this.NFC_MAJOR_VERSION = 1;
|
||||
this.NFC_MINOR_VERSION = 7;
|
||||
|
||||
this.NFC_REQUEST_CONFIG = 0;
|
||||
this.NFC_REQUEST_CONNECT = 1;
|
||||
this.NFC_REQUEST_CLOSE = 2;
|
||||
this.NFC_REQUEST_GET_DETAILS = 3;
|
||||
this.NFC_REQUEST_READ_NDEF = 4;
|
||||
this.NFC_REQUEST_WRITE_NDEF = 5;
|
||||
this.NFC_REQUEST_MAKE_NDEF_READ_ONLY = 6;
|
||||
|
||||
this.NFC_RESPONSE_GENERAL = 1000;
|
||||
this.NFC_RESPONSE_CONFIG = 1001;
|
||||
this.NFC_RESPONSE_READ_NDEF_DETAILS = 1002;
|
||||
this.NFC_RESPONSE_READ_NDEF = 1003;
|
||||
|
||||
this.NFC_NOTIFICATION_INITIALIZED = 2000;
|
||||
this.NFC_NOTIFICATION_TECH_DISCOVERED = 2001;
|
||||
this.NFC_NOTIFICATION_TECH_LOST = 2002;
|
||||
|
||||
this.NFC_TECHS = {
|
||||
0:"NDEF",
|
||||
1:"NDEF_WRITEABLE",
|
||||
2:"NDEF_FORMATABLE",
|
||||
3:"P2P",
|
||||
4:"NFC_A",
|
||||
5:"NFC_B",
|
||||
6:"NFC_F",
|
||||
7:"NFC_V",
|
||||
8:"NFC_ISO_DEP"
|
||||
};
|
||||
|
||||
// nfcd error codes
|
||||
this.NFC_SUCCESS = 0;
|
||||
this.NFC_ERROR_IO = -1;
|
||||
|
|
|
@ -340,12 +340,6 @@ NetworkManager.prototype = {
|
|||
gNetworkService.removeDefaultRoute(network);
|
||||
this.setAndConfigureActive();
|
||||
#ifdef MOZ_B2G_RIL
|
||||
// Resolve and add extra host route. For example, mms proxy or mmsc.
|
||||
// IMPORTANT: The offline state of DNSService will be set implicitly in
|
||||
// setAndConfigureActive() by modifying Services.io.offline.
|
||||
// Always setExtraHostRoute() after setAndConfigureActive().
|
||||
this.setExtraHostRoute(network);
|
||||
|
||||
// Update data connection when Wifi connected/disconnected
|
||||
if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) {
|
||||
for (let i = 0; i < this.mRil.numRadioInterfaces; i++) {
|
||||
|
@ -366,8 +360,7 @@ NetworkManager.prototype = {
|
|||
if (this.isNetworkTypeMobile(network.type)) {
|
||||
this.removeHostRoutes(network);
|
||||
}
|
||||
// Remove extra host route. For example, mms proxy or mmsc.
|
||||
this.removeExtraHostRoute(network);
|
||||
|
||||
// Remove secondary default route for dun.
|
||||
if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_DUN) {
|
||||
this.removeSecondaryDefaultRoute(network);
|
||||
|
@ -455,6 +448,56 @@ NetworkManager.prototype = {
|
|||
this.setAndConfigureActive();
|
||||
},
|
||||
|
||||
_updateRoutes: function(doAdd, ipAddresses, networkName, gateways) {
|
||||
let promises = [];
|
||||
|
||||
ipAddresses.forEach((aIpAddress) => {
|
||||
let gateway = this.selectGateway(gateways, aIpAddress);
|
||||
if (gateway) {
|
||||
promises.push((doAdd)
|
||||
? gNetworkService.addHostRoute(networkName, gateway, aIpAddress)
|
||||
: gNetworkService.removeHostRoute(networkName, gateway, aIpAddress));
|
||||
}
|
||||
});
|
||||
|
||||
return Promise.all(promises);
|
||||
},
|
||||
|
||||
isValidatedNetwork: function(network) {
|
||||
let isValid = false;
|
||||
try {
|
||||
isValid = (this.getNetworkId(network) in this.networkInterfaces);
|
||||
} catch (e) {
|
||||
debug("Invalid network interface: " + e);
|
||||
}
|
||||
|
||||
return isValid;
|
||||
},
|
||||
|
||||
addHostRoute: function(network, host) {
|
||||
if (!this.isValidatedNetwork(network)) {
|
||||
return Promise.reject("Invalid network interface.");
|
||||
}
|
||||
|
||||
return this.resolveHostname(host)
|
||||
.then((ipAddresses) => this._updateRoutes(true,
|
||||
ipAddresses,
|
||||
network.name,
|
||||
network.getGateways()));
|
||||
},
|
||||
|
||||
removeHostRoute: function(network, host) {
|
||||
if (!this.isValidatedNetwork(network)) {
|
||||
return Promise.reject("Invalid network interface.");
|
||||
}
|
||||
|
||||
return this.resolveHostname(host)
|
||||
.then((ipAddresses) => this._updateRoutes(false,
|
||||
ipAddresses,
|
||||
network.name,
|
||||
network.getGateways()));
|
||||
},
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
isNetworkTypeSecondaryMobile: function(type) {
|
||||
return (type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS ||
|
||||
|
@ -470,35 +513,16 @@ NetworkManager.prototype = {
|
|||
|
||||
setHostRoutes: function(network) {
|
||||
let hosts = network.getDnses().concat(network.httpProxyHost);
|
||||
let gateways = network.getGateways();
|
||||
let promises = [];
|
||||
|
||||
for (let i = 0; i < hosts.length; i++) {
|
||||
let host = hosts[i];
|
||||
let gateway = this.selectGateway(gateways, host);
|
||||
if (gateway && host) {
|
||||
promises.push(gNetworkService.addHostRoute(network.name, gateway, host));
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.all(promises);
|
||||
return this._updateRoutes(true, hosts, network.name, network.getGateways());
|
||||
},
|
||||
|
||||
removeHostRoutes: function(network) {
|
||||
let hosts = network.getDnses().concat(network.httpProxyHost);
|
||||
let gateways = network.getGateways();
|
||||
let promises = [];
|
||||
|
||||
for (let i = 0; i < hosts.length; i++) {
|
||||
let host = hosts[i];
|
||||
let gateway = this.selectGateway(gateways, host);
|
||||
if (gateway && host) {
|
||||
promises.push(gNetworkService.removeHostRoute(network.name, gateway, host));
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.all(promises);
|
||||
return this._updateRoutes(false, hosts, network.name, network.getGateways());
|
||||
},
|
||||
#endif
|
||||
|
||||
selectGateway: function(gateways, host) {
|
||||
for (let i = 0; i < gateways.length; i++) {
|
||||
|
@ -511,88 +535,7 @@ NetworkManager.prototype = {
|
|||
return null;
|
||||
},
|
||||
|
||||
setExtraHostRoute: function(network) {
|
||||
if (network.type != Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (!(network instanceof Ci.nsIRilNetworkInterface)) {
|
||||
let errorMsg = "Network for MMS must be an instance of " +
|
||||
"nsIRilNetworkInterface";
|
||||
debug(errorMsg);
|
||||
return Promise.reject(errorMsg);
|
||||
}
|
||||
|
||||
network = network.QueryInterface(Ci.nsIRilNetworkInterface);
|
||||
|
||||
debug("Adding mmsproxy and/or mmsc route for " + network.name);
|
||||
|
||||
let hostToResolve = network.mmsProxy;
|
||||
// Workaround an xpconnect issue with undefined string objects.
|
||||
// See bug 808220
|
||||
if (!hostToResolve || hostToResolve === "undefined") {
|
||||
hostToResolve = network.mmsc;
|
||||
}
|
||||
|
||||
let mmsHosts = this.resolveHostname([hostToResolve]);
|
||||
if (mmsHosts.length == 0) {
|
||||
let errorMsg = "No valid hostnames can be added. Stop adding host route.";
|
||||
debug(errorMsg);
|
||||
return Promise.reject(errorMsg);
|
||||
}
|
||||
|
||||
let gateways = network.getGateways();
|
||||
let promises = [];
|
||||
for (let i = 0; i < mmsHosts.length; i++) {
|
||||
let gateway = this.selectGateway(gateways, mmsHosts[i]);
|
||||
if (gateway) {
|
||||
promises.push(gNetworkService.addHostRoute(network.name, gateway,
|
||||
mmsHosts[i]));
|
||||
}
|
||||
}
|
||||
return Promise.all(promises);
|
||||
},
|
||||
|
||||
removeExtraHostRoute: function(network) {
|
||||
if (network.type != Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (!(network instanceof Ci.nsIRilNetworkInterface)) {
|
||||
let errorMsg = "Network for MMS must be an instance of " +
|
||||
"nsIRilNetworkInterface";
|
||||
debug(errorMsg);
|
||||
return Promise.reject(errorMsg);
|
||||
}
|
||||
|
||||
network = network.QueryInterface(Ci.nsIRilNetworkInterface);
|
||||
|
||||
debug("Removing mmsproxy and/or mmsc route for " + network.name);
|
||||
|
||||
let hostToResolve = network.mmsProxy;
|
||||
// Workaround an xpconnect issue with undefined string objects.
|
||||
// See bug 808220
|
||||
if (!hostToResolve || hostToResolve === "undefined") {
|
||||
hostToResolve = network.mmsc;
|
||||
}
|
||||
|
||||
let mmsHosts = this.resolveHostname([hostToResolve]);
|
||||
if (mmsHosts.length == 0) {
|
||||
let errorMsg = "No valid hostnames can be removed. Stop removing host route.";
|
||||
debug(errorMsg);
|
||||
return Promise.reject(errorMsg);
|
||||
}
|
||||
|
||||
let gateways = network.getGateways();
|
||||
let promises = [];
|
||||
for (let i = 0; i < mmsHosts.length; i++) {
|
||||
let gateway = this.selectGateway(gateways, mmsHosts[i]);
|
||||
if (gateway) {
|
||||
promises.push(gNetworkService.removeHostRoute(network.name, gateway,
|
||||
mmsHosts[i]));
|
||||
}
|
||||
}
|
||||
return Promise.all(promises);
|
||||
},
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
setSecondaryDefaultRoute: function(network) {
|
||||
let gateways = network.getGateways();
|
||||
for (let i = 0; i < gateways.length; i++) {
|
||||
|
@ -713,43 +656,46 @@ NetworkManager.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
resolveHostname: function(hosts) {
|
||||
let retval = [];
|
||||
|
||||
for (let hostname of hosts) {
|
||||
// Sanity check for null, undefined and empty string... etc.
|
||||
if (!hostname) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
let uri = Services.io.newURI(hostname, null, null);
|
||||
hostname = uri.host;
|
||||
} catch (e) {}
|
||||
|
||||
// An extra check for hostnames that cannot be made by newURI(...).
|
||||
// For example, an IP address like "10.1.1.1".
|
||||
if (hostname.match(this.REGEXP_IPV4) ||
|
||||
hostname.match(this.REGEXP_IPV6)) {
|
||||
retval.push(hostname);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
let hostnameIps = gDNSService.resolve(hostname, 0);
|
||||
while (hostnameIps.hasMore()) {
|
||||
retval.push(hostnameIps.getNextAddrAsString());
|
||||
debug("Found IP at: " + JSON.stringify(retval));
|
||||
}
|
||||
} catch (e) {
|
||||
debug("Failed to resolve '" + hostname + "', exception: " + e);
|
||||
}
|
||||
resolveHostname: function(hostname) {
|
||||
// Sanity check for null, undefined and empty string... etc.
|
||||
if (!hostname) {
|
||||
return Promise.reject(new Error("hostname is empty: " + hostname));
|
||||
}
|
||||
|
||||
return retval;
|
||||
if (hostname.match(this.REGEXP_IPV4) ||
|
||||
hostname.match(this.REGEXP_IPV6)) {
|
||||
return Promise.resolve([hostname]);
|
||||
}
|
||||
|
||||
let deferred = Promise.defer();
|
||||
let onLookupComplete = (aRequest, aRecord, aStatus) => {
|
||||
if (!Components.isSuccessCode(aStatus)) {
|
||||
deferred.reject(new Error(
|
||||
"Failed to resolve '" + hostname + "', with status: " + aStatus));
|
||||
return;
|
||||
}
|
||||
|
||||
let retval = [];
|
||||
while (aRecord.hasMore()) {
|
||||
retval.push(aRecord.getNextAddrAsString());
|
||||
}
|
||||
|
||||
if (!retval.length) {
|
||||
deferred.reject(new Error("No valid address after DNS lookup!"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (DEBUG) debug("hostname is resolved: " + hostname);
|
||||
if (DEBUG) debug("Addresses: " + JSON.stringify(retval));
|
||||
|
||||
deferred.resolve(retval);
|
||||
};
|
||||
|
||||
// TODO: Bug 992772 - Resolve the hostname with specified networkInterface.
|
||||
gDNSService.asyncResolve(hostname, 0, onLookupComplete, Services.tm.mainThread);
|
||||
|
||||
return deferred.promise;
|
||||
},
|
||||
#endif
|
||||
|
||||
convertConnectionType: function(network) {
|
||||
// If there is internal interface change (e.g., MOBILE_MMS, MOBILE_SUPL),
|
||||
|
|
|
@ -2284,6 +2284,7 @@ RadioInterface.prototype = {
|
|||
break;
|
||||
case "cellbroadcast-received":
|
||||
message.timestamp = Date.now();
|
||||
this.broadcastCbsSystemMessage(message);
|
||||
gMessageManager.sendCellBroadcastMessage("RIL:CellBroadcastReceived",
|
||||
this.clientId, message);
|
||||
break;
|
||||
|
@ -3310,6 +3311,48 @@ RadioInterface.prototype = {
|
|||
|
||||
},
|
||||
|
||||
/**
|
||||
* A helper to broadcast the system message to launch registered apps
|
||||
* like CMAS app and etc.
|
||||
*
|
||||
* @param aName
|
||||
* The system message name.
|
||||
* @param aMessage
|
||||
* The Cellbroadcast message received from ril_worker.
|
||||
*/
|
||||
broadcastCbsSystemMessage: function(aMessage) {
|
||||
// Create system message with the same structure of nsIDOMMozCellBroadcastMessage
|
||||
// and nsIDOMMozCellBroadcastEtwsInfo.
|
||||
let etws = (aMessage.etws != null)
|
||||
? {
|
||||
warningType: (aMessage.etws.warningType != null)
|
||||
? RIL.CB_ETWS_WARNING_TYPE_NAMES[aMessage.etws.warningType]
|
||||
: null,
|
||||
emergencyUserAlert: aMessage.etws.emergencyUserAlert,
|
||||
popup: aMessage.etws.popup
|
||||
}
|
||||
: null;
|
||||
|
||||
let systemMessage = {
|
||||
serviceId: this.clientId,
|
||||
gsmGeographicalScope: RIL.CB_GSM_GEOGRAPHICAL_SCOPE_NAMES[aMessage.geographicalScope],
|
||||
messageCode: aMessage.messageCode,
|
||||
messageId: aMessage.messageId,
|
||||
language: aMessage.language,
|
||||
body: aMessage.fullBody,
|
||||
messageClass: aMessage.messageClass,
|
||||
timestamp: aMessage.timestamp,
|
||||
etws: etws,
|
||||
cdmaServiceCategory: aMessage.serviceCategory
|
||||
};
|
||||
|
||||
if (DEBUG) {
|
||||
this.debug("CBS system message to be broadcasted: " + JSON.stringify(systemMessage));
|
||||
}
|
||||
|
||||
gSystemMessenger.broadcastMessage("cellbroadcast-received", systemMessage);
|
||||
},
|
||||
|
||||
/**
|
||||
* Set the setting value of "time.clock.automatic-update.available".
|
||||
*/
|
||||
|
|
|
@ -97,7 +97,7 @@ interface nsINetworkInterface : nsISupports
|
|||
/**
|
||||
* Manage network interfaces.
|
||||
*/
|
||||
[scriptable, uuid(f3193805-c070-4d23-bd5c-a439eb8610c3)]
|
||||
[scriptable, uuid(19822018-2454-11e4-baa7-2b5894f0af6f)]
|
||||
interface nsINetworkManager : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -196,4 +196,34 @@ interface nsINetworkManager : nsISupports
|
|||
in nsINetworkInterface networkInterface,
|
||||
in jsval config,
|
||||
in nsIWifiTetheringCallback callback);
|
||||
|
||||
/**
|
||||
* Add host route to the specified network into routing table.
|
||||
*
|
||||
* @param network
|
||||
* The network interface where the host to be routed to.
|
||||
* @param host
|
||||
* The host to be added.
|
||||
* The host will be resolved in advance if it's not an ip-address.
|
||||
*
|
||||
* @return a Promise
|
||||
* resolved if added; rejected, otherwise.
|
||||
*/
|
||||
jsval addHostRoute(in nsINetworkInterface network,
|
||||
in DOMString host);
|
||||
|
||||
/**
|
||||
* Remove host route to the specified network from routing table.
|
||||
*
|
||||
* @param network
|
||||
* The network interface where the routing to be removed from.
|
||||
* @param host
|
||||
* The host routed to the network.
|
||||
* The host will be resolved in advance if it's not an ip-address.
|
||||
*
|
||||
* @return a Promise
|
||||
* resolved if removed; rejected, otherwise.
|
||||
*/
|
||||
jsval removeHostRoute(in nsINetworkInterface network,
|
||||
in DOMString host);
|
||||
};
|
||||
|
|
|
@ -2529,78 +2529,106 @@ RilObject.prototype = {
|
|||
return true;
|
||||
},
|
||||
|
||||
_serviceCodeToKeyString: function(serviceCode) {
|
||||
switch (serviceCode) {
|
||||
case MMI_SC_CFU:
|
||||
case MMI_SC_CF_BUSY:
|
||||
case MMI_SC_CF_NO_REPLY:
|
||||
case MMI_SC_CF_NOT_REACHABLE:
|
||||
case MMI_SC_CF_ALL:
|
||||
case MMI_SC_CF_ALL_CONDITIONAL:
|
||||
return MMI_KS_SC_CALL_FORWARDING;
|
||||
case MMI_SC_PIN:
|
||||
return MMI_KS_SC_PIN;
|
||||
case MMI_SC_PIN2:
|
||||
return MMI_KS_SC_PIN2;
|
||||
case MMI_SC_PUK:
|
||||
return MMI_KS_SC_PUK;
|
||||
case MMI_SC_PUK2:
|
||||
return MMI_KS_SC_PUK2;
|
||||
case MMI_SC_IMEI:
|
||||
return MMI_KS_SC_IMEI;
|
||||
case MMI_SC_CLIP:
|
||||
return MMI_KS_SC_CLIP;
|
||||
case MMI_SC_CLIR:
|
||||
return MMI_KS_SC_CLIR;
|
||||
case MMI_SC_BAOC:
|
||||
case MMI_SC_BAOIC:
|
||||
case MMI_SC_BAOICxH:
|
||||
case MMI_SC_BAIC:
|
||||
case MMI_SC_BAICr:
|
||||
case MMI_SC_BA_ALL:
|
||||
case MMI_SC_BA_MO:
|
||||
case MMI_SC_BA_MT:
|
||||
return MMI_KS_SC_CALL_BARRING;
|
||||
case MMI_SC_CALL_WAITING:
|
||||
return MMI_SC_CALL_WAITING;
|
||||
default:
|
||||
return MMI_KS_SC_USSD;
|
||||
}
|
||||
},
|
||||
|
||||
sendMMI: function(options) {
|
||||
if (DEBUG) {
|
||||
this.context.debug("SendMMI " + JSON.stringify(options));
|
||||
}
|
||||
let mmiString = options.mmi;
|
||||
let mmi = this._parseMMI(mmiString);
|
||||
|
||||
let _sendMMIError = (function(errorMsg, mmiServiceCode) {
|
||||
let mmi = this._parseMMI(options.mmi);
|
||||
if (DEBUG) {
|
||||
this.context.debug("MMI " + JSON.stringify(mmi));
|
||||
}
|
||||
|
||||
let _sendMMIError = (function(errorMsg) {
|
||||
options.success = false;
|
||||
options.errorMsg = errorMsg;
|
||||
if (mmiServiceCode) {
|
||||
options.mmiServiceCode = mmiServiceCode;
|
||||
}
|
||||
this.sendChromeMessage(options);
|
||||
}).bind(this);
|
||||
|
||||
function _isValidPINPUKRequest(mmiServiceCode) {
|
||||
// It's neither a valid mmi code nor an ongoing ussd.
|
||||
if (!mmi && !this._ussdSession) {
|
||||
_sendMMIError(MMI_ERROR_KS_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
options.mmiServiceCode = mmi ?
|
||||
this._serviceCodeToKeyString(mmi.serviceCode) : MMI_KS_SC_USSD;
|
||||
|
||||
function _isValidPINPUKRequest() {
|
||||
// The only allowed MMI procedure for ICC PIN, PIN2, PUK and PUK2 handling
|
||||
// is "Registration" (**).
|
||||
if (!mmi.procedure || mmi.procedure != MMI_PROCEDURE_REGISTRATION ) {
|
||||
_sendMMIError(MMI_ERROR_KS_INVALID_ACTION, mmiServiceCode);
|
||||
if (mmi.procedure != MMI_PROCEDURE_REGISTRATION ) {
|
||||
_sendMMIError(MMI_ERROR_KS_INVALID_ACTION);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mmi.sia || !mmi.sia.length || !mmi.sib || !mmi.sib.length ||
|
||||
!mmi.sic || !mmi.sic.length) {
|
||||
_sendMMIError(MMI_ERROR_KS_ERROR, mmiServiceCode);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mmi.sib != mmi.sic) {
|
||||
_sendMMIError(MMI_ERROR_KS_MISMATCH_PIN, mmiServiceCode);
|
||||
if (!mmi.sia || !mmi.sib || !mmi.sic) {
|
||||
_sendMMIError(MMI_ERROR_KS_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mmi.sia.length < 4 || mmi.sia.length > 8 ||
|
||||
mmi.sib.length < 4 || mmi.sib.length > 8 ||
|
||||
mmi.sic.length < 4 || mmi.sic.length > 8) {
|
||||
_sendMMIError(MMI_ERROR_KS_INVALID_PIN, mmiServiceCode);
|
||||
_sendMMIError(MMI_ERROR_KS_INVALID_PIN);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mmi.sib != mmi.sic) {
|
||||
_sendMMIError(MMI_ERROR_KS_MISMATCH_PIN);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
let _isRadioAvailable = (function(mmiServiceCode) {
|
||||
let _isRadioAvailable = (function() {
|
||||
if (this.radioState !== GECKO_RADIOSTATE_READY) {
|
||||
_sendMMIError(GECKO_ERROR_RADIO_NOT_AVAILABLE, mmiServiceCode);
|
||||
_sendMMIError(GECKO_ERROR_RADIO_NOT_AVAILABLE);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}).bind(this);
|
||||
|
||||
// If we couldn't parse the MMI code, we'll send it as an USSD request.
|
||||
if (mmi === null) {
|
||||
if (this._ussdSession) {
|
||||
if (!_isRadioAvailable(MMI_KS_SC_USSD)) {
|
||||
return;
|
||||
}
|
||||
options.ussd = mmiString;
|
||||
this.sendUSSD(options);
|
||||
return;
|
||||
}
|
||||
|
||||
_sendMMIError(MMI_ERROR_KS_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
if (DEBUG) {
|
||||
this.context.debug("MMI " + JSON.stringify(mmi));
|
||||
}
|
||||
|
||||
// We check if the MMI service code is supported and in that case we
|
||||
// trigger the appropriate RIL request if possible.
|
||||
let sc = mmi.serviceCode;
|
||||
|
@ -2612,14 +2640,13 @@ RilObject.prototype = {
|
|||
case MMI_SC_CF_NOT_REACHABLE:
|
||||
case MMI_SC_CF_ALL:
|
||||
case MMI_SC_CF_ALL_CONDITIONAL:
|
||||
if (!_isRadioAvailable(MMI_KS_SC_CALL_FORWARDING)) {
|
||||
if (!_isRadioAvailable()) {
|
||||
return;
|
||||
}
|
||||
// Call forwarding requires at least an action, given by the MMI
|
||||
// procedure, and a reason, given by the MMI service code, but there
|
||||
// is no way that we get this far without a valid procedure or service
|
||||
// code.
|
||||
options.mmiServiceCode = MMI_KS_SC_CALL_FORWARDING;
|
||||
options.action = MMI_PROC_TO_CF_ACTION[mmi.procedure];
|
||||
options.reason = MMI_SC_TO_CF_REASON[sc];
|
||||
options.number = mmi.sia;
|
||||
|
@ -2640,12 +2667,10 @@ RilObject.prototype = {
|
|||
// an MMI code of the form **04*OLD_PIN*NEW_PIN*NEW_PIN#, where old PIN
|
||||
// should be entered as the SIA parameter and the new PIN as SIB and
|
||||
// SIC.
|
||||
if (!_isRadioAvailable(MMI_KS_SC_PIN) ||
|
||||
!_isValidPINPUKRequest(MMI_KS_SC_PIN)) {
|
||||
if (!_isRadioAvailable() || !_isValidPINPUKRequest()) {
|
||||
return;
|
||||
}
|
||||
|
||||
options.mmiServiceCode = MMI_KS_SC_PIN;
|
||||
options.pin = mmi.sia;
|
||||
options.newPin = mmi.sib;
|
||||
this.changeICCPIN(options);
|
||||
|
@ -2657,12 +2682,10 @@ RilObject.prototype = {
|
|||
// enter and MMI code of the form **042*OLD_PIN2*NEW_PIN2*NEW_PIN2#,
|
||||
// where the old PIN2 should be entered as the SIA parameter and the
|
||||
// new PIN2 as SIB and SIC.
|
||||
if (!_isRadioAvailable(MMI_KS_SC_PIN2) ||
|
||||
!_isValidPINPUKRequest(MMI_KS_SC_PIN2)) {
|
||||
if (!_isRadioAvailable() || !_isValidPINPUKRequest()) {
|
||||
return;
|
||||
}
|
||||
|
||||
options.mmiServiceCode = MMI_KS_SC_PIN2;
|
||||
options.pin = mmi.sia;
|
||||
options.newPin = mmi.sib;
|
||||
this.changeICCPIN2(options);
|
||||
|
@ -2674,12 +2697,10 @@ RilObject.prototype = {
|
|||
// enter an MMI code of the form **05*PUK*NEW_PIN*NEW_PIN#, where PUK
|
||||
// should be entered as the SIA parameter and the new PIN as SIB and
|
||||
// SIC.
|
||||
if (!_isRadioAvailable(MMI_KS_SC_PUK) ||
|
||||
!_isValidPINPUKRequest(MMI_KS_SC_PUK)) {
|
||||
if (!_isRadioAvailable() || !_isValidPINPUKRequest()) {
|
||||
return;
|
||||
}
|
||||
|
||||
options.mmiServiceCode = MMI_KS_SC_PUK;
|
||||
options.puk = mmi.sia;
|
||||
options.newPin = mmi.sib;
|
||||
this.enterICCPUK(options);
|
||||
|
@ -2691,12 +2712,10 @@ RilObject.prototype = {
|
|||
// enter an MMI code of the form **052*PUK2*NEW_PIN2*NEW_PIN2#, where
|
||||
// PUK2 should be entered as the SIA parameter and the new PIN2 as SIB
|
||||
// and SIC.
|
||||
if (!_isRadioAvailable(MMI_KS_SC_PUK2) ||
|
||||
!_isValidPINPUKRequest(MMI_KS_SC_PUK2)) {
|
||||
if (!_isRadioAvailable() || !_isValidPINPUKRequest()) {
|
||||
return;
|
||||
}
|
||||
|
||||
options.mmiServiceCode = MMI_KS_SC_PUK2;
|
||||
options.puk = mmi.sia;
|
||||
options.newPin = mmi.sib;
|
||||
this.enterICCPUK2(options);
|
||||
|
@ -2710,7 +2729,6 @@ RilObject.prototype = {
|
|||
return;
|
||||
}
|
||||
// If we already had the device's IMEI, we just send it to chrome.
|
||||
options.mmiServiceCode = MMI_KS_SC_IMEI;
|
||||
options.success = true;
|
||||
options.statusMessage = this.IMEI;
|
||||
this.sendChromeMessage(options);
|
||||
|
@ -2718,12 +2736,11 @@ RilObject.prototype = {
|
|||
|
||||
// CLIP
|
||||
case MMI_SC_CLIP:
|
||||
options.mmiServiceCode = MMI_KS_SC_CLIP;
|
||||
options.procedure = mmi.procedure;
|
||||
if (options.procedure === MMI_PROCEDURE_INTERROGATION) {
|
||||
this.queryCLIP(options);
|
||||
} else {
|
||||
_sendMMIError(MMI_ERROR_KS_NOT_SUPPORTED, MMI_KS_SC_CLIP);
|
||||
_sendMMIError(MMI_ERROR_KS_NOT_SUPPORTED);
|
||||
}
|
||||
return;
|
||||
|
||||
|
@ -2732,7 +2749,6 @@ RilObject.prototype = {
|
|||
// point in the future. In the mean time we handle temporary CLIR MMI
|
||||
// commands through the dial() function. Please see bug 889737.
|
||||
case MMI_SC_CLIR:
|
||||
options.mmiServiceCode = MMI_KS_SC_CLIR;
|
||||
options.procedure = mmi.procedure;
|
||||
switch (options.procedure) {
|
||||
case MMI_PROCEDURE_INTERROGATION:
|
||||
|
@ -2745,7 +2761,7 @@ RilObject.prototype = {
|
|||
options.clirMode = CLIR_SUPPRESSION;
|
||||
break;
|
||||
default:
|
||||
_sendMMIError(MMI_ERROR_KS_NOT_SUPPORTED, MMI_KS_SC_CLIR);
|
||||
_sendMMIError(MMI_ERROR_KS_NOT_SUPPORTED);
|
||||
return;
|
||||
}
|
||||
options.isSetCLIR = true;
|
||||
|
@ -2761,7 +2777,6 @@ RilObject.prototype = {
|
|||
case MMI_SC_BA_ALL:
|
||||
case MMI_SC_BA_MO:
|
||||
case MMI_SC_BA_MT:
|
||||
options.mmiServiceCode = MMI_KS_SC_CALL_BARRING;
|
||||
options.password = mmi.sia || "";
|
||||
options.serviceClass = this._siToServiceClass(mmi.sib);
|
||||
options.facility = MMI_SC_TO_CB_FACILITY[sc];
|
||||
|
@ -2775,7 +2790,7 @@ RilObject.prototype = {
|
|||
} else if (mmi.procedure === MMI_PROCEDURE_DEACTIVATION) {
|
||||
options.enabled = 0;
|
||||
} else {
|
||||
_sendMMIError(MMI_ERROR_KS_NOT_SUPPORTED, MMI_KS_SC_CALL_BARRING);
|
||||
_sendMMIError(MMI_ERROR_KS_NOT_SUPPORTED);
|
||||
return;
|
||||
}
|
||||
this.setICCFacilityLock(options);
|
||||
|
@ -2783,11 +2798,10 @@ RilObject.prototype = {
|
|||
|
||||
// Call waiting
|
||||
case MMI_SC_CALL_WAITING:
|
||||
if (!_isRadioAvailable(MMI_KS_SC_CALL_WAITING)) {
|
||||
if (!_isRadioAvailable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
options.mmiServiceCode = MMI_KS_SC_CALL_WAITING;
|
||||
|
||||
if (mmi.procedure === MMI_PROCEDURE_INTERROGATION) {
|
||||
this._handleQueryMMICallWaiting(options);
|
||||
|
@ -2799,7 +2813,7 @@ RilObject.prototype = {
|
|||
} else if (mmi.procedure === MMI_PROCEDURE_DEACTIVATION) {
|
||||
options.enabled = false;
|
||||
} else {
|
||||
_sendMMIError(MMI_ERROR_KS_NOT_SUPPORTED, MMI_KS_SC_CALL_WAITING);
|
||||
_sendMMIError(MMI_ERROR_KS_NOT_SUPPORTED);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2808,22 +2822,13 @@ RilObject.prototype = {
|
|||
return;
|
||||
}
|
||||
|
||||
// If the MMI code is not a known code and is a recognized USSD request,
|
||||
// it shall still be sent as a USSD request.
|
||||
if (mmi.fullMMI) {
|
||||
if (!_isRadioAvailable(MMI_KS_SC_USSD)) {
|
||||
return;
|
||||
}
|
||||
|
||||
options.ussd = mmi.fullMMI;
|
||||
options.mmiServiceCode = MMI_KS_SC_USSD;
|
||||
this.sendUSSD(options);
|
||||
// If the MMI code is not a known code, it is treated as an ussd.
|
||||
if (!_isRadioAvailable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// At this point, the MMI string is considered as not valid MMI code and
|
||||
// not valid USSD code.
|
||||
_sendMMIError(MMI_ERROR_KS_ERROR);
|
||||
options.ussd = mmi.fullMMI;
|
||||
this.sendUSSD(options);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -2844,7 +2849,6 @@ RilObject.prototype = {
|
|||
* Cancel pending USSD.
|
||||
*/
|
||||
cancelUSSD: function(options) {
|
||||
options.mmiServiceCode = MMI_KS_SC_USSD;
|
||||
this.context.Buf.simpleRequest(REQUEST_CANCEL_USSD, options);
|
||||
},
|
||||
|
||||
|
@ -6056,7 +6060,6 @@ RilObject.prototype[REQUEST_GET_IMEI] = function REQUEST_GET_IMEI(length, option
|
|||
return;
|
||||
}
|
||||
|
||||
options.mmiServiceCode = MMI_KS_SC_IMEI;
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
|
||||
if ((!options.success || this.IMEI == null) && !options.errorMsg) {
|
||||
|
@ -14174,9 +14177,8 @@ SimRecordHelperObject.prototype = {
|
|||
ICCIOHelper.loadNextRecord(options);
|
||||
} else {
|
||||
RIL.iccInfoPrivate.OPL = opl;
|
||||
RIL.overrideICCNetworkName();
|
||||
}
|
||||
|
||||
RIL.overrideICCNetworkName();
|
||||
}
|
||||
|
||||
ICCIOHelper.loadLinearFixedEF({fileId: ICC_EF_OPL,
|
||||
|
@ -14245,9 +14247,8 @@ SimRecordHelperObject.prototype = {
|
|||
}
|
||||
}
|
||||
RIL.iccInfoPrivate.PNN = pnn;
|
||||
RIL.overrideICCNetworkName();
|
||||
}
|
||||
|
||||
RIL.overrideICCNetworkName();
|
||||
}
|
||||
|
||||
let pnn = [];
|
||||
|
|
|
@ -459,6 +459,19 @@ TelephonyService.prototype = {
|
|||
return hasConference ? numCalls + 1 : numCalls;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get arbitrary one of active call.
|
||||
*/
|
||||
_getOneActiveCall: function(aClientId) {
|
||||
for (let index in this._currentCalls[aClientId]) {
|
||||
let call = this._currentCalls[aClientId][index];
|
||||
if (call.state === nsITelephonyService.CALL_STATE_CONNECTED) {
|
||||
return call;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
_addCdmaChildCall: function(aClientId, aNumber, aParentId) {
|
||||
let childCall = {
|
||||
callIndex: CDMA_SECOND_CALL_INDEX,
|
||||
|
@ -509,6 +522,7 @@ TelephonyService.prototype = {
|
|||
});
|
||||
},
|
||||
|
||||
cachedDialRequest: null,
|
||||
isDialing: false,
|
||||
|
||||
dial: function(aClientId, aNumber, aIsDialEmergency, aCallback) {
|
||||
|
@ -563,7 +577,25 @@ TelephonyService.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
this._dialInternal(aClientId, options, aCallback);
|
||||
// Before we dial, we have to hold the active call first.
|
||||
let activeCall = this._getOneActiveCall(aClientId);
|
||||
if (!activeCall) {
|
||||
this._dialInternal(aClientId, options, aCallback);
|
||||
} else {
|
||||
if (DEBUG) debug("There is an active call. Hold it first before dial.");
|
||||
|
||||
this.cachedDialRequest = {
|
||||
clientId: aClientId,
|
||||
options: options,
|
||||
callback: aCallback
|
||||
};
|
||||
|
||||
if (activeCall.isConference) {
|
||||
this.holdConference(aClientId);
|
||||
} else {
|
||||
this.holdCall(aClientId, activeCall.callIndex);
|
||||
}
|
||||
}
|
||||
}, cause => {
|
||||
aCallback.notifyDialError(DIAL_ERROR_BAD_NUMBER);
|
||||
});
|
||||
|
@ -588,7 +620,7 @@ TelephonyService.prototype = {
|
|||
} else {
|
||||
// RIL doesn't hold the 2nd call. We create one by ourselves.
|
||||
aCallback.notifyDialSuccess(CDMA_SECOND_CALL_INDEX, response.number);
|
||||
this._addCdmaChildCall(aClientId, aNumber, currentCdmaCallIndex);
|
||||
this._addCdmaChildCall(aClientId, response.number, currentCdmaCallIndex);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -899,6 +931,15 @@ TelephonyService.prototype = {
|
|||
this._currentCalls[aClientId][aCall.callIndex] = call;
|
||||
}
|
||||
|
||||
// Handle cached dial request.
|
||||
if (this.cachedDialRequest && !this._getOneActiveCall()) {
|
||||
if (DEBUG) debug("All calls held. Perform the cached dial request.");
|
||||
|
||||
let request = this.cachedDialRequest;
|
||||
this._dialInternal(request.clientId, request.options, request.callback);
|
||||
this.cachedDialRequest = null;
|
||||
}
|
||||
|
||||
this._notifyAllListeners("callStateChanged", [aClientId,
|
||||
call.callIndex,
|
||||
call.state,
|
||||
|
|
|
@ -64,3 +64,4 @@ disabled = Bug 821958
|
|||
[test_temporary_clir.js]
|
||||
[test_outgoing_error_state.js]
|
||||
[test_mmi_code.js]
|
||||
[test_outgoing_auto_hold.js]
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
MARIONETTE_TIMEOUT = 60000;
|
||||
MARIONETTE_HEAD_JS = 'head.js';
|
||||
|
||||
function testAutoHoldCall() {
|
||||
let outCall1;
|
||||
let outCall2;
|
||||
|
||||
return gDial("0900000001")
|
||||
.then(call => { outCall1 = call; })
|
||||
.then(() => gRemoteAnswer(outCall1))
|
||||
.then(() => {
|
||||
is(outCall1.state, "connected");
|
||||
})
|
||||
.then(() => gDial("0900000002"))
|
||||
.then(call => { outCall2 = call; })
|
||||
.then(() => {
|
||||
is(outCall1.state, "held");
|
||||
})
|
||||
.then(() => gRemoteHangUpCalls([outCall1, outCall2]));
|
||||
}
|
||||
|
||||
function testAutoHoldConferenceCall() {
|
||||
let subCall1;
|
||||
let subCall2;
|
||||
let outCall;
|
||||
|
||||
return gSetupConference(["0900000001", "0900000002"])
|
||||
.then(calls => {
|
||||
[subCall1, subCall2] = calls;
|
||||
is(conference.state, "connected");
|
||||
})
|
||||
.then(() => gDial("0900000003"))
|
||||
.then(call => { outCall = call; })
|
||||
.then(() => {
|
||||
is(subCall1.state, "held");
|
||||
is(subCall2.state, "held");
|
||||
is(conference.state, "held");
|
||||
})
|
||||
.then(() => gRemoteHangUpCalls([subCall1, subCall2, outCall]));
|
||||
}
|
||||
|
||||
startTest(function() {
|
||||
testAutoHoldCall()
|
||||
.then(() => testAutoHoldConferenceCall())
|
||||
.then(null, () => {
|
||||
ok(false, 'promise rejects during test.');
|
||||
})
|
||||
.then(finish);
|
||||
});
|
|
@ -14,7 +14,7 @@ function runAJAXTest() {
|
|||
function onManifestLoad(manifest) {
|
||||
if (manifest.testcases) {
|
||||
AJAXtests = manifest.testcases;
|
||||
runAJAXTest();
|
||||
runAJAXTest();
|
||||
} else {
|
||||
ok(false, "manifest check", "no manifest!?!");
|
||||
SimpleTest.finish();
|
||||
|
@ -26,5 +26,10 @@ function fetchManifest() {
|
|||
d.addBoth(onManifestLoad);
|
||||
}
|
||||
|
||||
// Double timeout duration. Since this test case takes longer than 300 seconds
|
||||
// on B2G emulator.
|
||||
// See bug 968783.
|
||||
SimpleTest.requestLongerTimeout(2);
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(fetchManifest);
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#include "nsISupportsImpl.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
#include "prprf.h"
|
||||
|
||||
// Undo the damage done by mozzconf.h
|
||||
#undef compress
|
||||
|
||||
|
@ -1124,7 +1126,7 @@ MessageChannel::DispatchSyncMessage(const Message& aMsg)
|
|||
Result rv = mListener->OnMessageReceived(aMsg, reply);
|
||||
mDispatchingSyncMessage = false;
|
||||
|
||||
if (!MaybeHandleError(rv, "DispatchSyncMessage")) {
|
||||
if (!MaybeHandleError(rv, aMsg, "DispatchSyncMessage")) {
|
||||
delete reply;
|
||||
reply = new Message();
|
||||
reply->set_sync();
|
||||
|
@ -1182,7 +1184,7 @@ MessageChannel::DispatchUrgentMessage(const Message& aMsg)
|
|||
mDispatchingUrgentMessageCount--;
|
||||
gDispatchingUrgentMessageCount--;
|
||||
|
||||
if (!MaybeHandleError(rv, "DispatchUrgentMessage")) {
|
||||
if (!MaybeHandleError(rv, aMsg, "DispatchUrgentMessage")) {
|
||||
delete reply;
|
||||
reply = new Message();
|
||||
reply->set_urgent();
|
||||
|
@ -1204,7 +1206,7 @@ MessageChannel::DispatchRPCMessage(const Message& aMsg)
|
|||
|
||||
Message *reply = nullptr;
|
||||
|
||||
if (!MaybeHandleError(mListener->OnCallReceived(aMsg, reply), "DispatchRPCMessage")) {
|
||||
if (!MaybeHandleError(mListener->OnCallReceived(aMsg, reply), aMsg, "DispatchRPCMessage")) {
|
||||
delete reply;
|
||||
reply = new Message();
|
||||
reply->set_rpc();
|
||||
|
@ -1228,7 +1230,7 @@ MessageChannel::DispatchAsyncMessage(const Message& aMsg)
|
|||
NS_RUNTIMEABORT("unhandled special message!");
|
||||
}
|
||||
|
||||
MaybeHandleError(mListener->OnMessageReceived(aMsg), "DispatchAsyncMessage");
|
||||
MaybeHandleError(mListener->OnMessageReceived(aMsg), aMsg, "DispatchAsyncMessage");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1296,7 +1298,7 @@ MessageChannel::DispatchInterruptMessage(const Message& aMsg, size_t stackDepth)
|
|||
Result rv = mListener->OnCallReceived(aMsg, reply);
|
||||
--mRemoteStackDepthGuess;
|
||||
|
||||
if (!MaybeHandleError(rv, "DispatchInterruptMessage")) {
|
||||
if (!MaybeHandleError(rv, aMsg, "DispatchInterruptMessage")) {
|
||||
delete reply;
|
||||
reply = new Message();
|
||||
reply->set_interrupt();
|
||||
|
@ -1556,7 +1558,7 @@ MessageChannel::ReportConnectionError(const char* aChannelName) const
|
|||
}
|
||||
|
||||
bool
|
||||
MessageChannel::MaybeHandleError(Result code, const char* channelName)
|
||||
MessageChannel::MaybeHandleError(Result code, const Message& aMsg, const char* channelName)
|
||||
{
|
||||
if (MsgProcessed == code)
|
||||
return true;
|
||||
|
@ -1587,7 +1589,12 @@ MessageChannel::MaybeHandleError(Result code, const char* channelName)
|
|||
return false;
|
||||
}
|
||||
|
||||
PrintErrorMessage(mSide, channelName, errorMsg);
|
||||
char printedMsg[512];
|
||||
PR_snprintf(printedMsg, sizeof(printedMsg),
|
||||
"(msgtype=0x%lX,name=%s) %s",
|
||||
aMsg.type(), aMsg.name(), errorMsg);
|
||||
|
||||
PrintErrorMessage(mSide, channelName, printedMsg);
|
||||
|
||||
mListener->OnProcessingError(code);
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ class MessageChannel : HasResultCodes
|
|||
void OnNotifyMaybeChannelError();
|
||||
void ReportConnectionError(const char* aChannelName) const;
|
||||
void ReportMessageRouteError(const char* channelName) const;
|
||||
bool MaybeHandleError(Result code, const char* channelName);
|
||||
bool MaybeHandleError(Result code, const Message& aMsg, const char* channelName);
|
||||
|
||||
void Clear();
|
||||
|
||||
|
|
|
@ -3039,6 +3039,7 @@ nsDocumentViewer::SetFullZoom(float aFullZoom)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
bool fullZoomChange = (mPageZoom != aFullZoom);
|
||||
mPageZoom = aFullZoom;
|
||||
|
||||
struct ZoomInfo ZoomInfo = { aFullZoom };
|
||||
|
@ -3052,9 +3053,12 @@ nsDocumentViewer::SetFullZoom(float aFullZoom)
|
|||
// And do the external resources
|
||||
mDocument->EnumerateExternalResources(SetExtResourceFullZoom, &ZoomInfo);
|
||||
|
||||
nsContentUtils::DispatchChromeEvent(mDocument, static_cast<nsIDocument*>(mDocument),
|
||||
NS_LITERAL_STRING("FullZoomChange"),
|
||||
true, true);
|
||||
// Dispatch FullZoomChange event only if fullzoom value really was been changed
|
||||
if (fullZoomChange) {
|
||||
nsContentUtils::DispatchChromeEvent(mDocument, static_cast<nsIDocument*>(mDocument),
|
||||
NS_LITERAL_STRING("FullZoomChange"),
|
||||
true, true);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1161,10 +1161,10 @@ random == 445004-1.html 445004-1-ref.html # bug 472268
|
|||
skip-if(B2G) fails-if(Android) == 446100-1b.html about:blank
|
||||
skip-if(B2G) fails-if(Android) == 446100-1c.html about:blank
|
||||
== 446100-1d.html about:blank
|
||||
skip-if(B2G&&browserIsRemote) == 446100-1e.html about:blank
|
||||
skip-if(B2G&&browserIsRemote) == 446100-1f.html about:blank
|
||||
== 446100-1e.html about:blank
|
||||
== 446100-1f.html about:blank
|
||||
skip-if(B2G) fails-if(Android) == 446100-1g.html about:blank
|
||||
skip-if(B2G&&browserIsRemote) == 446100-1h.html about:blank
|
||||
== 446100-1h.html about:blank
|
||||
skip-if(B2G) == 447749-1.html 447749-1-ref.html
|
||||
fuzzy(127,2) == 448193.html 448193-ref.html
|
||||
!= 449149-1a.html about:blank
|
||||
|
@ -1633,8 +1633,8 @@ fails-if(Android&&AndroidVersion!=10&&AndroidVersion!=17) == 617242-1.html 61724
|
|||
!= 618071.html 618071-notref.html
|
||||
== 619117-1.html 619117-1-ref.html
|
||||
HTTP(..) == 619511-1.html 619511-1-ref.html
|
||||
skip-if(Android||(B2G&&browserIsRemote)) HTTP(..) == 621253-1-externalFilter.html 621253-1-ref.html
|
||||
skip-if(Android||(B2G&&browserIsRemote)) == 621253-1-internalFilter.html 621253-1-ref.html
|
||||
skip-if(Android) HTTP(..) == 621253-1-externalFilter.html 621253-1-ref.html
|
||||
skip-if(Android) == 621253-1-internalFilter.html 621253-1-ref.html
|
||||
HTTP(..) == 621253-2-externalFilter.html 621253-2-ref.html
|
||||
== 621253-2-internalFilter.html 621253-2-ref.html
|
||||
skip-if(B2G) random-if(winWidget) fuzzy-if(OSX==10.8,19,17) == 621918-1.svg 621918-1-ref.svg # 1-pixel diacritic positioning discrepancy in rotated text (may depend on platform fonts)
|
||||
|
|
|
@ -15,10 +15,10 @@ fuzzy-if(Android,4,34) == image-opacity-02.svg image-opacity-02-ref.svg # Bug 77
|
|||
== image-svg-inline-zoom-in-01b.html ../pass.svg
|
||||
== image-svg-inline-zoom-in-01c.html ../pass.svg
|
||||
== image-svg-inline-zoom-in-01d.html ../pass.svg
|
||||
skip-if(B2G&&browserIsRemote) == image-svg-inline-zoom-out-01a.html ../pass.svg
|
||||
skip-if(B2G&&browserIsRemote) == image-svg-inline-zoom-out-01b.html ../pass.svg
|
||||
skip-if(B2G&&browserIsRemote) == image-svg-inline-zoom-out-01c.html ../pass.svg
|
||||
skip-if(B2G&&browserIsRemote) == image-svg-inline-zoom-out-01d.html ../pass.svg
|
||||
== image-svg-inline-zoom-out-01a.html ../pass.svg
|
||||
== image-svg-inline-zoom-out-01b.html ../pass.svg
|
||||
== image-svg-inline-zoom-out-01c.html ../pass.svg
|
||||
== image-svg-inline-zoom-out-01d.html ../pass.svg
|
||||
== image-svg-inline-sprite-zoom-in-01a.html image-svg-inline-sprite-zoom-in-01-ref.html
|
||||
== image-svg-inline-sprite-zoom-in-01b.html image-svg-inline-sprite-zoom-in-01-ref.html
|
||||
== image-svg-inline-sprite-zoom-out-01a.html image-svg-inline-sprite-zoom-out-01-ref.html
|
||||
|
|
Двоичные данные
security/apps/marketplace-dev-reviewers.crt
Двоичные данные
security/apps/marketplace-dev-reviewers.crt
Двоичный файл не отображается.
|
@ -1,43 +0,0 @@
|
|||
#!/bin/bash
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
PYTHON=$1
|
||||
|
||||
if [ -z "${PYTHON}" ]
|
||||
then
|
||||
echo "No python found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VIRTUAL_ENV_VERSION="49f40128a9ca3824ebf253eca408596e135cf893"
|
||||
|
||||
# Check if environment exists, if not, create a virtualenv:
|
||||
if [ -d "marionette_auto_venv" ]
|
||||
then
|
||||
cd marionette_auto_venv
|
||||
. bin/activate
|
||||
else
|
||||
curl -L https://raw.github.com/pypa/virtualenv/${VIRTUAL_ENV_VERSION}/virtualenv.py | ${PYTHON} - marionette_auto_venv
|
||||
cd marionette_auto_venv
|
||||
. bin/activate
|
||||
|
||||
# set up mozbase
|
||||
git clone git://github.com/mozilla/mozbase.git
|
||||
cd mozbase
|
||||
python setup_development.py
|
||||
cd ..
|
||||
|
||||
# set up gitpython
|
||||
easy_install http://pypi.python.org/packages/source/G/GitPython/GitPython-0.3.2.RC1.tar.gz
|
||||
fi
|
||||
|
||||
cd ../..
|
||||
# update the marionette_client
|
||||
python setup.py develop
|
||||
cd marionette
|
||||
|
||||
#pop off the python parameter
|
||||
shift
|
||||
python runtests.py $@
|
Загрузка…
Ссылка в новой задаче