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

Commit 339fcd99 authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by android-build-merger
Browse files

Merge "Refactorings to match adb_abb to adb_shell code."

am: 463773b7

Change-Id: Ia4724a38e8474bbae94c640ccd9cb3cf7d8f1915
parents 69f21111 463773b7
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -775,17 +775,16 @@ static int adb_abb(int argc, const char** argv) {
        error_exit("abb is not supported by the device");
    }

    optind = 1;  // argv[0] is always "abb", so set `optind` appropriately.

    // Defaults.
    constexpr char escape_char = '~';  // -e
    constexpr bool use_shell_protocol = true;
    constexpr auto shell_type_arg = kShellServiceArgRaw;
    constexpr bool empty_command = false;

    std::string service_string("abb:");
    for (auto i = optind; i < argc; ++i) {
        service_string.append(argv[i]);
        service_string.push_back(ABB_ARG_DELIMETER);
    }
    std::vector<const char*> args(argv + optind, argv + argc);
    std::string service_string = "abb:" + android::base::Join(args, ABB_ARG_DELIMETER);

    D("abb -e 0x%x [%*.s]\n", escape_char, static_cast<int>(service_string.size()),
      service_string.data());