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

Commit 0074ceb7 authored by Luca Stefani's avatar Luca Stefani
Browse files

Revert "adb: Add wait-for-online command"

Replaced by upstream impl

This reverts commit 833628c6.

Change-Id: I47b65162188b77dffd1fff564baf7ae4bdb16ac5
parent 397d2949
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -109,7 +109,6 @@ enum ConnectionState {
    kCsRecovery,
    kCsSideload,
    kCsRescue,
    kCsOnline,
};

inline bool ConnectionStateIsOnline(ConnectionState state) {
+4 −4
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ static void help() {
        "scripting:\n"
        " wait-for[-TRANSPORT]-STATE\n"
        "     wait for device to be in the given state\n"
        "     STATE: device, recovery, rescue, sideload, bootloader, online, or disconnect\n"
        "     STATE: device, recovery, rescue, sideload, bootloader, or disconnect\n"
        "     TRANSPORT: usb, local, or any [default=any]\n"
        " get-state                print offline | bootloader | device\n"
        " get-serialno             print <serial-number>\n"
@@ -1090,11 +1090,11 @@ static bool wait_for_device(const char* service,

    if (components[3] != "any" && components[3] != "bootloader" && components[3] != "device" &&
        components[3] != "recovery" && components[3] != "rescue" && components[3] != "sideload" &&
        components[3] != "online" && components[3] != "disconnect") {
        components[3] != "disconnect") {
        fprintf(stderr,
                "adb: unknown state %s; "
                "expected 'any', 'bootloader', 'device', 'recovery', 'rescue', 'sideload', "
                "'online', or 'disconnect'\n",
                "expected 'any', 'bootloader', 'device', 'recovery', 'rescue', 'sideload', or "
                "'disconnect'\n",
                components[3].c_str());
        return false;
    }
+1 −5
Original line number Diff line number Diff line
@@ -116,9 +116,7 @@ static void wait_for_state(int fd, state_info* sinfo) {
                break;
            }
        } else if (t != nullptr &&
                   (sinfo->state == kCsAny || sinfo->state == t->GetConnectionState() ||
                   (sinfo->state == kCsOnline && (t->GetConnectionState() == kCsRecovery ||
                                                  t->GetConnectionState() == kCsDevice)) )) {
                   (sinfo->state == kCsAny || sinfo->state == t->GetConnectionState())) {
            SendOkay(fd);
            break;
        }
@@ -239,8 +237,6 @@ asocket* host_service_to_socket(std::string_view name, std::string_view serial,
            sinfo->state = kCsAny;
        } else if (name == "-disconnect") {
            sinfo->state = kCsOffline;
        } else if (name == "-online") {
            sinfo->state = kCsOnline;
        } else {
            return nullptr;
        }