Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: adb/common.py

Issue 2177573003: Add option to send reboot command and not wait for device. (Closed) Base URL: https://github.com/luci/python-adb.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | adb/contrib/adb_commands_safe.py » ('j') | adb/contrib/adb_commands_safe.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: adb/common.py
diff --git a/adb/common.py b/adb/common.py
index 197af011066a6ea0c291b5a63be2314cabf02fc4..a7b2d9f6124d05060f98dd6d910777b247d60872 100644
--- a/adb/common.py
+++ b/adb/common.py
@@ -442,6 +442,17 @@ class TcpHandle(Handle):
finally:
self._connection = None
+ def Reset(self, new_endpoint=None):
+ self.Close()
+ if new_endpoint:
+ if ':' in new_endpoint:
M-A Ruel 2016/07/23 00:58:43 I feel odd about this, shouldn't we create a new i
bpastene 2016/07/23 01:17:39 Yeah; I tried, but ran into a couple of problems:
M-A Ruel 2016/07/23 01:29:34 No, that's fine. Not worth reengineering.
+ (self._host, self._port) = new_endpoint.split(':')
+ else:
+ self._host = new_endpoint
+ self._port = 5555
+ self._serial_number = '%s:%s' % (self._host, self._port)
+ self.Open()
+
def BulkWrite(self, data, timeout_ms=None):
try:
self._connection.settimeout(self.Timeout(timeout_ms) / 1000.0)
« no previous file with comments | « no previous file | adb/contrib/adb_commands_safe.py » ('j') | adb/contrib/adb_commands_safe.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698