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

Commit

Permalink
add system message handler for test
Browse files Browse the repository at this point in the history
  • Loading branch information
evelynhung committed Sep 14, 2012
1 parent e186503 commit cc94759
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
17 changes: 17 additions & 0 deletions apps/settings/js/bluetooth.js
Expand Up @@ -8,6 +8,22 @@
needs to access its method via window.opener
*/
var gDeviceList = null;
navigator.mozSetMessageHandler('bluetooth-requestconfirmation', function gotMessage(message) {
dump("=== bluetooth-requestconfirmation got message: " + message.deviceAddress + ", " + message.passkey);
// defaultAdapter.setPairingConfirmation(message.deviceAddress, false);
});
navigator.mozSetMessageHandler('bluetooth-requestpasskey', function gotMessage(message) {
dump("[Gaia] bluetooth-requestpasskey got message: " + message.deviceAddress + ", " + message.name);
});
navigator.mozSetMessageHandler('bluetooth-requestpincode', function gotMessage(message) {
dump("[Gaia] bluetooth-requestpincode got message: " + message.deviceAddress + ", " + message.name);
});
navigator.mozSetMessageHandler('bluetooth-authorize', function gotMessage(message) {
dump("[Gaia] bluetooth-authorize got message: " + message.deviceAddress + ", " + message.uuid);
});
navigator.mozSetMessageHandler('bluetooth-cancel', function gotMessage(message) {
dump("[Gaia] bluetooth-cacel got message");
});

// handle BlueTooth settings
window.addEventListener('localized', function bluetoothSettings(evt) {
Expand All @@ -19,6 +35,7 @@ window.addEventListener('localized', function bluetoothSettings(evt) {
if (!settings || !bluetooth)
return;


var gBluetoothInfoBlock = document.querySelector('#bluetooth-desc');
var gBluetoothCheckBox = document.querySelector('#bluetooth-status input');

Expand Down
5 changes: 5 additions & 0 deletions apps/settings/manifest.webapp
Expand Up @@ -25,6 +25,11 @@
"disposition": "window"
}
},
"messages": ["bluetooth-requestconfirmation",
"bluetooth-requestpasskey",
"bluetooth-requestpincode",
"bluetooth-authorize",
"bluetooth-cancel"],
"locales": {
"ar": {
"name": "الضبط",
Expand Down

0 comments on commit cc94759

Please sign in to comment.