Bug 836973 - Force adb on when marionette is enabled (i.e. non-user builds). r=fabrice
authorDave Hylands <dhylands@mozilla.com>
Fri, 01 Feb 2013 02:04:04 -0800
changeset 120554 c46098d2964c681782c3d76ec4753993a8ce96d5
parent 120553 6a6ba49340e700b856f14a55e62a74cf70d892de
child 120555 f3b3be0822c44a42a15ed32b00b775883a68a10a
push id22294
push userdhylands@mozilla.com
push dateFri, 01 Feb 2013 10:04:13 +0000
treeherdermozilla-inbound@c46098d2964c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs836973
milestone21.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 836973 - Force adb on when marionette is enabled (i.e. non-user builds). r=fabrice
b2g/chrome/content/settings.js
--- a/b2g/chrome/content/settings.js
+++ b/b2g/chrome/content/settings.js
@@ -200,23 +200,33 @@ Components.utils.import('resource://gre/
 // =================== Debugger ====================
 SettingsListener.observe('devtools.debugger.remote-enabled', false, function(value) {
   Services.prefs.setBoolPref('devtools.debugger.remote-enabled', value);
   // This preference is consulted during startup
   Services.prefs.savePrefFile(null);
   value ? RemoteDebugger.start() : RemoteDebugger.stop();
 
 #ifdef MOZ_WIDGET_GONK
+  let enableAdb = value;
+
+  if (Services.prefs.getBoolPref('marionette.defaultPrefs.enabled')) {
+    // Marionette is enabled. Force adb on, since marionette requires remote
+    // debugging to be disabled (we don't want adb to track the remote debugger
+    // setting).
+
+    enableAdb = true;
+  }
+
   // Configure adb.
   try {
     let currentConfig = libcutils.property_get("persist.sys.usb.config");
     let configFuncs = currentConfig.split(",");
     let adbIndex = configFuncs.indexOf("adb");
 
-    if (value) {
+    if (enableAdb) {
       // Add adb to the list of functions, if not already present
       if (adbIndex < 0) {
         configFuncs.push("adb");
       }
     } else {
       // Remove adb from the list of functions, if present
       if (adbIndex >= 0) {
         configFuncs.splice(adbIndex,1);