Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 668cc771 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

adb: print better error message when there are insufficient permissions for a device.



Now, a command like "adb shell" will print "insufficient permissions for device"
instead of "device not found" if adb does not have permissions to communicate with the device.

Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent a8be72f6
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -720,7 +720,11 @@ retry:

    adb_mutex_lock(&transport_lock);
    for (t = transport_list.next; t != &transport_list; t = t->next) {
        if (t->connection_state == CS_NOPERM) continue;
        if (t->connection_state == CS_NOPERM) {
        if (error_out)
            *error_out = "insufficient permissions for device";
            continue;
        }

        /* check for matching serial number */
        if (serial) {
@@ -768,12 +772,6 @@ retry:
                *error_out = "device offline";
            result = NULL;
        }
        if (result && result->connection_state == CS_NOPERM) {
            if (error_out)
                *error_out = "no permissions for device";
            result = NULL;
        }

         /* check for required connection state */
        if (result && state != CS_ANY && result->connection_state != state) {
            if (error_out)