Merge b2g-inbound to m-c a=merge

This commit is contained in:
Wes Kocher 2015-03-02 12:56:08 -08:00
commit 5a567e6952
41 changed files with 358 additions and 205 deletions

View File

@ -123,11 +123,6 @@ SettingsListener.observe('language.current', 'en-US', function(value) {
}
});
});
// Debug flag
SettingsListener.observe('ril.debugging.enabled', false, function(value) {
Services.prefs.setBoolPref('ril.debugging.enabled', value);
});
})();
//=================== DeviceInfo ====================
@ -528,6 +523,7 @@ let settingsToObserve = {
'layers.effect.grayscale': false,
'layers.effect.contrast': "0.0",
'privacy.donottrackheader.enabled': false,
'ril.debugging.enabled': false,
'ril.radio.disabled': false,
'ril.mms.requestReadReport.enabled': {
prefName: 'dom.mms.requestReadReport',

View File

@ -27,4 +27,4 @@ skip-if = toolkit != "gonk"
[test_logshake_gonk.js]
# only run on b2g builds due to requiring b2g-specific log files to exist
skip-if = ((toolkit != "gonk") || ((toolkit == "gonk") && (debug == true))) # bug 1125989: disabled because of race condition in OS.File.makeDir
skip-if = (toolkit != "gonk")

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f34ce82a840ad3c0aed3bfff18517b3f6a0eb37f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c8ed1085a67490a1ecd7f275e5de9487e1b93b1d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

View File

@ -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="f34ce82a840ad3c0aed3bfff18517b3f6a0eb37f"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c8ed1085a67490a1ecd7f275e5de9487e1b93b1d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f34ce82a840ad3c0aed3bfff18517b3f6a0eb37f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c8ed1085a67490a1ecd7f275e5de9487e1b93b1d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a1ddea3133e0807350326cee5dcf0d06fad00c08"/>
@ -135,7 +135,7 @@
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c5f8d282efe4a4e8b1e31a37300944e338e60e4f"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="9f28c4faea3b2f01db227b2467b08aeba96d9bec"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="84395037a7a04546e8ef7cb81572eb516b85562b"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="2eac5a8f931ab1c4aa41be7ac02db8a821df6efc"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
<project name="darwinstreamingserver" path="system/darwinstreamingserver" remote="b2g" revision="cf85968c7f85e0ec36e72c87ceb4837a943b8af6"/>
</manifest>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f34ce82a840ad3c0aed3bfff18517b3f6a0eb37f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c8ed1085a67490a1ecd7f275e5de9487e1b93b1d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="52775e03a2d8532429dff579cb2cd56718e488c3">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f34ce82a840ad3c0aed3bfff18517b3f6a0eb37f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c8ed1085a67490a1ecd7f275e5de9487e1b93b1d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -145,6 +145,7 @@
<!-- external/qemu for emulator-l need to be updated in bug-1121378 -->
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="7639c5c496ffd207bb627f2a59b2c5203ae6fefc"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="16abda2258c9aa1ed78f00bb0a9b2b43b4cb919e"/>
<project name="platform/development" path="development" revision="7ec1ce5e75f943a4a673aa12d8177d5cf2c0a4cf"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="94704df982a90d2ab74bd620d54155d148c415b2"/>
<!-- hardware-ril for emulator-l need to be updated in bug-1113054 -->
<project name="platform/hardware/ril" path="hardware/ril" revision="71dfa8228ad0d6cdf6bac0426ac59404ab74b7f3"/>

View File

@ -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="f34ce82a840ad3c0aed3bfff18517b3f6a0eb37f"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c8ed1085a67490a1ecd7f275e5de9487e1b93b1d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f34ce82a840ad3c0aed3bfff18517b3f6a0eb37f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c8ed1085a67490a1ecd7f275e5de9487e1b93b1d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -146,7 +146,7 @@
<project name="platform/hardware/ril" path="hardware/ril" revision="12b1977cc704b35f2e9db2bb423fa405348bc2f3"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="985bf15264d865fe7b9c5b45f61c451cbaafa43d"/>
<project name="platform/system/core" path="system/core" revision="42839aedcf70bf6bc92a3b7ea4a5cc9bf9aef3f9"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="84395037a7a04546e8ef7cb81572eb516b85562b"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="2eac5a8f931ab1c4aa41be7ac02db8a821df6efc"/>
<project name="platform/system/qcom" path="system/qcom" revision="63e3f6f176caad587d42bba4c16b66d953fb23c2"/>
<project name="platform/vendor/qcom-opensource/wlan/prima" path="vendor/qcom/opensource/wlan/prima" revision="d8952a42771045fca73ec600e2b42a4c7129d723"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4c187c1f3a0dffd8e51a961735474ea703535b99"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f34ce82a840ad3c0aed3bfff18517b3f6a0eb37f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c8ed1085a67490a1ecd7f275e5de9487e1b93b1d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a1ddea3133e0807350326cee5dcf0d06fad00c08"/>
@ -145,7 +145,7 @@
<project name="platform/hardware/ril" path="hardware/ril" revision="c4e2ac95907a5519a0e09f01a0d8e27fec101af0"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="e1eb226fa3ad3874ea7b63c56a9dc7012d7ff3c2"/>
<project name="platform/system/core" path="system/core" revision="adc485d8755af6a61641d197de7cfef667722580"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="84395037a7a04546e8ef7cb81572eb516b85562b"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="2eac5a8f931ab1c4aa41be7ac02db8a821df6efc"/>
<project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4ae5df252123591d5b941191790e7abed1bce5a4"/>
<project name="platform/vendor/qcom-opensource/wlan/prima" path="vendor/qcom/opensource/wlan/prima" revision="ce18b47b4a4f93a581d672bbd5cb6d12fe796ca9"/>

View File

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "f34ce82a840ad3c0aed3bfff18517b3f6a0eb37f",
"git_revision": "c8ed1085a67490a1ecd7f275e5de9487e1b93b1d",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "c00390d70e15726ba3e4c50bd2353fbf991f25c9",
"revision": "45fe49a5560cdaa07920739af65722a63b2de4f9",
"repo_path": "integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f34ce82a840ad3c0aed3bfff18517b3f6a0eb37f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c8ed1085a67490a1ecd7f275e5de9487e1b93b1d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a1ddea3133e0807350326cee5dcf0d06fad00c08"/>
@ -130,7 +130,7 @@
<project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
<project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="84395037a7a04546e8ef7cb81572eb516b85562b"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="2eac5a8f931ab1c4aa41be7ac02db8a821df6efc"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="52775e03a2d8532429dff579cb2cd56718e488c3">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="f34ce82a840ad3c0aed3bfff18517b3f6a0eb37f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c8ed1085a67490a1ecd7f275e5de9487e1b93b1d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -157,5 +157,5 @@
<project name="platform/hardware/qcom/sensors" path="hardware/qcom/sensors" revision="3724fd91ef5183684d97e2bf1d7ff948faabe090"/>
<project name="platform/hardware/qcom/wlan" path="hardware/qcom/wlan" revision="2e54754cc0529d26ccac37ed291600048adbf6c0"/>
<project name="platform/hardware/ril" path="hardware/ril" revision="71dfa8228ad0d6cdf6bac0426ac59404ab74b7f3"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="84395037a7a04546e8ef7cb81572eb516b85562b"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="2eac5a8f931ab1c4aa41be7ac02db8a821df6efc"/>
</manifest>

View File

@ -462,23 +462,28 @@
@BINPATH@/components/CellBroadcastService.manifest
@BINPATH@/components/MmsService.js
@BINPATH@/components/MmsService.manifest
@BINPATH@/components/MobileConnectionService.js
@BINPATH@/components/MobileConnectionService.manifest
@BINPATH@/components/MobileMessageDatabaseService.js
@BINPATH@/components/MobileMessageDatabaseService.manifest
#ifndef DISABLE_MOZ_RIL_GEOLOC
@BINPATH@/components/MobileConnectionService.js
@BINPATH@/components/MobileConnectionService.manifest
@BINPATH@/components/RadioInterfaceLayer.js
@BINPATH@/components/RadioInterfaceLayer.manifest
@BINPATH@/components/RILContentHelper.js
@BINPATH@/components/RILSystemMessengerHelper.js
@BINPATH@/components/RILSystemMessengerHelper.manifest
@BINPATH@/components/SmsService.js
@BINPATH@/components/SmsService.manifest
#endif
@BINPATH@/components/RILContentHelper.js
@BINPATH@/components/RILContentHelper.manifest
@BINPATH@/components/RILSystemMessengerHelper.js
@BINPATH@/components/RILSystemMessengerHelper.manifest
@BINPATH@/components/TelephonyAudioService.js
@BINPATH@/components/TelephonyAudioService.manifest
#ifndef DISABLE_MOZ_RIL_GEOLOC
@BINPATH@/components/TelephonyService.js
@BINPATH@/components/TelephonyService.manifest
@BINPATH@/components/VoicemailService.js
@BINPATH@/components/VoicemailService.manifest
#endif
#endif // MOZ_WIDGET_GONK && MOZ_B2G_RIL
#ifndef MOZ_WIDGET_GONK

View File

@ -7657,6 +7657,18 @@ MOZ_ARG_WITH_STRING(jitreport-granularity,
AC_DEFINE_UNQUOTED(JS_DEFAULT_JITREPORT_GRANULARITY, $JITREPORT_GRANULARITY)
dnl ========================================================
dnl = Disable Mozilla's versions of RIL and Geolocation
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(mozril-geoloc,
[ --disable-mozril-geoloc Disable Mozilla's RIL and geolocation],
DISABLE_MOZ_RIL_GEOLOC=1,
DISABLE_MOZ_RIL_GEOLOC= )
if test -n "$DISABLE_MOZ_RIL_GEOLOC"; then
AC_DEFINE(DISABLE_MOZ_RIL_GEOLOC)
fi
AC_SUBST(DISABLE_MOZ_RIL_GEOLOC)
dnl ========================================================
dnl =
dnl = Misc. Options

View File

@ -196,16 +196,12 @@ BluetoothManager::HandleAdapterRemoved(const BluetoothValue& aValue)
// Remove the adapter of given address from adapters array
nsString addressToRemove = aValue.get_nsString();
uint32_t numAdapters = mAdapters.Length();
for (uint32_t i = 0; i < numAdapters; i++) {
uint32_t i;
for (i = 0; i < mAdapters.Length(); i++) {
nsString address;
mAdapters[i]->GetAddress(address);
if (address.Equals(addressToRemove)) {
mAdapters.RemoveElementAt(i);
if (mDefaultAdapterIndex == (int)i) {
ReselectDefaultAdapter();
}
break;
}
}
@ -214,6 +210,11 @@ BluetoothManager::HandleAdapterRemoved(const BluetoothValue& aValue)
BluetoothAdapterEventInit init;
init.mAddress = addressToRemove;
DispatchAdapterEvent(NS_LITERAL_STRING("adapterremoved"), init);
// Reselect default adapter if it's removed
if (mDefaultAdapterIndex == (int)i) {
ReselectDefaultAdapter();
}
}
void

View File

@ -56,12 +56,12 @@ StringToUuid(const char* aString, BluetoothUuid& aUuid)
uuid4 = htonl(uuid4);
uuid5 = htons(uuid5);
memcpy(&aUuid.mUuid[0], &uuid0, 4);
memcpy(&aUuid.mUuid[4], &uuid1, 2);
memcpy(&aUuid.mUuid[6], &uuid2, 2);
memcpy(&aUuid.mUuid[8], &uuid3, 2);
memcpy(&aUuid.mUuid[10], &uuid4, 4);
memcpy(&aUuid.mUuid[14], &uuid5, 2);
memcpy(&aUuid.mUuid[0], &uuid0, sizeof(uint32_t));
memcpy(&aUuid.mUuid[4], &uuid1, sizeof(uint16_t));
memcpy(&aUuid.mUuid[6], &uuid2, sizeof(uint16_t));
memcpy(&aUuid.mUuid[8], &uuid3, sizeof(uint16_t));
memcpy(&aUuid.mUuid[10], &uuid4, sizeof(uint32_t));
memcpy(&aUuid.mUuid[14], &uuid5, sizeof(uint16_t));
}
bool

View File

@ -28,9 +28,13 @@ XPCOMUtils.defineLazyServiceGetter(this, "gSettingsService",
"@mozilla.org/settingsService;1",
"nsISettingsService");
XPCOMUtils.defineLazyServiceGetter(this, "gRadioInterfaceLayer",
"@mozilla.org/ril;1",
"nsIRadioInterfaceLayer");
XPCOMUtils.defineLazyGetter(this, "gRadioInterfaceLayer", function() {
let ril = { numRadioInterfaces: 0 };
try {
ril = Cc["@mozilla.org/ril;1"].getService(Ci.nsIRadioInterfaceLayer);
} catch(e) {}
return ril;
});
const GONK_CELLBROADCAST_SERVICE_CONTRACTID =
"@mozilla.org/cellbroadcast/gonkservice;1";

View File

@ -18,7 +18,7 @@ UNIFIED_SOURCES += [
'ipc/CellBroadcastParent.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']:
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL'] and not CONFIG['DISABLE_MOZ_RIL_GEOLOC']:
EXTRA_COMPONENTS += [
'gonk/CellBroadcastService.js',
'gonk/CellBroadcastService.manifest',

View File

@ -56,9 +56,13 @@ XPCOMUtils.defineLazyServiceGetter(this, "gNetworkManager",
"@mozilla.org/network/manager;1",
"nsINetworkManager");
XPCOMUtils.defineLazyServiceGetter(this, "gRadioInterfaceLayer",
"@mozilla.org/ril;1",
"nsIRadioInterfaceLayer");
XPCOMUtils.defineLazyGetter(this, "gRadioInterfaceLayer", function() {
let ril = { numRadioInterfaces: 0 };
try {
ril = Cc["@mozilla.org/ril;1"].getService(Ci.nsIRadioInterfaceLayer);
} catch(e) {}
return ril;
});
let DEBUG = RIL.DEBUG_RIL;
function debug(s) {

View File

@ -62,10 +62,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']:
'gonk/nsIGonkMobileConnectionService.idl',
'gonk/nsIMobileConnectionMessenger.idl',
]
EXTRA_COMPONENTS += [
'gonk/MobileConnectionService.js',
'gonk/MobileConnectionService.manifest',
]
if not CONFIG['DISABLE_MOZ_RIL_GEOLOC']:
EXTRA_COMPONENTS += [
'gonk/MobileConnectionService.js',
'gonk/MobileConnectionService.manifest',
]
LOCAL_INCLUDES += [
'/dom/system/gonk',

View File

@ -40,7 +40,10 @@ const DOM_MOBILE_MESSAGE_DELIVERY_ERROR = "error";
const SMS_HANDLED_WAKELOCK_TIMEOUT = 5000;
XPCOMUtils.defineLazyGetter(this, "gRadioInterfaces", function() {
let ril = Cc["@mozilla.org/ril;1"].getService(Ci.nsIRadioInterfaceLayer);
let ril = { numRadioInterfaces: 0 };
try {
ril = Cc["@mozilla.org/ril;1"].getService(Ci.nsIRadioInterfaceLayer);
} catch(e) {}
let interfaces = [];
for (let i = 0; i < ril.numRadioInterfaces; i++) {

View File

@ -35,9 +35,12 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']:
'gonk/MmsService.manifest',
'gonk/MobileMessageDatabaseService.js',
'gonk/MobileMessageDatabaseService.manifest',
'gonk/SmsService.js',
'gonk/SmsService.manifest',
]
if not CONFIG['DISABLE_MOZ_RIL_GEOLOC']:
EXTRA_COMPONENTS += [
'gonk/SmsService.js',
'gonk/SmsService.manifest',
]
EXPORTS.mozilla.dom += [
'DOMMobileMessageError.h',

View File

@ -8,10 +8,10 @@
namespace mozilla {
#define NFCD_MAJOR_VERSION 1
#define NFCD_MINOR_VERSION 20
#define NFCD_MINOR_VERSION 21
enum NfcRequest {
ChangeRFStateReq = 0,
ChangeRFStateReq,
ReadNDEFReq,
WriteNDEFReq,
MakeReadOnlyReq,
@ -20,14 +20,16 @@ enum NfcRequest {
};
enum NfcResponse {
GeneralRsp = 1000,
ChangeRFStateRsp,
ReadNDEFRsp,
TransceiveRsp
WriteNDEFRsp,
MakeReadOnlyRsp,
FormatRsp,
TransceiveRsp,
};
enum NfcNotification {
Initialized = 2000,
Initialized,
TechDiscovered,
TechLost,
HCIEventTransaction,

View File

@ -49,13 +49,10 @@ NfcMessageHandler::Marshall(Parcel& aParcel, const CommandOptions& aOptions)
result = ReadNDEFRequest(aParcel, aOptions);
} else if (!strcmp(type, kWriteNDEFRequest)) {
result = WriteNDEFRequest(aParcel, aOptions);
mPendingReqQueue.AppendElement(NfcRequest::WriteNDEFReq);
} else if (!strcmp(type, kMakeReadOnlyRequest)) {
result = MakeReadOnlyRequest(aParcel, aOptions);
mPendingReqQueue.AppendElement(NfcRequest::MakeReadOnlyReq);
} else if (!strcmp(type, kFormatRequest)) {
result = FormatRequest(aParcel, aOptions);
mPendingReqQueue.AppendElement(NfcRequest::FormatReq);
} else if (!strcmp(type, kTransceiveRequest)) {
result = TransceiveRequest(aParcel, aOptions);
} else {
@ -68,23 +65,46 @@ NfcMessageHandler::Marshall(Parcel& aParcel, const CommandOptions& aOptions)
bool
NfcMessageHandler::Unmarshall(const Parcel& aParcel, EventOptions& aOptions)
{
bool result;
mozilla::unused << htonl(aParcel.readInt32()); // parcel size
int32_t type = aParcel.readInt32();
bool isNotification = type >> 31;
int32_t msgType = type & ~(1 << 31);
switch (type) {
case NfcResponse::GeneralRsp:
result = GeneralResponse(aParcel, aOptions);
break;
return isNotification ? ProcessNotification(msgType, aParcel, aOptions) :
ProcessResponse(msgType, aParcel, aOptions);
}
bool
NfcMessageHandler::ProcessResponse(int32_t aType, const Parcel& aParcel, EventOptions& aOptions)
{
bool result;
switch (aType) {
case NfcResponse::ChangeRFStateRsp:
result = ChangeRFStateResponse(aParcel, aOptions);
break;
case NfcResponse::ReadNDEFRsp:
result = ReadNDEFResponse(aParcel, aOptions);
break;
case NfcResponse::WriteNDEFRsp: // Fall through.
case NfcResponse::MakeReadOnlyRsp:
case NfcResponse::FormatRsp:
result = GeneralResponse(aType, aParcel, aOptions);
break;
case NfcResponse::TransceiveRsp:
result = TransceiveResponse(aParcel, aOptions);
break;
default:
result = false;
}
return result;
}
bool
NfcMessageHandler::ProcessNotification(int32_t aType, const Parcel& aParcel, EventOptions& aOptions)
{
bool result;
switch (aType) {
case NfcNotification::Initialized:
result = InitializeNotification(aParcel, aOptions);
break;
@ -106,25 +126,21 @@ NfcMessageHandler::Unmarshall(const Parcel& aParcel, EventOptions& aOptions)
}
bool
NfcMessageHandler::GeneralResponse(const Parcel& aParcel, EventOptions& aOptions)
NfcMessageHandler::GeneralResponse(const int32_t aResponse, const Parcel& aParcel, EventOptions& aOptions)
{
const char* type;
NS_ENSURE_TRUE(!mPendingReqQueue.IsEmpty(), false);
int pendingReq = mPendingReqQueue[0];
mPendingReqQueue.RemoveElementAt(0);
switch (pendingReq) {
case NfcRequest::WriteNDEFReq:
switch (aResponse) {
case NfcResponse::WriteNDEFRsp:
type = kWriteNDEFResponse;
break;
case NfcRequest::MakeReadOnlyReq:
case NfcResponse::MakeReadOnlyRsp:
type = kMakeReadOnlyResponse;
break;
case NfcRequest::FormatReq:
case NfcResponse::FormatRsp:
type = kFormatResponse;
break;
default:
NMH_LOG("Nfcd, unknown general response %d", pendingReq);
NMH_LOG("Nfcd, unknown general aResponse %d", aResponse);
return false;
}

View File

@ -24,7 +24,8 @@ public:
bool Unmarshall(const android::Parcel& aParcel, EventOptions& aOptions);
private:
bool GeneralResponse(const android::Parcel& aParcel, EventOptions& aOptions);
bool ProcessResponse(int32_t aType, const android::Parcel& aParcel, EventOptions& aOptions);
bool GeneralResponse(int32_t aResponse, const android::Parcel& aParcel, EventOptions& aOptions);
bool ChangeRFStateRequest(android::Parcel& aParcel, const CommandOptions& options);
bool ChangeRFStateResponse(const android::Parcel& aParcel, EventOptions& aOptions);
bool ReadNDEFRequest(android::Parcel& aParcel, const CommandOptions& options);
@ -35,6 +36,7 @@ private:
bool TransceiveRequest(android::Parcel& aParcel, const CommandOptions& options);
bool TransceiveResponse(const android::Parcel& aParcel, EventOptions& aOptions);
bool ProcessNotification(int32_t aType, const android::Parcel& aParcel, EventOptions& aOptions);
bool InitializeNotification(const android::Parcel& aParcel, EventOptions& aOptions);
bool TechDiscoveredNotification(const android::Parcel& aParcel, EventOptions& aOptions);
bool TechLostNotification(const android::Parcel& aParcel, EventOptions& aOptions);
@ -44,7 +46,6 @@ private:
bool WriteNDEFMessage(android::Parcel& aParcel, const CommandOptions& aOptions);
bool ReadTransceiveResponse(const android::Parcel& aParcel, EventOptions& aOptions);
private:
nsTArray<int32_t> mPendingReqQueue;
nsTArray<nsString> mRequestIdQueue;
};

View File

@ -205,7 +205,7 @@ SettingsServiceLock.prototype = {
try {
aCallback && aCallback.handle ? aCallback.handle(aName, aValue) : null;
} catch (e) {
if (DEBUG) debug("settings 'handle' callback threw an exception, dropping: " + e + "\n");
if (DEBUG) debug("settings 'handle' for " + aName + " callback threw an exception, dropping: " + e + "\n");
}
},

View File

@ -73,8 +73,11 @@ XPCOMUtils.defineLazyGetter(this, "gNumRadioInterfaces", function() {
.processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
if (isParentProcess) {
let ril = Cc["@mozilla.org/ril;1"].getService(Ci.nsIRadioInterfaceLayer);
return ril.numRadioInterfaces;
let ril = { numRadioInterfaces: 0 };
try {
ril = Cc["@mozilla.org/ril;1"].getService(Ci.nsIRadioInterfaceLayer);
} catch(e) {}
return ril.numRadioInterfaces
}
return Services.prefs.getIntPref(kPrefRilNumRadioInterfaces);

View File

@ -0,0 +1,18 @@
# Copyright 2012 Mozilla Foundation and Mozilla contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# RILContentHelper.js
component {472816e1-1fd6-4405-996c-806f9ea68174} RILContentHelper.js
contract @mozilla.org/ril/content-helper;1 {472816e1-1fd6-4405-996c-806f9ea68174}
category profile-after-change RILContentHelper @mozilla.org/ril/content-helper;1

View File

@ -16,8 +16,3 @@
component {2d831c8d-6017-435b-a80c-e5d422810cea} RadioInterfaceLayer.js
contract @mozilla.org/ril;1 {2d831c8d-6017-435b-a80c-e5d422810cea}
category profile-after-change RadioInterfaceLayer @mozilla.org/ril;1
# RILContentHelper.js
component {472816e1-1fd6-4405-996c-806f9ea68174} RILContentHelper.js
contract @mozilla.org/ril/content-helper;1 {472816e1-1fd6-4405-996c-806f9ea68174}
category profile-after-change RILContentHelper @mozilla.org/ril/content-helper;1

View File

@ -88,9 +88,8 @@ if CONFIG['MOZ_B2G_RIL']:
'nsIRadioInterfaceLayer.idl',
]
EXTRA_COMPONENTS += [
'RadioInterfaceLayer.js',
'RadioInterfaceLayer.manifest',
'RILContentHelper.js',
'RILContentHelper.manifest',
'RILSystemMessengerHelper.js',
'RILSystemMessengerHelper.manifest',
]
@ -100,6 +99,11 @@ if CONFIG['MOZ_B2G_RIL']:
'ril_worker_buf_object.js',
'RILSystemMessenger.jsm',
]
if not CONFIG['DISABLE_MOZ_RIL_GEOLOC']:
EXTRA_COMPONENTS += [
'RadioInterfaceLayer.js',
'RadioInterfaceLayer.manifest',
]
FAIL_ON_WARNINGS = True

View File

@ -78,18 +78,6 @@ this.DialNumberUtils = {
return new RegExp("^" + fullmmi + optionalDialString + "$");
})(),
_isPoundString: function(aString) {
return aString && aString[aString.length - 1] === "#";
},
_isShortString: function(aString) {
if (!aString || this.isEmergency(aString) || aString.length > 2 ||
(aString.length == 2 && aString[0] === "1")) {
return false;
}
return true;
},
/**
* Check parse the given string as an MMI code.
*
@ -117,12 +105,6 @@ this.DialNumberUtils = {
};
}
if (this._isPoundString(aString) || this._isShortString(aString)) {
return {
fullMMI: aString
};
}
return null;
}
};

View File

@ -11,6 +11,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
/* global RIL */
XPCOMUtils.defineLazyGetter(this, "RIL", function () {
let obj = {};
Cu.import("resource://gre/modules/ril_consts.js", obj);
@ -58,32 +59,43 @@ function debug(s) {
dump("TelephonyService: " + s + "\n");
}
XPCOMUtils.defineLazyServiceGetter(this, "gRadioInterfaceLayer",
"@mozilla.org/ril;1",
"nsIRadioInterfaceLayer");
/* global gRadioInterfaceLayer */
XPCOMUtils.defineLazyGetter(this, "gRadioInterfaceLayer", function() {
let ril = { numRadioInterfaces: 0 };
try {
ril = Cc["@mozilla.org/ril;1"].getService(Ci.nsIRadioInterfaceLayer);
} catch(e) {}
return ril;
});
/* global gPowerManagerService */
XPCOMUtils.defineLazyServiceGetter(this, "gPowerManagerService",
"@mozilla.org/power/powermanagerservice;1",
"nsIPowerManagerService");
/* global gTelephonyMessenger */
XPCOMUtils.defineLazyServiceGetter(this, "gTelephonyMessenger",
"@mozilla.org/ril/system-messenger-helper;1",
"nsITelephonyMessenger");
/* global gAudioService */
XPCOMUtils.defineLazyServiceGetter(this, "gAudioService",
"@mozilla.org/telephony/audio-service;1",
"nsITelephonyAudioService");
/* global gGonkMobileConnectionService */
XPCOMUtils.defineLazyServiceGetter(this, "gGonkMobileConnectionService",
"@mozilla.org/mobileconnection/mobileconnectionservice;1",
"nsIGonkMobileConnectionService");
/* global gPhoneNumberUtils */
XPCOMUtils.defineLazyGetter(this, "gPhoneNumberUtils", function() {
let ns = {};
Cu.import("resource://gre/modules/PhoneNumberUtils.jsm", ns);
return ns.PhoneNumberUtils;
});
/* global gDialNumberUtils */
XPCOMUtils.defineLazyGetter(this, "gDialNumberUtils", function() {
let ns = {};
Cu.import("resource://gre/modules/DialNumberUtils.jsm", ns);
@ -482,6 +494,11 @@ TelephonyService.prototype = {
return null;
},
/**
* Dial number. Perform call setup or SS procedure accordingly.
*
* @see 3GPP TS 22.030 Figure 3.5.3.2
*/
dial: function(aClientId, aNumber, aIsDialEmergency, aCallback) {
if (DEBUG) debug("Dialing " + (aIsDialEmergency ? "emergency " : "") + aNumber);
@ -501,16 +518,21 @@ TelephonyService.prototype = {
let isEmergencyNumber = gDialNumberUtils.isEmergency(aNumber);
// Should be radio on except it's an emergency number.
if (!(this._isRadioOn(aClientId) || isEmergencyNumber)) {
aCallback.notifyError(DIAL_ERROR_RADIO_NOT_AVAILABLE);
// DialEmergency accepts only emergency number.
if (aIsDialEmergency && !isEmergencyNumber) {
if (!this._isRadioOn(aClientId)) {
if (DEBUG) debug("Error: Radio is off. Drop.");
aCallback.notifyError(DIAL_ERROR_RADIO_NOT_AVAILABLE);
return;
}
if (DEBUG) debug("Error: Dial a non-emergency by dialEmergency. Drop.");
aCallback.notifyError(DIAL_ERROR_BAD_NUMBER);
return;
}
// DialEmergency accepts only emergency number.
if (aIsDialEmergency && !isEmergencyNumber) {
if (DEBUG) debug("Error: Dail a non-emergency by dialEmergency. Drop.");
aCallback.notifyError(DIAL_ERROR_BAD_NUMBER);
if (isEmergencyNumber) {
this._dialCall(aClientId, aNumber, undefined, aCallback);
return;
}
@ -520,19 +542,28 @@ TelephonyService.prototype = {
return;
}
if (this._hasCalls(aClientId)) {
this._dialInCallMMI(aClientId, aNumber, aCallback);
return;
}
let mmi = gDialNumberUtils.parseMMI(aNumber);
if (!mmi) {
this._dialCall(aClientId, aNumber, undefined, aCallback);
} else if (this._isTemporaryCLIR(mmi)) {
this._dialCall(aClientId, mmi.dialNumber,
this._procedureToCLIRMode(mmi.procedure), aCallback);
if (mmi) {
if (this._isTemporaryCLIR(mmi)) {
this._dialCall(aClientId, mmi.dialNumber,
this._procedureToCLIRMode(mmi.procedure), aCallback);
} else {
this._dialMMI(aClientId, mmi, aCallback);
}
} else {
this._dialMMI(aClientId, mmi, aCallback);
if (aNumber[aNumber.length - 1] === "#") { // # string
this._dialMMI(aClientId, {fullMMI: aNumber}, aCallback);
} else if (aNumber.length <= 2) { // short string
if (this._hasCalls(aClientId)) {
this._dialInCallMMI(aClientId, aNumber, aCallback);
} else if (aNumber.length === 2 && aNumber[0] === "1") {
this._dialCall(aClientId, aNumber, undefined, aCallback);
} else {
this._dialMMI(aClientId, {fullMMI: aNumber}, aCallback);
}
} else {
this._dialCall(aClientId, aNumber, undefined, aCallback);
}
}
},
@ -590,9 +621,19 @@ TelephonyService.prototype = {
}
let isEmergency = gDialNumberUtils.isEmergency(aNumber);
if (!isEmergency && this._isEmergencyOnly()) {
if (DEBUG) debug("Error: Dail a normal call when emergencyCallsOnly. Drop");
aCallback.notifyError(DIAL_ERROR_BAD_NUMBER);
if (!isEmergency) {
if (!this._isRadioOn(aClientId)) {
if (DEBUG) debug("Error: Dial a normal call when radio off. Drop");
aCallback.notifyError(DIAL_ERROR_RADIO_NOT_AVAILABLE);
return;
}
if (this._isEmergencyOnly()) {
if (DEBUG) debug("Error: Dial a normal call when emergencyCallsOnly. Drop");
aCallback.notifyError(DIAL_ERROR_BAD_NUMBER);
return;
}
}
if (isEmergency) {

View File

@ -25,6 +25,7 @@ qemu = true
[test_incall_mmi_call_hold.js]
[test_incall_mmi_call_waiting.js]
[test_incall_mmi_conference.js]
[test_incall_mmi_imei.js]
[test_incoming_already_connected.js]
[test_incoming_already_held.js]
[test_incoming_answer_hangup_oncallschanged.js]

View File

@ -0,0 +1,38 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = 'head.js';
const number = "0900000001";
let outCall;
function getIMEI() {
log("Test *#06# ...");
return gSendMMI("*#06#").then(aResult => {
ok(aResult.success, "success");
is(aResult.serviceCode, "scImei", "Service code IMEI");
// IMEI is hardcoded as "000000000000000".
// See it here {B2G_HOME}/external/qemu/telephony/android_modem.c
// (The aResult of +CGSN).
is(aResult.statusMessage, "000000000000000", "Emulator IMEI");
is(aResult.additionalInformation, undefined, "No additional information");
});
}
function testInCallMMI_IMEI() {
log('= testInCallMMI_IMEI =');
return gDial(number)
.then(call => outCall = call)
.then(() => gRemoteAnswer(outCall))
.then(() => getIMEI())
.then(() => gRemoteHangUpCalls([outCall]));
}
startTest(function() {
testInCallMMI_IMEI()
.catch(error => ok(false, "Promise reject: " + error))
.then(finish);
});

View File

@ -65,6 +65,7 @@ startTestWithPermissions(['mobileconnection'], function() {
.then(() => testDial_EmergencyNumber())
.then(() => testDialEmergency_NormalNumber())
.then(() => testDialEmergency_EmergencyNumber())
.catch(error => ok(false, "Promise reject: " + error))
.then(() => setRadioEnabledAll(true))
.catch(error => ok(false, "Promise reject: " + error))
.then(finish);

View File

@ -30,44 +30,6 @@ add_test(function test_parseMMI_undefined() {
run_next_test();
});
add_test(function test_parseMMI_one_digit_short_code() {
let mmi = parseMMI("1");
equal(mmi.fullMMI, "1");
equal(mmi.procedure, undefined);
equal(mmi.serviceCode, undefined);
equal(mmi.sia, undefined);
equal(mmi.sib, undefined);
equal(mmi.sic, undefined);
equal(mmi.pwd, undefined);
equal(mmi.dialNumber, undefined);
run_next_test();
});
add_test(function test_parseMMI_invalid_short_code() {
let mmi = parseMMI("11");
equal(mmi, null);
run_next_test();
});
add_test(function test_parseMMI_short_code() {
let mmi = parseMMI("21");
equal(mmi.fullMMI, "21");
equal(mmi.procedure, undefined);
equal(mmi.serviceCode, undefined);
equal(mmi.sia, undefined);
equal(mmi.sib, undefined);
equal(mmi.sic, undefined);
equal(mmi.pwd, undefined);
equal(mmi.dialNumber, undefined);
run_next_test();
});
add_test(function test_parseMMI_dial_string() {
let mmi = parseMMI("12345");
@ -79,14 +41,7 @@ add_test(function test_parseMMI_dial_string() {
add_test(function test_parseMMI_USSD_without_asterisk_prefix() {
let mmi = parseMMI("123#");
equal(mmi.fullMMI, "123#");
equal(mmi.procedure, undefined);
equal(mmi.serviceCode, undefined);
equal(mmi.sia, undefined);
equal(mmi.sib, undefined);
equal(mmi.sic, undefined);
equal(mmi.pwd, undefined);
equal(mmi.dialNumber, undefined);
equal(mmi, null);
run_next_test();
});
@ -109,14 +64,7 @@ add_test(function test_parseMMI_USSD() {
add_test(function test_parseMMI_USSD_with_two_sharps() {
let mmi = parseMMI("*225#4384903113430962#");
equal(mmi.fullMMI, "*225#4384903113430962#");
equal(mmi.procedure, undefined);
equal(mmi.serviceCode, undefined);
equal(mmi.sia, undefined);
equal(mmi.sib, undefined);
equal(mmi.sic, undefined);
equal(mmi.pwd, undefined);
equal(mmi.dialNumber, undefined);
equal(mmi, null);
run_next_test();
});

View File

@ -291,11 +291,13 @@ public:
};
/* The InputReceiver template parameter used in the helper functions below needs
* to be a class that implements a function with the signature:
* to be a class that implements functions with the signatures:
* nsEventStatus ReceiveInputEvent(const InputData& aEvent,
* ScrollableLayerGuid* aGuid,
* uint64_t* aOutInputBlockId);
* The classes that currently implement this are APZCTreeManager and
* void SetAllowedTouchBehavior(uint64_t aInputBlockId,
* const nsTArray<uint32_t>& aBehaviours);
* The classes that currently implement these are APZCTreeManager and
* TestAsyncPanZoomController. Using this template allows us to test individual
* APZC instances in isolation and also an entire APZ tree, while using the same
* code to dispatch input events.
@ -323,6 +325,22 @@ CreatePinchGestureInput(PinchGestureInput::PinchGestureType aType,
return result;
}
template<class InputReceiver> static void
SetDefaultAllowedTouchBehavior(const nsRefPtr<InputReceiver>& aTarget,
uint64_t aInputBlockId,
int touchPoints = 1)
{
nsTArray<uint32_t> defaultBehaviors;
// use the default value where everything is allowed
for (int i = 0; i < touchPoints; i++) {
defaultBehaviors.AppendElement(mozilla::layers::AllowedTouchBehavior::HORIZONTAL_PAN
| mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN
| mozilla::layers::AllowedTouchBehavior::PINCH_ZOOM
| mozilla::layers::AllowedTouchBehavior::DOUBLE_TAP_ZOOM);
}
aTarget->SetAllowedTouchBehavior(aInputBlockId, defaultBehaviors);
}
template<class InputReceiver> static nsEventStatus
TouchDown(const nsRefPtr<InputReceiver>& aTarget, int aX, int aY, int aTime, uint64_t* aOutInputBlockId = nullptr)
{
@ -352,11 +370,25 @@ Tap(const nsRefPtr<InputReceiver>& aTarget, int aX, int aY, int& aTime, int aTap
nsEventStatus (*aOutEventStatuses)[2] = nullptr,
uint64_t* aOutInputBlockId = nullptr)
{
// Even if the caller doesn't care about the block id, we need it to set the
// allowed touch behaviour below, so make sure aOutInputBlockId is non-null.
uint64_t blockId;
if (!aOutInputBlockId) {
aOutInputBlockId = &blockId;
}
nsEventStatus status = TouchDown(aTarget, aX, aY, aTime, aOutInputBlockId);
if (aOutEventStatuses) {
(*aOutEventStatuses)[0] = status;
}
aTime += aTapLength;
// If touch-action is enabled then simulate the allowed touch behaviour
// notification that the main thread is supposed to deliver.
if (gfxPrefs::TouchActionEnabled()) {
SetDefaultAllowedTouchBehavior(aTarget, *aOutInputBlockId);
}
status = TouchUp(aTarget, aX, aY, aTime);
if (aOutEventStatuses) {
(*aOutEventStatuses)[1] = status;
@ -407,8 +439,11 @@ Pan(const nsRefPtr<InputReceiver>& aTarget,
aTime += TIME_BETWEEN_TOUCH_EVENT;
// Allowed touch behaviours must be set after sending touch-start.
if (gfxPrefs::TouchActionEnabled() && aAllowedTouchBehaviors) {
if (aAllowedTouchBehaviors) {
EXPECT_EQ(1UL, aAllowedTouchBehaviors->Length());
aTarget->SetAllowedTouchBehavior(*aOutInputBlockId, *aAllowedTouchBehaviors);
} else if (gfxPrefs::TouchActionEnabled()) {
SetDefaultAllowedTouchBehavior(aTarget, *aOutInputBlockId);
}
status = TouchMove(aTarget, 10, aTouchStartY, aTime);
@ -549,8 +584,11 @@ PinchWithTouchInput(const nsRefPtr<InputReceiver>& aTarget,
(*aOutEventStatuses)[0] = status;
}
if (gfxPrefs::TouchActionEnabled() && aAllowedTouchBehaviors) {
if (aAllowedTouchBehaviors) {
EXPECT_EQ(2UL, aAllowedTouchBehaviors->Length());
aTarget->SetAllowedTouchBehavior(*aOutInputBlockId, *aAllowedTouchBehaviors);
} else if (gfxPrefs::TouchActionEnabled()) {
SetDefaultAllowedTouchBehavior(aTarget, *aOutInputBlockId, 2);
}
MultiTouchInput mtiMove1 = MultiTouchInput(MultiTouchInput::MULTITOUCH_MOVE, 0, TimeStamp(), 0);
@ -689,10 +727,12 @@ public:
};
TEST_F(APZCPinchTester, Pinch_DefaultGestures_NoTouchAction) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
DoPinchTest(true);
}
TEST_F(APZCPinchGestureDetectorTester, Pinch_UseGestureDetector_NoTouchAction) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
DoPinchTest(true);
}
@ -958,6 +998,7 @@ protected:
};
TEST_F(APZCPanningTester, Pan) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
DoPanTest(true, true, mozilla::layers::AllowedTouchBehavior::NONE);
}
@ -1451,6 +1492,7 @@ protected:
};
TEST_F(APZCLongPressTester, LongPress) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
DoLongPressTest(mozilla::layers::AllowedTouchBehavior::NONE);
}
@ -1462,6 +1504,7 @@ TEST_F(APZCLongPressTester, LongPressWithTouchAction) {
}
TEST_F(APZCLongPressTester, LongPressPreventDefault) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
DoLongPressPreventDefaultTest(mozilla::layers::AllowedTouchBehavior::NONE);
}
@ -1486,6 +1529,13 @@ DoubleTap(const nsRefPtr<InputReceiver>& aTarget, int aX, int aY, int& aTime,
(*aOutInputBlockIds)[0] = blockId;
}
aTime += 10;
// If touch-action is enabled then simulate the allowed touch behaviour
// notification that the main thread is supposed to deliver.
if (gfxPrefs::TouchActionEnabled()) {
SetDefaultAllowedTouchBehavior(aTarget, blockId);
}
status = TouchUp(aTarget, aX, aY, aTime);
if (aOutEventStatuses) {
(*aOutEventStatuses)[1] = status;
@ -1499,6 +1549,11 @@ DoubleTap(const nsRefPtr<InputReceiver>& aTarget, int aX, int aY, int& aTime,
(*aOutInputBlockIds)[1] = blockId;
}
aTime += 10;
if (gfxPrefs::TouchActionEnabled()) {
SetDefaultAllowedTouchBehavior(aTarget, blockId);
}
status = TouchUp(aTarget, aX, aY, aTime);
if (aOutEventStatuses) {
(*aOutEventStatuses)[3] = status;
@ -2133,6 +2188,8 @@ TEST_F(APZHitTestingTester, ComplexMultiLayerTree) {
}
TEST_F(APZHitTestingTester, TestRepaintFlushOnNewInputBlock) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
// The main purpose of this test is to verify that touch-start events (or anything
// that starts a new input block) don't ever get untransformed. This should always
// hold because the APZ code should flush repaints when we start a new input block

View File

@ -168,11 +168,6 @@ UnixSocketRawData::Send(int aFd)
// SocketBase
//
SocketBase::~SocketBase()
{
MOZ_ASSERT(mConnectionStatus == SOCKET_DISCONNECTED);
}
SocketConnectionStatus
SocketBase::GetConnectionStatus() const
{
@ -247,6 +242,11 @@ SocketBase::SocketBase()
, mConnectDelayMs(0)
{ }
SocketBase::~SocketBase()
{
MOZ_ASSERT(mConnectionStatus == SOCKET_DISCONNECTED);
}
void
SocketBase::SetConnectionStatus(SocketConnectionStatus aConnectionStatus)
{

View File

@ -211,8 +211,6 @@ class SocketBase
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SocketBase)
virtual ~SocketBase();
SocketConnectionStatus GetConnectionStatus() const;
int GetSuggestedConnectDelayMs() const;
@ -256,6 +254,7 @@ public:
protected:
SocketBase();
virtual ~SocketBase();
void SetConnectionStatus(SocketConnectionStatus aConnectionStatus);

View File

@ -333,9 +333,11 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticFeedback)
#endif
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init)
#ifndef DISABLE_MOZ_RIL_GEOLOC
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsICellBroadcastService,
NS_CreateCellBroadcastService)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsISmsService, NS_CreateSmsService)
#endif
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMmsService, NS_CreateMmsService)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMobileMessageService,
NS_CreateMobileMessageService)
@ -357,8 +359,10 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(GamepadServiceTest,
#endif
#ifdef MOZ_WIDGET_GONK
#ifndef DISABLE_MOZ_RIL_GEOLOC
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIGeolocationProvider,
GonkGPSGeolocationProvider::GetSingleton)
#endif
// Since the nsVolumeService constructor calls into nsIPowerManagerService,
// we need it to be constructed sometime after nsIPowerManagerService.
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsVolumeService,
@ -366,12 +370,14 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsVolumeService,
#endif
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMediaManagerService,
MediaManager::GetInstance)
#ifndef DISABLE_MOZ_RIL_GEOLOC
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMobileConnectionService,
NS_CreateMobileConnectionService)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsITelephonyService,
NS_CreateTelephonyService)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIVoicemailService,
NS_CreateVoicemailService)
#endif
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(FakeTVService,
TVServiceFactory::CreateFakeTVService)
NS_GENERIC_FACTORY_CONSTRUCTOR(TVTunerData)
@ -782,8 +788,16 @@ NS_DEFINE_NAMED_CID(NS_DEVICE_SENSORS_CID);
NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID);
#endif
#endif
#ifndef DISABLE_MOZ_RIL_GEOLOC
NS_DEFINE_NAMED_CID(CELLBROADCAST_SERVICE_CID);
#ifdef MOZ_WIDGET_GONK
NS_DEFINE_NAMED_CID(GONK_GPS_GEOLOCATION_PROVIDER_CID);
#endif
NS_DEFINE_NAMED_CID(TELEPHONY_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_VOICEMAIL_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_MOBILE_CONNECTION_SERVICE_CID);
NS_DEFINE_NAMED_CID(SMS_SERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(MMS_SERVICE_CID);
NS_DEFINE_NAMED_CID(MOBILE_MESSAGE_SERVICE_CID);
NS_DEFINE_NAMED_CID(MOBILE_MESSAGE_DATABASE_SERVICE_CID);
@ -796,9 +810,6 @@ NS_DEFINE_NAMED_CID(TCPSERVERSOCKETCHILD_CID);
NS_DEFINE_NAMED_CID(UDPSOCKETCHILD_CID);
NS_DEFINE_NAMED_CID(NS_TIMESERVICE_CID);
NS_DEFINE_NAMED_CID(NS_MEDIASTREAMCONTROLLERSERVICE_CID);
#ifdef MOZ_WIDGET_GONK
NS_DEFINE_NAMED_CID(GONK_GPS_GEOLOCATION_PROVIDER_CID);
#endif
NS_DEFINE_NAMED_CID(NS_MEDIAMANAGERSERVICE_CID);
#ifdef MOZ_GAMEPAD
NS_DEFINE_NAMED_CID(NS_GAMEPAD_TEST_CID);
@ -811,8 +822,6 @@ NS_DEFINE_NAMED_CID(NS_SYNTHVOICEREGISTRY_CID);
#ifdef ACCESSIBILITY
NS_DEFINE_NAMED_CID(NS_ACCESSIBILITY_SERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(TELEPHONY_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_VOICEMAIL_SERVICE_CID);
NS_DEFINE_NAMED_CID(FAKE_TV_SERVICE_CID);
NS_DEFINE_NAMED_CID(TV_TUNER_DATA_CID);
NS_DEFINE_NAMED_CID(TV_CHANNEL_DATA_CID);
@ -820,8 +829,6 @@ NS_DEFINE_NAMED_CID(TV_PROGRAM_DATA_CID);
NS_DEFINE_NAMED_CID(GECKO_MEDIA_PLUGIN_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_MOBILE_CONNECTION_SERVICE_CID);
NS_DEFINE_NAMED_CID(PRESENTATION_DEVICE_MANAGER_CID);
NS_DEFINE_NAMED_CID(TEXT_INPUT_PROCESSOR_CID);
@ -1081,8 +1088,10 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
#endif
{ &kTHIRDPARTYUTIL_CID, false, nullptr, ThirdPartyUtilConstructor },
{ &kNS_STRUCTUREDCLONECONTAINER_CID, false, nullptr, nsStructuredCloneContainerConstructor },
#ifndef DISABLE_MOZ_RIL_GEOLOC
{ &kCELLBROADCAST_SERVICE_CID, false, nullptr, nsICellBroadcastServiceConstructor },
{ &kSMS_SERVICE_CID, false, nullptr, nsISmsServiceConstructor },
#endif
{ &kMMS_SERVICE_CID, false, nullptr, nsIMmsServiceConstructor },
{ &kMOBILE_MESSAGE_SERVICE_CID, false, nullptr, nsIMobileMessageServiceConstructor },
{ &kMOBILE_MESSAGE_DATABASE_SERVICE_CID, false, nullptr, nsIMobileMessageDatabaseServiceConstructor },
@ -1096,7 +1105,7 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kGECKO_MEDIA_PLUGIN_SERVICE_CID, true, nullptr, GeckoMediaPluginServiceConstructor },
{ &kNS_TIMESERVICE_CID, false, nullptr, nsITimeServiceConstructor },
{ &kNS_MEDIASTREAMCONTROLLERSERVICE_CID, false, nullptr, nsIStreamingProtocolControllerServiceConstructor },
#ifdef MOZ_WIDGET_GONK
#if defined(MOZ_WIDGET_GONK) && !defined(DISABLE_MOZ_RIL_GEOLOC)
{ &kGONK_GPS_GEOLOCATION_PROVIDER_CID, false, nullptr, nsIGeolocationProviderConstructor },
#endif
{ &kNS_MEDIAMANAGERSERVICE_CID, false, nullptr, nsIMediaManagerServiceConstructor },
@ -1106,9 +1115,11 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
#ifdef ACCESSIBILITY
{ &kNS_ACCESSIBILITY_SERVICE_CID, false, nullptr, CreateA11yService },
#endif
#ifndef DISABLE_MOZ_RIL_GEOLOC
{ &kTELEPHONY_SERVICE_CID, false, nullptr, nsITelephonyServiceConstructor },
{ &kNS_MOBILE_CONNECTION_SERVICE_CID, false, NULL, nsIMobileConnectionServiceConstructor },
{ &kNS_VOICEMAIL_SERVICE_CID, false, nullptr, nsIVoicemailServiceConstructor },
#endif
{ &kFAKE_TV_SERVICE_CID, false, nullptr, FakeTVServiceConstructor },
{ &kTV_TUNER_DATA_CID, false, nullptr, TVTunerDataConstructor },
{ &kTV_CHANNEL_DATA_CID, false, nullptr, TVChannelDataConstructor },
@ -1240,8 +1251,10 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
#endif
{ THIRDPARTYUTIL_CONTRACTID, &kTHIRDPARTYUTIL_CID },
{ NS_STRUCTUREDCLONECONTAINER_CONTRACTID, &kNS_STRUCTUREDCLONECONTAINER_CID },
#ifndef DISABLE_MOZ_RIL_GEOLOC
{ CELLBROADCAST_SERVICE_CONTRACTID, &kCELLBROADCAST_SERVICE_CID },
{ SMS_SERVICE_CONTRACTID, &kSMS_SERVICE_CID },
#endif
{ MMS_SERVICE_CONTRACTID, &kMMS_SERVICE_CID },
{ MOBILE_MESSAGE_SERVICE_CONTRACTID, &kMOBILE_MESSAGE_SERVICE_CID },
{ MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID, &kMOBILE_MESSAGE_DATABASE_SERVICE_CID },
@ -1254,7 +1267,7 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ "@mozilla.org/udp-socket-child;1", &kUDPSOCKETCHILD_CID },
{ TIMESERVICE_CONTRACTID, &kNS_TIMESERVICE_CID },
{ MEDIASTREAMCONTROLLERSERVICE_CONTRACTID, &kNS_MEDIASTREAMCONTROLLERSERVICE_CID },
#ifdef MOZ_WIDGET_GONK
#if defined(MOZ_WIDGET_GONK) && !defined(DISABLE_MOZ_RIL_GEOLOC)
{ GONK_GPS_GEOLOCATION_PROVIDER_CONTRACTID, &kGONK_GPS_GEOLOCATION_PROVIDER_CID },
#endif
#ifdef MOZ_GAMEPAD
@ -1265,14 +1278,18 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID },
{ "@mozilla.org/accessibleRetrieval;1", &kNS_ACCESSIBILITY_SERVICE_CID },
#endif
#ifndef DISABLE_MOZ_RIL_GEOLOC
{ TELEPHONY_SERVICE_CONTRACTID, &kTELEPHONY_SERVICE_CID },
#endif
{ FAKE_TV_SERVICE_CONTRACTID, &kFAKE_TV_SERVICE_CID },
{ TV_TUNER_DATA_CONTRACTID, &kTV_TUNER_DATA_CID },
{ TV_CHANNEL_DATA_CONTRACTID, &kTV_CHANNEL_DATA_CID },
{ TV_PROGRAM_DATA_CONTRACTID, &kTV_PROGRAM_DATA_CID },
{ "@mozilla.org/gecko-media-plugin-service;1", &kGECKO_MEDIA_PLUGIN_SERVICE_CID },
#ifndef DISABLE_MOZ_RIL_GEOLOC
{ NS_MOBILE_CONNECTION_SERVICE_CONTRACTID, &kNS_MOBILE_CONNECTION_SERVICE_CID },
{ NS_VOICEMAIL_SERVICE_CONTRACTID, &kNS_VOICEMAIL_SERVICE_CID },
#endif
{ PRESENTATION_DEVICE_MANAGER_CONTRACTID, &kPRESENTATION_DEVICE_MANAGER_CID },
{ "@mozilla.org/text-input-processor;1", &kTEXT_INPUT_PROCESSOR_CID },
{ nullptr }