Bug 746429 - Make failure to set master volume non-fatal to startup, r=cjones a=b2g-only
authorMichael Wu <mwu@mozilla.com>
Wed, 18 Apr 2012 13:42:20 -0400
changeset 95231 32ed0c04a15396e8e5d161c49834a7a62845ec92
parent 95230 12a2ee1f008862b213e4c93f80ca9c396c146888
child 95232 e299d978c3bc284413158c0c94c4fd9344ce4515
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones, b2g-only
bugs746429
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 746429 - Make failure to set master volume non-fatal to startup, r=cjones a=b2g-only
b2g/chrome/content/shell.js
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -107,17 +107,22 @@ var shell = {
     window.addEventListener('mozfullscreenchange', this);
     window.addEventListener('sizemodechange', this);
     this.contentBrowser.addEventListener('load', this, true);
 
     // Until the volume can be set from the content side, set it to a
     // a specific value when the device starts. This way the front-end
     // can display a notification when the volume change and show a volume
     // level modified from this point.
-    Services.audioManager.masterVolume = 0.5;
+    // try catch block must be used since the emulator fails here. bug 746429
+    try {
+      Services.audioManager.masterVolume = 0.5;
+    } catch(e) {
+      dump('Error setting master volume: ' + e + '\n');
+    }
 
     let domains = "";
     try {
       domains = Services.prefs.getCharPref('b2g.privileged.domains');
     } catch(e) {}
 
     addPermissions(domains.split(","));