Commit graph

330 commits

Author SHA1 Message Date
Elliott Hughes
7f80f04a2c Merge "Report errno more often in fastboot." am: 8c5384e50b
am: 272b2694cd

* commit '272b2694cd3556120a3e39b88a0702103e2ed58a':
  Report errno more often in fastboot.

Change-Id: Ie26d2c70e65b70c08017f848f21fb91d6f20e3a4
2016-05-11 21:50:07 +00:00
Elliott Hughes
53ec495b40 Report errno more often in fastboot.
Change-Id: I4b4b47c584a146b38876a379f26ceb20d071c643
2016-05-11 12:39:27 -07:00
Chih-hung Hsieh
fb44ca5178 Merge "Fix google-explicit-constructor warnings." am: 7bdd6a8b5a
am: 427d8d840f

* commit '427d8d840f6ec5ce5767b2ee521e4ac5b7ebd619':
  Fix google-explicit-constructor warnings.

Change-Id: I26dc45aca83f991aa7993f6d4233e0439dd44a22
2016-04-30 05:16:35 +00:00
Chih-hung Hsieh
7bdd6a8b5a Merge "Fix google-explicit-constructor warnings." 2016-04-30 05:10:05 +00:00
Chih-Hung Hsieh
1c563d96f0 Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I4504e98a8db31e0edcbe63c23f9af43eb13e9d86
2016-04-29 15:44:04 -07:00
Elliott Hughes
a73dfe0cf9 Merge "Use more std::string in fastboot." am: 17f3b1bad7
am: 05ec41963d

* commit '05ec41963d7e219a78ef9ffad6d1b1dcf5f4135c':
  Use more std::string in fastboot.

Change-Id: I819aefd792b1c3cd98403f0b25afa21717086e44
2016-04-29 17:58:07 +00:00
Elliott Hughes
2810d00dd9 Use more std::string in fastboot.
Change-Id: Ic8c77eac1e0088627ab650050d9c97c5749e5c39
2016-04-29 08:30:13 -07:00
Elliott Hughes
32fed55e81 Merge "GCC compiler warning fix for sprintf into snprintf" am: d2afbe4
am: 3b4af9a

* commit '3b4af9a44dd6ffa724dfb5f40479f817efc74227':
  GCC compiler warning fix for sprintf into snprintf

Change-Id: I76d8892909721d7218112f5d360eca91ae686e84
2016-04-25 21:20:15 +00:00
Raja M
79bf64dc66 GCC compiler warning fix for sprintf into snprintf
To fix GCC WARNINGS while building.
or
To support error free -D_FORTIFY_SOURCE=2 strict mode compilation.
2016-04-24 09:44:04 +05:30
Alex Deymo
1b245719f1 Merge "fastboot: Minor fix to help text."
am: 92a7043

* commit '92a70439d6767f577546ccf7baf215b113265ae0':
  fastboot: Minor fix to help text.
2016-03-25 04:49:37 +00:00
Alex Deymo
f62d0cd943 fastboot: Minor fix to help text.
Help text had some missing end of line markers.

Bug: None
TEST=make out/host/linux-x86/bin/fastboot; fastboot

Change-Id: Iaa9e4e0a2d70c7d427f5e99e72fe1c2e2c26ee92
2016-03-24 19:51:05 -07:00
Ying Wang
3905db7616 Merge "Also archive adb.exe/fastboot.exe when building win_sdk." am: f666ba41a7
am: aa88fa5837

* commit 'aa88fa58371930b9b7aef8d942f72d7b9a29c8a7':
  Also archive adb.exe/fastboot.exe when building win_sdk.
2016-03-01 19:50:46 +00:00
Ying Wang
71edfc8b9a Also archive adb.exe/fastboot.exe when building win_sdk.
On linux we archive both Linux and Windows binaries.

Bug: 27315911
Change-Id: I17d25cd1ea611a9c917f1e78b47f21a8959eea20
2016-02-29 19:27:06 -08:00
James Hawkins
22b6f7a559 resolve merge conflicts of 0f5d443d0c to nyc-dev-plus-aosp
Change-Id: I850bda0808ae17ade5bc0e667211a599d284d6e3
2016-02-19 11:10:30 -08:00
James Hawkins
588a2cad7f system/core: Cleanup direct calls to opendir by containing in a
std::unique_ptr.

Bug: 26643633
Change-Id: Ia3491fdbff086558da694ae949cf08e4c89d0307
2016-02-18 14:52:46 -08:00
David Pursell
7b3b490fe2 Merge "fastboot: fix TCP protocol version check."
am: bcaeb78f63

* commit 'bcaeb78f63efb1daa83b5ed43aca9775ac1014b3':
  fastboot: fix TCP protocol version check.
2016-02-17 18:25:22 +00:00
David Pursell
aad72a533f fastboot: fix TCP protocol version check.
Currently the TCP handshake fails if the device TCP protocol version
doesn't match the host exactly, but the protocol is supposed to allow
for forwards compatibility by accepting any protocol version >= itself.
That way the other side can potentially lower its protocol to match and
keep going.

This CL fixes the protocol version check and adds corresponding unit
tests.

Bug: http://b/27220700
Change-Id: Ib17f0a55eb910105a27609bc94bf76a30442e92e
2016-02-17 10:00:09 -08:00
David Pursell
22317f2b5a Merge "fastboot: add UDP protocol."
am: c7f43c6ae1

* commit 'c7f43c6ae16a475627e6b3da44dde1cad17ab45a':
  fastboot: add UDP protocol.
2016-02-10 20:03:48 +00:00
David Pursell
4601c978ca fastboot: add UDP protocol.
Implements a UDP protocol for fastboot, documented in
fastboot_protocol.txt.

This version of the protocol does not include multi-packet windowing,
which will likely be needed to achieve reasonable speeds over WiFi.
Since we don't have any WiFi use cases yet, we'd like to get this in
now and update the protocol later if it becomes necessary.

Usage:
  fastboot -s udp:<hostname>[:port] <command>

Bug: http://b/26154914
Change-Id: Ia5bbae6bcd6405671f594d7120b3994746d234d3
2016-02-10 10:21:30 -08:00
David Pursell
09bd9593f0 Merge "fastboot: add Socket timeout detection."
am: d4ac11a57d

* commit 'd4ac11a57d37c56360e59ba75aa2f6ee777e5ed8':
  fastboot: add Socket timeout detection.
2016-02-08 19:00:39 +00:00
David Pursell
c742a7f174 fastboot: add Socket timeout detection.
UDP fastboot will require re-transmission in the case of datagrams
getting lost. This CL adds Socket functionality to easily distinguish
between a normal timeout and a socket failure.

I also found some Windows docs that indicate sockets may become
invalid after a call to recv() times out. This has never occurred in
my testing, but to be safe this switches the timeout implementation
to use select() instead of SO_RCVTIMEO.

Bug: http://b/26154914
Change-Id: Id7b598f8aea5df1a3676d24702b489042d5f9e3a
2016-02-05 13:22:06 -08:00
Elliott Hughes
a8c7e98123 Merge "Fix the version number in the fastboot documentation." am: 80e88a1274
am: 0f242b2dbf

* commit '0f242b2dbfd076fb1a23e6d5f80e317e8afc0a50':
  Fix the version number in the fastboot documentation.
2016-02-03 23:20:23 +00:00
Elliott Hughes
d505cd8db2 Fix the version number in the fastboot documentation.
Bug: https://code.google.com/p/android/issues/detail?id=65414
Change-Id: Ia52101f7c8d59e79583fd9658e001648ff545c66
2016-02-03 14:30:01 -08:00
David Pursell
bafd9f7e63 Merge "fastboot: add TCP protocol." am: 80dc9d8584
am: 6e2adac0c7

* commit '6e2adac0c76b6485ad7eda85f731bfb3f132658a':
  fastboot: add TCP protocol.
2016-02-03 22:07:22 +00:00
David Pursell
2ec418a4c9 fastboot: add TCP protocol.
This CL implements a TCP protocol for use with fastboot. Protocol
description is given in fastboot_protocol.txt, some examples of
expected behavior can also be found in tcp_test.cpp.

Usage is:
  fastboot -s tcp:<hostname>[:port] <command>

Bug: http://b/26558551
Change-Id: If53a514a534489c617db32c4fea8819949121282
2016-02-03 13:57:45 -08:00
David Pursell
dfc0a5d840 Merge "fastboot: fix SocketMock send failures." am: e54ea1c12d
am: 91b4e68738

* commit '91b4e687388e9e90714412d09dd521593f03ef80':
  fastboot: fix SocketMock send failures.
2016-02-03 19:00:18 +00:00
David Pursell
2c094f7983 fastboot: fix SocketMock send failures.
Fixes SocketMock::ExpectSendFailure() to allow unit testing of errors
during send, and adds tests for ExpectSendFailure() and
AddReceiveFailure().

Also adds missing tests to make sure ReceiveAll() continues to read
until failure or all bytes have been read.

Bug: http://b/26157893
Change-Id: I67e7d6de8e8ec4a3b62a6b7d7217f7530862edf7
2016-02-03 10:43:01 -08:00
David Pursell
f722c253e6 Merge "libcutils/fastboot: improve multi-buffer write." am: f6f800ef3c
am: ef0e01c346

* commit 'ef0e01c346b2f60b1941bf3335906de5996785d8':
  libcutils/fastboot: improve multi-buffer write.
2016-02-03 18:13:02 +00:00
David Pursell
b34e4a06ee libcutils/fastboot: improve multi-buffer write.
Fixes libcutils multi-buffer write interface to be more friendly and
hooks into it from the fastboot Socket class.

Bug: http://b/26558551
Change-Id: Ibb3a8428fc379755602de52722c1260f9e345bc0
2016-02-03 10:01:38 -08:00
David Pursell
4659c63114 Merge "fastboot: socket testing improvements." am: f971b6a24b
am: fe12d889e4

* commit 'fe12d889e41b688a84b4727126fde66011ca0ae6':
  fastboot: socket testing improvements.
2016-02-02 19:44:03 +00:00
David Pursell
c3a466960f fastboot: socket testing improvements.
(This code was originally part of a huge fastboot CL but has been split
out to try to make the CLs a little more manageable).

More prep for fastboot TCP and UDP implementations. This CL adds a
SocketMock class that makes it easy to mock out network behavior so we
can unit test the TCP and UDP protocols.

Also uses the new libcutils socket_get_local_port() to avoid hardcoding
a server port in unit tests.

Bug: http://b/26157893.
Change-Id: I1ba10f31e98d7349313fc15f240383d63378a8db
2016-02-02 11:29:10 -08:00
David Pursell
f6012df68d Merge "fastboot: use cutils socket functions." am: bbedd9523f
am: f0bfaf9503

* commit 'f0bfaf95038241c3f8ed65099c7d532a6c112e86':
  fastboot: use cutils socket functions.
2016-01-22 18:46:54 +00:00
David Pursell
572bce2908 fastboot: use cutils socket functions.
Now that cutils has cross-platform socket functionality, we can
restructure fastboot to remove platform-dependent networking code.

This CL adds socket_set_receive_timeout() to libcutils and combines the
fastboot socket code into a single implementation. It also adds TCP
functionality to fastboot sockets, but nothing uses it yet except for
the unit tests. A future CL will add the TCP protocol which will use
this TCP socket implementation.

Bug: http://b/26558551

Change-Id: If613fb348f9332b31fa2c88d67fb1e839923768a
2016-01-21 09:53:11 -08:00
David Pursell
cb56fb4b15 Merge "libcutils: share Windows networking code." am: 1906de1e0f
am: 7a568dbdd6

* commit '7a568dbdd6c1a39a90c01ab89092cb67a9a86198':
  libcutils: share Windows networking code.
2016-01-21 17:03:45 +00:00
David Pursell
1906de1e0f Merge "libcutils: share Windows networking code." 2016-01-21 16:40:00 +00:00
Josh Gao
08550d5cc9 Merge "fastboot: show progress when sending sparse images." am: 6a27196516
am: 69c9274c3e

* commit '69c9274c3ea023a7d3505592fab99f87144a61dd':
  fastboot: show progress when sending sparse images.
2016-01-19 23:08:28 +00:00
Josh Gao
163b83d01c Merge "fastboot: add .clang-format." am: d8ecde09c7
am: 5210031f9c

* commit '5210031f9c9873bbeca5f63af1ec22620590d2c1':
  fastboot: add .clang-format.
2016-01-19 23:06:32 +00:00
Josh Gao
9da9ac5b2a fastboot: show progress when sending sparse images.
Bug: http://b/25443220
Change-Id: Ica0c88aea2a0661f39ff1415ebba464c037651da
2016-01-19 14:50:18 -08:00
Josh Gao
cb73db7cd8 fastboot: add .clang-format.
Change-Id: Iacad00adfa3948118543d680651814b3c8c42858
2016-01-19 14:49:45 -08:00
David Pursell
0eb8e1b706 libcutils: share Windows networking code.
This CL moves Windows networking code from fastboot to libcutils so
that it can be shared with other host programs such as adb.

Not all libcutils networking functions have been implemented for
Windows, just those necessary for fastboot. In the next CL I will do
the same for adb, adding any additional required functions.

Unit tests have also been added to test the functions using a loopback
connection.

Bug: http://b/26236380.
Change-Id: Ibc51a67030fe69a04c23512eefa9d19b055c7c12
2016-01-15 15:57:35 -08:00
Daniel Rosenberg
ba3e38f9e1 Merge "fastboot: Add "--slot other"" am: 6bb8f752ec
am: abf108f6b2

* commit 'abf108f6b2cbcc4aaf7cea9719aff8b569245d60':
  fastboot: Add "--slot other"
2016-01-06 20:56:13 +00:00
Daniel Rosenberg
ed60d0706e Merge "fastboot: correct set_active behavior" am: 275d091441
am: f88b8cbe15

* commit 'f88b8cbe157b4372d4f1277e85ed25315ecd6c30':
  fastboot: correct set_active behavior
2016-01-06 19:49:25 +00:00
Daniel Rosenberg
c1743ba0d4 fastboot: Add "--slot other"
This allows you to flash to a slot other than the current one
without needing to enter the name of the slots.

Change-Id: I6bf8c29817be0a29b1abb005f1e72056cee126df
2016-01-06 19:42:01 +00:00
Daniel Rosenberg
15174d9bc7 fastboot: correct set_active behavior
Removed automatic reboot attached to set_active,
and fixed documentation error.

Change-Id: Idbb1639dc80870c17a6622dc78a7d78c88e268ab
2016-01-05 19:35:54 -08:00
David Pursell
e19a7980b8 Merge "fastboot: implement UDP networking interface." am: b6dfab03b6
am: 9526f21b56

* commit '9526f21b563c13836c75c33495b52d0f6ebc44ce':
  fastboot: implement UDP networking interface.
2015-12-17 00:42:27 +00:00
David Pursell
815c7beae7 fastboot: implement UDP networking interface.
This CL creates a UdpSocket class that provides a simple unified
interface to send and receive UDP packets for all platforms. Nothing
uses this interface yet except for tests.

The eventual goal is to implement a UDP protocol for fastboot, but it
makes the code much simpler and more modular if we handle the low-level
networking here independently of our custom fastboot protocol.

Some of the Windows code is similar to adb. I'd like to create a
library to hold the common functionality, but it is going to be a
little delicate to separate out the features unique to adb (e.g. the
custom file descriptor system), and I don't want to risk breaking
something in adb before the holiday break, so I'm hoping to get this in
for now and merge them early next year.

Tests are included in this CL to exercise this functionality using a
loopback connection.

Bug: http://b/26154763.
Tests: `fastboot_test` loopback tests on Linux, Mac, and Windows 7.
Change-Id: I81d1b7ace8d864246b99f6c80b8e29f64b8aa375
2015-12-16 16:16:08 -08:00
Elliott Hughes
2e83684537 Merge "Share the new adb USB diagnostic code with fastboot." am: efd8c3289e
am: 40f80e25d3

* commit '40f80e25d3f399ece26d5f1ac145921ccb7f5f80':
  Share the new adb USB diagnostic code with fastboot.
2015-12-14 12:47:44 -08:00
Elliott Hughes
1b708d368f Share the new adb USB diagnostic code with fastboot.
Bug: http://b/26134129
Change-Id: Ieaf0651c7b3f8a028760982091ec63a21a5484ba
2015-12-14 10:50:21 -08:00
Elliott Hughes
f65569d497 Merge "Remove fastboot/genkey.sh." am: 796ea6a65d
am: 54a584d722

* commit '54a584d72233c107f58863c659a011f65d4074fb':
  Remove fastboot/genkey.sh.
2015-12-13 13:19:26 -08:00
Elliott Hughes
44b6aefeeb Remove fastboot/genkey.sh.
Some unknown cruft from the pre-cupcake era.

Change-Id: I8964892419cda9781d1506aa7006c51dc00ca33d
2015-12-11 17:57:53 -08:00