adb: add authorizing, connecting states to transport.
Add two states: connecting and authorizing, to disambiguate the offline
and unauthorized states, respectively.
Previously, devices would transition as follows:
offline -> unauthorized -> offline -> online
offline -> unauthorized (when actually unauthorized)
With this patch:
connecting -> authorizing -> online
connecting -> authorizing -> unauthorized (when actually unauthorized)
This allows test automation and the like to distinguish between offline
devices, unauthorized devices, and working devices without having to
do retry loops with arbitrary sleeps on their end.
Test: manually plugging in a device with `while true; do adb shell echo foo; done`
6 files changed