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

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: rebase 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') | no next file with comments »
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:
+ (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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698