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

Unified Diff: build/android/adb_reverse_forwarder.py

Issue 1088793002: [Android] Remove android_commands uses from build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: docstrings for device_filter.py Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/adb_install_apk.py ('k') | build/android/enable_asserts.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/adb_reverse_forwarder.py
diff --git a/build/android/adb_reverse_forwarder.py b/build/android/adb_reverse_forwarder.py
index 1958fdde018c3afc04f91fdeeb840caca4d11730..b2da6a75809c9413d99dbd84aee8cc9ce818f1a8 100755
--- a/build/android/adb_reverse_forwarder.py
+++ b/build/android/adb_reverse_forwarder.py
@@ -11,12 +11,15 @@ i.e., "adb forward" in reverse. Requires |host_forwarder| and |device_forwarder|
to be built.
"""
+import logging
import optparse
import sys
import time
-from pylib import android_commands
-from pylib import constants, forwarder
+from pylib import constants
+from pylib import forwarder
+from pylib.device import adb_wrapper
+from pylib.device import device_filter
from pylib.device import device_utils
from pylib.utils import run_tests_helper
@@ -51,17 +54,18 @@ def main(argv):
parser.error('Bad port number')
sys.exit(1)
- devices = android_commands.GetAttachedDevices()
+ devices = adb_wrapper.AdbWrapper.Devices(
+ filters=device_filter.DefaultFilters())
if options.device:
- if options.device not in devices:
+ if options.device not in [d.GetDeviceSerial() for d in devices]:
raise Exception('Error: %s not in attached devices %s' % (options.device,
','.join(devices)))
devices = [options.device]
else:
if not devices:
raise Exception('Error: no connected devices')
- print "No device specified. Defaulting to " + devices[0]
+ logging.info('No device specified. Defaulting to %s', devices[0])
device = device_utils.DeviceUtils(devices[0])
constants.SetBuildType(options.build_type)
« no previous file with comments | « build/android/adb_install_apk.py ('k') | build/android/enable_asserts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698