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

Commit 09e79a6d authored by Steve Kondik's avatar Steve Kondik
Browse files

adb: Add a few more wait-for commands

 * wait-for-recovery is obvious.
 * wait-for-online will wait for recovery || device

Change-Id: I70f747bcd201a4157b988d7ed49bcc8e5ff4c85f
parent 3611b9e7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -470,6 +470,8 @@ int connection_state(atransport *t);
#define CS_SIDELOAD   6
#define CS_UNAUTHORIZED 7

#define CS_ONLINE    10 /* recovery or device */

extern int HOST;
extern int SHELL_EXIT_NOTIFY_FD;

+6 −0
Original line number Diff line number Diff line
@@ -572,6 +572,12 @@ asocket* host_service_to_socket(const char* name, const char *serial)
        } else if (!strncmp(name, "sideload", strlen("sideload"))) {
            sinfo->transport = kTransportAny;
            sinfo->state = CS_SIDELOAD;
        } else if (!strncmp(name, "recovery", strlen("recovery"))) {
            sinfo->transport = kTransportAny;
            sinfo->state = CS_RECOVERY;
        } else if (!strncmp(name, "online", strlen("online"))) {
            sinfo->transport = kTransportAny;
            sinfo->state = CS_ONLINE;
        } else {
            free(sinfo);
            return NULL;
+4 −1
Original line number Diff line number Diff line
@@ -863,8 +863,11 @@ retry:
                *error_out = "device offline";
            result = NULL;
        }

         /* check for required connection state */
        if (result && state != CS_ANY && result->connection_state != state) {
        if (result && state != CS_ANY && ((state != CS_ONLINE && result->connection_state != state)
                    || (state == CS_ONLINE && !(result->connection_state == CS_DEVICE
                    || result->connection_state == CS_RECOVERY)))) {
            if (error_out)
                *error_out = "invalid device state";
            result = NULL;