Loading adb/adb.cpp +1 −14 Original line number Diff line number Diff line Loading @@ -257,19 +257,6 @@ void send_connect(atransport* t) { send_packet(cp, t); } #if ADB_HOST void SendConnectOnHost(atransport* t) { // Send an empty message before A_CNXN message. This is because the data toggle of the ep_out on // host and ep_in on device may not be the same. apacket* p = get_apacket(); CHECK(p); send_packet(p, t); send_connect(t); } #endif // qual_overwrite is used to overwrite a qualifier string. dst is a // pointer to a char pointer. It is assumed that if *dst is non-NULL, it // was malloc'ed and needs to freed. *dst will be set to a dup of src. Loading Loading @@ -370,7 +357,7 @@ void handle_packet(apacket *p, atransport *t) if (p->msg.arg0){ send_packet(p, t); #if ADB_HOST SendConnectOnHost(t); send_connect(t); #endif } else { t->SetConnectionState(kCsOffline); Loading adb/adb.h +0 −3 Original line number Diff line number Diff line Loading @@ -225,9 +225,6 @@ void handle_online(atransport *t); void handle_offline(atransport *t); void send_connect(atransport *t); #if ADB_HOST void SendConnectOnHost(atransport* t); #endif void parse_banner(const std::string&, atransport* t); Loading adb/bugreport.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ class BugreportStandardStreamsCallback : public StandardStreamsCallbackInterface std::vector<const char*> srcs{src_file_.c_str()}; SetLineMessage("pulling"); status_ = br_->DoSyncPull(srcs, destination.c_str(), true, line_message_.c_str()) ? 0 : 1; br_->DoSyncPull(srcs, destination.c_str(), false, line_message_.c_str()) ? 0 : 1; if (status_ != 0) { fprintf(stderr, "Bug report finished but could not be copied to '%s'.\n" Loading adb/bugreport_test.cpp +11 −11 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ TEST_F(BugreportTest, NoArgumentsNDevice) { .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file), true, StrEq("pulling da_bugreport.zip"))) false, StrEq("pulling da_bugreport.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport"}; Loading @@ -205,7 +205,7 @@ TEST_F(BugreportTest, NoArgumentsPostNDevice) { WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip\n")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file), true, StrEq("pulling da_bugreport.zip"))) false, StrEq("pulling da_bugreport.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport"}; Loading @@ -219,7 +219,7 @@ TEST_F(BugreportTest, OkNDevice) { .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file.zip"}; Loading @@ -235,7 +235,7 @@ TEST_F(BugreportTest, OkNDeviceSplitBuffer) { WithArg<2>(WriteOnStdout("/bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file.zip"}; Loading Loading @@ -271,7 +271,7 @@ TEST_F(BugreportTest, OkProgress) { WithArg<2>(ReturnCallbackDone()))); // clang-format on EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file.zip"}; Loading Loading @@ -302,7 +302,7 @@ TEST_F(BugreportTest, OkProgressAlwaysForward) { WithArg<2>(ReturnCallbackDone()))); // clang-format on EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file.zip"}; Loading @@ -325,7 +325,7 @@ TEST_F(BugreportTest, OkProgressZeroPercentIsNotIgnored) { WithArg<2>(ReturnCallbackDone()))); // clang-format on EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file.zip"}; Loading @@ -344,7 +344,7 @@ TEST_F(BugreportTest, OkDirectory) { WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file), true, StrEq("pulling da_bugreport.zip"))) false, StrEq("pulling da_bugreport.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", td.path}; Loading @@ -358,7 +358,7 @@ TEST_F(BugreportTest, OkNoExtension) { .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip\n")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file"}; Loading @@ -377,7 +377,7 @@ TEST_F(BugreportTest, OkNDeviceDirectory) { WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file), true, StrEq("pulling da_bugreport.zip"))) false, StrEq("pulling da_bugreport.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", td.path}; Loading Loading @@ -458,7 +458,7 @@ TEST_F(BugreportTest, PullFails) { .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, HasSubstr("file.zip"))) false, HasSubstr("file.zip"))) .WillOnce(Return(false)); const char* args[] = {"bugreport", "file.zip"}; Loading adb/client/usb_libusb.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -333,6 +333,13 @@ static void process_device(libusb_device* device) { return; } rc = libusb_set_interface_alt_setting(handle.get(), interface_num, 0); if (rc != 0) { LOG(WARNING) << "failed to set interface alt setting for device '" << device_serial << "'" << libusb_error_name(rc); return; } for (uint8_t endpoint : {bulk_in, bulk_out}) { rc = libusb_clear_halt(handle.get(), endpoint); if (rc != 0) { Loading Loading
adb/adb.cpp +1 −14 Original line number Diff line number Diff line Loading @@ -257,19 +257,6 @@ void send_connect(atransport* t) { send_packet(cp, t); } #if ADB_HOST void SendConnectOnHost(atransport* t) { // Send an empty message before A_CNXN message. This is because the data toggle of the ep_out on // host and ep_in on device may not be the same. apacket* p = get_apacket(); CHECK(p); send_packet(p, t); send_connect(t); } #endif // qual_overwrite is used to overwrite a qualifier string. dst is a // pointer to a char pointer. It is assumed that if *dst is non-NULL, it // was malloc'ed and needs to freed. *dst will be set to a dup of src. Loading Loading @@ -370,7 +357,7 @@ void handle_packet(apacket *p, atransport *t) if (p->msg.arg0){ send_packet(p, t); #if ADB_HOST SendConnectOnHost(t); send_connect(t); #endif } else { t->SetConnectionState(kCsOffline); Loading
adb/adb.h +0 −3 Original line number Diff line number Diff line Loading @@ -225,9 +225,6 @@ void handle_online(atransport *t); void handle_offline(atransport *t); void send_connect(atransport *t); #if ADB_HOST void SendConnectOnHost(atransport* t); #endif void parse_banner(const std::string&, atransport* t); Loading
adb/bugreport.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ class BugreportStandardStreamsCallback : public StandardStreamsCallbackInterface std::vector<const char*> srcs{src_file_.c_str()}; SetLineMessage("pulling"); status_ = br_->DoSyncPull(srcs, destination.c_str(), true, line_message_.c_str()) ? 0 : 1; br_->DoSyncPull(srcs, destination.c_str(), false, line_message_.c_str()) ? 0 : 1; if (status_ != 0) { fprintf(stderr, "Bug report finished but could not be copied to '%s'.\n" Loading
adb/bugreport_test.cpp +11 −11 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ TEST_F(BugreportTest, NoArgumentsNDevice) { .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file), true, StrEq("pulling da_bugreport.zip"))) false, StrEq("pulling da_bugreport.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport"}; Loading @@ -205,7 +205,7 @@ TEST_F(BugreportTest, NoArgumentsPostNDevice) { WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip\n")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file), true, StrEq("pulling da_bugreport.zip"))) false, StrEq("pulling da_bugreport.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport"}; Loading @@ -219,7 +219,7 @@ TEST_F(BugreportTest, OkNDevice) { .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file.zip"}; Loading @@ -235,7 +235,7 @@ TEST_F(BugreportTest, OkNDeviceSplitBuffer) { WithArg<2>(WriteOnStdout("/bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file.zip"}; Loading Loading @@ -271,7 +271,7 @@ TEST_F(BugreportTest, OkProgress) { WithArg<2>(ReturnCallbackDone()))); // clang-format on EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file.zip"}; Loading Loading @@ -302,7 +302,7 @@ TEST_F(BugreportTest, OkProgressAlwaysForward) { WithArg<2>(ReturnCallbackDone()))); // clang-format on EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file.zip"}; Loading @@ -325,7 +325,7 @@ TEST_F(BugreportTest, OkProgressZeroPercentIsNotIgnored) { WithArg<2>(ReturnCallbackDone()))); // clang-format on EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file.zip"}; Loading @@ -344,7 +344,7 @@ TEST_F(BugreportTest, OkDirectory) { WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file), true, StrEq("pulling da_bugreport.zip"))) false, StrEq("pulling da_bugreport.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", td.path}; Loading @@ -358,7 +358,7 @@ TEST_F(BugreportTest, OkNoExtension) { .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip\n")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, StrEq("pulling file.zip"))) false, StrEq("pulling file.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", "file"}; Loading @@ -377,7 +377,7 @@ TEST_F(BugreportTest, OkNDeviceDirectory) { WithArg<2>(WriteOnStdout("OK:/device/da_bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file), true, StrEq("pulling da_bugreport.zip"))) false, StrEq("pulling da_bugreport.zip"))) .WillOnce(Return(true)); const char* args[] = {"bugreport", td.path}; Loading Loading @@ -458,7 +458,7 @@ TEST_F(BugreportTest, PullFails) { .WillOnce(DoAll(WithArg<2>(WriteOnStdout("OK:/device/bugreport.zip")), WithArg<2>(ReturnCallbackDone()))); EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"), true, HasSubstr("file.zip"))) false, HasSubstr("file.zip"))) .WillOnce(Return(false)); const char* args[] = {"bugreport", "file.zip"}; Loading
adb/client/usb_libusb.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -333,6 +333,13 @@ static void process_device(libusb_device* device) { return; } rc = libusb_set_interface_alt_setting(handle.get(), interface_num, 0); if (rc != 0) { LOG(WARNING) << "failed to set interface alt setting for device '" << device_serial << "'" << libusb_error_name(rc); return; } for (uint8_t endpoint : {bulk_in, bulk_out}) { rc = libusb_clear_halt(handle.get(), endpoint); if (rc != 0) { Loading