mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 21:18:35 +00:00
Backout bug 942104 (changesets 4e5746a65a5e:62e32a84a9fb) for missing review.
This commit is contained in:
parent
74a7ecb704
commit
0ca1c2ac03
@ -684,7 +684,6 @@ GK_ATOM(ondisabled, "ondisabled")
|
||||
GK_ATOM(ondischargingtimechange, "ondischargingtimechange")
|
||||
GK_ATOM(ondisconnected, "ondisconnected")
|
||||
GK_ATOM(ondisconnecting, "ondisconnecting")
|
||||
GK_ATOM(ondiscoverystatechanged, "ondiscoverystatechanged")
|
||||
GK_ATOM(ondownloading, "ondownloading")
|
||||
GK_ATOM(onDOMActivate, "onDOMActivate")
|
||||
GK_ATOM(onDOMAttrModified, "onDOMAttrModified")
|
||||
|
@ -48,10 +48,6 @@ const kEventConstructors = {
|
||||
return new BluetoothDeviceEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
BluetoothDiscoveryStateChangedEvent: { create: function (aName, aProps) {
|
||||
return new BluetoothDiscoveryStateChangedEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
BluetoothStatusChangedEvent: { create: function (aName, aProps) {
|
||||
return new BluetoothStatusChangedEvent(aName, aProps);
|
||||
},
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsDOMClassInfo.h"
|
||||
#include "nsIDOMBluetoothDeviceEvent.h"
|
||||
#include "nsIDOMBluetoothDiscoveryStateChangedEvent.h"
|
||||
#include "nsIDOMBluetoothStatusChangedEvent.h"
|
||||
#include "nsTArrayHelpers.h"
|
||||
#include "DOMRequest.h"
|
||||
@ -321,19 +320,6 @@ BluetoothAdapter::Notify(const BluetoothSignal& aData)
|
||||
|
||||
MOZ_ASSERT(arr.Length() == 1);
|
||||
SetPropertyByValue(arr[0]);
|
||||
} else if (aData.name().EqualsLiteral(DISCOVERY_STATE_CHANGED_ID)) {
|
||||
MOZ_ASSERT(v.type() == BluetoothValue::Tbool);
|
||||
bool isDiscovering = v.get_bool();
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
NS_NewDOMBluetoothDiscoveryStateChangedEvent(
|
||||
getter_AddRefs(event), this, nullptr, nullptr);
|
||||
|
||||
nsCOMPtr<nsIDOMBluetoothDiscoveryStateChangedEvent> e =
|
||||
do_QueryInterface(event);
|
||||
e->InitBluetoothDiscoveryStateChangedEvent(aData.name(), false, false,
|
||||
isDiscovering);
|
||||
DispatchTrustedEvent(event);
|
||||
} else if (aData.name().EqualsLiteral(PAIRED_STATUS_CHANGED_ID) ||
|
||||
aData.name().EqualsLiteral(HFP_STATUS_CHANGED_ID) ||
|
||||
aData.name().EqualsLiteral(SCO_STATUS_CHANGED_ID) ||
|
||||
|
@ -147,7 +147,6 @@ public:
|
||||
SendMediaPlayStatus(const MediaPlayStatus& aMediaPlayStatus, ErrorResult& aRv);
|
||||
|
||||
IMPL_EVENT_HANDLER(devicefound);
|
||||
IMPL_EVENT_HANDLER(discoverystatechanged);
|
||||
IMPL_EVENT_HANDLER(a2dpstatuschanged);
|
||||
IMPL_EVENT_HANDLER(hfpstatuschanged);
|
||||
IMPL_EVENT_HANDLER(pairedstatuschanged);
|
||||
|
@ -89,11 +89,6 @@ extern bool gBluetoothDebugFlag;
|
||||
*/
|
||||
#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.
|
||||
|
@ -49,6 +49,7 @@ static InfallibleTArray<nsString> sAdapterBondedAddressArray;
|
||||
static InfallibleTArray<BluetoothNamedValue> sRemoteDevicesPack;
|
||||
static nsTArray<nsRefPtr<BluetoothProfileController> > sControllerArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sBondingRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sChangeDiscoveryRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sGetDeviceRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sSetPropertyRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sUnbondingRunnableArray;
|
||||
@ -495,16 +496,12 @@ DiscoveryStateChangedCallback(bt_discovery_state_t aState)
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
bool isDiscovering = (aState == BT_DISCOVERY_STARTED);
|
||||
if (!sChangeDiscoveryRunnableArray.IsEmpty()) {
|
||||
BluetoothValue values(true);
|
||||
DispatchBluetoothReply(sChangeDiscoveryRunnableArray[0],
|
||||
values, EmptyString());
|
||||
|
||||
BluetoothSignal signal(NS_LITERAL_STRING(DISCOVERY_STATE_CHANGED_ID),
|
||||
NS_LITERAL_STRING(KEY_ADAPTER),
|
||||
isDiscovering);
|
||||
|
||||
nsRefPtr<DistributeBluetoothSignalTask>
|
||||
t = new DistributeBluetoothSignalTask(signal);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(t))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
sChangeDiscoveryRunnableArray.RemoveElementAt(0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -921,17 +918,17 @@ BluetoothServiceBluedroid::StartDiscoveryInternal(
|
||||
if (!IsReady()) {
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
|
||||
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
int ret = sBtInterface->start_discovery();
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
ReplyStatusError(aRunnable, ret, NS_LITERAL_STRING("StartDiscovery"));
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
DispatchBluetoothReply(aRunnable, true, EmptyString());
|
||||
|
||||
sChangeDiscoveryRunnableArray.AppendElement(aRunnable);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -950,10 +947,10 @@ BluetoothServiceBluedroid::StopDiscoveryInternal(
|
||||
int ret = sBtInterface->cancel_discovery();
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
ReplyStatusError(aRunnable, ret, NS_LITERAL_STRING("StopDiscovery"));
|
||||
return NS_ERROR_FAILURE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
DispatchBluetoothReply(aRunnable, true, EmptyString());
|
||||
sChangeDiscoveryRunnableArray.AppendElement(aRunnable);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1512,20 +1512,6 @@ EventFilter(DBusConnection* aConn, DBusMessage* aMsg, void* aData)
|
||||
errorStr,
|
||||
sAdapterProperties,
|
||||
ArrayLength(sAdapterProperties));
|
||||
|
||||
BluetoothNamedValue& property = v.get_ArrayOfBluetoothNamedValue()[0];
|
||||
if (property.name().EqualsLiteral("Discovering")) {
|
||||
bool isDiscovering = property.value();
|
||||
BluetoothSignal signal(NS_LITERAL_STRING(DISCOVERY_STATE_CHANGED_ID),
|
||||
NS_LITERAL_STRING(KEY_ADAPTER),
|
||||
isDiscovering);
|
||||
|
||||
nsRefPtr<DistributeBluetoothSignalTask>
|
||||
t = new DistributeBluetoothSignalTask(signal);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(t))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
}
|
||||
}
|
||||
} else if (dbus_message_is_signal(aMsg, DBUS_DEVICE_IFACE,
|
||||
"PropertyChanged")) {
|
||||
ParsePropertyChange(aMsg,
|
||||
|
@ -8,7 +8,6 @@ if CONFIG['MOZ_B2G_BT']:
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMBluetoothDevice.idl',
|
||||
'nsIDOMBluetoothDeviceEvent.idl',
|
||||
'nsIDOMBluetoothDiscoveryStateChangedEvent.idl',
|
||||
'nsIDOMBluetoothStatusChangedEvent.idl',
|
||||
]
|
||||
XPIDL_MODULE = 'dom_bluetooth'
|
||||
|
@ -1,22 +0,0 @@
|
||||
/* 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/. */
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(9de639cb-71c4-4144-8462-09763ec87c20)]
|
||||
interface nsIDOMBluetoothDiscoveryStateChangedEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute boolean discovering;
|
||||
|
||||
[noscript]
|
||||
void initBluetoothDiscoveryStateChangedEvent(in DOMString aType,
|
||||
in boolean aCanBubble,
|
||||
in boolean aCancelable,
|
||||
in boolean aDiscovering);
|
||||
};
|
||||
|
||||
dictionary BluetoothDiscoveryStateChangedEventInit : EventInit
|
||||
{
|
||||
bool discovering;
|
||||
};
|
@ -134,7 +134,6 @@ var interfaceNamesInGlobalScope =
|
||||
{name: "BluetoothAdapter", b2g: true},
|
||||
{name: "BluetoothDevice", b2g: true},
|
||||
{name: "BluetoothDeviceEvent", b2g: true},
|
||||
{name: "BluetoothDiscoveryStateChangedEvent", b2g: true},
|
||||
{name: "BluetoothManager", b2g: true},
|
||||
{name: "BluetoothStatusChangedEvent", b2g: true},
|
||||
{name: "BoxObject", xbl: true},
|
||||
|
@ -49,7 +49,6 @@ interface BluetoothAdapter : EventTarget {
|
||||
readonly attribute any uuids;
|
||||
|
||||
attribute EventHandler ondevicefound;
|
||||
attribute EventHandler ondiscoverystatechanged;
|
||||
|
||||
// Fired when pairing process is completed
|
||||
attribute EventHandler onpairedstatuschanged;
|
||||
|
@ -1,16 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/.
|
||||
*/
|
||||
|
||||
[Constructor(DOMString type, optional BluetoothDiscoveryStateChangedEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
|
||||
interface BluetoothDiscoveryStateChangedEvent : Event
|
||||
{
|
||||
readonly attribute boolean discovering;
|
||||
};
|
||||
|
||||
dictionary BluetoothDiscoveryStateChangedEventInit : EventInit
|
||||
{
|
||||
boolean discovering = false;
|
||||
};
|
@ -503,7 +503,6 @@ if CONFIG['MOZ_B2G_BT']:
|
||||
'BluetoothAdapter.webidl',
|
||||
'BluetoothDevice.webidl',
|
||||
'BluetoothDeviceEvent.webidl',
|
||||
'BluetoothDiscoveryStateChangedEvent.webidl',
|
||||
'BluetoothManager.webidl',
|
||||
'BluetoothStatusChangedEvent.webidl',
|
||||
]
|
||||
|
@ -30,7 +30,6 @@ simple_events = [
|
||||
#ifdef MOZ_B2G_BT
|
||||
'BluetoothDeviceEvent',
|
||||
'BluetoothStatusChangedEvent',
|
||||
'BluetoothDiscoveryStateChangedEvent',
|
||||
#endif
|
||||
#ifdef MOZ_B2G_RIL
|
||||
'CFStateChangeEvent',
|
||||
|
Loading…
x
Reference in New Issue
Block a user