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

Side by Side Diff: devil/devil/android/sdk/adb_wrapper.py

Issue 2815573003: Fix force stop using wrong "ps" cmd. (Closed)
Patch Set: Fix force stop using wrong "ps" cmd. Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « devil/devil/android/device_utils_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """This module wraps Android's adb tool. 5 """This module wraps Android's adb tool.
6 6
7 This is a thin wrapper around the adb interface. Any additional complexity 7 This is a thin wrapper around the adb interface. Any additional complexity
8 should be delegated to a higher level (ex. DeviceUtils). 8 should be delegated to a higher level (ex. DeviceUtils).
9 """ 9 """
10 10
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 class PersistentShell(object): 128 class PersistentShell(object):
129 '''Class to use persistent shell for ADB. 129 '''Class to use persistent shell for ADB.
130 130
131 This class allows a persistent ADB shell to be created, where multiple 131 This class allows a persistent ADB shell to be created, where multiple
132 commands can be passed into it. This avoids the overhead of starting 132 commands can be passed into it. This avoids the overhead of starting
133 up a new ADB shell for each command. 133 up a new ADB shell for each command.
134 134
135 Example of use: 135 Example of use:
136 with PersistentShell('123456789') as pshell: 136 with PersistentShell('123456789') as pshell:
137 pshell.RunCommand('which ls') 137 pshell.RunCommand('which ls')
138 pshell.RunCommandAndClose('echo TEST') 138 pshell.RunCommand('echo TEST', close=True)
139 ''' 139 '''
140 def __init__(self, serial): 140 def __init__(self, serial):
141 """Initialization function: 141 """Initialization function:
142 142
143 Args: 143 Args:
144 serial: Serial number of device. 144 serial: Serial number of device.
145 """ 145 """
146 self._cmd = [AdbWrapper.GetAdbPath(), '-s', serial, 'shell'] 146 self._cmd = [AdbWrapper.GetAdbPath(), '-s', serial, 'shell']
147 self._process = None 147 self._process = None
148 148
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 @property 908 @property
909 def is_emulator(self): 909 def is_emulator(self):
910 return _EMULATOR_RE.match(self._device_serial) 910 return _EMULATOR_RE.match(self._device_serial)
911 911
912 @property 912 @property
913 def is_ready(self): 913 def is_ready(self):
914 try: 914 try:
915 return self.GetState() == _READY_STATE 915 return self.GetState() == _READY_STATE
916 except device_errors.CommandFailedError: 916 except device_errors.CommandFailedError:
917 return False 917 return False
OLDNEW
« no previous file with comments | « devil/devil/android/device_utils_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698