| 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)
|
|
|