Bug 804460 - Patch 2: Failed to set audio stream volume to correct value by bluetooth headset, r=djf
authorGina Yeh <gyeh@mozilla.com>
Thu, 25 Oct 2012 18:50:46 +0800
changeset 111505 04c6d4d7e578e390ee64a17baf07abcf8d75158f
parent 111504 814a4bca12ebdb4dd017afe264b5440fb2dafba1
child 111506 12503ddc353b47bf992b76b5b64aa720013c7c29
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersdjf
bugs804460
milestone19.0a1
Bug 804460 - Patch 2: Failed to set audio stream volume to correct value by bluetooth headset, r=djf
b2g/chrome/content/shell.js
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -501,23 +501,20 @@ Services.obs.addObserver(function onWeba
   shell.sendChromeEvent({ type: 'webapps-registry-start' });
 }, 'webapps-registry-start', false);
 
 Services.obs.addObserver(function onWebappsReady(subject, topic, data) {
   shell.sendChromeEvent({ type: 'webapps-registry-ready' });
 }, 'webapps-registry-ready', false);
 
 Services.obs.addObserver(function onBluetoothVolumeChange(subject, topic, data) {
-  if (data == 'up') {
-    shell.sendChromeEvent({ type: 'volume-up-button-press' });
-    shell.sendChromeEvent({ type: 'volume-up-button-release' });
-  } else if (data == 'down') {
-    shell.sendChromeEvent({ type: 'volume-down-button-press' });
-    shell.sendChromeEvent({ type: 'volume-down-button-release' });
-  }
+  shell.sendChromeEvent({
+    type: "volumeset",
+    value: data
+  });
 }, 'bluetooth-volume-change', false);
 
 (function Repl() {
   if (!Services.prefs.getBoolPref('b2g.remote-js.enabled')) {
     return;
   }
   const prompt = 'JS> ';
   let output;