Bug 836973 - Force adb on when marionette is enabled (i.e. non-user builds). r=fabrice, a=tef+
authorDave Hylands <dhylands@mozilla.com>
Fri, 01 Feb 2013 02:04:04 -0800
changeset 118392 b21f703f1db10ed9f40910540a51855345b3ae83
parent 118391 830b5f88e3c343cd6d44d5247d17e5bfd7fbe772
child 118393 4bf63fd3ceafe5a8e041d253ea265a50dba23738
push id18
push userryanvm@gmail.com
push dateFri, 01 Feb 2013 23:13:14 +0000
reviewersfabrice, tef
bugs836973
milestone18.0
Bug 836973 - Force adb on when marionette is enabled (i.e. non-user builds). r=fabrice, a=tef+
b2g/chrome/content/settings.js
--- a/b2g/chrome/content/settings.js
+++ b/b2g/chrome/content/settings.js
@@ -192,23 +192,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);