mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge b2g-inbound to m-c a=merge CLOSED TREE
This commit is contained in:
commit
57e968fcbe
@ -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="a7dcc5fb595030dab140d5ff0e7eb5ef04017d51"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d4f756aa35cb7f030a92f3c1f65fb55254ddd1d"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
|
||||
<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="a7dcc5fb595030dab140d5ff0e7eb5ef04017d51"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="9d4f756aa35cb7f030a92f3c1f65fb55254ddd1d"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="9a9797062c6001d6346504161c51187a2968466b"/>
|
||||
|
@ -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="a7dcc5fb595030dab140d5ff0e7eb5ef04017d51"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d4f756aa35cb7f030a92f3c1f65fb55254ddd1d"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="90f848a40efad820ab00fa52bec52dff37255b12"/>
|
||||
|
@ -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="a7dcc5fb595030dab140d5ff0e7eb5ef04017d51"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d4f756aa35cb7f030a92f3c1f65fb55254ddd1d"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="a7dcc5fb595030dab140d5ff0e7eb5ef04017d51"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d4f756aa35cb7f030a92f3c1f65fb55254ddd1d"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
|
||||
<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="a7dcc5fb595030dab140d5ff0e7eb5ef04017d51"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="9d4f756aa35cb7f030a92f3c1f65fb55254ddd1d"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="9a9797062c6001d6346504161c51187a2968466b"/>
|
||||
|
@ -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="a7dcc5fb595030dab140d5ff0e7eb5ef04017d51"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d4f756aa35cb7f030a92f3c1f65fb55254ddd1d"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
|
||||
<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="a7dcc5fb595030dab140d5ff0e7eb5ef04017d51"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d4f756aa35cb7f030a92f3c1f65fb55254ddd1d"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="90f848a40efad820ab00fa52bec52dff37255b12"/>
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"git": {
|
||||
"git_revision": "a7dcc5fb595030dab140d5ff0e7eb5ef04017d51",
|
||||
"git_revision": "9d4f756aa35cb7f030a92f3c1f65fb55254ddd1d",
|
||||
"remote": "https://git.mozilla.org/releases/gaia.git",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "5e00921aa36301b179b4912d352e6bcc0de89edc",
|
||||
"revision": "6238380e300e25c4ec8aea2a8804d0ca3675f7fb",
|
||||
"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="a7dcc5fb595030dab140d5ff0e7eb5ef04017d51"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d4f756aa35cb7f030a92f3c1f65fb55254ddd1d"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="90f848a40efad820ab00fa52bec52dff37255b12"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="61e82f99bb8bc78d52b5717e9a2481ec7267fa33">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="a7dcc5fb595030dab140d5ff0e7eb5ef04017d51"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="9d4f756aa35cb7f030a92f3c1f65fb55254ddd1d"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="d3868ff4bb3a4b81382795e2784258c210fe6cb8"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
@ -712,6 +712,7 @@ public:
|
||||
virtual void Connect(int aClientIf,
|
||||
const nsAString& aBdAddr,
|
||||
bool aIsDirect, /* auto connect */
|
||||
BluetoothTransport aTransport,
|
||||
BluetoothGattClientResultHandler* aRes) = 0;
|
||||
virtual void Disconnect(int aClientIf,
|
||||
const nsAString& aBdAddr,
|
||||
@ -816,6 +817,10 @@ public:
|
||||
int aApperance,
|
||||
uint8_t aManufacturerLen,
|
||||
const ArrayBuffer& aManufacturerData,
|
||||
uint8_t aServiceDataLen,
|
||||
const ArrayBuffer& aServiceData,
|
||||
uint8_t aServiceUUIDLen,
|
||||
const ArrayBuffer& aServiceUUID,
|
||||
BluetoothGattClientResultHandler* aRes) = 0;
|
||||
|
||||
protected:
|
||||
|
@ -514,7 +514,9 @@ void
|
||||
BluetoothGattClientHALInterface::Scan(
|
||||
int aClientIf, bool aStart, BluetoothGattClientResultHandler* aRes)
|
||||
{
|
||||
#if ANDROID_VERSION >= 19
|
||||
#if ANDROID_VERSION >= 21
|
||||
int status = mInterface->scan(aStart);
|
||||
#elif ANDROID_VERSION >= 19
|
||||
int status = mInterface->scan(aClientIf, aStart);
|
||||
#else
|
||||
int status = BT_STATUS_UNSUPPORTED;
|
||||
@ -530,10 +532,21 @@ BluetoothGattClientHALInterface::Scan(
|
||||
void
|
||||
BluetoothGattClientHALInterface::Connect(
|
||||
int aClientIf, const nsAString& aBdAddr,
|
||||
bool aIsDirect, BluetoothGattClientResultHandler* aRes)
|
||||
bool aIsDirect, BluetoothTransport aTransport,
|
||||
BluetoothGattClientResultHandler* aRes)
|
||||
{
|
||||
bt_status_t status;
|
||||
#if ANDROID_VERSION >= 19
|
||||
#if ANDROID_VERSION >= 21
|
||||
bt_bdaddr_t bdAddr;
|
||||
btgatt_transport_t transport;
|
||||
|
||||
if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr)) ||
|
||||
NS_SUCCEEDED(Convert(aTransport, transport))) {
|
||||
status = mInterface->connect(aClientIf, &bdAddr, aIsDirect, transport);
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
#elif ANDROID_VERSION >= 19
|
||||
bt_bdaddr_t bdAddr;
|
||||
|
||||
if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
|
||||
@ -1019,10 +1032,34 @@ BluetoothGattClientHALInterface::SetAdvData(
|
||||
int aServerIf, bool aIsScanRsp, bool aIsNameIncluded,
|
||||
bool aIsTxPowerIncluded, int aMinInterval, int aMaxInterval, int aApperance,
|
||||
uint8_t aManufacturerLen, const ArrayBuffer& aManufacturerData,
|
||||
uint8_t aServiceDataLen, const ArrayBuffer& aServiceData,
|
||||
uint8_t aServiceUUIDLen, const ArrayBuffer& aServiceUUID,
|
||||
BluetoothGattClientResultHandler* aRes)
|
||||
{
|
||||
/* FIXME: This method allocates a large amount of memory on the
|
||||
* stack. It should be rewritten to prevent the pending stack
|
||||
* overflow. Additionally |ArrayBuffer| seems like the wrong data
|
||||
* type here. Why not use plain pointers instead?
|
||||
*/
|
||||
|
||||
bt_status_t status;
|
||||
#if ANDROID_VERSION >= 19
|
||||
#if ANDROID_VERSION >= 21
|
||||
char manufacturerData[aManufacturerLen + 1];
|
||||
char serviceData[aServiceDataLen + 1];
|
||||
char serviceUUID[aServiceUUIDLen + 1];
|
||||
|
||||
if (NS_SUCCEEDED(Convert(aManufacturerData, manufacturerData)) ||
|
||||
NS_SUCCEEDED(Convert(aServiceData, serviceData)) ||
|
||||
NS_SUCCEEDED(Convert(aServiceUUID, serviceUUID))) {
|
||||
status = mInterface->set_adv_data(
|
||||
aServerIf, aIsScanRsp, aIsNameIncluded, aIsTxPowerIncluded,
|
||||
aMinInterval, aMaxInterval, aApperance,
|
||||
aManufacturerLen, manufacturerData,
|
||||
aServiceDataLen, serviceData, aServiceUUIDLen, serviceUUID);
|
||||
} else {
|
||||
status = BT_STATUS_PARM_INVALID;
|
||||
}
|
||||
#elif ANDROID_VERSION >= 19
|
||||
char value[aManufacturerLen + 1];
|
||||
|
||||
if (NS_SUCCEEDED(Convert(aManufacturerData, value))) {
|
||||
|
@ -38,6 +38,7 @@ public:
|
||||
void Connect(int aClientIf,
|
||||
const nsAString& aBdAddr,
|
||||
bool aIsDirect, /* auto connect */
|
||||
BluetoothTransport aTransport,
|
||||
BluetoothGattClientResultHandler* aRes);
|
||||
void Disconnect(int aClientIf,
|
||||
const nsAString& aBdAddr,
|
||||
@ -139,6 +140,8 @@ public:
|
||||
int aApperance,
|
||||
uint8_t aManufacturerLen,
|
||||
const ArrayBuffer& aManufacturerData,
|
||||
uint8_t aServiceDataLen, const ArrayBuffer& aServiceData,
|
||||
uint8_t aServiceUUIDLen, const ArrayBuffer& aServiceUUID,
|
||||
BluetoothGattClientResultHandler* aRes);
|
||||
|
||||
protected:
|
||||
|
@ -139,21 +139,6 @@ public:
|
||||
, mConnId(0)
|
||||
{ }
|
||||
|
||||
~BluetoothGattClient()
|
||||
{
|
||||
mConnectRunnable = nullptr;
|
||||
mDisconnectRunnable = nullptr;
|
||||
mDiscoverRunnable = nullptr;
|
||||
mUnregisterClientRunnable = nullptr;
|
||||
mReadRemoteRssiRunnable = nullptr;
|
||||
mRegisterNotificationsRunnable = nullptr;
|
||||
mDeregisterNotificationsRunnable = nullptr;
|
||||
mReadCharacteristicState.Reset();
|
||||
mWriteCharacteristicState.Reset();
|
||||
mReadDescriptorState.Reset();
|
||||
mWriteDescriptorState.Reset();
|
||||
}
|
||||
|
||||
void NotifyDiscoverCompleted(bool aSuccess)
|
||||
{
|
||||
MOZ_ASSERT(!mAppUuid.IsEmpty());
|
||||
@ -209,6 +194,10 @@ public:
|
||||
nsTArray<BluetoothGattServiceId> mIncludedServices;
|
||||
nsTArray<BluetoothGattCharAttribute> mCharacteristics;
|
||||
nsTArray<BluetoothGattId> mDescriptors;
|
||||
|
||||
private:
|
||||
~BluetoothGattClient()
|
||||
{ }
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS0(BluetoothGattClient)
|
||||
@ -557,6 +546,7 @@ BluetoothGattManager::Connect(const nsAString& aAppUuid,
|
||||
sBluetoothGattClientInterface->Connect(client->mClientIf,
|
||||
aDeviceAddr,
|
||||
true, // direct connect
|
||||
TRANSPORT_AUTO,
|
||||
new ConnectResultHandler(client));
|
||||
} else {
|
||||
BluetoothUuid uuid;
|
||||
@ -1267,6 +1257,7 @@ BluetoothGattManager::RegisterClientNotification(BluetoothGattStatus aStatus,
|
||||
if (client->mConnectRunnable) {
|
||||
sBluetoothGattClientInterface->Connect(
|
||||
aClientIf, client->mDeviceAddr, true /* direct connect */,
|
||||
TRANSPORT_AUTO,
|
||||
new ConnectResultHandler(client));
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ public:
|
||||
static BluetoothGattManager* Get();
|
||||
static void InitGattInterface(BluetoothProfileResultHandler* aRes);
|
||||
static void DeinitGattInterface(BluetoothProfileResultHandler* aRes);
|
||||
virtual ~BluetoothGattManager();
|
||||
|
||||
void Connect(const nsAString& aAppUuid,
|
||||
const nsAString& aDeviceAddr,
|
||||
@ -86,6 +85,8 @@ public:
|
||||
BluetoothReplyRunnable* aRunnable);
|
||||
|
||||
private:
|
||||
~BluetoothGattManager();
|
||||
|
||||
class CleanupResultHandler;
|
||||
class CleanupResultHandlerRunnable;
|
||||
class InitGattResultHandler;
|
||||
|
@ -326,6 +326,24 @@ Convert(const btgatt_notify_params_t& aIn, BluetoothGattNotifyParam& aOut)
|
||||
return NS_OK;
|
||||
}
|
||||
#endif // ANDROID_VERSION >= 19
|
||||
|
||||
#if ANDROID_VERSION >= 21
|
||||
nsresult
|
||||
Convert(const BluetoothTransport& aIn, btgatt_transport_t& aOut)
|
||||
{
|
||||
static const btgatt_transport_t sTransport[] = {
|
||||
CONVERT(TRANSPORT_AUTO, GATT_TRANSPORT_AUTO),
|
||||
CONVERT(TRANSPORT_BREDR, GATT_TRANSPORT_BREDR),
|
||||
CONVERT(TRANSPORT_LE, GATT_TRANSPORT_LE)
|
||||
};
|
||||
if (aIn >= MOZ_ARRAY_LENGTH(sTransport)) {
|
||||
aOut = static_cast<btgatt_transport_t>(0); // silence compiler warning
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
aOut = sTransport[aIn];
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
// TODO: Support GATT
|
||||
#endif
|
||||
|
@ -905,6 +905,11 @@ Convert(const ArrayBuffer& aIn, char* aOut)
|
||||
memcpy(aOut, aIn.Data(), aIn.Length());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#if ANDROID_VERSION >= 21
|
||||
nsresult
|
||||
Convert(const BluetoothTransport& aIn, btgatt_transport_t& aOut);
|
||||
#endif
|
||||
#else
|
||||
// TODO: Support GATT
|
||||
#endif
|
||||
|
@ -39,12 +39,12 @@ public:
|
||||
MOZ_ASSERT(aController);
|
||||
}
|
||||
|
||||
private:
|
||||
virtual ~CheckProfileStatusCallback()
|
||||
{
|
||||
mController = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
nsRefPtr<BluetoothProfileController> mController;
|
||||
};
|
||||
|
||||
|
@ -167,6 +167,10 @@ public:
|
||||
BT_WARNING("Unable to get value for '" BLUETOOTH_ENABLED_SETTING "'");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
~StartupTask()
|
||||
{ }
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS(BluetoothService::StartupTask, nsISettingsServiceCallback);
|
||||
|
@ -87,7 +87,11 @@ TelephonyCall::ChangeStateInternal(uint16_t aCallState, bool aFireEvents)
|
||||
{
|
||||
nsRefPtr<TelephonyCall> kungFuDeathGrip(this);
|
||||
|
||||
nsString stateString;
|
||||
// Update the internal state.
|
||||
mCallState = aCallState;
|
||||
|
||||
// Indicate whether the external state have been changed.
|
||||
bool externalStateChanged = true;
|
||||
switch (aCallState) {
|
||||
// These states are used internally to mark this call is currently being
|
||||
// controlled, and we should block consecutive requests of the same type
|
||||
@ -96,36 +100,32 @@ TelephonyCall::ChangeStateInternal(uint16_t aCallState, bool aFireEvents)
|
||||
case nsITelephonyService::CALL_STATE_DISCONNECTING:
|
||||
case nsITelephonyService::CALL_STATE_HOLDING:
|
||||
case nsITelephonyService::CALL_STATE_RESUMING:
|
||||
externalStateChanged = false;
|
||||
break;
|
||||
// These states will be translated into literal strings which are used to
|
||||
// show the current status of this call.
|
||||
case nsITelephonyService::CALL_STATE_DIALING:
|
||||
stateString.AssignLiteral("dialing");
|
||||
mState.AssignLiteral("dialing");
|
||||
break;
|
||||
case nsITelephonyService::CALL_STATE_ALERTING:
|
||||
stateString.AssignLiteral("alerting");
|
||||
mState.AssignLiteral("alerting");
|
||||
break;
|
||||
case nsITelephonyService::CALL_STATE_CONNECTED:
|
||||
stateString.AssignLiteral("connected");
|
||||
mState.AssignLiteral("connected");
|
||||
break;
|
||||
case nsITelephonyService::CALL_STATE_HELD:
|
||||
stateString.AssignLiteral("held");
|
||||
mState.AssignLiteral("held");
|
||||
break;
|
||||
case nsITelephonyService::CALL_STATE_DISCONNECTED:
|
||||
stateString.AssignLiteral("disconnected");
|
||||
mState.AssignLiteral("disconnected");
|
||||
break;
|
||||
case nsITelephonyService::CALL_STATE_INCOMING:
|
||||
stateString.AssignLiteral("incoming");
|
||||
mState.AssignLiteral("incoming");
|
||||
break;
|
||||
default:
|
||||
NS_NOTREACHED("Unknown state!");
|
||||
}
|
||||
|
||||
mCallState = aCallState;
|
||||
if (!stateString.IsEmpty()) {
|
||||
mState = stateString;
|
||||
}
|
||||
|
||||
if (aCallState == nsITelephonyService::CALL_STATE_DISCONNECTED) {
|
||||
NS_ASSERTION(mLive, "Should be live!");
|
||||
mLive = false;
|
||||
@ -144,7 +144,7 @@ TelephonyCall::ChangeStateInternal(uint16_t aCallState, bool aFireEvents)
|
||||
}
|
||||
}
|
||||
|
||||
if (aFireEvents) {
|
||||
if (aFireEvents && externalStateChanged) {
|
||||
nsresult rv = DispatchCallEvent(NS_LITERAL_STRING("statechange"), this);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Failed to dispatch specific event!");
|
||||
@ -153,7 +153,7 @@ TelephonyCall::ChangeStateInternal(uint16_t aCallState, bool aFireEvents)
|
||||
// This can change if the statechange handler called back here... Need to
|
||||
// figure out something smarter.
|
||||
if (mCallState == aCallState) {
|
||||
rv = DispatchCallEvent(stateString, this);
|
||||
rv = DispatchCallEvent(mState, this);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Failed to dispatch specific event!");
|
||||
}
|
||||
|
@ -87,41 +87,47 @@ TelephonyCallGroup::ChangeState(uint16_t aCallState)
|
||||
if (mCallState == aCallState) {
|
||||
return;
|
||||
}
|
||||
// Update the internal state.
|
||||
mCallState = aCallState;
|
||||
|
||||
nsString stateString;
|
||||
// Indicate whether the external state should be changed.
|
||||
bool externalStateChanged = true;
|
||||
switch (aCallState) {
|
||||
// These states are used internally to mark this CallGroup is currently
|
||||
// being controlled, and we should block consecutive requests of the same
|
||||
// type according to these states.
|
||||
case nsITelephonyService::CALL_STATE_HOLDING:
|
||||
case nsITelephonyService::CALL_STATE_RESUMING:
|
||||
externalStateChanged = false;
|
||||
break;
|
||||
// These states will be translated into literal strings which are used to
|
||||
// show the current status of this CallGroup.
|
||||
case nsITelephonyService::CALL_STATE_UNKNOWN:
|
||||
mState.AssignLiteral("");
|
||||
break;
|
||||
case nsITelephonyService::CALL_STATE_CONNECTED:
|
||||
stateString.AssignLiteral("connected");
|
||||
break;
|
||||
case nsITelephonyService::CALL_STATE_HOLDING:
|
||||
stateString.AssignLiteral("holding");
|
||||
mState.AssignLiteral("connected");
|
||||
break;
|
||||
case nsITelephonyService::CALL_STATE_HELD:
|
||||
stateString.AssignLiteral("held");
|
||||
break;
|
||||
case nsITelephonyService::CALL_STATE_RESUMING:
|
||||
stateString.AssignLiteral("resuming");
|
||||
mState.AssignLiteral("held");
|
||||
break;
|
||||
default:
|
||||
NS_NOTREACHED("Unknown state!");
|
||||
}
|
||||
|
||||
mState = stateString;
|
||||
mCallState = aCallState;
|
||||
|
||||
nsresult rv = DispatchCallEvent(NS_LITERAL_STRING("statechange"), nullptr);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Failed to dispatch specific event!");
|
||||
}
|
||||
if (!stateString.IsEmpty()) {
|
||||
// This can change if the statechange handler called back here... Need to
|
||||
// figure out something smarter.
|
||||
if (mCallState == aCallState) {
|
||||
rv = DispatchCallEvent(stateString, nullptr);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Failed to dispatch specific event!");
|
||||
if (externalStateChanged) {
|
||||
nsresult rv = DispatchCallEvent(NS_LITERAL_STRING("statechange"), nullptr);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Failed to dispatch specific event!");
|
||||
}
|
||||
if (!mState.IsEmpty()) {
|
||||
// This can change if the statechange handler called back here... Need to
|
||||
// figure out something smarter.
|
||||
if (mCallState == aCallState) {
|
||||
rv = DispatchCallEvent(mState, nullptr);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Failed to dispatch specific event!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,9 +70,7 @@ public:
|
||||
|
||||
IMPL_EVENT_HANDLER(statechange)
|
||||
IMPL_EVENT_HANDLER(connected)
|
||||
IMPL_EVENT_HANDLER(holding)
|
||||
IMPL_EVENT_HANDLER(held)
|
||||
IMPL_EVENT_HANDLER(resuming)
|
||||
IMPL_EVENT_HANDLER(callschanged)
|
||||
IMPL_EVENT_HANDLER(error)
|
||||
|
||||
|
@ -777,8 +777,7 @@ let emulator = (function() {
|
||||
promises.push(waitForNamedStateEvent(call, "held"));
|
||||
}
|
||||
|
||||
let promise = waitForNamedStateEvent(conference, "holding")
|
||||
.then(() => waitForNamedStateEvent(conference, "held"))
|
||||
let promise = waitForNamedStateEvent(conference, "held")
|
||||
.then(() => {
|
||||
if (typeof heldCallback === "function") {
|
||||
heldCallback();
|
||||
@ -810,8 +809,7 @@ let emulator = (function() {
|
||||
promises.push(waitForNamedStateEvent(call, "connected"));
|
||||
}
|
||||
|
||||
let promise = waitForNamedStateEvent(conference, "resuming")
|
||||
.then(() => waitForNamedStateEvent(conference, "connected"))
|
||||
let promise = waitForNamedStateEvent(conference, "connected")
|
||||
.then(() => {
|
||||
if (typeof connectedCallback === "function") {
|
||||
connectedCallback();
|
||||
|
@ -30,9 +30,7 @@ interface TelephonyCallGroup : EventTarget {
|
||||
|
||||
attribute EventHandler onstatechange;
|
||||
attribute EventHandler onconnected;
|
||||
attribute EventHandler onholding;
|
||||
attribute EventHandler onheld;
|
||||
attribute EventHandler onresuming;
|
||||
attribute EventHandler oncallschanged;
|
||||
attribute EventHandler onerror;
|
||||
};
|
||||
|
@ -6,6 +6,16 @@
|
||||
|
||||
Components.utils.import("resource://gre/modules/devtools/event-emitter.js");
|
||||
|
||||
/**
|
||||
* TODO (Bug 1132453) The `Simulator` module is deprecated, and should be
|
||||
* removed once all simulator addons stop using it (see bug 1132452).
|
||||
*
|
||||
* If you want to register, unregister, or otherwise deal with installed
|
||||
* simulators, please use the `Simulators` module defined in:
|
||||
*
|
||||
* browser/devtools/webide/modules/simulators.js
|
||||
*/
|
||||
|
||||
const EXPORTED_SYMBOLS = ["Simulator"];
|
||||
|
||||
const Simulator = {
|
||||
|
Loading…
Reference in New Issue
Block a user