Skip to content

Commit

Permalink
merge b2g-inbound to mozilla-central
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed May 13, 2014
2 parents aa3f375 + 556a5dc commit 386b597
Show file tree
Hide file tree
Showing 67 changed files with 3,649 additions and 1,457 deletions.
2 changes: 1 addition & 1 deletion b2g/components/ActivitiesGlue.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ActivitiesDialog.prototype = {
chooseActivity: function ap_chooseActivity(aOptions, aActivities, aCallback) {
// B2G does not have an alternate activity system, make no choice and return.
if (aActivities.length === 0) {
aCallback(Ci.nsIActivityUIGlueCallback.WEBAPPS_ACTIVITY, -1);
aCallback.handleEvent(Ci.nsIActivityUIGlueCallback.WEBAPPS_ACTIVITY, -1);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion b2g/config/emulator-ics/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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="2f89c43e798ccba631025bedc47a1fb24e830cf2"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de1c755411949b50ae395b42e124af215ed9b702"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="30f87e602509415be4f69493c23cba1912f91ef5"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
Expand Down
4 changes: 2 additions & 2 deletions b2g/config/emulator-jb/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f89c43e798ccba631025bedc47a1fb24e830cf2"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="de1c755411949b50ae395b42e124af215ed9b702"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="30f87e602509415be4f69493c23cba1912f91ef5"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
Expand Down Expand Up @@ -131,6 +131,6 @@
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="e16b5c17131d2296101b24c87887c9ccf057649f"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="bc70af75eac79073c4c935bf1f71c0cb10e821b7"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="683f93486878469c2de912d175956845c2b919d6"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="b0bc602eeaabc308a3a9e913ec3a22ad3696364e"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
</manifest>
2 changes: 1 addition & 1 deletion b2g/config/emulator-kk/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="65fba428f8d76336b33ddd9e15900357953600ba">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f89c43e798ccba631025bedc47a1fb24e830cf2"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="de1c755411949b50ae395b42e124af215ed9b702"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="30f87e602509415be4f69493c23cba1912f91ef5"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/emulator/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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="2f89c43e798ccba631025bedc47a1fb24e830cf2"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de1c755411949b50ae395b42e124af215ed9b702"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="30f87e602509415be4f69493c23cba1912f91ef5"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
Expand Down
4 changes: 2 additions & 2 deletions b2g/config/flame/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f89c43e798ccba631025bedc47a1fb24e830cf2"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="de1c755411949b50ae395b42e124af215ed9b702"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="30f87e602509415be4f69493c23cba1912f91ef5"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
Expand Down Expand Up @@ -141,7 +141,7 @@
<project name="platform/hardware/ril" path="hardware/ril" revision="c4e2ac95907a5519a0e09f01a0d8e27fec101af0"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="e1eb226fa3ad3874ea7b63c56a9dc7012d7ff3c2"/>
<project name="platform/system/core" path="system/core" revision="bbf7212289fc8311e43f9d11e10788e310d36a08"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="683f93486878469c2de912d175956845c2b919d6"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="b0bc602eeaabc308a3a9e913ec3a22ad3696364e"/>
<project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4ae5df252123591d5b941191790e7abed1bce5a4"/>
</manifest>
2 changes: 1 addition & 1 deletion b2g/config/gaia.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "c244070248a9c226a6fabc45f9de5dd10d7f4d6f",
"revision": "d37aa6da234abefd5227511661ec6a365c1cfb84",
"repo_path": "/integration/gaia-central"
}
2 changes: 1 addition & 1 deletion b2g/config/hamachi/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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="2f89c43e798ccba631025bedc47a1fb24e830cf2"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de1c755411949b50ae395b42e124af215ed9b702"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="30f87e602509415be4f69493c23cba1912f91ef5"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/helix/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="2f89c43e798ccba631025bedc47a1fb24e830cf2"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de1c755411949b50ae395b42e124af215ed9b702"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="30f87e602509415be4f69493c23cba1912f91ef5"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/inari/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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="2f89c43e798ccba631025bedc47a1fb24e830cf2"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de1c755411949b50ae395b42e124af215ed9b702"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="30f87e602509415be4f69493c23cba1912f91ef5"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/leo/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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="2f89c43e798ccba631025bedc47a1fb24e830cf2"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de1c755411949b50ae395b42e124af215ed9b702"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="30f87e602509415be4f69493c23cba1912f91ef5"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
Expand Down
4 changes: 2 additions & 2 deletions b2g/config/mako/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f89c43e798ccba631025bedc47a1fb24e830cf2"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="de1c755411949b50ae395b42e124af215ed9b702"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="30f87e602509415be4f69493c23cba1912f91ef5"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="3512d982f336887a73283bb8d1147a8f7b822077"/>
Expand Down Expand Up @@ -127,7 +127,7 @@
<project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
<project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="683f93486878469c2de912d175956845c2b919d6"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="b0bc602eeaabc308a3a9e913ec3a22ad3696364e"/>
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
<project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/wasabi/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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="2f89c43e798ccba631025bedc47a1fb24e830cf2"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="de1c755411949b50ae395b42e124af215ed9b702"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="30f87e602509415be4f69493c23cba1912f91ef5"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>
Expand Down
16 changes: 0 additions & 16 deletions dom/base/nsDOMClassInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@
#include "nsIDOMSmsSegmentInfo.h"
#include "nsIDOMMozMobileMessageThread.h"

#ifdef MOZ_B2G_RIL
#include "nsIDOMMobileConnection.h"
#endif // MOZ_B2G_RIL

#ifdef MOZ_B2G_FM
#include "FMRadio.h"
#endif
Expand Down Expand Up @@ -413,11 +409,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(MozMobileMessageThread, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)

#ifdef MOZ_B2G_RIL
NS_DEFINE_CLASSINFO_DATA(MozMobileConnection, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
#endif

NS_DEFINE_CLASSINFO_DATA(CSSFontFaceRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)

Expand Down Expand Up @@ -1050,13 +1041,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozMobileMessageThread)
DOM_CLASSINFO_MAP_END

#ifdef MOZ_B2G_RIL
DOM_CLASSINFO_MAP_BEGIN(MozMobileConnection, nsIDOMMozMobileConnection)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozMobileConnection)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_END
#endif // MOZ_B2G_RIL

DOM_CLASSINFO_MAP_BEGIN(CSSFontFaceRule, nsIDOMCSSFontFaceRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFaceRule)
DOM_CLASSINFO_MAP_END
Expand Down
4 changes: 0 additions & 4 deletions dom/base/nsDOMClassInfoClasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ DOMCI_CLASS(MozSmsFilter)
DOMCI_CLASS(MozSmsSegmentInfo)
DOMCI_CLASS(MozMobileMessageThread)

#ifdef MOZ_B2G_RIL
DOMCI_CLASS(MozMobileConnection)
#endif

// @font-face in CSS
DOMCI_CLASS(CSSFontFaceRule)

Expand Down
17 changes: 16 additions & 1 deletion dom/bindings/Bindings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -817,11 +817,27 @@ DOMInterfaces = {
'nativeType': 'mozilla::dom::IccManager',
},

'MozMobileCellInfo': {
'nativeType': 'mozilla::dom::MobileCellInfo',
},

'MozMobileConnection': {
'nativeType': 'mozilla::dom::MobileConnection',
},

'MozMobileConnectionArray': {
'nativeType': 'mozilla::dom::MobileConnectionArray',
'resultNotAddRefed': [ 'item' ]
},

'MozMobileConnectionInfo': {
'nativeType': 'mozilla::dom::MobileConnectionInfo',
},

'MozMobileNetworkInfo': {
'nativeType': 'mozilla::dom::MobileNetworkInfo',
},

'MozNamedAttrMap': {
'nativeType': 'nsDOMAttributeMap',
},
Expand Down Expand Up @@ -1906,7 +1922,6 @@ addExternalIface('MozFrameLoader', nativeType='nsIFrameLoader', notflattened=Tru
addExternalIface('MozFrameRequestCallback', nativeType='nsIFrameRequestCallback',
notflattened=True)
addExternalIface('MozIccInfo', headerFile='nsIDOMIccInfo.h')
addExternalIface('MozMobileConnection', headerFile='nsIDOMMobileConnection.h')
addExternalIface('MozMobileMessageManager', headerFile='nsIDOMMobileMessageManager.h')
addExternalIface('MozObserver', nativeType='nsIObserver', notflattened=True)
addExternalIface('MozRDFCompositeDataSource', nativeType='nsIRDFCompositeDataSource',
Expand Down
4 changes: 2 additions & 2 deletions dom/bluetooth/BluetoothRilListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "BluetoothRilListener.h"

#include "BluetoothHfpManager.h"
#include "nsIDOMMobileConnection.h"
#include "nsIMobileConnectionInfo.h"
#include "nsIRadioInterfaceLayer.h"
#include "nsRadioInterfaceLayer.h"
#include "nsServiceManagerUtils.h"
Expand Down Expand Up @@ -350,7 +350,7 @@ BluetoothRilListener::SelectClient()
NS_ENSURE_TRUE_VOID(connection);

for (uint32_t i = 0; i < mMobileConnListeners.Length(); i++) {
nsCOMPtr<nsIDOMMozMobileConnectionInfo> voiceInfo;
nsCOMPtr<nsIMobileConnectionInfo> voiceInfo;
connection->GetVoiceConnectionInfo(i, getter_AddRefs(voiceInfo));
if (!voiceInfo) {
BT_WARNING("%s: Failed to get voice connection info", __FUNCTION__);
Expand Down
13 changes: 9 additions & 4 deletions dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
#include "nsContentUtils.h"
#include "nsIAudioManager.h"
#include "nsIDOMIccInfo.h"
#include "nsIDOMMobileConnection.h"
#include "nsIIccProvider.h"
#include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionProvider.h"
#include "nsIMobileNetworkInfo.h"
#include "nsIObserverService.h"
#include "nsISettingsService.h"
#include "nsITelephonyProvider.h"
Expand Down Expand Up @@ -406,6 +407,10 @@ BluetoothHfpManager::Init()
}

hal::RegisterBatteryObserver(this);
// Update to the latest battery level
hal::BatteryInformation batteryInfo;
hal::GetCurrentBatteryInformation(&batteryInfo);
Notify(batteryInfo);

mListener = new BluetoothRilListener();
NS_ENSURE_TRUE(mListener->Listen(true), false);
Expand Down Expand Up @@ -521,7 +526,7 @@ BluetoothHfpManager::Notify(const hal::BatteryInformation& aBatteryInfo)
{
// Range of battery level: [0, 1], double
// Range of CIND::BATTCHG: [0, 5], int
mBattChg = (int) ceil(aBatteryInfo.level() * 5.0);
mBattChg = (int) round(aBatteryInfo.level() * 5.0);
UpdateDeviceCIND();
}

Expand Down Expand Up @@ -889,7 +894,7 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE_VOID(connection);

nsCOMPtr<nsIDOMMozMobileConnectionInfo> voiceInfo;
nsCOMPtr<nsIMobileConnectionInfo> voiceInfo;
connection->GetVoiceConnectionInfo(aClientId, getter_AddRefs(voiceInfo));
NS_ENSURE_TRUE_VOID(voiceInfo);

Expand Down Expand Up @@ -924,7 +929,7 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
UpdateDeviceCIND();

// Operator name
nsCOMPtr<nsIDOMMozMobileNetworkInfo> network;
nsCOMPtr<nsIMobileNetworkInfo> network;
voiceInfo->GetNetwork(getter_AddRefs(network));
NS_ENSURE_TRUE_VOID(network);
network->GetLongName(mOperatorName);
Expand Down
13 changes: 9 additions & 4 deletions dom/bluetooth/bluez/BluetoothHfpManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@

#ifdef MOZ_B2G_RIL
#include "nsIDOMIccInfo.h"
#include "nsIDOMMobileConnection.h"
#include "nsIIccProvider.h"
#include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionProvider.h"
#include "nsIMobileNetworkInfo.h"
#include "nsITelephonyProvider.h"
#include "nsRadioInterfaceLayer.h"
#endif
Expand Down Expand Up @@ -220,7 +221,7 @@ BluetoothHfpManager::Notify(const hal::BatteryInformation& aBatteryInfo)
{
// Range of battery level: [0, 1], double
// Range of CIND::BATTCHG: [0, 5], int
int level = ceil(aBatteryInfo.level() * 5.0);
int level = round(aBatteryInfo.level() * 5.0);
if (level != sCINDItems[CINDType::BATTCHG].value) {
sCINDItems[CINDType::BATTCHG].value = level;
SendCommand(RESPONSE_CIEV, CINDType::BATTCHG);
Expand Down Expand Up @@ -425,6 +426,10 @@ BluetoothHfpManager::Init()
}

hal::RegisterBatteryObserver(this);
// Update to the latest battery level
hal::BatteryInformation batteryInfo;
hal::GetCurrentBatteryInformation(&batteryInfo);
Notify(batteryInfo);

#ifdef MOZ_B2G_RIL
mListener = new BluetoothRilListener();
Expand Down Expand Up @@ -605,7 +610,7 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE_VOID(connection);

nsCOMPtr<nsIDOMMozMobileConnectionInfo> voiceInfo;
nsCOMPtr<nsIMobileConnectionInfo> voiceInfo;
connection->GetVoiceConnectionInfo(aClientId, getter_AddRefs(voiceInfo));
NS_ENSURE_TRUE_VOID(voiceInfo);

Expand Down Expand Up @@ -648,7 +653,7 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
mNetworkSelectionMode = 0;
}

nsCOMPtr<nsIDOMMozMobileNetworkInfo> network;
nsCOMPtr<nsIMobileNetworkInfo> network;
voiceInfo->GetNetwork(getter_AddRefs(network));
NS_ENSURE_TRUE_VOID(network);
network->GetLongName(mOperatorName);
Expand Down
4 changes: 3 additions & 1 deletion dom/mobileconnection/interfaces/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

XPIDL_SOURCES += [
'nsIDOMMobileConnection.idl',
'nsIMobileCellInfo.idl',
'nsIMobileConnectionInfo.idl',
'nsIMobileConnectionProvider.idl',
'nsIMobileNetworkInfo.idl',
]

XPIDL_MODULE = 'dom_mobileconnection'
Loading

0 comments on commit 386b597

Please sign in to comment.