diff options
author | Benoit Goby <benoit@android.com> | 2013-01-15 12:36:47 -0800 |
---|---|---|
committer | Benoit Goby <benoit@android.com> | 2013-01-15 17:21:13 -0800 |
commit | 77e8e5851d3b951b5382663bd50f1f83cb531eb2 (patch) | |
tree | bf54c0b6288faa3c723031469d81d2c9958bfee7 /adb/transport.c | |
parent | 345cb066d2e0c774c877a85d3035f298df1daf16 (diff) | |
download | core-77e8e5851d3b951b5382663bd50f1f83cb531eb2.tar.gz core-77e8e5851d3b951b5382663bd50f1f83cb531eb2.tar.bz2 core-77e8e5851d3b951b5382663bd50f1f83cb531eb2.zip |
adb: Add "unauthorized" connection state
Add a new connection state, so that devices, that require confirmation
to allow adb, appear as "unauthorized" in the adb devices lists.
Change-Id: Ib4264bc5736dedecf05bcf8e31896f4d7a91fad8
Diffstat (limited to 'adb/transport.c')
-rw-r--r-- | adb/transport.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/adb/transport.c b/adb/transport.c index 9fd6cc2e6..b4abb66ec 100644 --- a/adb/transport.c +++ b/adb/transport.c @@ -851,6 +851,12 @@ retry: adb_mutex_unlock(&transport_lock); if (result) { + if (result->connection_state == CS_UNAUTHORIZED) { + if (error_out) + *error_out = "device unauthorized. Please check the confirmation dialog on your device."; + result = NULL; + } + /* offline devices are ignored -- they are either being born or dying */ if (result && result->connection_state == CS_OFFLINE) { if (error_out) @@ -888,6 +894,7 @@ static const char *statename(atransport *t) case CS_RECOVERY: return "recovery"; case CS_SIDELOAD: return "sideload"; case CS_NOPERM: return "no permissions"; + case CS_UNAUTHORIZED: return "unauthorized"; default: return "unknown"; } } |