Bug 1188240 - Disable auto-playing of media without user consent on Android 2.3-4.0. r=rbarker
authorEugen Sawin <esawin@me73.com>
Thu, 01 Oct 2015 18:15:21 +0200
changeset 265624 df9c8be97792b91c541089b6f9b1267bc42ce72c
parent 265623 f89a4c296fb1dfdad6e4580ad36ba339f34f3c15
child 265625 fd625bea9fde7f11d2132a8c560b84f823c4e6bb
push id15472
push usercbook@mozilla.com
push dateFri, 02 Oct 2015 11:51:34 +0000
treeherderfx-team@2c33ef6b27e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrbarker
bugs1188240
milestone44.0a1
Bug 1188240 - Disable auto-playing of media without user consent on Android 2.3-4.0. r=rbarker
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -517,16 +517,22 @@ var BrowserApp = {
       Services.prefs.setIntPref("extensions.autoDisableScopes", 1);
       Services.prefs.setBoolPref("xpinstall.enabled", false);
     } else if (ParentalControls.parentalControlsEnabled) {
       Services.prefs.clearUserPref("extensions.enabledScopes");
       Services.prefs.clearUserPref("extensions.autoDisableScopes");
       Services.prefs.setBoolPref("xpinstall.enabled", true);
     }
 
+    let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
+    if (sysInfo.get("version") < 16) {
+      let defaults = Services.prefs.getDefaultBranch(null);
+      defaults.setBoolPref("media.autoplay.enabled", false);
+    }
+
     try {
       // Set the tiles click observer only if tiles reporting is enabled (that
       // is, a report URL is set in prefs).
       gTilesReportURL = Services.prefs.getCharPref("browser.tiles.reportURL");
       Services.obs.addObserver(this, "Tiles:Click", false);
     } catch (e) {
       // Tiles reporting is disabled.
     }