Bug 787203 - [mozdevice] Add remove_forward method to DeviceManagerADB; r?ahal
For adb forward --remove|remove-all
MozReview-Commit-ID: FrfFOCSQl6q
--- a/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
+++ b/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
@@ -179,16 +179,29 @@ class DeviceManagerADB(DeviceManager):
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
"""
if not self._checkCmd(['forward', local, remote], timeout=self.short_timeout) == 0:
raise DMError("Failed to forward socket connection.")
+ def remove_forward(self, local=None):
+ """
+ Turn off forwarding of socket connection.
+ """
+ cmd = ['forward']
+ if local is None:
+ cmd.extend(['--remove-all'])
+ else:
+ cmd.extend(['--remove', local])
+ if not self._checkCmd(cmd, timeout=self.short_timeout) == 0:
+ raise DMError("Failed to remove connection forwarding.")
+
+
def remount(self):
"Remounts the /system partition on the device read-write."
return self._checkCmd(['remount'], timeout=self.short_timeout)
def devices(self):
"Return a list of connected devices as (serial, status) tuples."
proc = self._runCmd(['devices'])
proc.output.pop(0) # ignore first line of output