Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #27671 from gasolin/issue-1125735
Browse files Browse the repository at this point in the history
Bug 1125735 - [Bluetooth][System]remove updateConnected function since its not used...; r=ian,alive
  • Loading branch information
gasolin committed Jan 28, 2015
2 parents e46c388 + d7a5a09 commit 26ff171
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
25 changes: 0 additions & 25 deletions apps/system/js/bluetooth.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ var Bluetooth = {
navigator.mozSetMessageHandler('bluetooth-opp-transfer-start',
function bt_fileTransferUpdate(transferInfo) {
self._setProfileConnected(self.Profiles.OPP, true);
self.updateConnected();
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent('bluetooth-opp-transfer-start',
/* canBubble */ true, /* cancelable */ false,
Expand All @@ -129,7 +128,6 @@ var Bluetooth = {
navigator.mozSetMessageHandler('bluetooth-opp-transfer-complete',
function bt_fileTransferUpdate(transferInfo) {
self._setProfileConnected(self.Profiles.OPP, false);
self.updateConnected();
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent('bluetooth-opp-transfer-complete',
/* canBubble */ true, /* cancelable */ false,
Expand Down Expand Up @@ -190,40 +188,17 @@ var Bluetooth = {
var self = this;
adapter.onhfpstatuschanged = function bt_hfpStatusChanged(evt) {
self._setProfileConnected(self.Profiles.HFP, evt.status);
self.updateConnected();
};

adapter.ona2dpstatuschanged = function bt_a2dpStatusChanged(evt) {
self._setProfileConnected(self.Profiles.A2DP, evt.status);
self.updateConnected();
};

adapter.onscostatuschanged = function bt_scoStatusChanged(evt) {
self._setProfileConnected(self.Profiles.SCO, evt.status);
};
},

updateConnected: function bt_updateConnected() {
var bluetooth = window.navigator.mozBluetooth;

if (!bluetooth || !('isConnected' in bluetooth)) {
return;
}

var wasConnected = this.connected;
this.connected = this.isProfileConnected(this.Profiles.HFP) ||
this.isProfileConnected(this.Profiles.A2DP) ||
this.isProfileConnected(this.Profiles.OPP);

if (wasConnected !== this.connected) {
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent('bluetoothconnectionchange',
/* canBubble */ true, /* cancelable */ false,
{deviceConnected: this.connected});
window.dispatchEvent(evt);
}
},

/**
* called by external for re-use adapter.
*
Expand Down
7 changes: 0 additions & 7 deletions apps/system/js/statusbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,8 @@ var StatusBar = {
// Listen to Custom event send by 'nfc_manager.js'
window.addEventListener('nfc-state-changed', this);

// 'bluetoothconnectionchange' fires when the overall bluetooth connection
// changes.
// 'bluetoothprofileconnectionchange' fires when a bluetooth connection of
// a specific profile changes.
window.addEventListener('bluetoothconnectionchange', this);
window.addEventListener('bluetoothprofileconnectionchange', this);

// Listen to 'moztimechange'
Expand Down Expand Up @@ -433,10 +430,6 @@ var StatusBar = {
this.update.data.call(this);
break;

case 'bluetoothconnectionchange':
this.update.bluetooth.call(this);
break;

case 'bluetoothprofileconnectionchange':
this.update.bluetoothProfiles.call(this);
break;
Expand Down

0 comments on commit 26ff171

Please sign in to comment.