adb_host: Revised handling of device serials.

* Drop support for multiple serials: a single ADBHost controls a single
  device, either using an explicitly provided serial, or without
  specifying any serial when running command.

* In the latter case, we raise an exception whenever a command lists
  more than one device. While this doesn't quite guarantee that the test
  environment is sane, it will probably decrease the number of false
  positives.

* Allow to distinguish between ADB vs fastboot serials: we're seeing
  cases where they are actually distinct. If no fastboot serial
  provided, default to the ADB one.

* Don't pass an explicit use_serial argument between methods: if
  a serial's provided, use that. If not, either use a TCP/IP device
  hostname (if given) or don't add a device specifier at all.

* Some adjustments around TCP/IP vs USB (serial) mode enforcement.

BUG=chromium:548881
TEST=Test successfully switches devices to fastboot and back.

Change-Id: I5ce3781cb397d8a5a5ac15a960d680625f32a585
Reviewed-on: https://chromium-review.googlesource.com/309974
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
1 file changed