mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Merge m-c to inbound a=merge CLOSED TREE
This commit is contained in:
commit
33baeda5d3
2
CLOBBER
2
CLOBBER
@ -22,4 +22,4 @@
|
||||
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
|
||||
# don't change CLOBBER for WebIDL changes any more.
|
||||
|
||||
Bug 1146355: Run Bluetooth APIs v1 and v2 with same backend code
|
||||
Bug 1152821: Merge BluetoothCommon.h variants into single 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="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -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="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>
|
||||
|
@ -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="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
|
||||
|
@ -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="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="6b0721ca0e92788df30daf8f7a5fb2863544f9c8">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -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="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>
|
||||
|
@ -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="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -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="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"git": {
|
||||
"git_revision": "c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b",
|
||||
"git_revision": "8e28588496f82f8f069c171c65842d622b9d8d7d",
|
||||
"remote": "https://git.mozilla.org/releases/gaia.git",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "f9a4193e82db33f7717a939b769b0b90975231fe",
|
||||
"revision": "ff36a42838b338d750be214ac110c5cc4369b180",
|
||||
"repo_path": "integration/gaia-central"
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="6b0721ca0e92788df30daf8f7a5fb2863544f9c8">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -1703,9 +1703,9 @@ pref("loop.debug.websocket", false);
|
||||
pref("loop.debug.sdk", false);
|
||||
pref("loop.debug.twoWayMediaTelemetry", false);
|
||||
#ifdef DEBUG
|
||||
pref("loop.CSP", "default-src 'self' about: file: chrome: http://localhost:*; img-src *; font-src 'none'; connect-src wss://*.tokbox.com https://*.opentok.com https://*.tokbox.com wss://*.mozilla.com https://*.mozilla.org wss://*.mozaws.net http://localhost:* ws://localhost:*; media-src blob:");
|
||||
pref("loop.CSP", "default-src 'self' about: file: chrome: http://localhost:*; img-src * data:; font-src 'none'; connect-src wss://*.tokbox.com https://*.opentok.com https://*.tokbox.com wss://*.mozilla.com https://*.mozilla.org wss://*.mozaws.net http://localhost:* ws://localhost:*; media-src blob:");
|
||||
#else
|
||||
pref("loop.CSP", "default-src 'self' about: file: chrome:; img-src *; font-src 'none'; connect-src wss://*.tokbox.com https://*.opentok.com https://*.tokbox.com wss://*.mozilla.com https://*.mozilla.org wss://*.mozaws.net; media-src blob:");
|
||||
pref("loop.CSP", "default-src 'self' about: file: chrome:; img-src * data:; font-src 'none'; connect-src wss://*.tokbox.com https://*.opentok.com https://*.tokbox.com wss://*.mozilla.com https://*.mozilla.org wss://*.mozaws.net; media-src blob:");
|
||||
#endif
|
||||
pref("loop.oauth.google.redirect_uri", "urn:ietf:wg:oauth:2.0:oob:auto");
|
||||
pref("loop.oauth.google.scope", "https://www.google.com/m8/feeds");
|
||||
|
@ -719,11 +719,14 @@ html, .fx-embedded, #main,
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.standalone .media.nested {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.standalone .remote_wrapper {
|
||||
position: relative;
|
||||
width: calc(100% - 10px);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.standalone {
|
||||
@ -976,7 +979,7 @@ body[dir=rtl] .share-service-dropdown .share-panel-header {
|
||||
/* `top` is chosen to vertically position the area near the center
|
||||
of the media element. */
|
||||
top: calc(50% - 140px);
|
||||
left: calc(25% + 62.5px + 10px);
|
||||
left: 25%;
|
||||
z-index: 1000;
|
||||
/* `width` here is specified by the design spec. */
|
||||
width: 250px;
|
||||
@ -1049,7 +1052,7 @@ body[dir=rtl] .share-service-dropdown .share-panel-header {
|
||||
|
||||
.standalone .room-conversation .video_wrapper.remote_wrapper {
|
||||
background-color: #4e4e4e;
|
||||
width: calc(75% - 10px); /* Take the left margin into account. */
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
.standalone .room-conversation .conversation-toolbar {
|
||||
@ -1079,6 +1082,7 @@ body[dir=rtl] .share-service-dropdown .share-panel-header {
|
||||
right: 0;
|
||||
margin: auto;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
}
|
||||
.standalone .room-conversation-wrapper .video-layout-wrapper {
|
||||
/* 50px: header's height; 25px: footer's height */
|
||||
|
@ -23,6 +23,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "ctypes",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
|
||||
"resource://gre/modules/WindowsRegistry.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//// Helpers.
|
||||
|
||||
@ -410,7 +412,7 @@ Cookies.prototype = {
|
||||
aCallback(success);
|
||||
}
|
||||
}).bind(this), false);
|
||||
fileReader.readAsText(File(aFile));
|
||||
fileReader.readAsText(new File(aFile));
|
||||
},
|
||||
|
||||
/**
|
||||
@ -444,6 +446,7 @@ Cookies.prototype = {
|
||||
|
||||
let hostLen = hostpath.indexOf("/");
|
||||
let host = hostpath.substr(0, hostLen);
|
||||
let path = hostpath.substr(hostLen);
|
||||
|
||||
// For a non-null domain, assume it's what Mozilla considers
|
||||
// a domain cookie. See bug 222343.
|
||||
@ -455,7 +458,6 @@ Cookies.prototype = {
|
||||
host = "." + host;
|
||||
}
|
||||
|
||||
let path = hostpath.substr(hostLen);
|
||||
let expireTime = CtypesHelpers.fileTimeToDate(Number(expireTimeHi),
|
||||
Number(expireTimeLo));
|
||||
Services.cookies.add(host,
|
||||
|
@ -346,42 +346,3 @@
|
||||
#close-button:-moz-locale-dir(rtl) {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
|
||||
/* ::::: private browsing indicator ::::: */
|
||||
|
||||
@media (-moz-os-version: windows-vista),
|
||||
(-moz-os-version: windows-win7) {
|
||||
#TabsToolbar > .private-browsing-indicator {
|
||||
background-image: url("chrome://browser/skin/privatebrowsing-mask-tabstrip-XPVista7.png");
|
||||
}
|
||||
|
||||
/* We're intentionally using the titlebar asset here for fullscreen mode.
|
||||
* See bug 1008183.
|
||||
*/
|
||||
#private-browsing-indicator-titlebar > .private-browsing-indicator,
|
||||
#main-window[inFullscreen] #TabsToolbar > .private-browsing-indicator {
|
||||
background-image: url("chrome://browser/skin/privatebrowsing-mask-titlebar-XPVista7.png");
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-windows-glass) {
|
||||
#main-window[sizemode="normal"] > #titlebar > #titlebar-content > #titlebar-buttonbox-container > #private-browsing-indicator-titlebar > .private-browsing-indicator {
|
||||
top: 1px;
|
||||
}
|
||||
#main-window[sizemode="maximized"] > #titlebar > #titlebar-content > #titlebar-buttonbox-container > #private-browsing-indicator-titlebar > .private-browsing-indicator {
|
||||
top: -1px;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This next block targets Aero Basic, which has different positioning for the
|
||||
* window caption buttons, and therefore needs to be special-cased.
|
||||
*/
|
||||
@media (-moz-windows-default-theme) {
|
||||
@media not all and (-moz-windows-compositor) {
|
||||
#main-window[sizemode="normal"] > #titlebar > #titlebar-content > #titlebar-buttonbox-container > #private-browsing-indicator-titlebar > .private-browsing-indicator {
|
||||
background-image: url("chrome://browser/skin/privatebrowsing-mask-titlebar-XPVista7-tall.png");
|
||||
height: 28px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2663,24 +2663,29 @@ chatbox {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@media (-moz-os-version: windows-xp) {
|
||||
@media (-moz-os-version: windows-xp),
|
||||
(-moz-os-version: windows-vista),
|
||||
(-moz-os-version: windows-win7) {
|
||||
#TabsToolbar > .private-browsing-indicator {
|
||||
background-image: url("chrome://browser/skin/privatebrowsing-mask-tabstrip-XPVista7.png");
|
||||
}
|
||||
|
||||
/* We're intentionally using the titlebar asset here for fullscreen mode.
|
||||
* See bug 1008183.
|
||||
*/
|
||||
#private-browsing-indicator-titlebar > .private-browsing-indicator,
|
||||
#main-window[inFullscreen] #TabsToolbar > .private-browsing-indicator {
|
||||
background-image: url("chrome://browser/skin/privatebrowsing-mask-titlebar-XPVista7.png");
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-os-version: windows-xp) {
|
||||
@media not all and (-moz-windows-classic) {
|
||||
#private-browsing-indicator-titlebar > .private-browsing-indicator {
|
||||
background-image: url("chrome://browser/skin/privatebrowsing-mask-titlebar-XPVista7-tall.png");
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
/* We're intentionally using the titlebar asset here for fullscreen mode.
|
||||
* See bug 1008183.
|
||||
*/
|
||||
#main-window[inFullscreen] #TabsToolbar > .private-browsing-indicator {
|
||||
background-image: url("chrome://browser/skin/privatebrowsing-mask-titlebar-XPVista7.png");
|
||||
}
|
||||
|
||||
#main-window[sizemode="maximized"] > #titlebar > #titlebar-content > #titlebar-buttonbox-container > #private-browsing-indicator-titlebar > .private-browsing-indicator {
|
||||
top: -5px;
|
||||
}
|
||||
@ -2691,13 +2696,6 @@ chatbox {
|
||||
}
|
||||
|
||||
@media (-moz-windows-classic) {
|
||||
/* We're intentionally using the titlebar asset here for fullscreen mode.
|
||||
* See bug 1008183.
|
||||
*/
|
||||
#private-browsing-indicator-titlebar > .private-browsing-indicator,
|
||||
#main-window[inFullscreen] #TabsToolbar > .private-browsing-indicator {
|
||||
background-image: url("chrome://browser/skin/privatebrowsing-mask-titlebar-XPVista7.png");
|
||||
}
|
||||
/**
|
||||
* We have to use top instead of background-position in this case, otherwise
|
||||
* the bottom of the indicator would get cut off by the bounds of the
|
||||
@ -2708,6 +2706,31 @@ chatbox {
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-os-version: windows-vista),
|
||||
(-moz-os-version: windows-win7) {
|
||||
@media (-moz-windows-glass) {
|
||||
#main-window[sizemode="normal"] > #titlebar > #titlebar-content > #titlebar-buttonbox-container > #private-browsing-indicator-titlebar > .private-browsing-indicator {
|
||||
top: 1px;
|
||||
}
|
||||
#main-window[sizemode="maximized"] > #titlebar > #titlebar-content > #titlebar-buttonbox-container > #private-browsing-indicator-titlebar > .private-browsing-indicator {
|
||||
top: -1px;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This next block targets Aero Basic, which has different positioning for the
|
||||
* window caption buttons, and therefore needs to be special-cased.
|
||||
*/
|
||||
@media (-moz-windows-default-theme) {
|
||||
@media not all and (-moz-windows-compositor) {
|
||||
#main-window[sizemode="normal"] > #titlebar > #titlebar-content > #titlebar-buttonbox-container > #private-browsing-indicator-titlebar > .private-browsing-indicator {
|
||||
background-image: url("chrome://browser/skin/privatebrowsing-mask-titlebar-XPVista7-tall.png");
|
||||
height: 28px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* End private browsing indicators */
|
||||
|
||||
%include ../shared/UITour.inc.css
|
||||
|
@ -4,9 +4,10 @@
|
||||
* 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/. */
|
||||
|
||||
#ifndef mozilla_dom_bluetooth_bluetoothcommon_h__
|
||||
#define mozilla_dom_bluetooth_bluetoothcommon_h__
|
||||
#ifndef mozilla_dom_bluetooth_bluetoothcommon_h
|
||||
#define mozilla_dom_bluetooth_bluetoothcommon_h
|
||||
|
||||
#include "mozilla/Compiler.h"
|
||||
#include "mozilla/Observer.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsString.h"
|
||||
@ -16,10 +17,16 @@ extern bool gBluetoothDebugFlag;
|
||||
|
||||
#define SWITCH_BT_DEBUG(V) (gBluetoothDebugFlag = V)
|
||||
|
||||
#if MOZ_IS_GCC && MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
|
||||
#if MOZ_IS_GCC
|
||||
# if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
|
||||
/* use designated array initializers if supported */
|
||||
#define INIT_ARRAY_AT(in_, out_) \
|
||||
[in_] = out_
|
||||
# define INIT_ARRAY_AT(in_, out_) \
|
||||
[in_] = out_
|
||||
# else
|
||||
/* otherwise init array element by position */
|
||||
# define INIT_ARRAY_AT(in_, out_) \
|
||||
out_
|
||||
# endif
|
||||
#else
|
||||
/* otherwise init array element by position */
|
||||
#define INIT_ARRAY_AT(in_, out_) \
|
||||
@ -179,6 +186,21 @@ extern bool gBluetoothDebugFlag;
|
||||
#define PAIRING_REQ_TYPE_CONFIRMATION "pairingconfirmationreq"
|
||||
#define PAIRING_REQ_TYPE_CONSENT "pairingconsentreq"
|
||||
|
||||
/**
|
||||
* When the pair status of a Bluetooth device is changed, we'll dispatch an
|
||||
* event.
|
||||
*
|
||||
* TODO: remove with bluetooth1
|
||||
*/
|
||||
#define PAIRED_STATUS_CHANGED_ID "pairedstatuschanged"
|
||||
|
||||
/**
|
||||
* This event would be fired when discovery procedure starts or stops.
|
||||
*
|
||||
* TODO: remove with bluetooth1
|
||||
*/
|
||||
#define DISCOVERY_STATE_CHANGED_ID "discoverystatechanged"
|
||||
|
||||
/**
|
||||
* System message to launch bluetooth app if no pairing listener is ready to
|
||||
* receive pairing requests.
|
||||
@ -503,13 +525,13 @@ enum {
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpMediaAttribute {
|
||||
AVRCP_MEDIA_ATTRIBUTE_TITLE,
|
||||
AVRCP_MEDIA_ATTRIBUTE_ARTIST,
|
||||
AVRCP_MEDIA_ATTRIBUTE_ALBUM,
|
||||
AVRCP_MEDIA_ATTRIBUTE_TRACK_NUM,
|
||||
AVRCP_MEDIA_ATTRIBUTE_NUM_TRACKS,
|
||||
AVRCP_MEDIA_ATTRIBUTE_GENRE,
|
||||
AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME
|
||||
AVRCP_MEDIA_ATTRIBUTE_TITLE = 0x01,
|
||||
AVRCP_MEDIA_ATTRIBUTE_ARTIST = 0x02,
|
||||
AVRCP_MEDIA_ATTRIBUTE_ALBUM = 0x03,
|
||||
AVRCP_MEDIA_ATTRIBUTE_TRACK_NUM = 0x04,
|
||||
AVRCP_MEDIA_ATTRIBUTE_NUM_TRACKS = 0x05,
|
||||
AVRCP_MEDIA_ATTRIBUTE_GENRE = 0x06,
|
||||
AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME = 0x07
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpPlayerAttribute {
|
||||
@ -519,6 +541,19 @@ enum BluetoothAvrcpPlayerAttribute {
|
||||
AVRCP_PLAYER_ATTRIBUTE_SCAN
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpPlayerRepeatValue {
|
||||
AVRCP_PLAYER_VAL_OFF_REPEAT = 0x01,
|
||||
AVRCP_PLAYER_VAL_SINGLE_REPEAT = 0x02,
|
||||
AVRCP_PLAYER_VAL_ALL_REPEAT = 0x03,
|
||||
AVRCP_PLAYER_VAL_GROUP_REPEAT = 0x04
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpPlayerShuffleValue {
|
||||
AVRCP_PLAYER_VAL_OFF_SHUFFLE = 0x01,
|
||||
AVRCP_PLAYER_VAL_ALL_SHUFFLE = 0x02,
|
||||
AVRCP_PLAYER_VAL_GROUP_SHUFFLE = 0x03
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpStatus {
|
||||
AVRCP_STATUS_BAD_COMMAND,
|
||||
AVRCP_STATUS_BAD_PARAMETER,
|
@ -39,24 +39,32 @@ using namespace mozilla::dom;
|
||||
using namespace mozilla::ipc;
|
||||
|
||||
namespace {
|
||||
// Sending system message "bluetooth-opp-update-progress" every 50kb
|
||||
static const uint32_t kUpdateProgressBase = 50 * 1024;
|
||||
// Sending system message "bluetooth-opp-update-progress" every 50kb
|
||||
static const uint32_t kUpdateProgressBase = 50 * 1024;
|
||||
|
||||
/*
|
||||
* The format of the header of an PUT request is
|
||||
* [opcode:1][packet length:2][headerId:1][header length:2]
|
||||
*/
|
||||
static const uint32_t kPutRequestHeaderSize = 6;
|
||||
/*
|
||||
* The format of the header of an PUT request is
|
||||
* [opcode:1][packet length:2][headerId:1][header length:2]
|
||||
*/
|
||||
static const uint32_t kPutRequestHeaderSize = 6;
|
||||
|
||||
/*
|
||||
* The format of the appended header of an PUT request is
|
||||
* [headerId:1][header length:4]
|
||||
* P.S. Length of name header is 4 since unicode is 2 bytes per char.
|
||||
*/
|
||||
static const uint32_t kPutRequestAppendHeaderSize = 5;
|
||||
/*
|
||||
* The format of the appended header of an PUT request is
|
||||
* [headerId:1][header length:4]
|
||||
* P.S. Length of name header is 4 since unicode is 2 bytes per char.
|
||||
*/
|
||||
static const uint32_t kPutRequestAppendHeaderSize = 5;
|
||||
|
||||
StaticRefPtr<BluetoothOppManager> sBluetoothOppManager;
|
||||
static bool sInShutdown = false;
|
||||
// UUID of OBEX Object Push
|
||||
static const BluetoothUuid kObexObjectPush = {
|
||||
{
|
||||
0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
|
||||
0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
|
||||
}
|
||||
};
|
||||
|
||||
StaticRefPtr<BluetoothOppManager> sBluetoothOppManager;
|
||||
static bool sInShutdown = false;
|
||||
}
|
||||
|
||||
BEGIN_BLUETOOTH_NAMESPACE
|
||||
@ -301,7 +309,7 @@ BluetoothOppManager::ConnectInternal(const nsAString& aDeviceAddress)
|
||||
|
||||
mSocket =
|
||||
new BluetoothSocket(this, BluetoothSocketType::RFCOMM, false, true);
|
||||
mSocket->ConnectSocket(aDeviceAddress, -1);
|
||||
mSocket->ConnectSocket(aDeviceAddress, kObexObjectPush, -1);
|
||||
}
|
||||
|
||||
void
|
||||
@ -374,7 +382,9 @@ BluetoothOppManager::Listen()
|
||||
mServerSocket =
|
||||
new BluetoothSocket(this, BluetoothSocketType::RFCOMM, false, true);
|
||||
|
||||
if (!mServerSocket->ListenSocket(BluetoothReservedChannels::CHANNEL_OPUSH)) {
|
||||
if (!mServerSocket->ListenSocket(NS_LITERAL_STRING("OBEX Object Push"),
|
||||
kObexObjectPush,
|
||||
BluetoothReservedChannels::CHANNEL_OPUSH)) {
|
||||
BT_WARNING("[OPP] Can't listen on RFCOMM socket!");
|
||||
mServerSocket = nullptr;
|
||||
return false;
|
||||
|
@ -1976,6 +1976,43 @@ BluetoothServiceBluedroid::UuidToServiceClassInt(const BluetoothUuid& mUuid)
|
||||
memcpy(&shortUuid, mUuid.mUuid + 2, sizeof(uint16_t));
|
||||
return ntohs(shortUuid);
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothServiceBluedroid::IsConnected(const nsAString& aRemoteBdAddr)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
nsString connectedAddress;
|
||||
|
||||
// Check whether HFP/HSP are connected.
|
||||
BluetoothProfileManagerBase* profile;
|
||||
profile = BluetoothHfpManager::Get();
|
||||
if (profile && profile->IsConnected()) {
|
||||
profile->GetAddress(connectedAddress);
|
||||
if (aRemoteBdAddr.Equals(connectedAddress)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check whether OPP is connected.
|
||||
profile = BluetoothOppManager::Get();
|
||||
if (profile->IsConnected()) {
|
||||
profile->GetAddress(connectedAddress);
|
||||
if (aRemoteBdAddr.Equals(connectedAddress)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check whether A2DP is connected.
|
||||
profile = BluetoothA2dpManager::Get();
|
||||
if (profile->IsConnected()) {
|
||||
profile->GetAddress(connectedAddress);
|
||||
if (aRemoteBdAddr.Equals(connectedAddress)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
@ -2485,6 +2522,10 @@ BluetoothServiceBluedroid::RemoteDevicePropertiesNotification(
|
||||
}
|
||||
}
|
||||
|
||||
// BlueDroid wouldn't notify the status of connection, therefore, query the
|
||||
// connection state and append to properties array
|
||||
BT_APPEND_NAMED_VALUE(props, "Connected", IsConnected(aBdAddr));
|
||||
|
||||
if (sRequestedDeviceCountArray.IsEmpty()) {
|
||||
// This is possible because the callback would be called after turning
|
||||
// Bluetooth on.
|
||||
|
@ -505,6 +505,8 @@ protected:
|
||||
const nsAString& aPlayStatus);
|
||||
|
||||
uint16_t UuidToServiceClassInt(const BluetoothUuid& mUuid);
|
||||
|
||||
static bool IsConnected(const nsAString& aRemoteBdAddr);
|
||||
};
|
||||
|
||||
END_BLUETOOTH_NAMESPACE
|
||||
|
@ -22,10 +22,6 @@ using namespace mozilla::ipc;
|
||||
USING_BLUETOOTH_NAMESPACE
|
||||
|
||||
static const size_t MAX_READ_SIZE = 1 << 16;
|
||||
static const uint8_t UUID_OBEX_OBJECT_PUSH[] = {
|
||||
0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
|
||||
0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
|
||||
};
|
||||
static BluetoothSocketInterface* sBluetoothSocketInterface;
|
||||
|
||||
// helper functions
|
||||
@ -559,7 +555,9 @@ private:
|
||||
};
|
||||
|
||||
bool
|
||||
BluetoothSocket::ConnectSocket(const nsAString& aDeviceAddress, int aChannel)
|
||||
BluetoothSocket::ConnectSocket(const nsAString& aDeviceAddress,
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
NS_ENSURE_FALSE(mImpl, false);
|
||||
@ -571,12 +569,11 @@ BluetoothSocket::ConnectSocket(const nsAString& aDeviceAddress, int aChannel)
|
||||
BluetoothSocketResultHandler* res = new ConnectSocketResultHandler(mImpl);
|
||||
SetCurrentResultHandler(res);
|
||||
|
||||
// TODO: uuid as argument
|
||||
sBluetoothSocketInterface->Connect(
|
||||
aDeviceAddress,
|
||||
BluetoothSocketType::RFCOMM,
|
||||
UUID_OBEX_OBJECT_PUSH,
|
||||
aChannel, mEncrypt, mAuth, res);
|
||||
aServiceUuid.mUuid, aChannel,
|
||||
mEncrypt, mAuth, res);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -610,7 +607,9 @@ private:
|
||||
};
|
||||
|
||||
bool
|
||||
BluetoothSocket::ListenSocket(int aChannel)
|
||||
BluetoothSocket::ListenSocket(const nsAString& aServiceName,
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
NS_ENSURE_FALSE(mImpl, false);
|
||||
@ -624,9 +623,8 @@ BluetoothSocket::ListenSocket(int aChannel)
|
||||
|
||||
sBluetoothSocketInterface->Listen(
|
||||
BluetoothSocketType::RFCOMM,
|
||||
NS_LITERAL_STRING("OBEX Object Push"),
|
||||
UUID_OBEX_OBJECT_PUSH,
|
||||
aChannel, mEncrypt, mAuth, res);
|
||||
aServiceName, aServiceUuid.mUuid, aChannel,
|
||||
mEncrypt, mAuth, res);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -24,9 +24,13 @@ public:
|
||||
bool aAuth,
|
||||
bool aEncrypt);
|
||||
|
||||
bool ConnectSocket(const nsAString& aDeviceAddress, int aChannel);
|
||||
bool ConnectSocket(const nsAString& aDeviceAddress,
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel);
|
||||
|
||||
bool ListenSocket(int aChannel);
|
||||
bool ListenSocket(const nsAString& aServiceName,
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel);
|
||||
|
||||
void CloseSocket();
|
||||
|
||||
|
@ -1,500 +0,0 @@
|
||||
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#ifndef mozilla_dom_bluetooth_bluetoothcommon_h__
|
||||
#define mozilla_dom_bluetooth_bluetoothcommon_h__
|
||||
|
||||
#include "mozilla/Compiler.h"
|
||||
#include "mozilla/Observer.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsString.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
#if MOZ_IS_GCC
|
||||
# if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
|
||||
/* use designated array initializers if supported */
|
||||
# define INIT_ARRAY_AT(in_, out_) \
|
||||
[in_] = out_
|
||||
# else
|
||||
/* otherwise init array element by position */
|
||||
# define INIT_ARRAY_AT(in_, out_) \
|
||||
out_
|
||||
# endif
|
||||
#else
|
||||
/* otherwise init array element by position */
|
||||
#define INIT_ARRAY_AT(in_, out_) \
|
||||
out_
|
||||
#endif
|
||||
|
||||
#define CONVERT(in_, out_) \
|
||||
INIT_ARRAY_AT(in_, out_)
|
||||
|
||||
extern bool gBluetoothDebugFlag;
|
||||
|
||||
#define SWITCH_BT_DEBUG(V) (gBluetoothDebugFlag = V)
|
||||
|
||||
#undef BT_LOG
|
||||
#if defined(MOZ_WIDGET_GONK)
|
||||
#include <android/log.h>
|
||||
|
||||
/**
|
||||
* Prints 'D'EBUG build logs, which show in DEBUG build only when
|
||||
* developer setting 'Bluetooth output in adb' is enabled.
|
||||
*/
|
||||
#define BT_LOGD(msg, ...) \
|
||||
do { \
|
||||
if (gBluetoothDebugFlag) { \
|
||||
__android_log_print(ANDROID_LOG_INFO, "GeckoBluetooth", \
|
||||
"%s: " msg, __FUNCTION__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
* Prints 'R'ELEASE build logs, which show in both RELEASE and DEBUG builds.
|
||||
*/
|
||||
#define BT_LOGR(msg, ...) \
|
||||
__android_log_print(ANDROID_LOG_INFO, "GeckoBluetooth", \
|
||||
"%s: " msg, __FUNCTION__, ##__VA_ARGS__) \
|
||||
|
||||
/**
|
||||
* Prints DEBUG build warnings, which show in DEBUG build only.
|
||||
*/
|
||||
#define BT_WARNING(args...) \
|
||||
NS_WARNING(nsPrintfCString(args).get()) \
|
||||
|
||||
#else
|
||||
#define BT_LOGD(msg, ...) \
|
||||
do { \
|
||||
if (gBluetoothDebugFlag) { \
|
||||
printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define BT_LOGR(msg, ...) printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__)
|
||||
#define BT_WARNING(msg, ...) printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Wrap literal name and value into a BluetoothNamedValue
|
||||
* and append it to the array.
|
||||
*/
|
||||
#define BT_APPEND_NAMED_VALUE(array, name, value) \
|
||||
array.AppendElement(BluetoothNamedValue(NS_LITERAL_STRING(name), value))
|
||||
|
||||
/**
|
||||
* Ensure success of system message broadcast with void return.
|
||||
*/
|
||||
#define BT_ENSURE_TRUE_VOID_BROADCAST_SYSMSG(type, parameters) \
|
||||
do { \
|
||||
if (!BroadcastSystemMessage(type, parameters)) { \
|
||||
BT_WARNING("Failed to broadcast [%s]", \
|
||||
NS_ConvertUTF16toUTF8(type).get()); \
|
||||
return; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define BEGIN_BLUETOOTH_NAMESPACE \
|
||||
namespace mozilla { namespace dom { namespace bluetooth {
|
||||
#define END_BLUETOOTH_NAMESPACE \
|
||||
} /* namespace bluetooth */ } /* namespace dom */ } /* namespace mozilla */
|
||||
#define USING_BLUETOOTH_NAMESPACE \
|
||||
using namespace mozilla::dom::bluetooth;
|
||||
|
||||
#define KEY_LOCAL_AGENT "/B2G/bluetooth/agent"
|
||||
#define KEY_REMOTE_AGENT "/B2G/bluetooth/remote_device_agent"
|
||||
#define KEY_MANAGER "/B2G/bluetooth/manager"
|
||||
#define KEY_ADAPTER "/B2G/bluetooth/adapter"
|
||||
|
||||
/**
|
||||
* When the connection status of a Bluetooth profile is changed, we'll notify
|
||||
* observers which register the following topics.
|
||||
*/
|
||||
#define BLUETOOTH_A2DP_STATUS_CHANGED_ID "bluetooth-a2dp-status-changed"
|
||||
#define BLUETOOTH_HFP_STATUS_CHANGED_ID "bluetooth-hfp-status-changed"
|
||||
#define BLUETOOTH_HID_STATUS_CHANGED_ID "bluetooth-hid-status-changed"
|
||||
#define BLUETOOTH_SCO_STATUS_CHANGED_ID "bluetooth-sco-status-changed"
|
||||
|
||||
/**
|
||||
* When the connection status of a Bluetooth profile is changed, we'll
|
||||
* dispatch one of the following events.
|
||||
*/
|
||||
#define A2DP_STATUS_CHANGED_ID "a2dpstatuschanged"
|
||||
#define HFP_STATUS_CHANGED_ID "hfpstatuschanged"
|
||||
#define SCO_STATUS_CHANGED_ID "scostatuschanged"
|
||||
|
||||
/**
|
||||
* When the pair status of a Bluetooth device is changed, we'll dispatch an
|
||||
* event.
|
||||
*/
|
||||
#define PAIRED_STATUS_CHANGED_ID "pairedstatuschanged"
|
||||
|
||||
/**
|
||||
* This event would be fired when discovery procedure starts or stops.
|
||||
*/
|
||||
#define DISCOVERY_STATE_CHANGED_ID "discoverystatechanged"
|
||||
|
||||
/**
|
||||
* When receiving a query about current play status from remote device, we'll
|
||||
* dispatch an event.
|
||||
*/
|
||||
#define REQUEST_MEDIA_PLAYSTATUS_ID "requestmediaplaystatus"
|
||||
|
||||
// Bluetooth address format: xx:xx:xx:xx:xx:xx (or xx_xx_xx_xx_xx_xx)
|
||||
#define BLUETOOTH_ADDRESS_LENGTH 17
|
||||
#define BLUETOOTH_ADDRESS_NONE "00:00:00:00:00:00"
|
||||
#define BLUETOOTH_ADDRESS_BYTES 6
|
||||
|
||||
// Bluetooth stack internal error, such as I/O error
|
||||
#define ERR_INTERNAL_ERROR "InternalError"
|
||||
|
||||
BEGIN_BLUETOOTH_NAMESPACE
|
||||
|
||||
enum BluetoothStatus {
|
||||
STATUS_SUCCESS,
|
||||
STATUS_FAIL,
|
||||
STATUS_NOT_READY,
|
||||
STATUS_NOMEM,
|
||||
STATUS_BUSY,
|
||||
STATUS_DONE,
|
||||
STATUS_UNSUPPORTED,
|
||||
STATUS_PARM_INVALID,
|
||||
STATUS_UNHANDLED,
|
||||
STATUS_AUTH_FAILURE,
|
||||
STATUS_RMT_DEV_DOWN
|
||||
};
|
||||
|
||||
enum BluetoothBondState {
|
||||
BOND_STATE_NONE,
|
||||
BOND_STATE_BONDING,
|
||||
BOND_STATE_BONDED
|
||||
};
|
||||
|
||||
enum BluetoothTypeOfDevice {
|
||||
TYPE_OF_DEVICE_BREDR,
|
||||
TYPE_OF_DEVICE_BLE,
|
||||
TYPE_OF_DEVICE_DUAL
|
||||
};
|
||||
|
||||
enum BluetoothPropertyType {
|
||||
PROPERTY_UNKNOWN,
|
||||
PROPERTY_BDNAME,
|
||||
PROPERTY_BDADDR,
|
||||
PROPERTY_UUIDS,
|
||||
PROPERTY_CLASS_OF_DEVICE,
|
||||
PROPERTY_TYPE_OF_DEVICE,
|
||||
PROPERTY_SERVICE_RECORD,
|
||||
PROPERTY_ADAPTER_SCAN_MODE,
|
||||
PROPERTY_ADAPTER_BONDED_DEVICES,
|
||||
PROPERTY_ADAPTER_DISCOVERY_TIMEOUT,
|
||||
PROPERTY_REMOTE_FRIENDLY_NAME,
|
||||
PROPERTY_REMOTE_RSSI,
|
||||
PROPERTY_REMOTE_VERSION_INFO,
|
||||
PROPERTY_REMOTE_DEVICE_TIMESTAMP
|
||||
};
|
||||
|
||||
enum BluetoothScanMode {
|
||||
SCAN_MODE_NONE,
|
||||
SCAN_MODE_CONNECTABLE,
|
||||
SCAN_MODE_CONNECTABLE_DISCOVERABLE
|
||||
};
|
||||
|
||||
enum BluetoothSspVariant {
|
||||
SSP_VARIANT_PASSKEY_CONFIRMATION,
|
||||
SSP_VARIANT_PASSKEY_ENTRY,
|
||||
SSP_VARIANT_CONSENT,
|
||||
SSP_VARIANT_PASSKEY_NOTIFICATION
|
||||
};
|
||||
|
||||
struct BluetoothUuid {
|
||||
uint8_t mUuid[16];
|
||||
};
|
||||
|
||||
struct BluetoothServiceRecord {
|
||||
BluetoothUuid mUuid;
|
||||
uint16_t mChannel;
|
||||
char mName[256];
|
||||
};
|
||||
|
||||
struct BluetoothRemoteInfo {
|
||||
int mVerMajor;
|
||||
int mVerMinor;
|
||||
int mManufacturer;
|
||||
};
|
||||
|
||||
struct BluetoothProperty {
|
||||
/* Type */
|
||||
BluetoothPropertyType mType;
|
||||
|
||||
/* Value
|
||||
*/
|
||||
|
||||
/* PROPERTY_BDNAME
|
||||
PROPERTY_BDADDR
|
||||
PROPERTY_REMOTE_FRIENDLY_NAME */
|
||||
nsString mString;
|
||||
|
||||
/* PROPERTY_UUIDS */
|
||||
nsTArray<BluetoothUuid> mUuidArray;
|
||||
|
||||
/* PROPERTY_ADAPTER_BONDED_DEVICES */
|
||||
nsTArray<nsString> mStringArray;
|
||||
|
||||
/* PROPERTY_CLASS_OF_DEVICE
|
||||
PROPERTY_ADAPTER_DISCOVERY_TIMEOUT */
|
||||
uint32_t mUint32;
|
||||
|
||||
/* PROPERTY_RSSI_VALUE */
|
||||
int32_t mInt32;
|
||||
|
||||
/* PROPERTY_TYPE_OF_DEVICE */
|
||||
BluetoothTypeOfDevice mTypeOfDevice;
|
||||
|
||||
/* PROPERTY_SERVICE_RECORD */
|
||||
BluetoothServiceRecord mServiceRecord;
|
||||
|
||||
/* PROPERTY_SCAN_MODE */
|
||||
BluetoothScanMode mScanMode;
|
||||
|
||||
/* PROPERTY_REMOTE_VERSION_INFO */
|
||||
BluetoothRemoteInfo mRemoteInfo;
|
||||
};
|
||||
|
||||
/* Physical transport for GATT connections to remote dual-mode devices */
|
||||
enum BluetoothTransport {
|
||||
TRANSPORT_AUTO, /* No preference of physical transport */
|
||||
TRANSPORT_BREDR, /* Prefer BR/EDR transport */
|
||||
TRANSPORT_LE /* Prefer LE transport */
|
||||
};
|
||||
|
||||
struct BluetoothActivityEnergyInfo {
|
||||
uint8_t mStatus;
|
||||
uint8_t mStackState; /* stack reported state */
|
||||
uint64_t mTxTime; /* in ms */
|
||||
uint64_t mRxTime; /* in ms */
|
||||
uint64_t mIdleTime; /* in ms */
|
||||
uint64_t mEnergyUsed; /* a product of mA, V and ms */
|
||||
};
|
||||
|
||||
enum BluetoothSocketType {
|
||||
RFCOMM = 1,
|
||||
SCO = 2,
|
||||
L2CAP = 3,
|
||||
EL2CAP = 4
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeAtResponse {
|
||||
HFP_AT_RESPONSE_ERROR,
|
||||
HFP_AT_RESPONSE_OK
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeAudioState {
|
||||
HFP_AUDIO_STATE_DISCONNECTED,
|
||||
HFP_AUDIO_STATE_CONNECTING,
|
||||
HFP_AUDIO_STATE_CONNECTED,
|
||||
HFP_AUDIO_STATE_DISCONNECTING,
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeCallAddressType {
|
||||
HFP_CALL_ADDRESS_TYPE_UNKNOWN,
|
||||
HFP_CALL_ADDRESS_TYPE_INTERNATIONAL
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeCallDirection {
|
||||
HFP_CALL_DIRECTION_OUTGOING,
|
||||
HFP_CALL_DIRECTION_INCOMING
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeCallHoldType {
|
||||
HFP_CALL_HOLD_RELEASEHELD,
|
||||
HFP_CALL_HOLD_RELEASEACTIVE_ACCEPTHELD,
|
||||
HFP_CALL_HOLD_HOLDACTIVE_ACCEPTHELD,
|
||||
HFP_CALL_HOLD_ADDHELDTOCONF
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeCallMode {
|
||||
HFP_CALL_MODE_VOICE,
|
||||
HFP_CALL_MODE_DATA,
|
||||
HFP_CALL_MODE_FAX
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeCallMptyType {
|
||||
HFP_CALL_MPTY_TYPE_SINGLE,
|
||||
HFP_CALL_MPTY_TYPE_MULTI
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeCallState {
|
||||
HFP_CALL_STATE_ACTIVE,
|
||||
HFP_CALL_STATE_HELD,
|
||||
HFP_CALL_STATE_DIALING,
|
||||
HFP_CALL_STATE_ALERTING,
|
||||
HFP_CALL_STATE_INCOMING,
|
||||
HFP_CALL_STATE_WAITING,
|
||||
HFP_CALL_STATE_IDLE
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeConnectionState
|
||||
{
|
||||
HFP_CONNECTION_STATE_DISCONNECTED,
|
||||
HFP_CONNECTION_STATE_CONNECTING,
|
||||
HFP_CONNECTION_STATE_CONNECTED,
|
||||
HFP_CONNECTION_STATE_SLC_CONNECTED,
|
||||
HFP_CONNECTION_STATE_DISCONNECTING
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeNetworkState {
|
||||
HFP_NETWORK_STATE_NOT_AVAILABLE,
|
||||
HFP_NETWORK_STATE_AVAILABLE
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeWbsConfig {
|
||||
HFP_WBS_NONE, /* Neither CVSD nor mSBC codec, but other optional codec.*/
|
||||
HFP_WBS_NO, /* CVSD */
|
||||
HFP_WBS_YES /* mSBC */
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeNRECState {
|
||||
HFP_NREC_STOPPED,
|
||||
HFP_NREC_STARTED
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeServiceType {
|
||||
HFP_SERVICE_TYPE_HOME,
|
||||
HFP_SERVICE_TYPE_ROAMING
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeVoiceRecognitionState {
|
||||
HFP_VOICE_RECOGNITION_STOPPED,
|
||||
HFP_VOICE_RECOGNITION_STARTED
|
||||
};
|
||||
|
||||
enum BluetoothHandsfreeVolumeType {
|
||||
HFP_VOLUME_TYPE_SPEAKER,
|
||||
HFP_VOLUME_TYPE_MICROPHONE
|
||||
};
|
||||
|
||||
class BluetoothSignal;
|
||||
typedef mozilla::Observer<BluetoothSignal> BluetoothSignalObserver;
|
||||
|
||||
// Enums for object types, currently used for shared function lookups
|
||||
// (get/setproperty, etc...). Possibly discernable via dbus paths, but this
|
||||
// method is future-proofed for platform independence.
|
||||
enum BluetoothObjectType {
|
||||
TYPE_MANAGER = 0,
|
||||
TYPE_ADAPTER = 1,
|
||||
TYPE_DEVICE = 2,
|
||||
|
||||
TYPE_INVALID
|
||||
};
|
||||
|
||||
enum BluetoothA2dpAudioState {
|
||||
A2DP_AUDIO_STATE_REMOTE_SUSPEND,
|
||||
A2DP_AUDIO_STATE_STOPPED,
|
||||
A2DP_AUDIO_STATE_STARTED,
|
||||
};
|
||||
|
||||
enum BluetoothA2dpConnectionState {
|
||||
A2DP_CONNECTION_STATE_DISCONNECTED,
|
||||
A2DP_CONNECTION_STATE_CONNECTING,
|
||||
A2DP_CONNECTION_STATE_CONNECTED,
|
||||
A2DP_CONNECTION_STATE_DISCONNECTING
|
||||
};
|
||||
|
||||
enum ControlPlayStatus {
|
||||
PLAYSTATUS_STOPPED = 0x00,
|
||||
PLAYSTATUS_PLAYING = 0x01,
|
||||
PLAYSTATUS_PAUSED = 0x02,
|
||||
PLAYSTATUS_FWD_SEEK = 0x03,
|
||||
PLAYSTATUS_REV_SEEK = 0x04,
|
||||
PLAYSTATUS_UNKNOWN,
|
||||
PLAYSTATUS_ERROR = 0xFF,
|
||||
};
|
||||
|
||||
enum {
|
||||
AVRCP_UID_SIZE = 8
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpMediaAttribute {
|
||||
AVRCP_MEDIA_ATTRIBUTE_TITLE = 0x01,
|
||||
AVRCP_MEDIA_ATTRIBUTE_ARTIST = 0x02,
|
||||
AVRCP_MEDIA_ATTRIBUTE_ALBUM = 0x03,
|
||||
AVRCP_MEDIA_ATTRIBUTE_TRACK_NUM = 0x04,
|
||||
AVRCP_MEDIA_ATTRIBUTE_NUM_TRACKS = 0x05,
|
||||
AVRCP_MEDIA_ATTRIBUTE_GENRE = 0x6,
|
||||
AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME = 0x7
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpPlayerAttribute {
|
||||
AVRCP_PLAYER_ATTRIBUTE_EQUALIZER,
|
||||
AVRCP_PLAYER_ATTRIBUTE_REPEAT,
|
||||
AVRCP_PLAYER_ATTRIBUTE_SHUFFLE,
|
||||
AVRCP_PLAYER_ATTRIBUTE_SCAN
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpPlayerRepeatValue {
|
||||
AVRCP_PLAYER_VAL_OFF_REPEAT = 0x01,
|
||||
AVRCP_PLAYER_VAL_SINGLE_REPEAT = 0x02,
|
||||
AVRCP_PLAYER_VAL_ALL_REPEAT = 0x03,
|
||||
AVRCP_PLAYER_VAL_GROUP_REPEAT = 0x04,
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpPlayerShuffleValue {
|
||||
AVRCP_PLAYER_VAL_OFF_SHUFFLE = 0x01,
|
||||
AVRCP_PLAYER_VAL_ALL_SHUFFLE = 0x02,
|
||||
AVRCP_PLAYER_VAL_GROUP_SHUFFLE = 0x03,
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpStatus {
|
||||
AVRCP_STATUS_BAD_COMMAND,
|
||||
AVRCP_STATUS_BAD_PARAMETER,
|
||||
AVRCP_STATUS_NOT_FOUND,
|
||||
AVRCP_STATUS_INTERNAL_ERROR,
|
||||
AVRCP_STATUS_SUCCESS
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpEvent {
|
||||
AVRCP_EVENT_PLAY_STATUS_CHANGED,
|
||||
AVRCP_EVENT_TRACK_CHANGE,
|
||||
AVRCP_EVENT_TRACK_REACHED_END,
|
||||
AVRCP_EVENT_TRACK_REACHED_START,
|
||||
AVRCP_EVENT_PLAY_POS_CHANGED,
|
||||
AVRCP_EVENT_APP_SETTINGS_CHANGED
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpNotification {
|
||||
AVRCP_NTF_INTERIM,
|
||||
AVRCP_NTF_CHANGED
|
||||
};
|
||||
|
||||
enum BluetoothAvrcpRemoteFeature {
|
||||
AVRCP_REMOTE_FEATURE_NONE,
|
||||
AVRCP_REMOTE_FEATURE_METADATA,
|
||||
AVRCP_REMOTE_FEATURE_ABSOLUTE_VOLUME,
|
||||
AVRCP_REMOTE_FEATURE_BROWSE
|
||||
};
|
||||
|
||||
struct BluetoothAvrcpElementAttribute {
|
||||
uint32_t mId;
|
||||
nsString mValue;
|
||||
};
|
||||
|
||||
struct BluetoothAvrcpNotificationParam {
|
||||
ControlPlayStatus mPlayStatus;
|
||||
uint8_t mTrack[8];
|
||||
uint32_t mSongPos;
|
||||
uint8_t mNumAttr;
|
||||
uint8_t mIds[256];
|
||||
uint8_t mValues[256];
|
||||
};
|
||||
|
||||
struct BluetoothAvrcpPlayerSettings {
|
||||
uint8_t mNumAttr;
|
||||
uint8_t mIds[256];
|
||||
uint8_t mValues[256];
|
||||
};
|
||||
|
||||
END_BLUETOOTH_NAMESPACE
|
||||
|
||||
#endif // mozilla_dom_bluetooth_bluetoothcommon_h__
|
@ -50,6 +50,8 @@ BluetoothDevice::BluetoothDevice(nsPIDOMWindow* aWindow,
|
||||
, mJsUuids(nullptr)
|
||||
, mJsServices(nullptr)
|
||||
, mAdapterPath(aAdapterPath)
|
||||
, mConnected(false)
|
||||
, mPaired(false)
|
||||
, mIsRooted(false)
|
||||
{
|
||||
MOZ_ASSERT(aWindow);
|
||||
|
@ -17,7 +17,7 @@ struct ParamTraits<mozilla::dom::bluetooth::BluetoothObjectType>
|
||||
: public ContiguousEnumSerializer<
|
||||
mozilla::dom::bluetooth::BluetoothObjectType,
|
||||
mozilla::dom::bluetooth::TYPE_MANAGER,
|
||||
mozilla::dom::bluetooth::TYPE_INVALID>
|
||||
mozilla::dom::bluetooth::NUM_TYPE>
|
||||
{ };
|
||||
|
||||
} // namespace IPC
|
||||
|
@ -81,6 +81,30 @@ namespace {
|
||||
bool sInShutdown = false;
|
||||
static const char kHfpCrlf[] = "\xd\xa";
|
||||
|
||||
// UUID of Handsfree Audio Gateway
|
||||
static const BluetoothUuid kHandsfreeAG = {
|
||||
{
|
||||
0x00, 0x00, 0x11, 0x1F, 0x00, 0x00, 0x10, 0x00,
|
||||
0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
|
||||
}
|
||||
};
|
||||
|
||||
// UUID of Headset Audio Gateway
|
||||
static const BluetoothUuid kHeadsetAG = {
|
||||
{
|
||||
0x00, 0x00, 0x11, 0x12, 0x00, 0x00, 0x10, 0x00,
|
||||
0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
|
||||
}
|
||||
};
|
||||
|
||||
// Unknown service UUID (for SCO socket)
|
||||
static const BluetoothUuid kUnknownService = {
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
|
||||
0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
// Sending ringtone related
|
||||
static bool sStopSendingRingFlag = true;
|
||||
@ -1180,6 +1204,8 @@ BluetoothHfpManager::Listen()
|
||||
new BluetoothSocket(this, BluetoothSocketType::RFCOMM, true, true);
|
||||
|
||||
if (!mHandsfreeSocket->Listen(
|
||||
NS_LITERAL_STRING("Handsfree Audio Gateway"),
|
||||
kHandsfreeAG,
|
||||
BluetoothReservedChannels::CHANNEL_HANDSFREE_AG)) {
|
||||
BT_WARNING("[HFP] Can't listen on RFCOMM socket!");
|
||||
mHandsfreeSocket = nullptr;
|
||||
@ -1192,6 +1218,8 @@ BluetoothHfpManager::Listen()
|
||||
new BluetoothSocket(this, BluetoothSocketType::RFCOMM, true, true);
|
||||
|
||||
if (!mHeadsetSocket->Listen(
|
||||
NS_LITERAL_STRING("Headset Audio Gateway"),
|
||||
kHeadsetAG,
|
||||
BluetoothReservedChannels::CHANNEL_HEADSET_AG)) {
|
||||
BT_WARNING("[HSP] Can't listen on RFCOMM socket!");
|
||||
mHandsfreeSocket->Disconnect();
|
||||
@ -1900,7 +1928,9 @@ BluetoothHfpManager::OnGetServiceChannel(const nsAString& aDeviceAddress,
|
||||
|
||||
MOZ_ASSERT(mSocket);
|
||||
|
||||
if (!mSocket->Connect(NS_ConvertUTF16toUTF8(aDeviceAddress), aChannel)) {
|
||||
if (!mSocket->Connect(aDeviceAddress,
|
||||
mIsHsp? kHeadsetAG : kHandsfreeAG,
|
||||
aChannel)) {
|
||||
OnConnect(NS_LITERAL_STRING(ERR_CONNECTION_FAILED));
|
||||
}
|
||||
}
|
||||
@ -1996,7 +2026,7 @@ BluetoothHfpManager::ConnectSco(BluetoothReplyRunnable* aRunnable)
|
||||
// Stop listening
|
||||
mScoSocket->Disconnect();
|
||||
|
||||
mScoSocket->Connect(NS_ConvertUTF16toUTF8(mDeviceAddress), -1);
|
||||
mScoSocket->Connect(mDeviceAddress, kUnknownService, -1);
|
||||
mScoSocketStatus = mScoSocket->GetConnectionStatus();
|
||||
|
||||
mScoRunnable = aRunnable;
|
||||
@ -2033,7 +2063,8 @@ BluetoothHfpManager::ListenSco()
|
||||
|
||||
mScoSocket->Disconnect();
|
||||
|
||||
if (!mScoSocket->Listen(-1)) {
|
||||
if (!mScoSocket->Listen(NS_LITERAL_STRING("Handsfree Audio Gateway SCO"),
|
||||
kUnknownService, -1)) {
|
||||
BT_WARNING("Can't listen on SCO socket!");
|
||||
return false;
|
||||
}
|
||||
|
@ -41,28 +41,36 @@ using mozilla::TimeDuration;
|
||||
using mozilla::TimeStamp;
|
||||
|
||||
namespace {
|
||||
// Sending system message "bluetooth-opp-update-progress" every 50kb
|
||||
static const uint32_t kUpdateProgressBase = 50 * 1024;
|
||||
// Sending system message "bluetooth-opp-update-progress" every 50kb
|
||||
static const uint32_t kUpdateProgressBase = 50 * 1024;
|
||||
|
||||
/*
|
||||
* The format of the header of an PUT request is
|
||||
* [opcode:1][packet length:2][headerId:1][header length:2]
|
||||
*/
|
||||
static const uint32_t kPutRequestHeaderSize = 6;
|
||||
/*
|
||||
* The format of the header of an PUT request is
|
||||
* [opcode:1][packet length:2][headerId:1][header length:2]
|
||||
*/
|
||||
static const uint32_t kPutRequestHeaderSize = 6;
|
||||
|
||||
/*
|
||||
* The format of the appended header of an PUT request is
|
||||
* [headerId:1][header length:4]
|
||||
* P.S. Length of name header is 4 since unicode is 2 bytes per char.
|
||||
*/
|
||||
static const uint32_t kPutRequestAppendHeaderSize = 5;
|
||||
/*
|
||||
* The format of the appended header of an PUT request is
|
||||
* [headerId:1][header length:4]
|
||||
* P.S. Length of name header is 4 since unicode is 2 bytes per char.
|
||||
*/
|
||||
static const uint32_t kPutRequestAppendHeaderSize = 5;
|
||||
|
||||
// The default timeout we permit to wait for SDP updating if we can't get
|
||||
// service channel.
|
||||
static const double kSdpUpdatingTimeoutMs = 3000.0;
|
||||
// The default timeout we permit to wait for SDP updating if we can't get
|
||||
// service channel.
|
||||
static const double kSdpUpdatingTimeoutMs = 3000.0;
|
||||
|
||||
StaticRefPtr<BluetoothOppManager> sBluetoothOppManager;
|
||||
static bool sInShutdown = false;
|
||||
// UUID of OBEX Object Push
|
||||
static const BluetoothUuid kObexObjectPush = {
|
||||
{
|
||||
0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
|
||||
0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
|
||||
}
|
||||
};
|
||||
|
||||
StaticRefPtr<BluetoothOppManager> sBluetoothOppManager;
|
||||
static bool sInShutdown = false;
|
||||
}
|
||||
|
||||
class mozilla::dom::bluetooth::SendFileBatch {
|
||||
@ -314,7 +322,9 @@ BluetoothOppManager::Listen()
|
||||
mRfcommSocket =
|
||||
new BluetoothSocket(this, BluetoothSocketType::RFCOMM, true, true);
|
||||
|
||||
if (!mRfcommSocket->Listen(BluetoothReservedChannels::CHANNEL_OPUSH)) {
|
||||
if (!mRfcommSocket->Listen(NS_LITERAL_STRING("OBEX Object Push"),
|
||||
kObexObjectPush,
|
||||
BluetoothReservedChannels::CHANNEL_OPUSH)) {
|
||||
BT_WARNING("[OPP] Can't listen on RFCOMM socket!");
|
||||
mRfcommSocket = nullptr;
|
||||
return false;
|
||||
@ -325,7 +335,9 @@ BluetoothOppManager::Listen()
|
||||
mL2capSocket =
|
||||
new BluetoothSocket(this, BluetoothSocketType::EL2CAP, true, true);
|
||||
|
||||
if (!mL2capSocket->Listen(BluetoothReservedChannels::CHANNEL_OPUSH_L2CAP)) {
|
||||
if (!mL2capSocket->Listen(NS_LITERAL_STRING("OBEX Object Push"),
|
||||
kObexObjectPush,
|
||||
BluetoothReservedChannels::CHANNEL_OPUSH_L2CAP)) {
|
||||
BT_WARNING("[OPP] Can't listen on L2CAP socket!");
|
||||
mRfcommSocket->Disconnect();
|
||||
mRfcommSocket = nullptr;
|
||||
@ -1624,7 +1636,7 @@ BluetoothOppManager::OnGetServiceChannel(const nsAString& aDeviceAddress,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mSocket->Connect(NS_ConvertUTF16toUTF8(aDeviceAddress), aChannel)) {
|
||||
if (!mSocket->Connect(aDeviceAddress, kObexObjectPush, aChannel)) {
|
||||
OnSocketConnectError(mSocket);
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,9 @@ BluetoothSocket::BluetoothSocket(BluetoothSocketObserver* aObserver,
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothSocket::Connect(const nsACString& aDeviceAddress, int aChannel)
|
||||
BluetoothSocket::Connect(const nsAString& aDeviceAddress,
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(!aDeviceAddress.IsEmpty());
|
||||
@ -34,7 +36,8 @@ BluetoothSocket::Connect(const nsACString& aDeviceAddress, int aChannel)
|
||||
nsAutoPtr<BluetoothUnixSocketConnector> c(
|
||||
new BluetoothUnixSocketConnector(mType, aChannel, mAuth, mEncrypt));
|
||||
|
||||
if (!ConnectSocket(c.forget(), aDeviceAddress.BeginReading())) {
|
||||
if (!ConnectSocket(c.forget(),
|
||||
NS_ConvertUTF16toUTF8(aDeviceAddress).BeginReading())) {
|
||||
nsAutoString addr;
|
||||
GetAddress(addr);
|
||||
BT_LOGD("%s failed. Current connected device address: %s",
|
||||
@ -46,7 +49,9 @@ BluetoothSocket::Connect(const nsACString& aDeviceAddress, int aChannel)
|
||||
}
|
||||
|
||||
bool
|
||||
BluetoothSocket::Listen(int aChannel)
|
||||
BluetoothSocket::Listen(const nsAString& aServiceName,
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
|
@ -22,8 +22,12 @@ public:
|
||||
bool aAuth,
|
||||
bool aEncrypt);
|
||||
|
||||
bool Connect(const nsACString& aDeviceAddress, int aChannel);
|
||||
bool Listen(int aChannel);
|
||||
bool Connect(const nsAString& aDeviceAddress,
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel);
|
||||
bool Listen(const nsAString& aServiceName,
|
||||
const BluetoothUuid& aServiceUuid,
|
||||
int aChannel);
|
||||
inline void Disconnect()
|
||||
{
|
||||
CloseSocket();
|
||||
|
@ -160,6 +160,10 @@ if CONFIG['MOZ_B2G_BT']:
|
||||
# Exported interfaces
|
||||
#
|
||||
|
||||
EXPORTS.mozilla.dom.bluetooth += [
|
||||
'BluetoothCommon.h'
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_B2G_BT_API_V2']:
|
||||
EXPORTS.mozilla.dom.bluetooth.ipc += [
|
||||
'bluetooth2/ipc/BluetoothMessageUtils.h',
|
||||
@ -167,7 +171,6 @@ if CONFIG['MOZ_B2G_BT_API_V2']:
|
||||
EXPORTS.mozilla.dom.bluetooth += [
|
||||
'bluetooth2/BluetoothAdapter.h',
|
||||
'bluetooth2/BluetoothClassOfDevice.h',
|
||||
'bluetooth2/BluetoothCommon.h',
|
||||
'bluetooth2/BluetoothDevice.h',
|
||||
'bluetooth2/BluetoothDiscoveryHandle.h',
|
||||
'bluetooth2/BluetoothGatt.h',
|
||||
@ -189,7 +192,6 @@ else:
|
||||
]
|
||||
EXPORTS.mozilla.dom.bluetooth += [
|
||||
'bluetooth1/BluetoothAdapter.h',
|
||||
'bluetooth1/BluetoothCommon.h',
|
||||
'bluetooth1/BluetoothDevice.h',
|
||||
'bluetooth1/BluetoothManager.h',
|
||||
]
|
||||
|
@ -41,6 +41,9 @@ function testAddContact(aIcc, aType, aPin2) {
|
||||
|
||||
return aIcc.updateContact(aType, contact, aPin2)
|
||||
.then((aResult) => {
|
||||
is(aResult.id, aIcc.iccInfo.iccid + "5");
|
||||
is(aResult.name[0], "add");
|
||||
is(aResult.tel[0].value, "0912345678");
|
||||
// Get ICC contact for checking new contact
|
||||
return aIcc.readContacts(aType)
|
||||
.then((aResult) => {
|
||||
@ -49,6 +52,7 @@ function testAddContact(aIcc, aType, aPin2) {
|
||||
|
||||
is(aResult[4].name[0], "add");
|
||||
is(aResult[4].tel[0].value, "0912345678");
|
||||
is(aResult[4].id, aIcc.iccInfo.iccid + "5");
|
||||
}, (aError) => {
|
||||
ok(false, "Cannot get " + aType + " contacts: " + aError.name);
|
||||
})
|
||||
|
@ -3394,13 +3394,23 @@ public class BrowserApp extends GeckoApp
|
||||
|
||||
// If the user has clicked the tab queue notification then load the tabs.
|
||||
if(AppConstants.NIGHTLY_BUILD && AppConstants.MOZ_ANDROID_TAB_QUEUE && mInitialized && isTabQueueAction) {
|
||||
int queuedTabCount = TabQueueHelper.getTabQueueLength(this);
|
||||
TabQueueHelper.openQueuedUrls(this, mProfile, TabQueueHelper.FILE_NAME, false);
|
||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
int queuedTabCount = TabQueueHelper.getTabQueueLength(BrowserApp.this);
|
||||
TabQueueHelper.openQueuedUrls(BrowserApp.this, mProfile, TabQueueHelper.FILE_NAME, false);
|
||||
|
||||
// If there's more than one tab then also show the tabs panel.
|
||||
if (queuedTabCount > 1) {
|
||||
showNormalTabs();
|
||||
}
|
||||
// If there's more than one tab then also show the tabs panel.
|
||||
if (queuedTabCount > 1) {
|
||||
ThreadUtils.postToUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showNormalTabs();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!mInitialized || !Intent.ACTION_MAIN.equals(action)) {
|
||||
|
@ -365,6 +365,10 @@ public:
|
||||
MOZ_ASSERT(onAsyncThread);
|
||||
#endif // DEBUG
|
||||
|
||||
nsCOMPtr<nsIRunnable> event = NS_NewRunnableMethodWithArg<nsCOMPtr<nsIThread>>
|
||||
(mConnection, &Connection::shutdownAsyncThread, mAsyncExecutionThread);
|
||||
(void)NS_DispatchToMainThread(event);
|
||||
|
||||
// Internal close.
|
||||
(void)mConnection->internalClose(mNativeConnection);
|
||||
|
||||
@ -486,6 +490,7 @@ Connection::Connection(Service *aService,
|
||||
, threadOpenedOn(do_GetCurrentThread())
|
||||
, mDBConn(nullptr)
|
||||
, mAsyncExecutionThreadShuttingDown(false)
|
||||
, mAsyncExecutionThreadIsAlive(false)
|
||||
, mConnectionClosed(false)
|
||||
, mTransactionInProgress(false)
|
||||
, mProgressHandler(nullptr)
|
||||
@ -502,6 +507,8 @@ Connection::~Connection()
|
||||
|
||||
MOZ_ASSERT(!mAsyncExecutionThread,
|
||||
"AsyncClose has not been invoked on this connection!");
|
||||
MOZ_ASSERT(!mAsyncExecutionThreadIsAlive,
|
||||
"The async execution thread should have been shutdown!");
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(Connection)
|
||||
@ -569,6 +576,7 @@ Connection::getAsyncExecutionTarget()
|
||||
mAsyncExecutionThread);
|
||||
}
|
||||
|
||||
mAsyncExecutionThreadIsAlive = true;
|
||||
return mAsyncExecutionThread;
|
||||
}
|
||||
|
||||
@ -868,6 +876,17 @@ Connection::isClosed()
|
||||
return mConnectionClosed;
|
||||
}
|
||||
|
||||
void
|
||||
Connection::shutdownAsyncThread(nsIThread *aThread) {
|
||||
MOZ_ASSERT(!mAsyncExecutionThread);
|
||||
MOZ_ASSERT(mAsyncExecutionThreadIsAlive);
|
||||
MOZ_ASSERT(mAsyncExecutionThreadShuttingDown);
|
||||
|
||||
DebugOnly<nsresult> rv = aThread->Shutdown();
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
mAsyncExecutionThreadIsAlive = false;
|
||||
}
|
||||
|
||||
nsresult
|
||||
Connection::internalClose(sqlite3 *aNativeConnection)
|
||||
{
|
||||
|
@ -167,6 +167,11 @@ public:
|
||||
*/
|
||||
nsresult internalClose(sqlite3 *aDBConn);
|
||||
|
||||
/**
|
||||
* Shuts down the passed-in async thread.
|
||||
*/
|
||||
void shutdownAsyncThread(nsIThread *aAsyncThread);
|
||||
|
||||
/**
|
||||
* Obtains the filename of the connection. Useful for logging.
|
||||
*/
|
||||
@ -306,6 +311,12 @@ private:
|
||||
*/
|
||||
bool mAsyncExecutionThreadShuttingDown;
|
||||
|
||||
/**
|
||||
* Tracks whether the async thread has been initialized and Shutdown() has
|
||||
* not yet been invoked on it.
|
||||
*/
|
||||
DebugOnly<bool> mAsyncExecutionThreadIsAlive;
|
||||
|
||||
/**
|
||||
* Set to true just prior to calling sqlite3_close on the
|
||||
* connection.
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"repo": "https://hg.mozilla.org/build/mozharness",
|
||||
"revision": "31777d3667c1"
|
||||
"revision": "ed7cbf080ee6"
|
||||
}
|
||||
|
@ -124,6 +124,8 @@ tests:
|
||||
task: tasks/tests/b2g_mochitest_oop.yml
|
||||
reftest:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_reftests.yml
|
||||
tasks/builds/b2g_emulator_ics_opt.yml:
|
||||
task: tasks/tests/b2g_emulator_reftest.yml
|
||||
reftest-sanity-oop:
|
||||
|
@ -34,10 +34,13 @@ task:
|
||||
expires: '{{#from_now}}1 year{{/from_now}}'
|
||||
|
||||
extra:
|
||||
treeherderEnv:
|
||||
- production
|
||||
- staging
|
||||
chunks:
|
||||
total: 6
|
||||
treeherder:
|
||||
groupName: Reftest
|
||||
groupSymbol: tc-R
|
||||
groupSymbol: R
|
||||
groupName: Mulet Reftest
|
||||
symbol: 'R{{chunk}}'
|
||||
productName: b2g
|
||||
|
@ -1426,6 +1426,7 @@ try {
|
||||
|
||||
prefs.setCharPref("media.gmp-manager.url.override", "http://%(server)s/dummy-gmp-manager.xml");
|
||||
prefs.setCharPref("browser.selfsupport.url", "https://%(server)s/selfsupport-dummy/");
|
||||
prefs.setCharPref("toolkit.telemetry.server", "https://%(server)s/telemetry-dummy");
|
||||
}
|
||||
} catch (e) { }
|
||||
|
||||
|
@ -1,19 +1,21 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Components.utils.import("resource://gre/modules/TelemetryPing.jsm", this);
|
||||
Components.utils.import("resource://gre/modules/Services.jsm", this);
|
||||
const { classes: Cc, utils: Cu, interfaces: Ci, results: Cr } = Components;
|
||||
|
||||
const gIsWindows = ("@mozilla.org/windows-registry-key;1" in Components.classes);
|
||||
const gIsMac = ("@mozilla.org/xpcom/mac-utils;1" in Components.classes);
|
||||
const gIsAndroid = ("@mozilla.org/android/bridge;1" in Components.classes);
|
||||
const gIsGonk = ("@mozilla.org/cellbroadcast/gonkservice;1" in Components.classes);
|
||||
Cu.import("resource://gre/modules/TelemetryPing.jsm", this);
|
||||
Cu.import("resource://gre/modules/Services.jsm", this);
|
||||
|
||||
const gIsWindows = ("@mozilla.org/windows-registry-key;1" in Cc);
|
||||
const gIsMac = ("@mozilla.org/xpcom/mac-utils;1" in Cc);
|
||||
const gIsAndroid = ("@mozilla.org/android/bridge;1" in Cc);
|
||||
const gIsGonk = ("@mozilla.org/cellbroadcast/gonkservice;1" in Cc);
|
||||
|
||||
const MILLISECONDS_PER_MINUTE = 60 * 1000;
|
||||
const MILLISECONDS_PER_HOUR = 60 * MILLISECONDS_PER_MINUTE;
|
||||
const MILLISECONDS_PER_DAY = 24 * MILLISECONDS_PER_HOUR;
|
||||
|
||||
const HAS_DATAREPORTINGSERVICE = "@mozilla.org/datareporting/service;1" in Components.classes;
|
||||
const HAS_DATAREPORTINGSERVICE = "@mozilla.org/datareporting/service;1" in Cc;
|
||||
|
||||
let gOldAppInfo = null;
|
||||
let gGlobalScope = this;
|
||||
@ -75,8 +77,7 @@ function createAppInfo(id, name, version, platformVersion) {
|
||||
const XULAPPINFO_CID = Components.ID("{c763b610-9d49-455a-bbd2-ede71682a1ac}");
|
||||
let gAppInfo;
|
||||
if (!gOldAppInfo) {
|
||||
gOldAppInfo = Components.classes[XULAPPINFO_CONTRACTID]
|
||||
.getService(Components.interfaces.nsIXULRuntime);
|
||||
gOldAppInfo = Cc[XULAPPINFO_CONTRACTID].getService(Ci.nsIXULRuntime);
|
||||
}
|
||||
|
||||
gAppInfo = {
|
||||
@ -116,7 +117,7 @@ function createAppInfo(id, name, version, platformVersion) {
|
||||
var XULAppInfoFactory = {
|
||||
createInstance: function (outer, iid) {
|
||||
if (outer != null)
|
||||
throw Components.results.NS_ERROR_NO_AGGREGATION;
|
||||
throw Cr.NS_ERROR_NO_AGGREGATION;
|
||||
return gAppInfo.QueryInterface(iid);
|
||||
}
|
||||
};
|
||||
@ -127,17 +128,27 @@ function createAppInfo(id, name, version, platformVersion) {
|
||||
|
||||
// Fake the timeout functions for the TelemetryScheduler.
|
||||
function fakeSchedulerTimer(set, clear) {
|
||||
let session = Components.utils.import("resource://gre/modules/TelemetrySession.jsm");
|
||||
let session = Cu.import("resource://gre/modules/TelemetrySession.jsm");
|
||||
session.Policy.setSchedulerTickTimeout = set;
|
||||
session.Policy.clearSchedulerTickTimeout = clear;
|
||||
}
|
||||
|
||||
// Fake the current date.
|
||||
function fakeNow(date) {
|
||||
/**
|
||||
* Fake the current date.
|
||||
* This passes all received arguments to a new Date constructor and
|
||||
* uses the resulting date to fake the time in Telemetry modules.
|
||||
*
|
||||
* @return Date The new faked date.
|
||||
*/
|
||||
function fakeNow(...arguments) {
|
||||
const date = new Date(...arguments);
|
||||
|
||||
let session = Cu.import("resource://gre/modules/TelemetrySession.jsm");
|
||||
session.Policy.now = () => date;
|
||||
let environment = Cu.import("resource://gre/modules/TelemetryEnvironment.jsm");
|
||||
environment.Policy.now = () => date;
|
||||
|
||||
return new Date(date);
|
||||
}
|
||||
|
||||
// Return a date that is |offset| ms in the future from |date|.
|
||||
@ -151,7 +162,6 @@ function truncateToDays(aMsec) {
|
||||
|
||||
// Set logging preferences for all the tests.
|
||||
Services.prefs.setCharPref("toolkit.telemetry.log.level", "Trace");
|
||||
Services.prefs.setBoolPref("toolkit.telemetry.log.dump", true);
|
||||
TelemetryPing.initLogging();
|
||||
|
||||
// Avoid timers interrupting test behavior.
|
||||
|
@ -1,8 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/AddonManager.jsm");
|
||||
Cu.import("resource://gre/modules/TelemetryEnvironment.jsm", this);
|
||||
Cu.import("resource://gre/modules/Preferences.jsm", this);
|
||||
|
@ -3,11 +3,6 @@
|
||||
*/
|
||||
/* A testcase to make sure reading late writes stacks works. */
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm", this);
|
||||
|
||||
const Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
|
||||
|
@ -3,11 +3,6 @@
|
||||
*/
|
||||
/* A testcase to make sure reading the failed profile lock count works. */
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm", this);
|
||||
|
||||
const Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
|
||||
|
@ -1,6 +1,5 @@
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://gre/modules/TelemetryLog.jsm", this);
|
||||
Cu.import("resource://gre/modules/TelemetrySession.jsm", this);
|
||||
|
@ -8,11 +8,6 @@
|
||||
* checked in the second request.
|
||||
*/
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
Cu.import("resource://testing-common/httpd.js", this);
|
||||
Cu.import("resource://gre/modules/ClientID.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
@ -13,9 +13,7 @@
|
||||
* -> previousBuildID in telemetry, new value set in prefs.
|
||||
*/
|
||||
|
||||
"use strict"
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
"use strict";
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm", this);
|
||||
Cu.import("resource://gre/modules/TelemetrySession.jsm", this);
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { utils: Cu, interfaces: Ci, classes: Cc } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm", this);
|
||||
Cu.import("resource://gre/modules/TelemetryPing.jsm", this);
|
||||
Cu.import("resource://gre/modules/Timer.jsm", this);
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
// Check that TelemetrySession notifies correctly on idle-daily.
|
||||
|
||||
const { utils: Cu, interfaces: Ci, classes: Cc } = Components;
|
||||
|
||||
Cu.import("resource://testing-common/httpd.js", this);
|
||||
Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
|
||||
Cu.import("resource://gre/modules/Services.jsm", this);
|
||||
|
@ -12,11 +12,6 @@
|
||||
|
||||
"use strict"
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/osfile.jsm", this);
|
||||
Cu.import("resource://gre/modules/Services.jsm", this);
|
||||
Cu.import("resource://testing-common/httpd.js", this);
|
||||
|
@ -8,11 +8,6 @@
|
||||
* checked in the second request.
|
||||
*/
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
Cu.import("resource://testing-common/httpd.js", this);
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
Cu.import("resource://gre/modules/ClientID.jsm");
|
||||
|
@ -1,10 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
const Telemetry = Cc["@mozilla.org/base/telemetry;1"]
|
||||
.getService(Ci.nsITelemetry);
|
||||
|
||||
|
@ -1,10 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let Cu = Components.utils;
|
||||
let Cc = Components.classes;
|
||||
let Ci = Components.interfaces;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm", this);
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
|
||||
Cu.import("resource://gre/modules/ThirdPartyCookieProbe.jsm", this);
|
||||
|
@ -1,6 +1,5 @@
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
const Cu = Components.utils;
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const INT_MAX = 0x7FFFFFFF;
|
||||
|
||||
const Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
|
||||
|
Loading…
Reference in New Issue
Block a user