History log of /system/core/adb/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
85366c15d4e45f453835f2261020acedf6b51bab 07-Jun-2017 Josh Gao <jmgao@google.com> adb: remove SendConnectOnHost.

This logic appears to be racy, and it shouldn't actually be needed, if
our devices follow the USB spec. Use libusb_set_interface_alt_setting
on device initialization as well, to add one more thing that should
reset the data toggles.

Bug: 67320882
Bug: http://b/32952319
Test: python test_device.py
Change-Id: I392198af3d72c524b893e5056afa2b4617cea49c
(cherry picked from commit 4b5d4da6f6a863638c8100cde5af834a83ac8956)
db.cpp
db.h
lient/usb_libusb.cpp
ransport.cpp
ransport.h
ransport_usb.cpp
59dc0ecaaa3409e1b5510d15a0b753289880613d 13-Sep-2017 Josh Gao <jmgao@google.com> adb: partially revert b5e11415.

Revert the write_msg_lock part of commit b5e11415. A write which hangs
will hold onto the mutex, preventing the device kick from ever
happening, which also causes lots of other stuff to hang, due to Kick
being called with the transport lock taken.

Bug: 67320882
Test: python test_devices.py
Change-Id: Ie7c958799c93cad287c32d6bbef30c07f40c2d51
(cherry picked from commit 33d14b874844b21b4f14e25c5234c96fab7baeb3)
est_device.py
ransport.cpp
ransport.h
e3585684d93710cefb59dd410de0c6c07f804c60 12-Sep-2017 Josh Gao <jmgao@google.com> adb: reformat comments.

Bug: 67320882
Test: none
Change-Id: Ib484f701f66cdb57f303dbd6d5eb2e5a15abdc0e
(cherry picked from commit 55c8b34f144ab37f0e8a9df4b2399b74f155408f)
ocket.h
f0a4fb6ea516e895ee6740cb192e7fa16f539892 18-Aug-2017 Huihong Luo <huisinro@google.com> Fix bug #37284906, adb shell crashes on windows with invalid options.
For example, "adb.exe shell -list" crashes without this fix.
Test: adb.exe shell -list-packages

Bug: 67320882
Change-Id: I96be44128ff3ecab7804b70074cbde630b3fc3d1
(cherry picked from commit af39885c9fec7faeca393e2dc54ff8b4bba3ca6c)
ommandline.cpp
ec92e5f194fcad0e847df30497e8b70146c6e5ce 16-Aug-2017 Felipe Leme <felipeal@google.com> Don't preserve file attributes when pulling bugreport file...

...otherwise it could have weird dates when the device clock is wrong.

Bug: 67320882
Test: m -j32 adb && ./out/host/linux-x86/bin/adb bugreport test.zip && ls -l test.zip
Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test

Fixes: 63927360

Change-Id: I3f87277f1acb97212a87b89639e42b6d7d300faa
(cherry picked from commit 4bfddbd20e3bf11ffc31c8c4177a13ed14ab1a11)
ugreport.cpp
ugreport_test.cpp
0617eb7d83cbce9f577c76a2fbb291d53882cdca 02-Aug-2017 Elliott Hughes <enh@google.com> Fix reference to out of scope local in adb_thread_setname.

Bug: 67320882
Bug: https://android-review.googlesource.com/#/c/168725/5/adb/sysdeps.h@639
Test: boots, adbd thread names look sane
Signed-off-by: Ivan Maidanski <i.maidanski@samsung.com>
Change-Id: Ib3bdf53658f3903de8f0a5688f7d77745e677c77
(cherry picked from commit 7462f1858ce696c651442f74e2fb0e1b664b29b5)
ysdeps.h
3f526fe1e33b3ebd240ff7bee9c4da44621608a3 29-Sep-2017 Josh Gao <jmgao@google.com> adbd: improve thread names.

Name each service thread specifically to improve debuggability.

Bug: http://b/65648324
Bug: 64709603 (presubmit balking at the line above)
Test: adb shell debuggerd -b `adb shell pidof adbd` during a sync
Change-Id: I644e25fc2f14a26eafd19f596e4e8f3c2bb79967
(cherry picked from commit bcadc77550d22d866b179f745450b797e2d2bfe6)
ervices.cpp
hell_service.cpp
c4c0a7136b7736f26f065c600a766d2400ace76c 16-Aug-2017 Ting-Yuan Huang <laszio@google.com> Fix a potential memory leak

Bug: 65648324
Test: Built without seeing the warnings
Change-Id: I934509c78482af9ef7dc447c807f6450484b4b38
(cherry picked from commit f26cf6d52095a63f822ffc02d3b263543bdec0d9)
ervices.cpp
2b933918fcdbfb411502a9b12d77d6a1895855ce 13-Sep-2017 Josh Gao <jmgao@google.com> adb: add lock to remove_socket.

The comment that was previously here says that local_socket_list_lock
must be taken, but this function is exposed to external callers that
can't possibly take the lock.

Bug: http://b/65419665
Bug: 64709603 (presubmit balking at the line above)
Test: python test_device.py
Change-Id: I12d464933936b2a210a827ccf19ea201020d8d78
(cherry picked from commit 62c92f0c0529d8d1817afb4ff0c83151e4bb0ea0)
ockets.cpp
c78ecca70b44be14b06f526f17db199773ad160c 13-Sep-2017 Josh Gao <jmgao@google.com> Revert "adb: fix deadlock between transport_unref and usb_close."

This reverts commit 7e197ef83307ffcf2f55d1b8a603d0d3bd2e1d4d.

The mutex lock in transport_unref hides a race that seems otherwise
hard to fix. Specifically, there's no synchronization between acquiring
a transport and attaching it to an asocket*, leading to badness if the
transport is closed in between the two operations.

Fix the original problem the reverted patch addressed by manually
unlocking before calling unregister_usb_transport.

Bug: http://b/65419665
Bug: 64709603 (presubmit balking at the line above)
Test: python test_device.py
Change-Id: I0ed0044129b1671b2c5dd1b9fa2e70a9b4475dc5
(cherry picked from commit e48ecce671a2ab6647cc26a3cb11163aec0b712c)
lient/usb_libusb.cpp
ransport.cpp
ransport.h
1bd8498fc89d14b98e64142e07ad0c35c3bbffed 17-Aug-2017 Josh Gao <jmgao@google.com> adb: allow selection of a specific transport.

Extend device selection to allow selecting a specific transport via
monotonically increasing identifier (visible in devices -l).

This is useful when using multiple devices (like hikey960...) that
have identical bogus serial numbers like 0123456789ABCDEF.

Bug: http://b/37043226
Bug: 65419665
Test: adb -t {1, 2, 9999999} {get-serialno, shell, features}
Change-Id: I55e5dc5a406a4eeee0012e39b52e8cd232e608a6
(cherry picked from commit b122b175555d80b1d13dc1d864126f531e224d84)
db.cpp
db.h
db_client.cpp
db_client.h
ugreport.cpp
ugreport.h
ugreport_test.cpp
ommandline.cpp
ommandline.h
ervices.cpp
ockets.cpp
ransport.cpp
ransport.h
39103b95c8a3d666974f929647c28d1d9f51b143 17-Aug-2017 Josh Gao <jmgao@google.com> adb: fix deadlock in kick_all_transports.

Previously, kick_all_transports would deadlock if there were any
inaccessible transports, because the transport kick function would call
unregister_usb_transport, which attempts to take the already-held
transport lock.

Fix this by switching the transport lock over to a recursive mutex.

Bug: 65419665
Test: manual
Change-Id: If61296ff4745e1699f3e216811c1383582627604
(cherry picked from commit 1db71afe97c0c73167bc5d1fffea574b65bfa32c)
ransport.cpp
9fa61b4df3443e5c0a5e393af85e8e59b686fa14 31-Aug-2017 Bowgo Tsai <bowgotsai@google.com> Revert "adbd: lessen security constraints when the device is unlocked"

This reverts commit f1d3dbc32f18d9b3604da03bc043c1b4cc3f5a35.

With the following changes to move /sbin/adbd to /system/bin/adbd,
we don't need this workaround anymore.

https://android-review.googlesource.com/#/q/topic:move-adbd-to-system+(status:open+OR+status:merged)

Bug: 63313955
Bug: 63381692
Bug: 64822208
Test: 'adb root' works in VTS for a non-A/B device (userdebug GSI + user boot.img)

Change-Id: Ic1249d6abd7d6e6e7380a661df16d25447853a48
Merged-In: Ic1249d6abd7d6e6e7380a661df16d25447853a48
(cherry picked from commit 0603ec4294bc92449643608ee5f18e172d99fce0)
ndroid.mk
aemon/main.cpp
a2f1335819191a0ab29aa79d343ddf7376495af3 28-Aug-2017 Josh Gao <jmgao@google.com> adbd: don't spin if file sync read fails.

Bug: http://b/64508974
Bug: 64709603 (presubmit balking at the line above)
Test: mma
Change-Id: Ifba6a9dea3138b6d2a62c91cc0532f63986c048a
(cherry picked from commit 1d6c01b53d4b40476225f7e074cbd7c4d50dda04)
ile_sync_service.cpp
0bb4cb6fa211f063890d0d27db82853ebf19b878 18-Aug-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Move adbd from root to system" into oc-mr1-dev
2e93eda69cf20d9c04d56ea6bf1e2ea62ad62eb4 15-Aug-2017 Elliott Hughes <enh@google.com> Don't include the build number in the adbd binary.

We want repeatable builds for minimal OTAs.

Bug: http://b/64634017
Bug: 64709603 (presubmit balking at the line above)
Test: repeated builds after `touch daemon/main.cpp` keep same md5sum
Change-Id: Iedeb44377ea45bbf20e2212760802198a57dc14a
aemon/main.cpp
93defc17f376041437e5157a7c4d9e0344441811 28-Jul-2017 Bowgo Tsai <bowgotsai@google.com> Move adbd from root to system

Bug: 63910933
Test: normal boot sailfish, checks adb works
Test: recovery boot sailfish, checks adb works
Test: normal boot bullhead, checks adb works
Test: recovery boot bullhead, checks adb works

Change-Id: I1b27910c06a4172ca718b3344736ec8e3429f477
ndroid.mk
60364171dab5a86e7c8d0926e5a9ca69810dc55e 27-Jul-2017 Josh Gao <jmgao@google.com> Merge "adbd: add logging to troubleshoot usb issues." into oc-dr1-dev
am: 4ee59e0b51

Change-Id: I418023c78988508c72557f2c7572efa163a174ef
8f484a6896db26be9eef47cb2bf33166e98e6a2e 26-Jul-2017 Josh Gao <jmgao@google.com> adbd: add logging to troubleshoot usb issues.

Bug: http://b/63899881
Bug: http://b/63901259
Bug: http://b/63904904
Test: treehugger
Change-Id: Ifbc3caa6b416093bf8e127194003747c910352dc
(cherry picked from commit 184f571cfdf544963cff7450451dff081aa6e626)
dbd_auth.cpp
aemon/usb.cpp
ransport_usb.cpp
9679967dac5cd1100075366726613ab47b7c9dc4 18-Jul-2017 Bowgo Tsai <bowgotsai@google.com> Merge "adbd: lessen security constraints when the device is unlocked" am: e03665142e am: 0fe0ced23c
am: 620f6e65b3

Change-Id: I532c68a077019cbf133db5cbdcf967509415687b
f1d3dbc32f18d9b3604da03bc043c1b4cc3f5a35 11-Jul-2017 Bowgo Tsai <bowgotsai@google.com> adbd: lessen security constraints when the device is unlocked

ALLOW_ADBD_ROOT ('adb root') and ALLOW_ADBD_NO_AUTH (ro.adb.secure = 0)
are false in user build. This prevents a non-A/B device from running
Treble VTS because it requires 'adb root'. Without ALLOW_ADBD_NO_AUTH,
adb still can work if ro.adb.secure = 1. However, allowing it to be 0
is better for test automation.

The image combination in VTS is:
- system.img (userdebug): provided by Googlg
- boot.img (user): provided by the OEM <-- adbd is here
- vendor.img (user): provided by the OEM

This change allows 'adb root' and 'ro.adb.secure = 0' when the device is
unlocked in user build. No changes for userdebug/eng builds.

Note that the device must be unlocked when running VTS. Otherwise,
verified boot will prevent it from booting the system.img provided by
Google (no verity metadata).

Bug: 63313955
Bug: 63381692
Test: use the above image combination, check 'adb root' and
'ro.adb.secure = 0' can work

Change-Id: I109d96c950e54c4fb0ac0c98b989a20593681e52
ndroid.mk
aemon/main.cpp
aabd9a09b59b8a62c5b8cd4cba63c0d9fe390a67 26-Jun-2017 Josh Gao <jmgao@google.com> Revert "adb: turn on libusb by default."

This reverts commit f2f0b318508fec66fc07044b34f602960f399e5b.

libusb seems to be causing flakiness on some machines. Disable it for
now.

Bug: http://b/62962248
Test: python test_device.py (with DeviceOfflineTest commented out)
Change-Id: Ia9de78ab772c22574cf5ca7facb78f22af6d7a71
(cherry picked from commit 969110ca4aa8dd26a8c77f681b19d6f74c11cd93)
ransport_usb.cpp
6c95c3edcd00a0d722768244bafdf29c9b96d16c 28-Jun-2017 Dan Albert <danalbert@google.com> Merge "Indicate that a packet was truncated." am: 046160959c am: e76c8020ba
am: c83ec67ec3

Change-Id: I61c12bc6fbcd205c2421831a64ffb783249a2222
046160959cf92e90d9d07737fc80abd76dc80a53 28-Jun-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Indicate that a packet was truncated."
9893f93950cb6fce83ca3cff9cfced6ae2e9118c 27-Jun-2017 Dan Albert <danalbert@google.com> Indicate that a packet was truncated.

Test: make checkbuild, check adb log
Bug: None
Change-Id: I0006ed284697f01966fdd79ca0b05dbc6d2eecf0
db_utils.cpp
cb39742d3a863c7c699b2ec224e78de63ce4ac5a 27-Jun-2017 Josh Gao <jmgao@google.com> Merge "Revert "adb: turn on libusb by default."" am: b22067677e am: de931dab2d
am: 947a301852

Change-Id: Ideabacf8cd79adaf6fb828874ac636ed88707240
b22067677e0090e5c6de48c19c9d66b9de1b5ca8 26-Jun-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Revert "adb: turn on libusb by default.""
969110ca4aa8dd26a8c77f681b19d6f74c11cd93 26-Jun-2017 Josh Gao <jmgao@google.com> Revert "adb: turn on libusb by default."

This reverts commit f2f0b318508fec66fc07044b34f602960f399e5b.

libusb seems to be causing flakiness on some machines. Disable it for
now.

Bug: http://b/62962248
Test: python test_device.py (with DeviceOfflineTest commented out)
Change-Id: Ia9de78ab772c22574cf5ca7facb78f22af6d7a71
ransport_usb.cpp
b7806433bfb18990157f1f2154170c08c683ab52 21-Jun-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "adb: increase the shell command length limit." into oc-dr1-dev
b76034e7559c4ecb9e7dcf4c6d612b1014c07622 21-Jun-2017 Elliott Hughes <enh@google.com> Merge "Give a clear error message if we can't start the server." am: b6d3f28287 am: 1496863091
am: 07db226264

Change-Id: Ic2244ee02ca83ccdffcfbefac49797c2e4f7d459
b6d3f282875416c3817aa163802f4b46b10bd981 21-Jun-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Give a clear error message if we can't start the server."
6eadee860798bf4e0be0293450017fbc95ff41c8 15-Jun-2017 Elliott Hughes <enh@google.com> Give a clear error message if we can't start the server.

Bug: http://b/35218713
Test: adb kill-server ; export HOME=/ ; adb devices
Change-Id: I53cc30213be0eab84e42b09c7b501362d6e44b05
db.cpp
db_utils.cpp
db_utils.h
lient/main.cpp
34abac7d360c7983d1e647c9cf691e9b395c49b0 17-Jun-2017 Josh Gao <jmgao@google.com> adb: increase the shell command length limit.

Relax the shell command length limits when talking to an adbd with the
shell protocol.

shell is pretty much the only service that takes an arbitrarily long
string, so this is somewhat safe.

Bug: http://b/37716055
Test: `adb shell $(python -c 'print "echo " + "f" * (32*1024)') | wc` on L and master

Merged-In: I0737fd2244530ef8080f300cd3a3549a1ab93465
Change-Id: I0737fd2244530ef8080f300cd3a3549a1ab93465
db_client.cpp
db_io.cpp
ommandline.cpp
ockets.cpp
est_device.py
d1f7fef69b8a65195f104eff8051fc808a5b5706 08-Jun-2017 Josh Gao <jmgao@google.com> adb: fix deadlock between transport_unref and usb_close.

Fix a deadlock that happened when a reader/writer thread released a
transport while the hotplug thread attempted to handle a device
disconnection. Decrementing a transport refcount to zero would hold the
global transport mutex and attempt to take the usb handles mutex, while
the hotplug thread would hold the usb handles mutex and try to call
unregister_usb_transport, which would attempt to take the global
transport mutex.

Resolve this by making transport_unref not take the global transport
mutex.

Bug: http://b/62423753
Test: python test_device.py
Merged-In: Ib48b80a2091a254527f3a7d945b6a11fae61f937
Change-Id: Ib48b80a2091a254527f3a7d945b6a11fae61f937
(cherry picked from commit 7e197ef83307ffcf2f55d1b8a603d0d3bd2e1d4d)
ransport.cpp
ransport.h
24e8e0d0d8054cd225aa092a0c208911dffe5809 18-Jun-2017 Josh Gao <jmgao@google.com> Merge "adb: increase the shell command length limit." am: 9d2e688b9a am: 749d2a0ab5
am: 3df484eeab

Change-Id: I90d845f1c2b6aa767a7c5540b25619724f3b2331
9d2e688b9ab5abdb3d6c191907a5f44cb3c9833f 17-Jun-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: increase the shell command length limit."
a019f781417ea2351ace55603fc0906051f165c6 17-Jun-2017 Josh Gao <jmgao@google.com> adb: increase the shell command length limit.

Relax the shell command length limits when talking to an adbd with the
shell protocol.

shell is pretty much the only service that takes an arbitrarily long
string, so this is somewhat safe.

Bug: http://b/37716055
Test: `adb shell $(python -c 'print "echo " + "f" * (32*1024)') | wc` on L and master
Change-Id: I0737fd2244530ef8080f300cd3a3549a1ab93465
db_client.cpp
db_io.cpp
ommandline.cpp
ockets.cpp
est_device.py
7ff1e56f596b863e479a5ef389616ecc4488322c 13-Jun-2017 Josh Gao <jmgao@google.com> Merge "adb: fix deadlock between transport_unref and usb_close." am: 6f61a6d9c4 am: 2a8ce10cd8
am: 64523c01bd

Change-Id: I94128840430281a54c74cdfb2b35744b4730942f
6f61a6d9c4763a5d2ba0bed94b03c96d96f5b7d5 13-Jun-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: fix deadlock between transport_unref and usb_close."
c616a8ad84fb5e87a71e7755b7244acd34d3904a 12-Jun-2017 Nicolas Norvez <norvez@google.com> Merge "adbd: optionally use qemud pipe without ro.kernel.qemu" am: b3c363f32c am: 516ee2445d
am: 6ff249f483

Change-Id: I7a5886b9a9c325036007ad9251b0952fdbd7a206
717f15353f17f86cfad8dc952fd68c680f702dcc 06-Jun-2017 Nicolas Norvez <norvez@google.com> adbd: optionally use qemud pipe without ro.kernel.qemu

adbd currently decides to use the QEMUD pipe if ro.kernel.qemu=1, as set
for ranchu. The Android container in Chrome OS doesn't have that
property set and it can't be set to 1 because it's used as equivalent to
"runs inside an emulator" throughout Android and changes the way
graphics are handled, whether Bluetooth is supported, etc., behaviour
that we do not want to trigger in Chrome OS.

adbd now also checks service.adb.transport to decide whether to use the
QEMUD (goldfish) pipe.
adbd still first checks for ro.kernel.qemu to preserve existing
behaviour and will still fallback to TCP if it can't use Goldfish.

Bug: 38497992
Test: tested by jmgao@ -thanks!- on aosp_angler, adb still works.

Change-Id: I8370704145ae7301ac7aeef81c5cbd94cfcb7fd7
ransport_local.cpp
7e197ef83307ffcf2f55d1b8a603d0d3bd2e1d4d 08-Jun-2017 Josh Gao <jmgao@google.com> adb: fix deadlock between transport_unref and usb_close.

Fix a deadlock that happened when a reader/writer thread released a
transport while the hotplug thread attempted to handle a device
disconnection. Decrementing a transport refcount to zero would hold the
global transport mutex and attempt to take the usb handles mutex, while
the hotplug thread would hold the usb handles mutex and try to call
unregister_usb_transport, which would attempt to take the global
transport mutex.

Resolve this by making transport_unref not take the global transport
mutex.

Bug: http://b/62423753
Test: python test_device.py
Change-Id: Ib48b80a2091a254527f3a7d945b6a11fae61f937
ransport.cpp
ransport.h
806ca1a1b0dc4db749fb3b71b0209ff04336609e 07-Jun-2017 Josh Gao <jmgao@google.com> Merge changes Id51dcb18,I2517dcb9 am: 4db472b779 am: aa3c3fc3be
am: 4b32a1f8b8

Change-Id: I9b9a5f594dd9a20bbf6dc2fead193433deb51942
fd79f01baf5a8b60c4172fc183579b9c796edbd3 02-Jun-2017 Josh Gao <jmgao@google.com> adb: libusb: switch from polling for accessibility to a sleep.

For unclear reasons, it seems that for some people, devices are
becoming accessible, inaccessible, and then inaccessible again.
Switch to a sleep for now.

Bug: http://b/62200735
Test: manual
Merged-In: Id51dcb188c3534a57c35cbfd30a181c99115a23c
Change-Id: Id51dcb188c3534a57c35cbfd30a181c99115a23c
(cherry picked from commit 5b8b10e078ef12f21144cdb5fbc932dda47be212)
lient/usb_libusb.cpp
f74dd42e4e20bc09748aa5157186b05bdf31f74a 02-Jun-2017 Josh Gao <jmgao@google.com> adb: improve race between device_connected and device_disconnected.

If a device is unplugged while it's being processed, we can be inside
register_usb_transport still when we call unregister_usb_transport,
leading to bad things happening. Move the call of
register_usb_transport into the scope guarded by usb_handles_mutex.

Bug: http://b/62200735
Test: manual
Merged-In: I2517dcb9d30d9a08cebbb5f715ae3fd30c510109
Change-Id: I2517dcb9d30d9a08cebbb5f715ae3fd30c510109
(cherry picked from commit 7dd382ded948aa5adae3618f99d00c14c3703d05)
lient/usb_libusb.cpp
5b8b10e078ef12f21144cdb5fbc932dda47be212 02-Jun-2017 Josh Gao <jmgao@google.com> adb: libusb: switch from polling for accessibility to a sleep.

For unclear reasons, it seems that for some people, devices are
becoming accessible, inaccessible, and then inaccessible again.
Switch to a sleep for now.

Bug: http://b/62200735
Test: manual
Change-Id: Id51dcb188c3534a57c35cbfd30a181c99115a23c
lient/usb_libusb.cpp
7dd382ded948aa5adae3618f99d00c14c3703d05 02-Jun-2017 Josh Gao <jmgao@google.com> adb: improve race between device_connected and device_disconnected.

If a device is unplugged while it's being processed, we can be inside
register_usb_transport still when we call unregister_usb_transport,
leading to bad things happening. Move the call of
register_usb_transport into the scope guarded by usb_handles_mutex.

Bug: http://b/62200735
Test: manual
Change-Id: I2517dcb9d30d9a08cebbb5f715ae3fd30c510109
lient/usb_libusb.cpp
8e2661eedcef9fb52f0e2c0baf84de1d33461a0c 06-Jun-2017 Josh Gao <jmgao@google.com> Merge changes I6c6bf61b,I3fb0b3a8 am: 3160a25010 am: 9d7880fe96 am: 14f749c2c4
am: 2d30a74181

Change-Id: I57a3916c312b8cc23c616232e84ad6c5507b5a39
60b8c26520922f296a36efb17b8914b6f1e115ea 06-Jun-2017 Josh Gao <jmgao@google.com> adb: libusb: don't try to delete a usb_handle twice.

Previously, we would attempt to delete a usb_handle in both
device_disconnected and usb_close. If the one in device_disconnected
happened to happen first, usb_close would abort when it failed to find
the handle it was supposed to own.

Bug: http://b/62020217
Test: unplugging device on darwin
Change-Id: I6c6bf61bf89a4d9a23458c00b457080d3d6cc744
lient/usb_libusb.cpp
664a618c069b52d2e03d287d164dfdacd6038489 05-Jun-2017 Josh Gao <jmgao@google.com> adb: don't hold queue lock while performing callbacks.

Fix yet another source of deadlocks.

Bug: http://b/62020217
Test: unplugged device on darwin
Change-Id: I3fb0b3a84c56aed7d0da8ddba36e2d01fdb682ee
db_utils.h
f2bd9a1b6f17999990b84060d13b575724af8e09 02-Jun-2017 Josh Gao <jmgao@google.com> Merge "adb: reunregress waiting for device on start-server." am: 72076d1aa7 am: 08a70ac6e5 am: 986ba5bbbb
am: 86aeea69f2

Change-Id: Icfb77a5a596ebd9207793d9c7929bebb992de40d
b4ad076ede3e2c70f9444eb6eb1c76b031d714de 01-Jun-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Send color space information with screenshots"
3a4e80ab8a5e0c88590f3d593e4d3d0337c762c1 01-Jun-2017 Romain Guy <romainguy@google.com> Send color space information with screenshots

Version 2 of the framebuffer protocol in adb can now be used to read
the color space information of the screenshot: unknown (native),
sRGB or Display P3.

Bug: 29940137
Test: Manual
Change-Id: I037da58e1c4f6e9e874d72348140c067640c6931
ramebuffer_service.cpp
0b13c89f7a4df0c3105ca2aa4d9406ae4964fd8b 31-May-2017 Josh Gao <jmgao@google.com> adb: reunregress waiting for device on start-server.

Move the invocation of adb_notify_device_scan_complete to
the end of device_connected, where we decrement connecting_devices.
Also, create a dedicated thread for handling hotplug events, instead of
reusing the main thread for this, since the main thread blocks until
device scan is complete.

Test: `adb kill-server; adb devices`
Change-Id: Ia73b1a57538174282a48ef73ab0a3e58152d6f83
db.cpp
db_utils.h
lient/usb_libusb.cpp
2f8dc5c7854a83598079eb6bb7f266580a5924b9 31-May-2017 Josh Gao <jmgao@google.com> Merge "adb: fix deadlock." am: 68599f5759 am: d5a2cdb72c am: a08c949c7a
am: 86d63c89b0

Change-Id: I7c45e6fcf3327d97ff15adbaa47df7ad08d4d0b2
68599f57593a76af5d567d97e04652f4cd9f11a7 31-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: fix deadlock."
d1a3e8f1ab653831a3cc4c2a90fb0f8b7a2a95ac 31-May-2017 Josh Gao <jmgao@google.com> adb: fix deadlock.

libusb hotplug callbacks are called with the libusb lock taken, and we
call into libusb with our local mutex, so we need to enforce an ordering
between the two. Instead of calling device_connected or
device_disconnected directly, enqueue them onto the main thread.

Bug: http://b/62200735
Test: manually hotplugged a device
Change-Id: Ic5d55db83b47f4bb60f124ce94ddfe06f5f1a0c6
lient/usb_libusb.cpp
51dff9791e47ae7bc027be0c5bc07a89ce2f43e3 25-May-2017 GuangHui Liu <ghliu@google.com> Merge "Create build target to pull adb test scripts." am: 9c0a541f08 am: 0daaf93424 am: 621e253c43
am: 3b9865faa9

Change-Id: Ic5fb3113f33aa7bc0bfac3366862ce0236768e20
9c0a541f0811e4211a414e6987d03aa0111a4efa 25-May-2017 GuangHui Liu <ghliu@google.com> Merge "Create build target to pull adb test scripts."
8baa2168afc6f06ee8c1fb75b19c5a213643a2fe 24-May-2017 Felipe Leme <felipeal@google.com> Merge "Always print the initial bugreport progress message." am: 5b17d7131b am: 8b54eb7681 am: 916a84e38b
am: bcb2f87c5c

Change-Id: Ic9988557ad259439ad72b43c154d8d092f540088
a1a43715177e4cce7d4483100c5e7fe20ce0228a 24-May-2017 Dan Albert <danalbert@google.com> Merge "Add host feature for `push --sync` support." am: 886e6cac05 am: e2d7a50b69 am: 311f93faca
am: e0e9e4661b

Change-Id: I9909f7e52fc60b2446d84d1fc5da82a3925f921e
e5d665b46f5bbc841ab3eeb2070f390932f1a239 24-May-2017 Felipe Leme <felipeal@google.com> Always print the initial bugreport progress message.

Otherwise, it might take seconds to display the initial percentage,
and the user might thing something is wrong and CTRL-C the process.

Fixes: 62003852
Test: added BugreportTest.OkProgressZeroPercentIsNotIgnored
Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test --gtest_filter=BugreportTest.*

Change-Id: I8e7dbb28666c825c1408d5d204f813064fc3048f
ugreport.cpp
ugreport_test.cpp
5176df8d4a3f43aed35aa17508a0eb862c262ea4 23-May-2017 Dan Albert <danalbert@google.com> Add host feature for `push --sync` support.

Test: adb host-features | grep push_sync
Bug: None
Change-Id: Ia7a7e9c3c2e6632a9c954fbad8f64602a21d9757
db.cpp
ransport.cpp
ransport.h
41bda344a99011ac9591a5279914ed0e94f52eee 10-May-2017 GuangHui Liu <ghliu@google.com> Create build target to pull adb test scripts.

Test: m adb_integration_test_adb adb_integration_test_device

Change-Id: I8c97af44ecf65eeae8a8dd678c43ad1d9f6c8a51
ndroid.bp
ndroid.mk
8b4f5d97ce900f87e65825273e7477406b098862 23-May-2017 Josh Gao <jmgao@google.com> Merge changes I8d0c60e5,Ib8ad0ad6 am: a6bb369cb0 am: c7d9eb8636 am: a1c2561863
am: fb37f521b0

Change-Id: Ib67fcd1ff88df4e379ce92693eaa339d2dad0fbb
a6bb369cb0b1d20d3c592827a37316315cc2410a 23-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge changes I8d0c60e5,Ib8ad0ad6

* changes:
adb: boolify check_header and check_data.
adb: redirect stdout/stderr before initializing usb.
dfc0ba92a84fde48897b6c3a17b572adce8e4adf 19-May-2017 Dan Albert <danalbert@google.com> Merge "Add --sync support to push." am: 62db5fcee0 am: d50b10544b am: 141f9c46d5
am: 8572f515fd

Change-Id: I29fe1ae0cf6be95b7bd44aaaed87a06065229c16
06b0d6b01bee05a0604dcbb648bebbf7e9469bd8 19-May-2017 Dan Albert <danalbert@google.com> Add --sync support to push.

Passing --sync only copies files that are older on the device.

Test: nose2
Bug: None
Change-Id: I2ff6c3d1fe29262c8ee50db316aa92fc38dd7147
ommandline.cpp
ile_sync_client.cpp
ile_sync_service.h
est_device.py
05e2c509dd89e5a35d0e7ac6a3be28edca0a00c3 19-May-2017 Dan Albert <danalbert@google.com> Merge "Fix test following -p removal." am: 5e49fbc547 am: 3039d9d4fa am: 222a69bc92
am: b34b448bcd

Change-Id: I79a75b5167f7b8e03a176ed05f42c89000e43a61
def4aae26d34d50dc302b709de1dd5327dd84f1f 18-May-2017 Dan Albert <danalbert@google.com> Fix test following -p removal.

Just use the environment variable.

Test: nose2
Bug: None
Change-Id: I020c737f8aa7416b46794ce387a12f7959a9ca2a
est_device.py
36dadca9f0f0c007efb1d8b9d0c9d32cb9abe637 17-May-2017 Josh Gao <jmgao@google.com> adb: boolify check_header and check_data.

Test: grep
Change-Id: I8d0c60e500bba855a1afc0877253262246c07fef
ransport.cpp
ransport.h
ransport_local.cpp
ransport_usb.cpp
16c5a133ab2b80af2b56f86e42de04a4399c60fc 16-May-2017 Josh Gao <jmgao@google.com> adb: redirect stdout/stderr before initializing usb.

Avoid printing USB logging to the console.

Test: None
Change-Id: Ib8ad0ad6c559689d0f8feec2e66b42380edd26fb
lient/main.cpp
7718e06ac0c0b4d88a65f0ec2a9f7faf285cd1ce 17-May-2017 David Zeuthen <zeuthen@google.com> Merge "adb: Allow disabling verity on eng builds when using AVB." am: 7ce0f00c08 am: 1ceea342d5 am: 984757365f
am: 7fb7389b66

Change-Id: I738acce3d5548bcfc444b4c04a0e20ba95fd9962
abddbc2cdfba608b1c41ee1e788f0f5ca795bffd 17-May-2017 David Zeuthen <zeuthen@google.com> adb: Allow disabling verity on eng builds when using AVB.

Unlike VB1.0, if a device is using AVB then dm-verity is used on any
build (userdebug, eng, etc.). Therefore, we should allow disabling
verity on any build (except USER), not just userdebug. This bug was
pointed out in https://android-review.googlesource.com/#/c/371372/

Bug: 34124301
Test: Manually tested on -eng build on device using AVB.
Change-Id: I314550c13d7458d5d1ef68eb06f98849e11fbe15
et_verity_enable_state_service.cpp
7be316ec0df64eb67eb19a876ff0ab2f2dc1dce0 15-May-2017 Josh Gao <jmgao@google.com> Merge changes I8e8e0963,I3c714f63,Id157412e,Ib7c26fbd am: 55ddb99527 am: 66ca192ac3 am: f4578f1ad4
am: 21348e1205

Change-Id: Ie54a5dfdba5f6e4681473709af4aa370abb46d48
425aefdcf0f1b2068f56ca091047af5f02ae3f3d 13-May-2017 Josh Gao <jmgao@google.com> adb: libusb: recognize devices with multiple interfaces.

A bug was introduced by commit 8bf37d7a wherein we accidentally only
look at the first interface of a device when checking whether a USB
device was an ADB device or not.

Bug: http://b/38201318
Test: none
Change-Id: I8e8e0963c77cd2cb03538d926ab735f4b57e52b7
lient/usb_libusb.cpp
3f60a968e35b051943249fb9ac70e349323a0590 12-May-2017 Josh Gao <jmgao@google.com> adb: libusb: wait for devices to become accessible.

Android's host linux libusb uses netlink instead of udev for device
hotplug notification, which means we can get hotplug notifications
before udev has updated ownership/perms on the device.

When detecting a new device, poll the device file for a while until we
can access it, before trying to open it.

Bug: http://b/38170349
Test: manually incrased timeout and chmodded a device betwen 0 and 664
Change-Id: I3c714f630940df02b407442592301e2bbb3d9653
lient/usb_libusb.cpp
6da1cd49b5eaeabb3febe584845de6bb3ae45873 12-May-2017 Josh Gao <jmgao@google.com> adb: libusb: switch to hotplug for device detection.

Switch from polling in a loop to using libusb's hotplug API to detect
when devices arrive and leave. Use this to remove devices that were
inaccessible when they're unplugged.

Bug: http://b/38170349
Test: plugged in device
Change-Id: Id157412eb46834debecb0cd45b47b1ced50c2274
lient/usb_libusb.cpp
723258a4c7d024473de8558c15a6db5437468681 10-May-2017 Josh Gao <jmgao@google.com> adb: silence noise.

Remove logging statements that don't provide any benefit.

Test: none
Change-Id: Ib7c26fbdb019f4d6bbce2b7fb192cb5e6066e53f
db.cpp
f608eb283a13fad440f75bdf2d43eda13456956d 12-May-2017 Siarhei Vishniakou <svv@google.com> Merge "Adding 'uhid' permission for access to /dev/uhid." am: cecbc9993d am: 04daed4793 am: d819380f50
am: b995b58631

Change-Id: I0c4f2e22d6195f219a2e1b0ef346ce89b642dc6c
cecbc9993d5f5951e0287922aebbb3fd606166a5 11-May-2017 Siarhei Vishniakou <svv@google.com> Merge "Adding 'uhid' permission for access to /dev/uhid."
0729dd1edb1e392f60f9a2ad5cc06a84df2ab1f6 09-May-2017 Siarhei Vishniakou <svv@google.com> Adding 'uhid' permission for access to /dev/uhid.

This CL is in support of another CL c/2048848, topic
'Refactor hid command in /frameworks/base/cmds' in
internal master. Adding the permissions for
shell here to access uhid_node as part of the
new 'uhid' group.

Bug: 34052337
Test: Tested on angler, bluetooth mouse works OK.

Change-Id: If9e100aa1262d689fb8adc5c0ce93f157c96399e
aemon/main.cpp
18e944f1f7b6167693b1082ffa6339315ed6dba9 11-May-2017 Josh Gao <jmgao@google.com> Merge "adb: fix darwin build break." am: a0661237e1 am: 8016a0aa11 am: 40866ccfc0
am: 3521f70220

Change-Id: Ie93c0c172346bec1a07ea8e604ca23e5453840d6
7132752306c1d9f53f34842e8b342768bbb0fcf5 11-May-2017 Josh Gao <jmgao@google.com> Merge changes I394f5782,I9475f5d0,I59707186 am: 44f6592b0d am: b7f3707cd3 am: 75f0275fba
am: 9deb8140bf

Change-Id: Icfca230b2efb39332a2627192ff8610f532dae4c
cf4289550c775f84d343d83c1483ed2c07745eac 11-May-2017 Elliott Hughes <enh@google.com> Merge "Fix style nits in adb's Android.mk." am: 30b7f59efc am: 86698112b9 am: eba1d8338f
am: 94ed60471d

Change-Id: Idb4e5a160bbab50919e5a1b053a0d0f43fce8e28
362b4041f3162ef3d219d6bcebdd5170ae28a662 10-May-2017 Josh Gao <jmgao@google.com> adb: fix darwin build break.

Fix the following build breakage:

system/core/adb/client/usb_osx.cpp:433:13: error: static declaration of 'usb_cleanup' follows non-static declaration
static void usb_cleanup() NO_THREAD_SAFETY_ANALYSIS {
^
system/core/adb/usb.h:48:5: note: previous declaration is here
ADB_USB_INTERFACE(native::usb_handle*);

Bug: http://b/38203892
Test: mma on linux, darwin
Change-Id: I1c042e4d64ddcc0713f329202bc2037e590a9b4f
lient/usb_dispatch.cpp
lient/usb_linux.cpp
lient/usb_osx.cpp
44f6592b0de532afeb3636afb5177fd39b2442ea 10-May-2017 Josh Gao <jmgao@google.com> Merge changes I394f5782,I9475f5d0,I59707186

* changes:
adb: move all cleanup to a function with defined ordering.
adb: make `adb kill-server` wait for the server to die.
adb: libusb: replace sleep with timed CV wait.
bca78df5a4d555d9d413de92b0e295c15d8f381c 10-May-2017 Elliott Hughes <enh@google.com> Merge "Fix build error when (ADB|FASTBOOT)_VERSION has space" am: 3d29736d6b am: f2f3c3b91c am: 8ff4dbe443
am: cd81886b94

Change-Id: Icd8b12444f496c177d5aedcae624a2662c5e960c
8964fbfa5fd87df1b8b917fcb0b56c459c2761cf 10-May-2017 Elliott Hughes <enh@google.com> Fix style nits in adb's Android.mk.

We [try to] always use trailing \s in lists.

Bug: N/A
Test: builds
Change-Id: Ibc1ccacbe8a31f784f206d29a8c4f0f4650f7bde
ndroid.mk
b3526e1ee8b97e9909d380ffcc2f68ce6a083cc9 10-May-2017 SzuWei Lin <szuweilin@google.com> Fix build error when (ADB|FASTBOOT)_VERSION has space

Test: make, and build pass
Change-Id: I8fc608a5b8bccb43b8af72978ce16a945147f62d
ndroid.mk
aeb2a10daa3876172b5274811ca4f711bcb4de09 10-May-2017 Elliott Hughes <enh@google.com> Merge "Show the "platform tools" version in adb/fastboot --version." am: 6f4d47438d am: 3602f6141a am: 92764e2cb2
am: 3a92b606b5

Change-Id: Ic492a698b54e7195984ba733b9e5bf8542c1c2ee
6f4d47438def7b9e4745f5f1086df9425a65b9e7 10-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Show the "platform tools" version in adb/fastboot --version."
01b7bc43e90b951675cabe88313b96f57b2da712 09-May-2017 Josh Gao <jmgao@google.com> adb: move all cleanup to a function with defined ordering.

We want to explicitly define the order in which we teardown adb, so
move all of the at_quick_exits sprinkled throughout into one function
containing all of the cleanup functions.

Bug: http://b/37104408
Test: adb kill-server; adb start-server
Change-Id: I394f5782eb147e394d4b87df1ba364c061de4b90
db_listeners.cpp
db_listeners.h
lient/main.cpp
lient/usb_dispatch.cpp
lient/usb_libusb.cpp
lient/usb_windows.cpp
ransport.cpp
ransport.h
sb.h
b3c14ec693d4c061fc9ec7fdaa7897169d179479 09-May-2017 Josh Gao <jmgao@google.com> adb: make `adb kill-server` wait for the server to die.

Make the host:kill service shutdown its socket on process exit, instead
of immediately. Also, unify the two 'kill-server' implementations and
hide _adb_connect.

Bug: http://b/37104408
Test: adb kill-server; adb start-server
Change-Id: I9475f5d084d5fb91d33e393f2fd4e34056613384
db.cpp
db_client.cpp
db_client.h
ommandline.cpp
707a6e469f9c9621f09f42c6c5419587580398ab 09-May-2017 Josh Gao <jmgao@google.com> adb: libusb: replace sleep with timed CV wait.

Instead of sleeping for 500ms at the end of every device poll loop, use
a timed condition variable wait so that we can tell the device poll
thread to immediately commit suicide.

Bug: http://b/37869663
Test: adb kill-server; adb start-server
Change-Id: I597071866f7d9ef91900411727345d32c1a97556
lient/usb_libusb.cpp
4d4f64ff94e8c03d0c2e7b7ccfa7c48ca2345087 08-May-2017 Elliott Hughes <enh@google.com> Show the "platform tools" version in adb/fastboot --version.

Annoyingly folks parse the "adb --version" output so we have the
less-interesting protocol version first. But at least now we'll
have the "real" version somewhere...

Bug: N/A
Test: "adb --version"/"fastboot --version"
Change-Id: Ia85b561bd8d84c6fd6995923730d36f53b2f800b
ndroid.mk
db.cpp
aemon/main.cpp
ccbe13234c9cd7ce60f28982ff061f34cef52ce4 09-May-2017 Josh Gao <jmgao@google.com> Merge "adb: properly handle libusb_clear_halt failure." am: 761ae04777 am: b44385f6b3 am: 9886b1aa4a
am: 59edd00124

Change-Id: I334822bc95ca9f2d41f491b059bbb17f63d7f913
761ae047779ac5b995b1b9792221cf9f8d69bb8c 09-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: properly handle libusb_clear_halt failure."
8bf37d7a4d0b8e05a5fe6500c2e3c13eef2a99e7 06-May-2017 Josh Gao <jmgao@google.com> adb: properly handle libusb_clear_halt failure.

The original code used continue to attempt to try to skip the current
device, but there was an loop between the outside one and the continue.
Move the device handling logic into a function and replace continue
with return.

Test: mma
Change-Id: Iaa7f4b5ddc26d2ce03f1172d37d6307190b44412
lient/usb_libusb.cpp
1bfaecf6a9b77ade39b5958a284136736373d65e 06-May-2017 Elliott Hughes <enh@google.com> Merge "Give slightly less useless versions to adb and fastboot." am: ddfd5056a2 am: 77ca73f8a7 am: a2ce98d026
am: 0221e94d3e

Change-Id: I94b713bc3e1ce1e966763da89eb6c64aba4bca30
ddfd5056a29ad8a92cee075a558129cee7c64a84 06-May-2017 Elliott Hughes <enh@google.com> Merge "Give slightly less useless versions to adb and fastboot."
74a72968795f0665d258cdbce3a4a32465228145 06-May-2017 Elliott Hughes <enh@google.com> Merge "Fix macOS build." am: 71feb7b321 am: dcbd2a1501 am: 666b616592
am: 4db76b1d69

Change-Id: I58146e8d725f96967a9db1e982823d9598773e8b
2708a953d21f447e7377b0e1ea9dd69f703ad56e 06-May-2017 Elliott Hughes <enh@google.com> Give slightly less useless versions to adb and fastboot.

This will let us see (a) whether the user has a legit build or something they
built themselves and (b) what Android release it corresponds to.

This isn't as useful as showing what Platform Tools release we correspond to,
but I'm planning on doing that as a separate line.

Bug: N/A
Test: adb --version ; fastboot --version
Change-Id: Idca489295e3c6f8571146f95822c08808e36b382
ndroid.mk
4acb36020bfa3cb63ed81358754758e76fc5787d 06-May-2017 Elliott Hughes <enh@google.com> Fix macOS build.

system/core/adb/client/usb_libusb.cpp:162:20: error: unused function 'get_device_serial_path' [-Werror,-Wunused-function]
static std::string get_device_serial_path(libusb_device* device) {
^

Bug: N/A
Test: no choice but to submit and see...
Change-Id: I0026d3273891588c27df5ccd71c41ad9907b038d
lient/usb_libusb.cpp
8cf938d1dd098a4d52994ef683be5a348cdb9a7b 06-May-2017 Elliott Hughes <enh@google.com> Merge "Improve udev failure diagnostics." am: 5ad9ba12df am: 94202c2b9d am: 1ad393daba
am: 9edecb4d62

Change-Id: I3b7e34d524f87f24da2a7b77f84e0144f3b92526
cd35664cdc5097bf38fa2f12aa310855b3c123af 04-May-2017 Elliott Hughes <enh@google.com> Improve udev failure diagnostics.

A couple of folks had trouble understanding the existing message.

Before:

8XV7N15917000596 no permissions (udev requires plugdev group membership); see [http://developer.android.com/tools/device.html]

After:

8XV7N15917000596 no permissions (user buttmunch is not in the plugdev group); see [http://developer.android.com/tools/device.html]

This also fixes a libusb regression where we wouldn't show anything for
devices where we don't have permissions.

Bug: http://b/37707122
Test: ran "adb devices" as user buttmunch
Change-Id: I2fcd735ff4178145432b532a6e4dc8c93b2743fd
lient/usb_libusb.cpp
iagnose_usb.cpp
d7c9fa39c252e22593e169a35d6e34bb6b39fe66 05-May-2017 Josh Gao <jmgao@google.com> Merge changes from topic 'adb_thread_safety' am: 9083ff1c24 am: 2ca23fa508 am: 05b7443644
am: 577c2172d1

Change-Id: I1d384220c6eea9cb3066a8cbe86298543bde574a
09e163e96bc31abaf869213d31b2ba2212c412c1 05-May-2017 Josh Gao <jmgao@google.com> Merge "adb: make darwin build with thread safety analysis." am: 971e6585a6 am: b80ef5e6fd am: 5e0b56adfa
am: fcfa8731c3

Change-Id: I1246b35a5bb2fc3c3f48995b3a00bc2de7e8b499
fd713e53e890f5b3bf26a1c5a980137cc4378c3a 04-May-2017 Josh Gao <jmgao@google.com> adb: wait for devices to come up instead of sleeping for 3s.

Replace a hard-coded 3 second sleep with logic to wait until we've
scanned USB devices once and they've all come online.

Before:
adb shell true 0.00s user 0.00s system 0% cpu 3.047 total

After:
adb shell true 0.00s user 0.00s system 9% cpu 0.041 total

Bug: http://b/37869663
Test: `time adb shell true` after adb kill-server
Change-Id: I251d42afb885908ed9d03167287594ea16650d3f
db.cpp
db.h
db_client.cpp
lient/main.cpp
lient/usb_libusb.cpp
ransport.cpp
ransport.h
04a8218f09d342b3d0c4a67fc4df9ad805bc49cc 05-May-2017 Josh Gao <jmgao@google.com> adb: make darwin build with thread safety analysis.

Test: mma on darwin
Change-Id: I44dfc53fc381e60de83f3bc503691cdb8179ca91
lient/usb_osx.cpp
6f46e6b912b2cd30a699757c3f4bbf9b679e2b79 03-May-2017 Josh Gao <jmgao@google.com> adb: initialize mDNS asynchronously.

Use fdevent_run_on_main_thread to initialize mDNS in a thread and
register an fdevent from the main thread upon success.

This reduces the startup time of `adb server` by ~3 seconds when mDNS
can't be successfully started. With an already running adb server,
`time adb server nodaemon` goes from:

adb server nodaemon 0.00s user 0.16s system 4% cpu 3.817 total

to:

adb server nodaemon 0.00s user 0.01s system 1% cpu 0.665 total

Bug: http://b/37869663
Test: `adb server nodaemon` with an existing adb server
Change-Id: Ia5a1a2a138610f3bf6792400050ca68f95ae3734
ransport_mdns.cpp
4c936397c1dc8b127d7e27a9ee02ff7d0deef785 03-May-2017 Josh Gao <jmgao@google.com> adb: add fdevent_run_on_main_thread.

Add a function to run a function on the main thread, to allow fdevents
that depend on a blocking function to be registered.

Bug: http://b/37869663
Test: adb_test on linux
Change-Id: I84a0b372360420b7647057297b8f437e8afa874e
devent.cpp
devent.h
devent_test.cpp
devent_test.h
d25638cd51046b10a51e282e1bf79b3e31d8ebbc 04-May-2017 Josh Gao <jmgao@google.com> Merge "adb: use the actual wMaxPacketSize for usb endpoints." am: c7988b1f68 am: ff9d6425d4 am: 44190c3709
am: 439f523d0c

Change-Id: I44cd780ef9afc65ba793cbf2c1276f8ce2605d7b
c7988b1f684d7c0b86a0e3d58228ebc45297c858 04-May-2017 Josh Gao <jmgao@google.com> Merge "adb: use the actual wMaxPacketSize for usb endpoints."
3c82f122e7085954af4fb09d42dd651df7c388f8 04-May-2017 Josh Gao <jmgao@google.com> Merge "adb: enable -Wthread-safety on linux/darwin." am: 2983d2710e am: 0c91897714 am: d3f512ebe3
am: 425d0db555

Change-Id: If252edb1d239ed4ab507c17526ab53bf6f7292d5
2983d2710ee56a665541df9ec7d0a7cf8e9c17ca 04-May-2017 Josh Gao <jmgao@google.com> Merge "adb: enable -Wthread-safety on linux/darwin."
68f679c35b930fb1619fed101d7a850abb701f0a 03-May-2017 Josh Gao <jmgao@google.com> adb: enable -Wthread-safety on linux/darwin.

Delete the sysdeps/mutex tests that -Wthread-safety complains about.
We're using the standard library's std::mutex on all platforms now,
anyway.

Test: mma
Change-Id: I3bf958c72604b29dfb1d9c898d3c9aa34aed2685
ndroid.mk
ysdeps_test.cpp
ef3d343254405cc360b4df843c6e4a843c335012 03-May-2017 Josh Gao <jmgao@google.com> adb: use the actual wMaxPacketSize for usb endpoints.

Previously, adb was assuming a fixed maximum packet size of 1024 bytes
(the value for an endpoint connected via USB 3.0). When connected to an
endpoint that has an actual maximum packet size of 512 bytes (i.e.
every single device over USB 2.0), the following could occur:

device sends amessage with 512 byte payload
client reads amessage
client tries to read payload with a length of 1024

In this scenario, the kernel will block, waiting for an additional
packet which won't arrive until something else gets sent across the
wire, which will result in the previous read failing, and the new
packet being dropped.

Bug: http://b/37783561
Test: python test_device.py on linux/darwin, with native/libusb
Change-Id: I556f5344945e22dd1533b076f662a97eea24628e
lient/usb_dispatch.cpp
lient/usb_libusb.cpp
lient/usb_linux.cpp
lient/usb_osx.cpp
lient/usb_windows.cpp
est_device.py
ransport_usb.cpp
sb.h
0bd23c900f467f3599dd41511dca7e6ea39f1b02 03-May-2017 Felipe Leme <felipeal@google.com> Merge "Don't display bugreport progress when it recedes, for real..." am: 499af38623 am: 35d7f65654 am: eed955d7c6
am: 378c2a0c4f

Change-Id: I2f29e46d55988e61def72e661c48c770386115fc
499af386236a978319d6e2784ba9ef8c14ed8c6e 03-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Don't display bugreport progress when it recedes, for real..."
4df2bc7e8c035026693179fdd6d79b95a09aca6e 03-May-2017 Elliott Hughes <enh@google.com> Merge "Improve "adb sideload" error reporting." am: 66b25eb810 am: f2fe436d32 am: 2b0d807531
am: df3dc783af

Change-Id: I2d6489d7613acc4331f71e9c6199ef979e169d05
66b25eb810eb542e7b6ef5d5b0f89cf5f23abe06 03-May-2017 Elliott Hughes <enh@google.com> Merge "Improve "adb sideload" error reporting."
09e794c05d392941e04d961e1c4072b8bcc4133a 02-May-2017 Elliott Hughes <enh@google.com> Improve "adb sideload" error reporting.

Rather than quietly fall through to the legacy code with no explanation,
say why the first connection failed, and that the second attempt is only
going to be relevant for folks trying to sideload to a pre-KitKit device.

Before:

$ adb sideload mysid-ota-424425.zip
opening 'mysid-ota-424425.zip'...
connecting...
falling back to older sideload method...
error: closed

After:

$ adb sideload mysid-ota-424425.zip
adb: sideload connection failed: no devices/emulators found
adb: trying pre-KitKat sideload method...
adb: pre-KitKat sideload connection failed: no devices/emulators found

Also switch the legacy code to just read+write blocks rather than trying to
load the whole OTA package into RAM (which is in short supply on Win32).
This is probably of no practical use other than that it lets us report a
better error message (better than "terminate called after throwing an
instance of 'std::bad_alloc'").

Bug: https://issuetracker.google.com/37139736
Test: "adb sideload" with no device/a mysid/an angler
Change-Id: Ia568044aac61bd054301ebfd7fcd5ad5d6f3147a
ommandline.cpp
4cc03611cdd8f381d199e63f353075d6c7a3c44d 02-May-2017 Felipe Leme <felipeal@google.com> Don't display bugreport progress when it recedes, for real...

The previous fix was taking account just the progress reported by dumpstate,
not progress/percentage. As such, it was not detecting the cases where the
percentage decreased but the progress didn't.

Bug: 37878670
Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test --gtest_filter=BugreportTest.*

Change-Id: I5830028f3191a9b17f63aeed5c049b29fa7d1179
ugreport.cpp
ugreport.h
ugreport_test.cpp
c8d19a571f03eadd9eec5dc7c9d13a9210dd23fd 02-May-2017 David Zeuthen <zeuthen@google.com> Merge "adb: Support 'adb enable/disable-verity' when using AVB." am: 8fc6cc8910 am: 2b3a568171 am: 1855c98ac2
am: c14134bf1b

Change-Id: I749a17bb9db825e73e116b27a52a109cbef4e546
1e033d6804afb8f671065c3e094a4cc52919a5e9 12-Apr-2017 David Zeuthen <zeuthen@google.com> adb: Support 'adb enable/disable-verity' when using AVB.

Link with libavb_user and use this to enable/disable dm-verity if AVB
is in use.

Bug: 34124301
Test: Manually tested.
Change-Id: Ic03651312b955081cb3c126f6dafc46d6eeec0da
ndroid.mk
et_verity_enable_state_service.cpp
23da4855304a09ed3eba10ecfdf151934dfd848f 02-May-2017 Elliott Hughes <enh@google.com> Merge "Stop writing NUL bytes in adbkey.pub." am: d340c1ebbe am: 68c9642a9d am: a404e8ffe8
am: 5ccb3b97b6

Change-Id: I103bf495648b4a003677969ff7bbd1aae1f7ad4f
d340c1ebbe62246bdee64ae2c7e88f42cb0e8360 02-May-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Stop writing NUL bytes in adbkey.pub."
0b771b33fd934db9a7962ad704cdd38f72895c1a 01-May-2017 Elliott Hughes <enh@google.com> Stop writing NUL bytes in adbkey.pub.

In N we moved some code from C to C++ without realizing that EVP_EncodedLength
includes space for a terminating NUL and EVP_EncodeBlock writes one. Because
our key reading code copes with the NUL, we never noticed.

Distinguish between the required space returned by EVP_EncodedLength and the
actual number of bytes (not including NUL) used return by EVP_EncodeBlock.

Bug: http://b/36187819
Test: hexdump of ~/.android/adbkey.pub
Change-Id: I81a487ddbb5c884593b6426d1f41cfaece26ff90
db_auth_host.cpp
7e05467050f4828656c4b77183c0db4c6547a4c9 01-May-2017 Elliott Hughes <enh@google.com> Merge "Simplify "adb sync" documentation." am: 05eed13247 am: 893a3c4468 am: 4942d4a8cc
am: e856654357

Change-Id: Id513f4cc42dda438ce0f3c51d0387e98f9102e8a
0754cb929ce773977be4db323efbb19f03a68781 01-May-2017 Elliott Hughes <enh@google.com> Simplify "adb sync" documentation.

Remove -p (which only applied to "adb sync"), explicitly mention
$ANDROID_PRODUCT_OUT in the "adb sync" help text, and add "adb sync all"
as a synonym for "adb sync" for ease of documentation.

Bug: http://b/33761074
Test: "adb sync" still works, "adb --help" looks good
Change-Id: Ie5b2459a7e5e4140298f78815be25fa7c7bb47d0
ommandline.cpp
91fc4fd24572504930007c7226f56ab60c3413b7 28-Apr-2017 Jerry Zhang <zhangjerry@google.com> Merge "Revert "adb: Lower EP_ALLOC retry count"" am: 169590c47f am: 935d600800 am: ddcc232493
am: d3632d3ce1

Change-Id: I2d9698c24d9e03e812fd5d48c7bdfdcfcd1c2c33
40a87784913066f74c2f7a1e9f5f54aaf4692364 28-Apr-2017 Jerry Zhang <zhangjerry@google.com> Revert "adb: Lower EP_ALLOC retry count"

This reverts commit 05fe272a87c6be24d3e2808ecceed2be063b9c1d.

Commit "adb: Do not signal gaget stack unless descriptors are written"
fixed the main issue for configfs devices where device wasn't enabled
until after the ioctl was attempted. Thus it is safe to bring up the
retry count so that the ioctl doesn't fail due to small delays in
usb stack.

Test: use adb, switch configs on configfs devices
aemon/usb.cpp
1810d58e3581242cb34e78c0b0254774c4bee0d4 20-Apr-2017 Yabin Cui <yabinc@google.com> Merge "adb: fix two device offline problems." am: 2e821078e4 am: ae6a3605d2 am: 66cfd45a34
am: c4a1393a15

Change-Id: Ice92131cda4d9f421f0f62058a3867a918044d84
2e821078e432711006a580df19e68db48bfa9fae 20-Apr-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: fix two device offline problems."
b5e11415d9fdb929321c66889063dac50fb737af 11-Mar-2017 Yabin Cui <yabinc@google.com> adb: fix two device offline problems.

When device goes offline, user usually has to manually replug the
usb device. This patch tries to solve two offline situations, all
because when adb on host is killed, the adbd on device is not notified.

1. When adb server is killed while pushing a large file to device,
the device is still reading the unfinished large message. So the
device thinks of the CNXN message as part of the previous unfinished
message, so it doesn't reply and the device is in offline state.

The solution is to add a write_msg_lock in atransport struct. And it
kicks the transport only after sending a whole message. By kicking
all transports before exit, we ensure that we don't write part of
a message to any device. So next time we start adb server, the device
should be waiting for a new message.

2. When adb server is killed while pulling a large file from device,
the device is still trying to send the unfinished large message. So
adb on host usually reads data with EOVERFLOW error. This is because
adb on host is reading less than one packet sent from device.

The solution is to use buffered read on host. The max packet size
of bulk transactions in USB 3.0 is 1024 bytes. By preparing an at least
1024 bytes buffer when reading, EOVERFLOW no longer occurs. And teach
adb host to ignore wrong messages.

To be safe, this patch doesn't change any logic on device.

Bug: http://b/32952319
Test: run python -m unittest -q test_device.DeviceOfflineTest
Test: on linux/mac/windows with bullhead, ryu.
Change-Id: Ib149d30028a62a6f03857b8a95ab5a1d6e9b9c4e
db.cpp
db.h
db_client.cpp
db_trace.cpp
db_trace.h
lient/usb_libusb.cpp
lient/usb_linux.cpp
lient/usb_osx.cpp
lient/usb_windows.cpp
ommandline.cpp
devent.cpp
devent.h
ervices.cpp
ockets.cpp
est_device.py
ransport.cpp
ransport.h
ransport_local.cpp
ransport_test.cpp
ransport_usb.cpp
6ff8689e32e8e1866d1337bf1c45dd9a39def20f 20-Apr-2017 Elliott Hughes <enh@google.com> Merge "Fix various adb error reporting bugs." am: 8dead17a58 am: e6b808ea5b am: 38ed0537be
am: 1b50735ed4

Change-Id: Iaab2bb3a83664634bac3392eb17d50e50b690e47
1fc8f6e0cfdfd5c9dbbd82116fba2ebec82b4659 18-Apr-2017 Elliott Hughes <enh@google.com> Fix various adb error reporting bugs.

`adb install` was writing success to stderr rather than stdout.

Server mismatch messages were going to stdout rather than stderr.

Error messages should consistently start with a lower case letter.

Also improve consistency of syntax error reporting.

Bug: https://issuetracker.google.com/37128706 (adb install success to stdout)
Bug: https://issuetracker.google.com/37140458 (server mismatch on stderr)
Bug: http://b/32413861 (consistency)
Test: ran tests
Change-Id: I0d6cb0c7482bec03483dacefd996644b7a28d273
db.cpp
db_client.cpp
db_utils.cpp
db_utils.h
ugreport.cpp
ommandline.cpp
ommandline.h
7ad48688355f5c71716febfd4e7c1c9cbfebb579 18-Apr-2017 Steven Moreland <smoreland@google.com> Merge "libcutils: compile with BOARD_VNDK_VERSION current" into oc-dev am: 64639fd7dc
am: fc5d4345fa

Change-Id: I9673d2afe656b558a98b83d138ea867a39b51a18
fc5d4345fa47827bcc9b3192812055e72f691aea 18-Apr-2017 Steven Moreland <smoreland@google.com> Merge "libcutils: compile with BOARD_VNDK_VERSION current" into oc-dev
am: 64639fd7dc

Change-Id: Ic30e207a89cf80f6f509f64f92ec9ee32cfaf3c1
d73be1b96beab812b86f8174e7fc928291f0cb44 14-Apr-2017 Steven Moreland <smoreland@google.com> libcutils: compile with BOARD_VNDK_VERSION current

- moved __android_log_is_debuggable to a new public header
(log_properties.h)
- vendor version of sched_policy uses ALOG* instead SLOG*

Test: (sanity) liblog-unit-tests
Test: (sanity) libcutils_test (noting b/b/32972117, two tests continue
to fail)
Test: system/core as a whole makes with BOARD_VNDK_VERSION := current
now with no problems.
Test: boots/works on internal marlin
Bug: 33241851

(cherry picked from commit 1f83aa424f537cf3f07e1d27dbbcc524818b5358)

Merged-In: I5bc1f348dc0f0c8814bec5b5c3d2c52c825ab640
Change-Id: I5bc1f348dc0f0c8814bec5b5c3d2c52c825ab640
aemon/main.cpp
ervices.cpp
et_verity_enable_state_service.cpp
ockets.cpp
1f83aa424f537cf3f07e1d27dbbcc524818b5358 14-Apr-2017 Steven Moreland <smoreland@google.com> libcutils: compile with BOARD_VNDK_VERSION current

- moved __android_log_is_debuggable to a new public header
(log_properties.h)
- vendor version of sched_policy uses ALOG* instead SLOG*

Test: (sanity) liblog-unit-tests
Test: (sanity) libcutils_test (noting b/b/32972117, two tests continue
to fail)
Test: system/core as a whole makes with BOARD_VNDK_VERSION := current
now with no problems.
Test: boots/works on internal marlin
Bug: 33241851

Change-Id: I5bc1f348dc0f0c8814bec5b5c3d2c52c825ab640
aemon/main.cpp
ervices.cpp
et_verity_enable_state_service.cpp
ockets.cpp
c6e404c83e837166df3c9c64441a3a4371635840 14-Apr-2017 Josh Gao <jmgao@google.com> Merge changes from topics 'adb_thread', 'adb_loopback' am: 0301b3217b am: 750dfee974 am: da1f886ed8
am: 5d6593c5f7

Change-Id: I9f95633015ec7194b4bab54a0626ab99d90504ee
2abb5f879c939577f9e73d1792c596ca10cf4326 14-Apr-2017 Josh Gao <jmgao@google.com> adb: kill adb_thread_{create, join, detach, exit}. am: e1dacfc1b6 am: d56eebd6c2 am: ae80841ac7
am: 86a55ba49d

Change-Id: Ia99182c2f5eef3bcbd1a978bf8bdfeb3dfbd0be1
1a4a570a23b4d1ca1e68f7ed86aef18256fcb411 14-Apr-2017 Josh Gao <jmgao@google.com> adb: don't try to resolve 'localhost' am: 46de1d7f03 am: 32d7ede78b am: 677a73e5f1
am: 368e043a7b

Change-Id: I7586b4bd3622911eade0bfbf40359b7797d6eed1
d56eebd6c2d82ce78f7135c3bdcff0a598f00c22 14-Apr-2017 Josh Gao <jmgao@google.com> adb: kill adb_thread_{create, join, detach, exit}.
am: e1dacfc1b6

Change-Id: I5e0324b33d40f873d196946cee7591de0b7b949c
32d7ede78b3eacaaadd6073d13d8d5b364c235bf 14-Apr-2017 Josh Gao <jmgao@google.com> adb: don't try to resolve 'localhost'
am: 46de1d7f03

Change-Id: Ie419c5ddd80938760d7eaa3f50605c9874ca33d7
0301b3217be97631e5595bb9cc2cb51dcf8be24b 14-Apr-2017 Josh Gao <jmgao@google.com> Merge changes from topics 'adb_thread', 'adb_loopback'

* changes:
adb: statically link libbase into the tests.
adb: kill adb_thread_{create, join, detach, exit}.
adb: don't try to resolve 'localhost'
47330e21db24b2bce3e238a596904e17d178a78d 13-Apr-2017 Josh Gao <jmgao@google.com> adb: statically link libbase into the tests.

Make it easier to run the Windows tests with wine.

Test: adb_test
Test: wine adb_test.exe
Change-Id: I243c3adf4f6519dd7a38666ab42b384858351e21
ndroid.mk
e1dacfc1b65b04958924d1f982263d4aa71b0b94 13-Apr-2017 Josh Gao <jmgao@google.com> adb: kill adb_thread_{create, join, detach, exit}.

We have std::thread now, so we can delete this cruft.

Test: python test_device.py
Test: adb_test
Test: wine adb_test.exe
Test: /data/nativetest/adbd_test/adbd_test
Change-Id: Ie1c1792547b20dec45e2a62ce6515fcb981c3ef8
lient/usb_linux.cpp
lient/usb_osx.cpp
lient/usb_windows.cpp
ommandline.cpp
aemon/mdns.cpp
aemon/usb.cpp
devent_test.cpp
devent_test.h
ervices.cpp
hell_service.cpp
ocket_test.cpp
ysdeps.h
ysdeps_test.cpp
ransport.cpp
ransport_local.cpp
46de1d7f03b7debfd14ccf77a6e63fa2e66f9f04 12-Apr-2017 Josh Gao <jmgao@google.com> adb: don't try to resolve 'localhost'

Misconfigured systems can have localhost pointing to an address that
isn't 127.0.0.1 or ::1.

adb is the only caller of the libcutils socket_loopback functions, so
move them into adb and switch the implementations over to using
INADDR_LOOPBACK and in6addr_loopback, instead of resolving 'localhost'
when connecting.

Bug: http://b/37282612
Test: `killall adb; adb shell`
Test: `killall adb; ip addr del 127.0.0.1/8 dev lo; adb shell`
Change-Id: I01c1885f1d9757ad0f7b353dd04b4d1f057741c8
ndroid.mk
ysdeps.h
ysdeps/network.h
ysdeps/posix/network.cpp
fafc230863bbf425a105170c6daa38c9d48f0cac 12-Apr-2017 Johan Torås Halseth <johanth@google.com> Merge "Move adb backup/restore helptext to adb shell bu help." am: 4a36cc7cf6 am: 8898a151e6 am: 9f23feae1f
am: 406a75f1fc

Change-Id: I2371012be58cc3af0b1da87d9be558e3b1cb2cca
eca1b3bdcc9dbeb1a057a5903067efca8d262081 11-Apr-2017 Johan Toras Halseth <johanth@google.com> Move adb backup/restore helptext to adb shell bu help.

Key/value support for adb backup was added in ag/1946677, and help text
for adb shell bu is added in ag/2088937. This CL points the user to this
helptext instead of keeping it here, since it can quickly get out of
sync.

BUG=36170696

Test: adb
Change-Id: Ic40679f421a32e60f292ad20b726a89bfff03349
ommandline.cpp
b3f264f9b3c4ee91d3d9300ed26be72fdf97a52c 05-Apr-2017 Yabin Cui <yabinc@google.com> Merge "adb: don't reset usb when connecting it." am: 4b8087aeb2 am: 0c1bad300c am: e7affdc47c
am: 7ecf6c0e79

Change-Id: If47a46c05eda4f59b5221d33c2940de8c8ba4c12
4b8087aeb2d58906dbae6903dc252ba9bfc36f6c 04-Apr-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: don't reset usb when connecting it."
5d002b8d6ae0a1eeefe09309ae6687a16e82ed08 04-Apr-2017 Yabin Cui <yabinc@google.com> adb: don't reset usb when connecting it.

Calling libusb_reset_device() resets the usb connection with device
on linux platform. It can interfere with other usb interfaces and only
works on linux.
Removing it only affects when adb server is killed while doing IO with
device, which will be solved in later patches.

Bug: http://b/32952319
Test: none
Change-Id: I19522435eadd938ff95d49cbae3bcaa5c8f6d184
lient/usb_libusb.cpp
8663c0083adc1c7190a51188521f100a6dcb7917 04-Apr-2017 Elliott Hughes <enh@google.com> Merge "Show install path in "adb --version" and "fastboot --version"." am: d2d8b68f70 am: 8aac990de2 am: dd05434457
am: ff5e2fa208

Change-Id: I6fac7e98bb6fc5487094406af888f985b2f938cd
8aac990de21dfe7b6d7e43fcb8151f66410fd1b6 04-Apr-2017 Elliott Hughes <enh@google.com> Merge "Show install path in "adb --version" and "fastboot --version"."
am: d2d8b68f70

Change-Id: I3fac85f01f08c277bdc4ccc8ebbb22ddb9f3397f
d2d8b68f70c35355d17a1ffd9079723f9cce5717 04-Apr-2017 Elliott Hughes <enh@google.com> Merge "Show install path in "adb --version" and "fastboot --version"."
4182357b37dadab08c923510b184923526df33e7 31-Mar-2017 Josh Gao <jmgao@google.com> Merge "Revert "adb: check our socketpair ends in our win32 emulation."" am: c1314c8b13 am: 83b3c0817f am: cf476c9360
am: 3e5fb4a680

Change-Id: I2125437f764f714772845769927a6eaf39b82df8
83b3c0817fbf7499100f03dd827f4f281d0b27f3 31-Mar-2017 Josh Gao <jmgao@google.com> Merge "Revert "adb: check our socketpair ends in our win32 emulation.""
am: c1314c8b13

Change-Id: I4eaca80573fc3b17ff312eae2e9e4598a0bcf55a
1fd46dfa7266337324ca4429676a278a904192ba 31-Mar-2017 Elliott Hughes <enh@google.com> Show install path in "adb --version" and "fastboot --version".

Bug: http://b/36766455
Bug: http://b/34691048
Test: ran tests
Change-Id: I4b67ec54d41a281fe7a33c017d3cfbc8055e3b43
db.cpp
3726a0195b7b9394db080ccad9543431bdd59ef8 30-Mar-2017 Josh Gao <jmgao@google.com> Revert "adb: check our socketpair ends in our win32 emulation."

This reverts commit 5990191c4e4802567881db2f19db4adbddc64e1e.

Some Windows users are seeing mismatches between the two ends.

Bug: https://code.google.com/p/android/issues/detail?id=258400
Test: mma
Change-Id: Ie3a121a2754332608ff64b3b016adcb4258d41f3
ysdeps.h
ysdeps_win32.cpp
f66a7ee897ff8bc40ef1adb233178ba6ba83c0f7 29-Mar-2017 bohu <bohu@google.com> Revert "Revert "Qemu-pipe: refactor qemu_pipe.h into libqemu_pipe""

This reverts commit 63ef9ff5fa4b1e68029a54bb60c97b99bdf5defc.
ndroid.mk
ransport_local.cpp
63ef9ff5fa4b1e68029a54bb60c97b99bdf5defc 28-Mar-2017 bohu <bohu@google.com> Revert "Qemu-pipe: refactor qemu_pipe.h into libqemu_pipe"

It broke master
BUG: 36695011

This reverts commit ff87855e10423a1ad6f764f378b8182f86c6f738.

Change-Id: Ic1057a416748d4a3c9736cf3bb73982b8d45e5d5
ndroid.mk
ransport_local.cpp
08ef70558dcedf64f243d9c103dbe127121d10c5 28-Mar-2017 Bo Hu <bohu@google.com> Merge changes from topic 'qemu-cp'

* changes:
Qemu: make the qemu_pipe_open back compatible
Emulator: Enhance qemu_pipe.h to handle partial rw
Qemu-pipe: refactor qemu_pipe.h into libqemu_pipe
ff87855e10423a1ad6f764f378b8182f86c6f738 28-Feb-2017 bohu <bohu@google.com> Qemu-pipe: refactor qemu_pipe.h into libqemu_pipe

Traditionally, qemu_pipe has both the declaration and implentation of each
function in one header file--qemu_pipe.h, and it is getting incovenient to
maintain.

This CL separates the implementation of functions from the header file,
and makes qemu_pipe a static library for other modules to link to.

Note that the interface and implementation of qemu_pipe are kept unchanged,
and future CLs will enhance the implementation to make it more reliable and
more compatible with old and new API levels.

Following projects are affected by this refactoring, and they are modified
accordingly:

hardware/ril/reference-ril

Change-Id: I541ecbf0cc7eadeef9d4e37ffd9ca7bfcc5c94c0
(cherry picked from aosp 294d44be33bf6ad6d7d53189d38202a4911f2bd7)
ndroid.mk
ransport_local.cpp
36699d3fb2d279d3b3448ae1c989469b347bd2be 24-Mar-2017 Josh Gao <jmgao@google.com> Merge "adb: allow symlinks to directories in directory_exists."
am: c10c31e8ba

Change-Id: I9480b98081f9db54955da19a4565c9a458781cdb
ff468dce4c32de86aacbca4afe50a18e4aba43ce 24-Mar-2017 Josh Gao <jmgao@google.com> adb: allow symlinks to directories in directory_exists.

Bug: http://b/36516955
Test: python test_device.py
Change-Id: Ie81e87aac3b157182bde0955bdba23d48bfea873
db_utils.cpp
db_utils_test.cpp
0cb8c69bf284e7ca5caea265069e11b0ab804e2e 23-Mar-2017 Elliott Hughes <enh@google.com> Merge "Switch "adb sideload" over to lseek/read."
am: c0ca39c41a

Change-Id: Ia50ff02ed1e11f6bac3d5ef2e5d09c03fa6f216c
c0ca39c41ae2255ba86517ebe11c72b1fc44700d 23-Mar-2017 Elliott Hughes <enh@google.com> Merge "Switch "adb sideload" over to lseek/read."
ee1ac710cd10b8c46f68fb90ce93f95631a85e89 22-Mar-2017 Elliott Hughes <enh@google.com> Switch "adb sideload" over to lseek/read.

This made no difference to the time taken to sideload an AOSP marlin
update (1m24s), but does reduce the memory requirements to 64KiB.

Bug: https://code.google.com/p/android/issues/detail?id=258500
Bug: http://b/36046324
Test: "time adb sideload update.zip"
Change-Id: Ib0a4daeb5fe798a9bb9c9e0e5fbcff0ed46f20df
ommandline.cpp
70fd64ec05cde69fd89f3754038514cfe897bc03 21-Mar-2017 Felipe Leme <felipeal@google.com> Merge "Don't display bugreport progress when it recedes."
am: 450c44052c

Change-Id: Ieff977589b4c41687727099868b548e0072469f8
450c44052c53e68fa6c6fcd13e7c34a08d9c7bb1 21-Mar-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Don't display bugreport progress when it recedes."
f9d12f272e8f3aca59e8c78ec1b22d5b7dab1e1c 21-Mar-2017 Josh Gao <jmgao@google.com> Merge "adb: switch the jdwp control socket to SOCK_SEQPACKET."
am: 249836158e

Change-Id: Ia42f80f778b2ba78d5d6181038b144c89530f772
b2a7251c556fb1b964793c08745ca38c053bb9db 20-Mar-2017 Josh Gao <jmgao@google.com> adb: switch the jdwp control socket to SOCK_SEQPACKET.

Switch the jdwp control socket to SOCK_SEQPACKET so we don't have to
worry about short reads for the PID.

Bug: http://b/36411868
Test: adb jdwp
Change-Id: I908b88e93b1e0ca2895eb8e777d8438a7bbfa92a
dwp_service.cpp
7e5b10b18cbf750fa7ae1db300a76ba1ca8e86f3 20-Mar-2017 Josh Gao <jmgao@google.com> Merge "adb: detect closed jdwp socket."
am: e1c4e04f82

Change-Id: Ife55285da64e0c12dac3cd8e8171126c3bb8b543
dedcbaad51106a62a72721a68a27c132d3c04a82 20-Mar-2017 Felipe Leme <felipeal@google.com> Don't display bugreport progress when it recedes.

Also fixed InvalidNumberArgs that broke when usage() was moved out from
bugreport.cpp.

Fixes: 26354314
Bug: 28054087
Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test --gtest_filter=BugreportTest.*

Change-Id: I7be5ef7de0fb0d339dc80a2abc816e1c905deb22
ugreport.cpp
ugreport_test.cpp
3fd78c922c2670333e2cfa947e50f64460ced721 20-Mar-2017 Josh Gao <jmgao@google.com> adb: detect closed jdwp socket.

If a process opens a JDWP socket, but crashes before writing the full
PID, adbd will spin forever.

Bug: http://b/36411868
Test: none
Change-Id: I1811759e15c3d9c819685c5fc159a566bd4bc842
dwp_service.cpp
ef3017bdbd7d3c8bcdcfa8193d03a2ce45fcb1b9 15-Mar-2017 Tom Cherry <tomcherry@google.com> Merge "Remove extraneous .clang-format files"
am: 41c7bb5055

Change-Id: I5062d81a01cde71a9bbe7549f9e3c9198af955ae
5b4eb23cfd872e7de993f2e750ce6efd29296fc9 14-Mar-2017 Tom Cherry <tomcherry@google.com> Remove extraneous .clang-format files

The .clang-format files in the base, debuggerd, adb, libprocinfo, and
fastboot subdirectories each differ slightly from the top level
.clang-format-2 and .clang-format-4, but not in a substantially
meaningful way, as the source files in those directories have not been
re-formatted with clang-format. Therefore, let's reduce the
differences and use only the two top level clang-format files.

Secondly perform some small clean-up of the top level .clang-format
files. AllowShortBlocksOnASingleLine is already false in the Google
style, so it can be removed. AllowShortFunctionsOnASingleLine should
not change between the -2 and -4 versions, so leave it at the Google
default style in both, which is 'All'.

The diff stats for these changes are:

./base/
Old:
640 insertions(+), 531 deletions(-)
New:
563 insertions(+), 808 deletions(-)

./debuggerd/
Old:
910 insertions(+), 886 deletions(-)
New:
991 insertions(+), 1023 deletions(-)

./adb/
Old:
2623 insertions(+), 2886 deletions(-)
New:
2655 insertions(+), 3103 deletions(-)

./libprocinfo/
Old:
2 insertions(+), 1 deletion(-)
New:
4 insertions(+), 18 deletions(-)

./fastboot/
Old:
618 insertions(+), 743 deletions(-)
New:
726 insertions(+), 882 deletions(-)

./init/
Old:
1755 insertions(+), 1866 deletions(-)
New:
1715 insertions(+), 1952 deletions(-)

Test: Above clang-format stats
Change-Id: I3f7b8ab0660c8394c5008ba95ea15e70dd22b55b
/system/core/.clang-format-4
4ba84b2dd253079e59e4fe6bb354e8d2bdff58bb 11-Mar-2017 Bowgo Tsai <bowgotsai@google.com> Merge "adb: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()"
am: eca92a5a6f

Change-Id: I192ac96673a3c7e8b4f81c7b27fd761d445556ee
eca92a5a6fc0c1fce842f4891245b245ffe21f18 11-Mar-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()"
66ee277353c7e372ce5ad8a87d5591600fe284dd 10-Mar-2017 Bowgo Tsai <bowgotsai@google.com> adb: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()

The original default /fstab.{ro.hardware} might be moved to
/vendor/etc/. or /odm/etc/. Use the new API to get the default
fstab instead of using the hard-coded /fstab.{ro.hardware}.

Bug: 35811655
Test: boot marlin with /vendor/etc/fstab.marlin, then run 'adb remount'
Change-Id: I927209ce3c5bea45c01ed631a7c4c320fe728c00
emount_service.cpp
b0e8bbfc9900b28bfe87386feaf46155f5b33762 10-Mar-2017 Josh Gao <jmgao@google.com> Merge "adb: properly erase destroyed jdwp_trackers."
am: e02eba8fd2

Change-Id: Ia87892fecebc64198b70acf089aa7eac3652175e
e02eba8fd2ac21bd510dd963857902b688d2cb1c 10-Mar-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: properly erase destroyed jdwp_trackers."
6def9bd67ce536ee4ae95fa4e8342a61da6d338f 10-Mar-2017 Josh Gao <jmgao@google.com> adb: properly erase destroyed jdwp_trackers.

std::remove_if moves to-be-removed elements to the end of the vector
and returns an iterator that must be .erased.

Bug: http://b/35772578
Test: mma
Change-Id: Idfe8520e176204ac5ce000c30704873a3ffe6c9c
dwp_service.cpp
1b35c3f471cae7fd19e958373846679836d509fc 10-Mar-2017 Casey Dahlin <sadmac@google.com> Merge changes from topic 'adb-mdnsd'
am: f4f95496ce

Change-Id: I1749f913b8c5cca64880d3eec3009f850bc9141e
bd2c93fab0b183320fe10d06a953336d05c80293 10-Mar-2017 Casey Dahlin <sadmac@google.com> Enable mDNS on Darwin
am: 304150a521

Change-Id: Id0d77614fc3bf580c2879b9ad801c77dcbfc7752
cef0c7cf7d93bd43e8cbe579eea41185a1d783a9 10-Mar-2017 Casey Dahlin <sadmac@google.com> Don't include mDNS support on platforms other than Linux
am: d6c8091e9f

Change-Id: Ife0b6e08098c05288c3ea63e9063e5116335716a
b298855764c598368100fd4ad72cdfc57a25a23d 10-Mar-2017 Casey Dahlin <sadmac@google.com> Add mDNS device discovery for adb client
am: 13a269ea24

Change-Id: Ib5f80b3ccc9db7c6fe6f5c989e82083d734ce4df
f18d33c2c6c4e4c62406adc4a44a7aab1f1ed01c 10-Mar-2017 Casey Dahlin <sadmac@google.com> adb: Set a hostname for mDNS
am: 1fe3cae67e

Change-Id: Iea8700ec13502e58774968cd7383255f769fa105
cc9c92fa95b594f3f65e8f50378eb90cb148d82b 10-Mar-2017 Casey Dahlin <sadmac@google.com> Make ADBD announce its presence over mDNS
am: 6cd5e0b4ef

Change-Id: Ida2f133f72087f291f2d34e968503ae81c3fbd50
f4f95496ce053c851bbd8e10b6897e09843a8d4e 10-Mar-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'adb-mdnsd'

* changes:
Make ADB over mDNS work on Windows
Enable mDNS on Darwin
Don't include mDNS support on platforms other than Linux
Add mDNS device discovery for adb client
adb: Set a hostname for mDNS
Make ADBD announce its presence over mDNS
9d13bc216033cbe1a6d1b42579988c30990325ea 09-Mar-2017 Josh Gao <jmgao@google.com> Merge "adb: append the libwinpthread COPYING to adb's NOTICE."
am: c1b3c8ef26

Change-Id: I4de6f83ea394635710b4e89cc1818233b6605eca
d3bf1a8d7efcff045878cb60a3ee79c0f28b34c6 09-Mar-2017 Josh Gao <jmgao@google.com> adb: append the libwinpthread COPYING to adb's NOTICE.

We statically link libwinpthread into Windows binaries, but soong
currently can't specify notice files for toolchain_libraries. Add
libwinpthread's COPYING info directly to adb's as a hack.

Bug: http://b/36073965
Test: `make PRODUCT-sdk-win_sdk` + manual inspection of NOTICE.txt
Change-Id: I58d6be0ecf5626b67308f7e94128a2cd44dab161
OTICE
a37bc179dea679c059d94950fba419106afa149d 08-Mar-2017 Badhri Jagan Sridharan <badhri@google.com> Merge "adb: Do not signal gaget stack unless descriptors are written"
am: eab4c62e22

Change-Id: Ia04e413a6f3a0e3fcb1e8e52aa822accb808f1fb
43fd1a4ea72ec96de2790a6703722e900b354de6 08-Mar-2017 Badhri Jagan Sridharan <Badhri@google.com> adb: Do not signal gaget stack unless descriptors are written

While recovering from endpoint errors, the gadget stack was being
signalled even when desriptors were NOT being rewritten. Avoid this
as this might cause enumeration loops.

Bug: 36036550
Change-Id: Iff2b2fc8cded001ef3c77dc170dce3b96848970c
aemon/usb.cpp
304150a521b95654a0568536d2f8c7696dbbb333 23-Aug-2016 Casey Dahlin <sadmac@google.com> Enable mDNS on Darwin

We have to disable IPv6 to get this going, but nobody was yet using
IPv6, so that should be fine for now.

Test: Verified mDNS discovery on a MacBook
Bug: 31042497
(cherry picked from 9ae65de087171072f3890a81b074ae27db319508)

Change-Id: I628f0a1e9c4784db42fa56f5faf2904b6e1cf548
ndroid.mk
ransport_mdns.cpp
d6c8091e9f5cc31e6face99253c3805d9cc7058b 19-Jul-2016 Casey Dahlin <sadmac@google.com> Don't include mDNS support on platforms other than Linux

Test: Shamu build now passes
Bug: None
(cherry picked from 122a7738606d854d6dc10fa361c1d7296cc9670a)

Change-Id: I650adf0bca96fb655163f5e9b27d9995ae448ec2
ndroid.mk
ransport_mdns_unsupported.cpp
2fe9b6047536e1dbb3e6253bd6c2b3400d6f5903 21-Sep-2016 Casey Dahlin <sadmac@google.com> Make ADB over mDNS work on Windows

Test: Verified ADB over mDNS on a Windows machine
Bug: 30482671
(cherry picked from 9fdd77101f49d03ff29342e12e23edf241f68522)

Change-Id: If955ca304db71a5b08c5a9654f1e27ab74af9af8
ndroid.mk
ysdeps.h
ysdeps_win32.cpp
ransport_mdns.cpp
13a269ea24a98111d2e84a7ffa3c05ab8a4e73a9 23-Jun-2016 Casey Dahlin <sadmac@google.com> Add mDNS device discovery for adb client

Test: Was able to discover a raspberry pi.
Bug: 28074466
(cherry picked from e292cd16760321fccc99c8c261cb92fa4b6462ab)

Change-Id: Id9571576457a4a0a078e48a274a4e8eac78bfe2b
ndroid.mk
db_mdns.h
lient/main.cpp
aemon/mdns.cpp
ervices.cpp
ransport.h
ransport_local.cpp
ransport_mdns.cpp
1fe3cae67ecc20f346aa38bb0ed4500f8e2885bf 21-May-2016 Casey Dahlin <sadmac@google.com> adb: Set a hostname for mDNS

Now all devices won't appear as "Android." Should make it easier to
multiplex.

Test: Verified locally on a raspberry pi 3
Bug: 28887278
(cherry picked from 815b23319635d264ae0ce2c8c29a5776a57b8051)

Change-Id: Icfd0116477543af6a3049c14d818c1cff7fc3b93
aemon/mdns.cpp
6cd5e0b4efded6b86c27de7d97dd910190436867 07-May-2016 Casey Dahlin <sadmac@google.com> Make ADBD announce its presence over mDNS

We now request mdnsd from adb and register a service of type _adb._tcp
for clients to connect to.

Test: Verified service appears in avahi-browse
Bug: 28074466
(cherry picked from 379ac414e4d9f53388d903913022a55695292775)

Change-Id: Ie871b9c8b40e86063cc1e68e8f3e4290ead2d279
ndroid.mk
aemon/main.cpp
aemon/mdns.cpp
aemon/mdns.h
ef501512faeb8682eeeba8a75bb9895ab307adde 04-Mar-2017 Josh Gao <jmgao@google.com> Merge "adb: turn on libusb by default."
am: 817b2f3b2c

Change-Id: Iaeefdcc45a5b96243b0b47822361d71c6e154b6e
f2f0b318508fec66fc07044b34f602960f399e5b 02-Mar-2017 Josh Gao <jmgao@google.com> adb: turn on libusb by default.

Bug: http://b/31321337
Test: python test_device.py
Change-Id: Idb2ff1108331bf505feeeb943b6be7bb78124618
ransport_usb.cpp
8c3549115100c258b9b99c46c6f8cce782540d4f 02-Mar-2017 Bo Hu <bohu@google.com> Merge "DO NOT MERGE ANYWHERE Qemu-pipe: refactor qemu_pipe.h into libqemu_pipe"
294d44be33bf6ad6d7d53189d38202a4911f2bd7 28-Feb-2017 bohu <bohu@google.com> DO NOT MERGE ANYWHERE Qemu-pipe: refactor qemu_pipe.h into libqemu_pipe

Traditionally, qemu_pipe has both the declaration and implentation of each
function in one header file--qemu_pipe.h, and it is getting incovenient to
maintain.

This CL separates the implementation of functions from the header file,
and makes qemu_pipe a static library for other modules to link to.

Note that the interface and implementation of qemu_pipe are kept unchanged,
and future CLs will enhance the implementation to make it more reliable and
more compatible with old and new API levels.

Following projects are affected by this refactoring, and they are modified
accordingly:

device/generic/goldfish
device/generic/goldfish-opengl
hardware/ril/reference-ril

Change-Id: I541ecbf0cc7eadeef9d4e37ffd9ca7bfcc5c94c0
ndroid.mk
ransport_local.cpp
58021d15c94eb6a81d2673634956b5374af6a1e5 24-Feb-2017 Colin Cross <ccross@android.com> Move adb_dirname and adb_basename to libbase

adb already provides an implementation of dirname and basename that
take and produce std::strings, move it into libbase so it can be
used in the implementation of GetExecutableDirectory.

Test: out/host/linux-x86/nativetest64/adb_test/adb_test
Test: out/host/linux-x86/nativetest64/libbase_test/libbase_test
Test: adb shell /data/nativetest64/libbase_test/libbase_test64
Change-Id: Ideb1627607b14562121316d4ed27fa6fb0930684
db_utils.cpp
db_utils.h
db_utils_test.cpp
ugreport.cpp
ommandline.cpp
ile_sync_client.cpp
ile_sync_service.cpp
87eb0fc3d0dd02e263080abddb741362157f7785 24-Feb-2017 Josh Gao <jmgao@google.com> Merge "Revert "adb: remove win32 dependency on libwinpthread-1.dll.""
f134fe07b842e4bd4fb9194a5806b19417ceaeef 24-Feb-2017 Sandeep Patil <sspatil@google.com> adb: early-mount: fix verity toggle through adb for early mount

verity toggle through adb failed to work for early mount due to fstab
entries being moved into kernel/dt. This change fixes that by using the
new fs_mgr_read_fstab_default() api that will make sure all fstab
entries (from dt as well as from /fstab.{ro.hardware}) are combined
before returning the fstab object.

b/27805372

Test: early mount /system and /vendor on angler.
- test adb disable-verity && adb root to ensure rebooted instance
doesn't have 'partition.system.verified' property set. i.e. verity is
indeed disabled.

- test adb enable-verity && adb root to ensure rebooted instance does
have 'partition.system.verified' property set, i.e. verity is enabled.
also verified by trying to do 'adb remount' which correctly warns about
verity

Change-Id: Iffdcc0a0b959a65c326219bd4e9e41cba9ec7c88
Signed-off-by: Sandeep Patil <sspatil@google.com>
et_verity_enable_state_service.cpp
3d4d973e82388b113553a60336c4e47aa53453f5 23-Feb-2017 Josh Gao <jmgao@google.com> Revert "adb: remove win32 dependency on libwinpthread-1.dll."

This reverts commit c2e984eec8be27f67c5cf7c73060d84e1e0bf8b4.

Move the change to build/make, so that other win32 binaries get this as
well.
ndroid.mk
5d1756ceb58246a721e10464f788e81cdcdc455a 23-Feb-2017 Josh Gao <jmgao@google.com> adb: add `adb host-features`, report libusb status.

Add a 'host-features' command to get the features of the currently
running host adb server. Abuse it to report libusb status.

Bug: http://b/34983123
Test: adb host-features; adb kill-server; ADB_LIBUSB=1 adb start-server; adb host-features
Change-Id: I0e8d503a2dbdff9002ebb6ce8a298498a9421422
db.cpp
db.h
lient/usb_dispatch.cpp
ommandline.cpp
ransport.cpp
ransport.h
ransport_usb.cpp
sb.h
1d73abb4436f5c578f05dd016a820e4a37275f75 22-Feb-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: remove win32 dependency on libwinpthread-1.dll."
c2e984eec8be27f67c5cf7c73060d84e1e0bf8b4 22-Feb-2017 Josh Gao <jmgao@google.com> adb: remove win32 dependency on libwinpthread-1.dll.

Explicitly link against the static libwinpthread.a to avoid a
dependency on the dll.

Also, make the tests link against libbase statically.

Bug: http://b/31665213
Test: wine adb.exe
Test: wine adb_test.exe
Change-Id: Ifd41afcb1756a4b9b6db12e102b4db502e73d846
ndroid.mk
f3fb7de3c86f14939a67268cf5fc5713dc3c175e 21-Feb-2017 Jerry Zhang <zhangjerry@google.com> adb: set max_rw to USB_FFS_BULK_SIZE explicitly

Sometimes when endpoint_alloc returns ENODEV,
max_rw will end up being a value that is too
big.

Bug: 35634401
Test: push/pull files
Change-Id: Iaa81a3311b1855e2a835562cdf7a46ff4399feb1
aemon/usb.cpp
9eb551868bc9b8ab775767b620a017d3f93ca6c7 17-Feb-2017 Elliott Hughes <enh@google.com> adbd's children should have SIGPIPE set to SIG_DFL.

POSIX lets you choose whether or not SIGPIPE disposition is inherited,
and Linux chose "yes". Work around that.

Bug: http://b/35209888
Test: "ps -A | head" without the toybox workaround
Change-Id: I6b5afa3d87eb2af04b24c6c37fa338ab60ad2336
hell_service.cpp
05fe272a87c6be24d3e2808ecceed2be063b9c1d 16-Feb-2017 Jerry Zhang <zhangjerry@google.com> adb: Lower EP_ALLOC retry count

Retries were causing timeouts on some devices.

Bug: 35418581
Test: Change usb config
Change-Id: Ie80d9eba1cb9af0acee49bd7312842533a94a87b
aemon/usb.cpp
b5a34a2bce41d3f944223a1d8c7a10599802af36 11-Feb-2017 Jerry Zhang <zhangjerry@google.com> adb: Add bMaxBurst to superspeed descriptors

This gives a large boost to speed on usb 3.0.

Test: adb pull/push multi GB files
Bug: 31722483
Change-Id: Iea039f1aba8b2e4d7e4a2ecb504cccb5dd1e4629
aemon/usb.cpp
2f8c60b1cc0e3c4ef9c59ce3a08f85ab2900f477 11-Feb-2017 Jerry Zhang <zhangjerry@google.com> adb: Set max socket sizes to larger values.

This improves performance of push/pull.

Test: adb push/pull multi GB files.
Bug: 31722483
Change-Id: Ia01574c3db6a740d7a7e64ba1f5bc1fc279fb3f6
db.h
ervices.cpp
55205a565b573a40a65b41645d8b88f0a6f4f13d 04-Jan-2017 Jerry Zhang <zhangjerry@google.com> adb: Pre allocate kernel memory

This allows reliable use of larger buffer sizes.
Max r/w size is set only when that preallocation
is successful so that memory is guaranteed to be
available.

Bug: 31722483
Test: adb push with multi GB files
Change-Id: Ia0459ca051988abb144645871792e8f840dd3ff7
aemon/usb.cpp
aemon/usb.h
2ec36b0da00f959ed5cf47b947630fe6bfe73c9f 07-Feb-2017 Elliott Hughes <enh@google.com> Don't print 168^W143 lines of help when someone makes a typo.

Print actual usage messages in most cases.

Add --help and --version.

Bug: http://b/28054087
Test: manual
Change-Id: I39c1cb7a84f52e0c35d24f140ec55c3a181283fb
db_utils.cpp
db_utils.h
ugreport.cpp
ommandline.cpp
aced420f20538eb64137e154b1b5e9a00551ffce 01-Feb-2017 Nick Kralevich <nnk@google.com> usb_dispatch.cpp: Lower severity of logging statement.

The first time you run adb, it starts the adbd server and annoyingly
generates the following message:

adb I 02-01 11:57:58 99717 99717 usb_dispatch.cpp:30] using native
backend

Drop the severity of the message to avoid visible spammy messages only
intended for debugging.

Test: code compiles and no more log message in normal adb use
Change-Id: I882092a6cd14bc67980d88416397d51ab8393b1b
lient/usb_dispatch.cpp
06766a8b291e74c120b94a54052f5032adf5af48 26-Jan-2017 Josh Gao <jmgao@google.com> adb: fix darwin build.

Bug: none
Test: mma on mac
Change-Id: I49ef3c4892c7942a235d317d90386c7d8a872868
lient/usb_osx.cpp
1c70e1bcbcced190b351d4fb418f32b4e428f496 28-Sep-2016 Josh Gao <jmgao@google.com> adb: add libusb implementation for Linux/Darwin.

Add a libusb-based implementation alongside the existing native
implementations, controlled by the ADB_LIBUSB environment variable.

Windows will need more work for the usb driver.

Bug: http://b/31321337
Test: python test_device.py on linux/darwin, with ADB_LIBUSB=0 and 1
Change-Id: Ib68fb2c6c05475eae3ff4cc19f55802a6f489bb7
ndroid.mk
db.cpp
db.h
lient/main.cpp
lient/usb_dispatch.cpp
lient/usb_libusb.cpp
lient/usb_linux.cpp
ransport_usb.cpp
sb.h
4c38a921c225ef065ab0b3765f193fea64e2d6fb 25-Jan-2017 Josh Gao <jmgao@google.com> Merge changes I21eefab9,I0ac7d78a

* changes:
adb: move usb_* to client/usb_*.
adb: reorganize adbd USB handling code.
fb9a7e5995d2e6c2c7f08080201d41fe0f6c4b53 19-Jan-2017 Josh Gao <jmgao@google.com> adb: check for and report inotify_init1 failure.

Bug: http://b/34396687
Test: mma
Change-Id: I55ea84db49017a6533ac54db5072e3e75ba30097
db_auth_host.cpp
456e1ad42034316cee5a6467c4bcb23643b51e5a 19-Jan-2017 Josh Gao <jmgao@google.com> adb: move usb_* to client/usb_*.

Bug: http://b/31321337
Test: mma
Change-Id: I21eefab953737e87d211959616ac4f48926dd92c
ndroid.mk
lient/usb_linux.cpp
lient/usb_osx.cpp
lient/usb_windows.cpp
sb_linux.cpp
sb_osx.cpp
sb_windows.cpp
44c688ca19a570b4d73f92f34d410e62ef491f0a 12-Jan-2017 Josh Gao <jmgao@google.com> adb: reorganize adbd USB handling code.

Break adbd's USB initialization code into its own static library to
allow it to be used by benchmark code that pretends to be adbd.

Bug: http://b/31289465
Test: adb shell works on bullhead
Change-Id: I0ac7d78a4f7aef59bd6d14fc5cf1ed870e1f3a9d
ndroid.mk
aemon/usb.cpp
aemon/usb.h
sb_linux_client.cpp
cbe70cb0a8cb0171f3802273050e851a47b090ed 19-Oct-2016 Josh Gao <jmgao@google.com> debuggerd: advance our amazing bet.

Remove debuggerd in favor of a helper process that gets execed by
crashing processes.

Bug: http://b/30705528
Test: debuggerd_test
Change-Id: I9906c69473989cbf7fe5ea6cccf9a9c563d75906
ndroid.mk
aemon/main.cpp
83ab5c29c1760653a35f69261a4208e3ea5b7c24 14-Jan-2017 Elliott Hughes <enh@google.com> -e is really about TCP/IP devices, not emulators.

Despite the name.

Bug: N/A
Test: N/A
Change-Id: I099222137fabf68f961a6a2e5d11f2904ffd5a0d
ommandline.cpp
72d4c42cd548b1e852fa6bda9abad3f9705aaf6c 12-Jan-2017 Josh Gao <jmgao@google.com> Merge "adb: remove support for legacy f_adb interface."
183b73e665a4cd369ef88c657019cd29f009672b 11-Jan-2017 Josh Gao <jmgao@google.com> adb: remove support for legacy f_adb interface.

Everything should be using the functionfs interface instead by now.

Bug: http://b/34228376
Test: grepping for f_adb, android_adb in source tree
Test: m
Change-Id: I6bc41049c49a867499832588dac8ed108c636c11
db.h
aemon/main.cpp
sb_linux_client.cpp
705353ae277e408e70169c0811c5d104a3b733f6 11-Jan-2017 Alex Deymo <deymo@google.com> Remove "_static" and "_host" suffix from libext4_utils.

Bug: 34220783
Change-Id: I967dbaa9c48ad1feed2369c3a40f745b86a350f8
ndroid.mk
40e0ec918e728911c0dc3fb3f76d5c0de83dd702 06-Jan-2017 Tao Bao <tbao@google.com> adb: Fix the 'adb reboot sideload' for A/B devices.

We used to write the command file (/cache/recovery/command) to trigger
the sideload mode. A/B devices don't support that (may not have /cache
paritition). This CL switches to using libbootloader_message which
writes the command to BCB (bootloader control block) instead.

Test: "adb root && adb reboot sideload" reboots sailfish into recovery
sideload mode.

Change-Id: I158fd7cbcfa9a5d0609f1f684a2d03675217628f
ndroid.mk
ervices.cpp
94dd4b74100aedc4d04a46c6853bfa866679e2f5 17-Dec-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: fix adb trace tag"
a27666b823b265eeab6cb0e9355fd4bcbc34c6e3 15-Dec-2016 Josh Gao <jmgao@google.com> adb: don't require adb keys to be named "*.adb_key".

Don't require the extension on explicit file paths passed on; only
check for it in monitored directories.

Bug: http://b/33638233
Test: ADB_TRACE=1 ADB_VENDOR_KEYS=$HOME/foo adb server nodaemon
Change-Id: I7387e0bbe0f2e16878bf22b05d5c6e8d0f9e5a92
db_auth_host.cpp
e69e9be7b6dc51808b09dc0dc7bf77f8441b63af 14-Dec-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: remove extraneous stat in sync_recv."
b64413485815e1bb09c5041bf8556428378b3a97 14-Dec-2016 Daniel Friederich <dfriederich@magicleap.com> adb: fix adb trace tag

The ADB trace enum value collided with the 0 values used to mean all, hence it
was not possible to just trace the ADB tagged messages without also tracing everything else.

Change-Id: I15ff9c50c4ac01806c4841cf8213ce859faf130b
Test: Manually by setting ADB_TRACE and running adb, e.g. "ADB_TRACE=adb adb shell ls"
db_trace.cpp
52df920fd6caa810da62bb0e6bcc4da3434248e6 13-Dec-2016 Josh Gao <jmgao@google.com> adb: add script to trace adbd.

Bug: http://b/31289465
Test: sh trace.sh
Change-Id: Id6e20e83742541aec6bfd9f4112adbdadc078f74
ysdeps_win32_test.cpp
race.sh
f0f854bc76458b10b6b3ed88655fd87cd156dc70 13-Dec-2016 Josh Gao <jmgao@google.com> adb: retry install_listener for a while.

install_listener can fail if we told a previous adb server to quit and
it hasn't finished doing so yet. Retry it for a few hundred
milliseconds to avoid this.

Bug: http://b/28618716
Test: nc -l 5037; adb server nodaemon
Change-Id: Ibbda8f2718b85a2b6a08985aa8d29aa2204a3ead
lient/main.cpp
aac1145a5bdcc25d3e4bb60ebbad8e2a5c94fc5e 06-Dec-2016 Josh Gao <jmgao@google.com> adb: remove extraneous stat in sync_recv.

We do a remote stat to get the file's size before pulling in sync_recv,
but all of the callers to sync_recv have already done a stat. Pass the
expected file size into sync_recv to remove its stat.

Bug: http://b/31289465
Test: python test_device.py
Change-Id: I7ca8ed11c6134e5954acac86626f880ade3ec696
ile_sync_client.cpp
cfe72e290b6e3fd70f443e666ef6929527831fc0 29-Nov-2016 Josh Gao <jmgao@google.com> adb: add tracing to transport.cpp.

Bug: http://b/31289465
Test: systrace
Change-Id: I41968f447b61ef1eea2b933a5fd8623605c4dea6
ransport.cpp
1290fbf5eb21079d08f6aaed57c5aabd8d25b626 22-Nov-2016 Josh Gao <jmgao@google.com> adb: clang-format transport.cpp

Bug: http://b/31289465
Test: none
Change-Id: If99a9f1d4d6fa1d34b0ac3bbfc7f2e6bfc188ff2
ransport.cpp
fd12aaa8c13e6af5e342f24f9af41f32b05eba9b 22-Nov-2016 Josh Gao <jmgao@google.com> adb: add tracing to file_sync_service.cpp.

Bug: http://b/31289465
Test: systrace
Change-Id: I186675ca0310ace0e1d35561fa0b910417dcedd7
db_trace.h
ile_sync_service.cpp
a79477559213e25c6a1f4bf29fc1f4a2e741f8df 07-Dec-2016 Bill Yi <byi@google.com> Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD
5a1e3fdaf82aee348b1b22992a8c1d15db38413b 06-Dec-2016 Josh Gao <jmgao@google.com> Revert "Revert "adb: extend sync protocol's stat support.""

This reverts commit afa4b5d6eb45bbee8671a1bb93ea70506fb326e3.

Add functions to translate errno to and from the linux asm-generic
values, since mips has different values.

Bug: http://b/33058958
Test: python test_device.py with both old and new adbd
Change-Id: I1a122235f3e793ed10b3bf3ad293388015134150
ndroid.mk
db.h
ile_sync_client.cpp
ile_sync_service.cpp
ile_sync_service.h
ysdeps/errno.cpp
ysdeps/errno.h
ransport.cpp
ransport.h
a3577e1ac558d83428c492e806549e278e5dc8fb 05-Dec-2016 Josh Gao <jmgao@google.com> Revert "Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp.""

This reverts commit 43c02b27cd50a75f0fecb44e56a9bf32c6923aef.

Test: mma
Change-Id: I6b22ead8a4b964973ee2fdb8deba42bea74880cf
ndroid.mk
ile_sync_client.cpp
ysdeps.h
ysdeps/errno.h
ysdeps/win32/errno.cpp
ysdeps/win32/errno_test.cpp
ysdeps_win32.cpp
ysdeps_win32_test.cpp
bad5069cc0a71fa986f3bb41e18013232250b002 05-Dec-2016 Josh Gao <jmgao@google.com> Revert "adb: extend sync protocol's stat support."
am: afa4b5d6eb

Change-Id: I5fbf0e936685b320d322d4a8e1b1671f2d0da8cf
3cad1843f87fa2383406e0e0549bc5162ab86a69 05-Dec-2016 Josh Gao <jmgao@google.com> Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp."
am: 43c02b27cd

Change-Id: I5a4a050fdbf05910edf2e55dfb8442e30e88464e
afa4b5d6eb45bbee8671a1bb93ea70506fb326e3 05-Dec-2016 Josh Gao <jmgao@google.com> Revert "adb: extend sync protocol's stat support."

This reverts commit d6d5c38469203a63c686517d765a7e6d2bc24656.
ndroid.mk
db.h
ile_sync_client.cpp
ile_sync_service.cpp
ile_sync_service.h
ysdeps/errno.cpp
ysdeps/errno.h
ransport.cpp
ransport.h
43c02b27cd50a75f0fecb44e56a9bf32c6923aef 05-Dec-2016 Josh Gao <jmgao@google.com> Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp."

This reverts commit 4fba3d2638ecec0f87fe8d8913490bfbd7234d19.
ndroid.mk
ile_sync_client.cpp
ysdeps.h
ysdeps/errno.h
ysdeps/win32/errno.cpp
ysdeps/win32/errno_test.cpp
ysdeps_win32.cpp
ysdeps_win32_test.cpp
d5286d376b7cfc1a0bd35b3aefe7e8f982a877e8 05-Dec-2016 Josh Gao <jmgao@google.com> adb: move adb_strerror to sysdeps/win32/errno.cpp.
am: 4fba3d2638

Change-Id: Ibdfa8ebbcfee5baf459f82fd13e1a0e8167c5053
4733b631ed586bfd25ccbcf6a376657d56ffbd7b 05-Dec-2016 Josh Gao <jmgao@google.com> adb: extend sync protocol's stat support.
am: d6d5c38469

Change-Id: I26a1518bba4f65c0fdcc7c75d751badd9a3563d3
97e228e903518dd77e88d0e82a6ee9fee6e0c553 05-Dec-2016 Josh Gao <jmgao@google.com> Merge changes I9df4d6fa,I841123de

* changes:
adb: move adb_strerror to sysdeps/win32/errno.cpp.
adb: extend sync protocol's stat support.
32ca0ab616037bfd6bcc624cbf91c37b622e1657 03-Dec-2016 Elliott Hughes <enh@google.com> Merge "Remove unused adb_set_transport."
am: b898ce00fa

Change-Id: Ia428922f1a0241b8d7ec97517d360b02596a9781
de80be39aaf7ce989f2a7b96ff842f45fd596f78 02-Dec-2016 Elliott Hughes <enh@google.com> Remove unused adb_set_transport.

Bug: N/A
Test: builds
Change-Id: I0824d29c080c47e1002abf3520ebed8996bcbcc6
db_client.cpp
db_client.h
4fba3d2638ecec0f87fe8d8913490bfbd7234d19 30-Nov-2016 Josh Gao <jmgao@google.com> adb: move adb_strerror to sysdeps/win32/errno.cpp.

Bug: none
Test: mma
Change-Id: I9df4d6faf9883a78f50ca6b2b7c35f095d06ae20
ndroid.mk
ile_sync_client.cpp
ysdeps.h
ysdeps/errno.h
ysdeps/win32/errno.cpp
ysdeps/win32/errno_test.cpp
ysdeps_win32.cpp
ysdeps_win32_test.cpp
d6d5c38469203a63c686517d765a7e6d2bc24656 22-Nov-2016 Josh Gao <jmgao@google.com> adb: extend sync protocol's stat support.

Extend the file sync protocol to support calling regular stat (instead
of lstat), return error codes, and provide the entire stat struct.

Bug: http://b/33058958
Test: python test_device.py with both old and new adbd
Change-Id: I841123debc380f86194a19e91c97d85160112144
ndroid.mk
db.h
ile_sync_client.cpp
ile_sync_service.cpp
ile_sync_service.h
ysdeps/errno.cpp
ysdeps/errno.h
ransport.cpp
ransport.h
b6e9e5dddef4f9c44ad1e8148d0ce6205d123b5c 29-Nov-2016 Josh Gao <jmgao@google.com> adb: be more permissive in test_push_error_reporting.
am: 79ce3fe7db

Change-Id: I1239b5af85edca9ae6fa1a38f755b5707bbc614b
68fd28e3343ae9a1a426afe28cf674e5c40fd3ec 29-Nov-2016 Josh Gao <jmgao@google.com> adb: make sure that file mode macros match linux.
am: 05a3abfef3

Change-Id: I39a6938adc8b9b1da0185d36a1891f755bf2ca38
79ce3fe7db2a947d59218d446f356a9ab4c96800 19-Nov-2016 Josh Gao <jmgao@google.com> adb: be more permissive in test_push_error_reporting.

Be agnostic to whether /system is writable when testing push error
reporting.

Test: python test_device.py
Change-Id: I1d03564fa35442c20e2c96a7f5b56d39868efc52
est_device.py
05a3abfef34b7b7b0f4358c15fe5410cc088aa03 19-Nov-2016 Josh Gao <jmgao@google.com> adb: make sure that file mode macros match linux.

We use <sys/stat.h> mode macros on the host to parse modes sent over
from the device, so they had better match. Add static_asserts to ensure
this.

(Also, fix the cases where they don't.)

Test: mma -j48, compiled the static_asserts on darwin manually
Change-Id: I883e4e6c7489ea64d3c02d26790ac8293366d989
ile_sync_client.cpp
ysdeps.h
ysdeps/stat.h
c2102a7b8f5aef906e0db89c4dc9098bc2ed2b4f 18-Nov-2016 Josh Gao <jmgao@google.com> Merge "adb: fix progress percentage when pulling symlinks."
am: 453db013b0

Change-Id: I3789390531b46c7dc5ac6796e62e6e43bba3bcca
453db013b098e9b48cd9cb5c32fb5ce9c4c4485f 18-Nov-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: fix progress percentage when pulling symlinks."
da1f279509dc11b436818d0ef0b0bfb49d147fa0 18-Nov-2016 Josh Gao <jmgao@google.com> adb: fix progress percentage when pulling symlinks.

The adb protocol currently only supports lstat with no way of finding
the target of a symlink, so pulling a symlink that points to a file
looks like pulling a file with length equal to the length of path to
the symlink's target. Pulling a file that's sufficiently large can
overflow the int used to calculate percentage, and result in a bogus
completion percentage being displayed.

Bug: http://b/29277448
Test: adb pull /dev/block/platform/soc.0/f9824900.sdhci/by-name/system
Change-Id: I42d180550ac2aa9e4705676ccbb20f5db789fb8d
ile_sync_client.cpp
8e5fb5a0e73066ca40f43ebbd94c361d359f819a 17-Nov-2016 Elliott Hughes <enh@google.com> Merge "Remove dead code."
am: 3bde05d928

Change-Id: Ib748fef3e54687c2da1818a7cd738f31e30b79ac
3bde05d928fb74a75144ae0eeaa25891c91234d1 17-Nov-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Remove dead code."
284f07bd9d90386525abde6832e29c5539cd3c4d 17-Nov-2016 Elliott Hughes <enh@google.com> Remove dead code.

At this point, we can't write to oom_score_adj anyway.

Bug: https://code.google.com/p/android/issues/detail?id=227721
Test: boots, adb shell still works
Change-Id: I07e6ad32765f6582f316973547a3a3d552808287
hell_service.cpp
27bbe8bfb224ae4bf11f0dea58f26a975e67ef74 16-Nov-2016 Josh Gao <jmgao@google.com> Merge "adb: add sysdeps/chrono.h for chrono literals on Win32."
am: e631e470e0

Change-Id: Ie62e995d9790bf7539f3f9fca05de7b4b359dc7c
4602adbcd3b15f0a575f3ade899f481ff0909f44 16-Nov-2016 Josh Gao <jmgao@google.com> adb: add sysdeps/chrono.h for chrono literals on Win32.

Bug: http://b/32878766
Test: mma
Change-Id: Iaa89d4eadf07e63d6d7205057435a6c7fb5d4ec5
db_client.cpp
db_io.cpp
ommandline.cpp
ocket_test.cpp
ysdeps/chrono.h
ysdeps_test.cpp
ransport_local.cpp
sb_windows.cpp
2278b50f2499fb1841a63dab32a74de1b1c06400 16-Nov-2016 Elliott Hughes <enh@google.com> Merge "Switch adb over to <chrono>."
am: 59826ddee5

Change-Id: I673ce3c9f4a104df3197ec7120a126155e18918e
dbe91eee26300be10d6f1a0b42451dd46ea68538 15-Nov-2016 Elliott Hughes <enh@google.com> Switch adb over to <chrono>.

Clearer code, and lets us lose some more portability cruft.

Bug: http://b/32878766
Test: manual
Change-Id: Ie44928bbf8d68a74127aaf76e7e0060e25fa2cc8
db.cpp
db_client.cpp
db_io.cpp
ommandline.cpp
ocket_test.cpp
ysdeps.h
ysdeps_test.cpp
ransport_local.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
sb_windows.cpp
c6fbcd757980272602981b357a0c2c4100ab6e8f 03-Nov-2016 Jin Qian <jinqian@google.com> Merge "Set file capabilities after writing file data"
am: dd4e5ae943

Change-Id: I135c6ebf4fc9b11a7ed9798be1ce0a88862386a5
d0515e71652910c3a46f5cea8be75c0cf9132556 03-Nov-2016 Jin Qian <jinqian@google.com> Set file capabilities after writing file data

File capabilities will be cleared if we set them before writing file data.

Bug: 32543395

Change-Id: I88cc0a0ec23cd6fc6dbe86c93a76914809d7e5f9
ile_sync_service.cpp
1d51d6d6aa303e622c9581cb0b9622cc7bb318d2 31-Oct-2016 Josh Gao <jmgao@google.com> Merge "adb: add `adb reconnect offline` to reconnect offline devices."
am: 0945380e36

Change-Id: I832f5c97f455b2b38b4bcd734759cb9561ec9b31
0945380e36e4106a643af0a6e756fdc3487cfee2 31-Oct-2016 Josh Gao <jmgao@google.com> Merge "adb: add `adb reconnect offline` to reconnect offline devices."
22d2b3e1c2e1152ca9cf86c3eb42cd42e7448a31 27-Oct-2016 Josh Gao <jmgao@google.com> adb: add `adb reconnect offline` to reconnect offline devices.

Add a command to reconnect offline/unauthorized devices, mainly for use
with the inotify-monitoring of vendor key directories added by 2e671202.

Bug: http://b/29273531
Test: manually tested with a sailfish + copying vendor keys
Change-Id: If34cccee4ae553ada65d128b57d03cba8c0d7c46
db.cpp
ommandline.cpp
ockets.cpp
ransport.cpp
ransport.h
a4f497e0a2c4d878426f3cbcd091ee2455d4a68f 27-Oct-2016 Elliott Hughes <enh@google.com> Merge "Make "adb logcat" pass $ANDROID_LOG_TAGS through again."
am: b838ff65d9

Change-Id: I29acb11ca837c1824e4530c1e6315f04c7a25648
90390302d5ca7056fc679efe5aa01805a567e83a 27-Oct-2016 Elliott Hughes <enh@google.com> Make "adb logcat" pass $ANDROID_LOG_TAGS through again.

But not for Windows, because even dealing with environment variables is
too hard there (and no Windows user has complained yet).

Bug: http://b/30184452
Test: manual
Change-Id: I2d60049ed0049a9532414a7cdecbd0687e06aba7
db_trace.cpp
66321bc8891ee95f48d08c7d825969bb4fecccc4 26-Oct-2016 Elliott Hughes <enh@google.com> Merge "Improve "adb install" diagnostics."
am: a16ae8717c

Change-Id: Ia3a8b9cfce4d5e939a8a894e959731874d1f2fd0
a16ae8717c73f06066ddf572dfbd965c51f47ff4 26-Oct-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Improve "adb install" diagnostics."
02ee1725ae93aa5821c78fdfbbd1ee9e95ef67dd 26-Oct-2016 Elliott Hughes <enh@google.com> Merge "Make "adb bugreport"'s .zip check case-insensitive."
am: da6fe65000

Change-Id: I34d95b38bec230729b3707c698b347c9a5908831
7acce1b0ab0077601309cc8c7001a6fdcf7dafa7 26-Oct-2016 Elliott Hughes <enh@google.com> Make "adb bugreport"'s .zip check case-insensitive.

Bug: TODO
Test: manual
Change-Id: I0ece7d8dcb708e3755477f7df5ff03807fd227f2
ugreport.cpp
7288478443b552a948fc06c1b194a994e883de9c 25-Oct-2016 Elliott Hughes <enh@google.com> Improve "adb install" diagnostics.

Bug: http://b/32094640
Test: manual testing
Change-Id: I661936eabd3bdd8aa7ee8cc0e398a7cc7d4ddbbb
ommandline.cpp
e060cdadc8a6d8507aa3a0574be58d9bf005c40a 25-Oct-2016 Elliott Hughes <enh@google.com> Merge "Allow multiple tcp adb connection to same device."
am: 4818194a25

Change-Id: Id2b6bc99479e94cd94154ca194985f65df7e2afa
4818194a25771ae386bd7ffc66215739227fb844 25-Oct-2016 Elliott Hughes <enh@google.com> Merge "Allow multiple tcp adb connection to same device."
8baf1198eeacf0ba689bc93f4d2b36dd686486f4 24-Oct-2016 Josh Gao <jmgao@google.com> adb: fix test_sighup.
am: 470622f064

Change-Id: I342cbd04804e3d8d92d04ab088c6980d67bbc8e8
a06580956e538e7035797e5a50e649c416039c0e 24-Oct-2016 Josh Gao <jmgao@google.com> adb: fix race condition in test_non_interactive_sigint.
am: e76b9f3dde

Change-Id: Ib2b6c1118cb48c337c12efbd223c87fee76837f2
63660add3fb8d3c2cee143fb0c27ef01f487b41f 24-Oct-2016 Josh Gao <jmgao@google.com> Merge changes I34ba5757,Ie65a762a

* changes:
adb: fix test_sighup.
adb: fix race condition in test_non_interactive_sigint.
470622f064a777e86f14079ff2864d3166980c16 21-Oct-2016 Josh Gao <jmgao@google.com> adb: fix test_sighup.

Bug: http://b/32336914
Test: python test_device.py
Change-Id: I34ba5757b5e650d79327dc6779064acd850ce28e
est_device.py
e76b9f3dde800b44c4151ebee9ff469b6714d8aa 21-Oct-2016 Josh Gao <jmgao@google.com> adb: fix race condition in test_non_interactive_sigint.

Fix race condition in the test_non_interactive_sigint test by
looping for a while.

Bug: http://b/32336914
Test: python test_device.py
Change-Id: Ie65a762ad6f04815231add5444762c4c0ffd31cb
est_device.py
043912ec1176cb5814174361b4156a8b4393a379 22-Oct-2016 Tao Wu <lepton@google.com> Allow multiple tcp adb connection to same device.

This worked before Kitkat, and then we lost this feature in Kitkat.
Now I make the register logic in server_socket_thread as same as qemu_socket_thread.

Test: manual - build emulator image and connect from different adb client.
Bug: 32341562
Change-Id: I7b4831d280048d2a3796be3522bd3b8fbc1ade6b
Signed-off-by: Tao Wu <lepton@google.com>
ransport_local.cpp
f58d06a918755e1562ba7bffe4b632d6272cbe9e 22-Oct-2016 Elliott Hughes <enh@google.com> Merge "Move "adb shell" over to getopt(3), and allow -tt on old devices."
am: 620469a4ac

Change-Id: I4849d18fcd2afe0c1e5d3b2bdf3a3a755e557e91
cabfa1177f11772e29229135d08b1034518cad93 19-Oct-2016 Elliott Hughes <enh@google.com> Move "adb shell" over to getopt(3), and allow -tt on old devices.

From the bug:

Say we run a new adb against an old device (like KitKat). Even with a new
client ADB, in this configuration, "adb shell" will create a remove tty
unconditionally. So if the user runs "adb shell -t -t", we shouldn't fail
with a message about the remote device not supporting -tT options --- the
user asked to create a tty unconditionally, and since we're going to create
a tty unconditionally, we should just succeed. (That it's going to succeed
due to protocol inadequacy instead of succeeding on purpose is irrelevant.)

That adb fails in this case makes scripts more complicated, since they can't
just pass "-t -t" unconditionally if they want a tty and to work on all
device versions, even if the script requires a new-ish adb locally.

Bug: http://b/32216152
Bug: http://b/32219151
Test: test_device.py
Change-Id: I8ab7c8dfa212209a7ab43c1f0832eeac26d2e42f
ommandline.cpp
est_device.py
e02e11835db075fb761171c35aa4889ddf30f0a0 20-Oct-2016 Ting-Yuan Huang <laszio@google.com> Merge "adb: fix undefined behavior"
am: 1edd61ce5d

Change-Id: I35cbda2fa031dc8627aaaffb5e50be98ddb20430
ef57d54f80774701eee8bdb45185fb33e5ced473 20-Oct-2016 Ting-Yuan Huang <laszio@google.com> adb: fix undefined behavior

system/core/adb/shell_service_protocol_test.cpp:94:14: warning: Null
passed to a callee that requires a non-null 1st parameter
!memcmp(data, protocol->data(), data_length));

C99 requires memcmp() to take non-null pointers.

Bug: none
Test: clang-tidy doesn't complain
Change-Id: I77b8d9373fa257a070ffc7fd318231c2c9ea84c3
hell_service_protocol_test.cpp
8648bddf248c98b916480e776dedbd5d1f4c5f79 18-Oct-2016 Mark Salyzyn <salyzyn@google.com> adb: use __android_log_is_debuggable()
am: 97787a00e6

Change-Id: I326735c9b0e6163ab5b2215a6bed44ea710409d2
97787a00e6aeb9aba2d744566cfd9de3d2f8c4f6 29-Mar-2016 Mark Salyzyn <salyzyn@google.com> adb: use __android_log_is_debuggable()

Test: compile and months of adb functionality use
Bug: 27566046
Bug: 31456426
Change-Id: I6568eea0eda8dc67dec2ba34cd4c3f56fb0ff0e9
aemon/main.cpp
ervices.cpp
et_verity_enable_state_service.cpp
ockets.cpp
19340be9fee5681564776da722bb6a81987e306e 14-Oct-2016 Elliott Hughes <enh@google.com> Merge "Rely on the platform -std default." am: 955648a915 am: 4594f50635
am: f1dffe0501

Change-Id: Ibbffb45d50ad038d55a4d435a250b59b64547227
f1dffe0501d65f9e1e07b1c080fe73fe6bd977a7 14-Oct-2016 Elliott Hughes <enh@google.com> Merge "Rely on the platform -std default." am: 955648a915
am: 4594f50635

Change-Id: I459e76bcada6d849eccca73a470a910e335482bf
4594f50635d7b8ff5c6f0c23cab885ca903b8cbc 14-Oct-2016 Elliott Hughes <enh@google.com> Merge "Rely on the platform -std default."
am: 955648a915

Change-Id: Ic4e9a7fbc7d13cc18ebb84801bf2f2f9a1d04470
955648a915920733307da633b94b7fd44860b4d0 14-Oct-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Rely on the platform -std default."
4b9774fe9724c5c86b6951e465bc259b52cc213e 14-Oct-2016 Tao Wu <lepton@google.com> Merge "Fallback to IPv6 when IPv4 is not available in adb" am: c32d7fd66f am: 5b7c6772b0
am: 27c6c4cf04

Change-Id: I2ceb40b4589dfc2721197065ae5a85e9dc83b907
a4398c1abeafa173a20c08ce28aba289fd35f9c3 14-Oct-2016 Elliott Hughes <enh@google.com> Merge "Move off std::sto* function which abort on failure."
27c6c4cf045a6e8c0571979c22d653363fa8eec4 14-Oct-2016 Tao Wu <lepton@google.com> Merge "Fallback to IPv6 when IPv4 is not available in adb" am: c32d7fd66f
am: 5b7c6772b0

Change-Id: I63e945622d47ab1cbcbdd82d00cfdf3d51c95564
5b7c6772b091ad9b389b22684b8398a077a139bb 14-Oct-2016 Tao Wu <lepton@google.com> Merge "Fallback to IPv6 when IPv4 is not available in adb"
am: c32d7fd66f

Change-Id: I21efa80874bfffb88cc63098e0a402a3e8d1c122
da46b392f10d2809b5696632f67485f272ec5698 12-Oct-2016 Elliott Hughes <enh@google.com> Move off std::sto* function which abort on failure.

Bug: http://b/31403370
Test: builds, boots, libbase tests pass
Change-Id: I89cd7ca3d8f1c8a1bad0ddf3043439449d19a293
ugreport.cpp
7b700763f5f5d749e46d0dbd2b5b0b2dd74efd6c 20-Sep-2016 Tao Wu <lepton@google.com> Fallback to IPv6 when IPv4 is not available in adb

Test: manual - make sure it works in both IPv4/IPv6 env.
BUG: 31537253
Change-Id: Ica492bff34a8c0441516a213d0e8b78fcdfd3282
Signed-off-by: Tao Wu <lepton@google.com>
ysdeps.h
fc485e44887cbc454abc3babc6c342619d30f9f1 13-Oct-2016 Elliott Hughes <enh@google.com> Merge "Start retiring socket_loopback_client." am: 58f7f61266 am: cd0e8cfd33
am: aa509a3e9d

Change-Id: Iea3a25f193b9249ba93d49514b2a409d693121e1
aa509a3e9db597d0dd1e9f0568ec1f7671eaad05 13-Oct-2016 Elliott Hughes <enh@google.com> Merge "Start retiring socket_loopback_client." am: 58f7f61266
am: cd0e8cfd33

Change-Id: Ibd76fcb2aa9abb35a11f3b1e3f771a168f6d96de
cd0e8cfd33c88a2f88a264d99befdf074d2767d7 13-Oct-2016 Elliott Hughes <enh@google.com> Merge "Start retiring socket_loopback_client."
am: 58f7f61266

Change-Id: I2b3d6ae5e90fb99163eb639e185b93cd55ff724a
58f7f61266259c7a9ef23b111b5414949da5163a 13-Oct-2016 Elliott Hughes <enh@google.com> Merge "Start retiring socket_loopback_client."
7bdbbfb0efc1bd9b94ff838c36dfc0f88be59862 12-Oct-2016 Lingfeng Yang <lfy@google.com> Merge "Fix adb flakiness on reboot" am: f7a1c476ff am: d0dead710b
am: e93241e377

Change-Id: Icd024ed6896a1989f67beb512a399cd0979b2cf1
e93241e3772764858751e5185293ef9346b75bd3 12-Oct-2016 Lingfeng Yang <lfy@google.com> Merge "Fix adb flakiness on reboot" am: f7a1c476ff
am: d0dead710b

Change-Id: I7b966be541d89b2f13a9c39218627884e001cc21
d0dead710b1042b002ca47bdb9fe1da5d27b6e5d 12-Oct-2016 Lingfeng Yang <lfy@google.com> Merge "Fix adb flakiness on reboot"
am: f7a1c476ff

Change-Id: If74046384b04c8bae587c3194c85e1a1865e3cbb
1197952e71cffe5fab91625e49670083ead78712 06-Oct-2016 Lingfeng Yang <lfy@google.com> Fix adb flakiness on reboot

bug: 31950237

There are two lists of active ADB transports (devices),
and with the emulator, they can go out of sync.

This CL more conservatively checks if there are no
transports in either list before commiting to
register a new transport for the emulator.

(cherry picked from commit edaedfd5da41b2f5aa14b4d52742a6d8caa49214)

Change-Id: Id1201dc59c70825881dad80925c2e5bcc13dbd5e
db.h
ransport_local.cpp
139b372fab23b161366fe0e8df49bd19cca641d3 11-Oct-2016 Elliott Hughes <enh@google.com> Start retiring socket_loopback_client.

Bug: http://b/31537253
Test: can still talk to adb
Change-Id: Icfd7f00d35cf963befc139e81904790b4b8b67c0
ysdeps.h
f369babcb8b0928ab9c63e76db10b70750059717 11-Oct-2016 Josh Gao <jmgao@google.com> Merge "Remove useless arguments from is_adb_interface." am: bd6c6eb0e4 am: db50d1d6ef
am: 0a629b4bdd

Change-Id: I54e47bf9d8e056255335e809b9733e2597b3e532
0a629b4bddadb9d25bcec5e61e0d1994ee648f81 11-Oct-2016 Josh Gao <jmgao@google.com> Merge "Remove useless arguments from is_adb_interface." am: bd6c6eb0e4
am: db50d1d6ef

Change-Id: I4a21f8296643bbe185ac79df8888eec07c88ca78
db50d1d6efebbb9a8dda27647cd8574ae24a5bfd 11-Oct-2016 Josh Gao <jmgao@google.com> Merge "Remove useless arguments from is_adb_interface."
am: bd6c6eb0e4

Change-Id: I1390870da63506df411dbd94f2b19d147d90009c
144abd8cb20d87faf6bea3160a687e201166614b 11-Oct-2016 Mark Salyzyn <salyzyn@google.com> Merge "liblog: adb: move security interfaces to private" am: 09dac589f1 am: 586c6985cf
am: 4b5456eacc

Change-Id: Id78628d7e7abfa16f1ada16f894f9616a2dc469b
4b5456eacc2164948c2e1b440f9bb7ca42249534 11-Oct-2016 Mark Salyzyn <salyzyn@google.com> Merge "liblog: adb: move security interfaces to private" am: 09dac589f1
am: 586c6985cf

Change-Id: I8c54bdc1a3582be1fc7c4a9be83b555624fcb0a3
bd6c6eb0e46794873a77a5bdf07e2abd3f6b1664 11-Oct-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Remove useless arguments from is_adb_interface."
586c6985cfc58559763f58e32e8273fdd09e9c37 11-Oct-2016 Mark Salyzyn <salyzyn@google.com> Merge "liblog: adb: move security interfaces to private"
am: 09dac589f1

Change-Id: I05ad9cee5ffe00e842120aa960d6652517b94a16
36e0d390a2de7d13cdf667d9a7d125f0d66b3107 10-Oct-2016 Elliott Hughes <enh@google.com> Rely on the platform -std default.

Bug: http://b/32019064
Test: builds
Change-Id: I18a1d816d63b64601485045070851f32d44e85eb
ndroid.mk
30186df0f05ca2df10af7a64604eb93a1e1a27dc 27-Sep-2016 Josh Gao <jmgao@google.com> Remove useless arguments from is_adb_interface.

Test: mma
Change-Id: I8b7b411d7d5ec9d401b61ed8f817b98c61114d4f
db.h
ransport_usb.cpp
sb_linux.cpp
sb_osx.cpp
sb_windows.cpp
6debf985aa5127b43f1f79a010dc000f733793b8 05-Oct-2016 Mark Salyzyn <salyzyn@google.com> liblog: adb: move security interfaces to private

Test: Compile & adb functioning
Bug: 19235719
Bug: 26552300
Bug: 31289077
Bug: 31456426
Change-Id: I7ad8963bcca3d8b5c37b547c11d163b652d35556
ile_sync_service.cpp
hell_service.cpp
f883e2f65ceffaf1ea986c3005e19b589b104bea 07-Oct-2016 Josh Gao <jmgao@google.com> Merge "adb: rationalize types." am: 8caf4e7443 am: e335bea277
am: 010818f313

Change-Id: I1edebee150c7b36cfa3ca58626eaebf5e9ce647f
010818f31315670d8d0978adfc83553f646ae3ca 07-Oct-2016 Josh Gao <jmgao@google.com> Merge "adb: rationalize types." am: 8caf4e7443
am: e335bea277

Change-Id: I045ccbebbc1005a501768da3222a211e49821895
e335bea277e488b05b3db4e5ece2721787f53a78 07-Oct-2016 Josh Gao <jmgao@google.com> Merge "adb: rationalize types."
am: 8caf4e7443

Change-Id: I2e363c31a22b57964688f170c6f96cd8764959e0
06d61d4d96d28777f76578fb5d3c823168853166 06-Oct-2016 Josh Gao <jmgao@google.com> adb: rationalize types.

Use fixed length types for structs going over the wire, constify
arguments where possible, use char* instead of unsigned char* for
apacket data, and assorted other refactoring.

Bug: http://b/29273531
Test: python test_device.py with every combination of old/new adb and adbd
Change-Id: I0b6f818a32be5386985aa4519f542003cf427f9d
db.cpp
db.h
db_auth.h
db_auth_host.cpp
dbd_auth.cpp
ockets.cpp
ransport.cpp
ransport.h
e1afd17d7501ee583a270e58cd952f0f323c9395 06-Oct-2016 Josh Gao <jmgao@google.com> Merge "adb: split up adb_auth.cpp." am: 4a8b178c97 am: 4546c8ac3d
am: 58a5e5a50b

Change-Id: Ibb499732491fc584be2b1e61f95bb9375fad16ec
58a5e5a50bb9a8527cc06d54aae8f78fb4f34254 06-Oct-2016 Josh Gao <jmgao@google.com> Merge "adb: split up adb_auth.cpp." am: 4a8b178c97
am: 4546c8ac3d

Change-Id: Idb9ed3e21524893943ecd176d9abe6a1e3b5493b
4546c8ac3d8df5618c9f75e468ded69f4d89d1bb 06-Oct-2016 Josh Gao <jmgao@google.com> Merge "adb: split up adb_auth.cpp."
am: 4a8b178c97

Change-Id: I846a06ca04aad456c6659dd6db4c8d0666fc6707
4a8b178c97ccc388a9c94663dfd7e1c614ffba64 06-Oct-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: split up adb_auth.cpp."
3bd2879d8e9bb0c0a1b8045e09f9cf87c2daeef3 06-Oct-2016 Josh Gao <jmgao@google.com> adb: split up adb_auth.cpp.

All of the functions in adb_auth.cpp were used in only one of
adb/adbd. Split up them up into adb_auth_host.cpp and adbd_auth.cpp
respectively.

Bug: http://b/29273531
Test: built and flashed bullhead, adb still works
Change-Id: Ib610c5157522634cc273511175152f1306cc52a7
ndroid.mk
db.cpp
db_auth.cpp
db_auth.h
db_auth_client.cpp
db_auth_host.cpp
dbd_auth.cpp
ransport.cpp
ransport.h
4fa6e4855b3190a803b2ca937e499fabaca7897c 06-Oct-2016 Tao Bao <tbao@google.com> Merge "adb: Remove the obsolete include path to ext4_utils." am: 9f828a5383 am: a00020317e
am: 9766909149

Change-Id: I1059d176220327d6f1ecb5c56dde2bebf31c371f
9766909149e73f5d09a86045fa6a6f1b311d28ef 06-Oct-2016 Tao Bao <tbao@google.com> Merge "adb: Remove the obsolete include path to ext4_utils." am: 9f828a5383
am: a00020317e

Change-Id: I474494405de42c794af3160898a867e766c558b1
a00020317ed1c339d8b5f1ca98105b64743bc0bc 06-Oct-2016 Tao Bao <tbao@google.com> Merge "adb: Remove the obsolete include path to ext4_utils."
am: 9f828a5383

Change-Id: Ia833226376111a0ead4f0c5b5d79768a8b8dbeb2
fee161d189ead3887a636383700726f8257048e0 06-Oct-2016 Tao Bao <tbao@google.com> adb: Remove the obsolete include path to ext4_utils.

Since commit 8ad80763e4b3bdcd80d16c63f03b19eb9df989b2 has removed
'#include "ext4_sb.h"', there's no more reference to ext4_utils headers.

Test: `mmma system/core/adb`

Change-Id: I7ca1a6e91f1e0de84238c2a7facbebe9600a3d87
ndroid.mk
9f6b98dec0eccda745b664ca493c3ab4c6b60f7a 01-Oct-2016 Mark Salyzyn <salyzyn@google.com> system/core Replace log/log.h with android/log.h am: ff2dcd9af9 am: cac331afd9
am: 0308b0eabd

Change-Id: I4d631d53b4fc27e1a02d412bae21fffad6635258
0308b0eabd1b484819c507f99e919e4a49f7fbc3 01-Oct-2016 Mark Salyzyn <salyzyn@google.com> system/core Replace log/log.h with android/log.h am: ff2dcd9af9
am: cac331afd9

Change-Id: I95c6a64bc35a041688303fcee4d506865d0a19a4
cac331afd9bbea1730d001b3c246262f76e2ba78 01-Oct-2016 Mark Salyzyn <salyzyn@google.com> system/core Replace log/log.h with android/log.h
am: ff2dcd9af9

Change-Id: I3c47cb42639d56740ecf7e4fe61ea49982d69fed
ff2dcd9af994a23ed483939a416b48bdc10eefd5 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> system/core Replace log/log.h with android/log.h

Should use android/log.h instead of log/log.h as a good example
to all others. Adjust header order to comply with Android Coding
standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I33a8fb4e754d2dc4754d335660c450e0a67190fc
ile_sync_service.cpp
hell_service.cpp
a6d5587f7899b0be24eb37faec27611efa000573 30-Sep-2016 Elliott Hughes <enh@google.com> resolve merge conflicts of b40756a to nyc-dev-plus-aosp
am: fe807214ef

Change-Id: Ibcfd7f5c9c67084c754b2b60ff1e9eed976e3249
fe807214ef228c56261d49f3ec4af145c809d524 30-Sep-2016 Elliott Hughes <enh@google.com> resolve merge conflicts of b40756a to nyc-dev-plus-aosp

Change-Id: Ic1aa6fd6ab66ca8fb7cf434a3d0679a41288e4a7
b40756ac2872351a4232615c680db94636fd7962 30-Sep-2016 Elliott Hughes <enh@google.com> resolve merge conflicts of 50cb973 to stage-aosp-master

Change-Id: Idf0d02687cc47f64acfdd3da623c7a7a62043651
4bf9bc1ac70fb0856d6ec5ae1b8dc02402e6d7c5 29-Sep-2016 Elliott Hughes <enh@google.com> Improve "adb help" output.

The specific request was to document $ADB_VENDOR_KEYS, but since I'm here,
let's try to make the help output shorter but more useful...

Bug: http://b/18437888
Test: adb help
Change-Id: I77135d4e666f19524f880228d27d87ba881672b5
ommandline.cpp
5cab7cc6376ea13f7857a7f317698ffd7e302c0f 28-Sep-2016 David Pursell <dpursell@google.com> Merge "adb: fix host-side serial number parsing for IPv6." am: b1c4d90215 am: 94c652ed31
am: dde69001c2

Change-Id: I869720698bb91b0e968c51740b916ab58ea89d5a
dde69001c29b4c2743f88468b0a010d635e350a4 28-Sep-2016 David Pursell <dpursell@google.com> Merge "adb: fix host-side serial number parsing for IPv6." am: b1c4d90215
am: 94c652ed31

Change-Id: I87e3bbc33077830ca95e06807cb9863f42b87bf4
94c652ed31433891f25b63cb9ce43768f48e9fdc 28-Sep-2016 David Pursell <dpursell@google.com> Merge "adb: fix host-side serial number parsing for IPv6."
am: b1c4d90215

Change-Id: I62454f520192df9b600280b59704e7c0fe55687f
b1c4d90215087b292279c06216acd0264399cdf2 28-Sep-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: fix host-side serial number parsing for IPv6."
a539d4c04cdc937b2623460fae85604572a26d76 27-Sep-2016 Josh Gao <jmgao@google.com> Merge "adb: fix IOKit handle leaks on OS X." am: a2aff3f809 am: 279a1ea5b0
am: dbb34a87b4

Change-Id: I18ab725e1895f58519cab7f2bd29065058d70700
dbb34a87b4cefb9d4d6d2b0371203d73a975318c 27-Sep-2016 Josh Gao <jmgao@google.com> Merge "adb: fix IOKit handle leaks on OS X." am: a2aff3f809
am: 279a1ea5b0

Change-Id: Ia45f5ae1943a0d5292da230e902751e127702be4
279a1ea5b0751e2e3d8ada7b85d972e8fe8136ff 27-Sep-2016 Josh Gao <jmgao@google.com> Merge "adb: fix IOKit handle leaks on OS X."
am: a2aff3f809

Change-Id: I24587b122c3d4d57eef137456c3628e4010d7b5c
a2aff3f809055fb41578f7c5e6e18530dc40ec65 27-Sep-2016 Josh Gao <jmgao@google.com> Merge "adb: fix IOKit handle leaks on OS X."
b6a2f595151dc6de850f7bc0e2aa5aec3db80213 27-Sep-2016 Josh Gao <jmgao@google.com> adb: fix IOKit handle leaks on OS X.

Bug: https://code.google.com/p/android/issues/detail?id=219085
Test: Removed sleep in RunLoopThread, compared before/after this patch
Change-Id: Ia65bbedfb7d47bdb02bdfb69778784e5e855900b
sb_osx.cpp
9daaf229d0370230b250432cf59abdbd9627b27f 27-Sep-2016 Elliott Hughes <enh@google.com> Merge "Switch adb to <android-base/properties.h>." am: d9a23b5733 am: 5dc7e6a79a
am: 8b7751d360

Change-Id: Ie02bbd139d522d930649ecb06da3f853d6995034
8b7751d3603ed0e1cc38b069538494031c7c4907 27-Sep-2016 Elliott Hughes <enh@google.com> Merge "Switch adb to <android-base/properties.h>." am: d9a23b5733
am: 5dc7e6a79a

Change-Id: Ie2718d9f843b11feca003805569bb35acde62463
5dc7e6a79af1f79f65edb0659454a84c3171d186 27-Sep-2016 Elliott Hughes <enh@google.com> Merge "Switch adb to <android-base/properties.h>."
am: d9a23b5733

Change-Id: I09a1832143d9f54cd67128602c9e518a1b398b5c
ffdec180176094dac0fb902263370dea1deb138f 24-Sep-2016 Elliott Hughes <enh@google.com> Switch adb to <android-base/properties.h>.

Bug: http://b/23102347
Test: manual
Change-Id: Iffa66258c01f84f41b9af99ab5e768a0a2669106
db.cpp
db_trace.cpp
aemon/main.cpp
emount_service.cpp
ervices.cpp
et_verity_enable_state_service.cpp
ockets.cpp
ransport_local.cpp
sb_linux_client.cpp
0e0cf74c52af25fb220bac24c1b6b31721c27948 23-Sep-2016 Tao Wu <lepton@google.com> Merge "Ignore setsid error in some cases." am: 3562fd0fa8 am: 324acdce69
am: f7756b89e9

Change-Id: I7bc3c1f46fec39fb8fd2fe597633b067ad0a8bda
6d317aca93b9bbbf07f85eaf36672cb26a0ad118 23-Sep-2016 Josh Gao <jmgao@google.com> Merge "adb: kill adb_mutex_t, adb_cond_t." am: 7e4d1db957 am: 72c679d6d0
am: 71970fc473

Change-Id: I77f0221da27abb337ce7d8896cd6ad94c04548cf
f7756b89e97c0616242b3fac57e0cd9ae089db9c 22-Sep-2016 Tao Wu <lepton@google.com> Merge "Ignore setsid error in some cases." am: 3562fd0fa8
am: 324acdce69

Change-Id: I330be058b8c0d7b175845b30d59f091432d62f6c
71970fc473907a4976574e0425b8ef9cd51aec14 22-Sep-2016 Josh Gao <jmgao@google.com> Merge "adb: kill adb_mutex_t, adb_cond_t." am: 7e4d1db957
am: 72c679d6d0

Change-Id: I3b726d03c8dc299191a68488e28fe83c3bd89a77
324acdce6933a90e0d6821fb367627bba8073e37 22-Sep-2016 Tao Wu <lepton@google.com> Merge "Ignore setsid error in some cases."
am: 3562fd0fa8

Change-Id: I8ff768ce0e4ddd5e2810e40302bf597e2f39387b
72c679d6d0debc946d2b16d1a35bf3145fc5f2e2 22-Sep-2016 Josh Gao <jmgao@google.com> Merge "adb: kill adb_mutex_t, adb_cond_t."
am: 7e4d1db957

Change-Id: I3e10b6e3039e3aeb966f8ca27df69b61fa8aa0cc
3562fd0fa85ca59e5650f1fa21ae1f1e0cd9cf46 22-Sep-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Ignore setsid error in some cases."
7e4d1db9579bd914a75a90e032ae096061a692d0 22-Sep-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: kill adb_mutex_t, adb_cond_t."
0cd3ae1c281fa890389987cd05b2bf01cdf1e4c5 21-Sep-2016 Josh Gao <jmgao@google.com> adb: kill adb_mutex_t, adb_cond_t.

Now that we have support for std::mutex and std::condition_variable on
Windows, remove our mutex compatibility layer in favor of the C++ one.

Bug: http://b/31653591
Test: mma && $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test && \
python test_adb.py && python test_device.py
(also on Windows)

Change-Id: I5b7ed9c45cc2a32edcf4e77b56dc28e441f15f34
db_utils.cpp
lient/main.cpp
utex_list.h
ysdeps.h
ysdeps_test.cpp
ysdeps_win32.cpp
ransport.cpp
ransport_local.cpp
ransport_test.cpp
sb_linux_client.cpp
sb_windows.cpp
88e36027ed75e4992e3584b9bdb6c5ceff09cc25 21-Sep-2016 Josh Gao <jmgao@google.com> Merge "adb: parse tcp socket specs with base::ParseNetAddress." am: efee71c2de am: 67ed583564
am: 837f2cef9a

Change-Id: I4d7da8197397c2ab84f46733eeb3cd0eba82a01f
837f2cef9a4d8081b9553ac5dc0662758057a7ba 21-Sep-2016 Josh Gao <jmgao@google.com> Merge "adb: parse tcp socket specs with base::ParseNetAddress." am: efee71c2de
am: 67ed583564

Change-Id: Ia820151b0c5fae600adb204421759b9cc5c92ad7
67ed58356496e7d00e6d998a5323a1bb5eab7fb2 21-Sep-2016 Josh Gao <jmgao@google.com> Merge "adb: parse tcp socket specs with base::ParseNetAddress."
am: efee71c2de

Change-Id: I911b1bed18e1d1d55c585d78479a85d4d8ba2875
efee71c2defdea4f105d2ff71950f935d6ff2a27 21-Sep-2016 Josh Gao <jmgao@google.com> Merge "adb: parse tcp socket specs with base::ParseNetAddress."
73d55aaab23256f85941730444e82cbc41a63f8b 21-Sep-2016 David Pursell <dpursell@google.com> adb: fix host-side serial number parsing for IPv6.

When the adb client sends a command to the adb server targeting a
particular device serial, it looks something like this:
host-serial:<serial>:<command>

But if <serial> happens to be an IPv6 address (e.g. when `adb connect`
targets IPv6), the current parsing code doesn't handle the additional
colons properly. This CL fixes the host-serial parsing to handle this
case.

This only affects commands that explicitly name a device serial, e.g.:
adb -s <IPv6> shell
adb -s <IPv6> forward <port> <port>
Implicitly using a single attached device was unaffected by this bug.

Bug: http://b/30891386
Test: `adb -s [fe80::ba27:ebff:feb1:934%eth2]:5555 shell` works now,
and new unittests pass.
Change-Id: Iffe784e61432ae94eb96ed3c8477900a3e807329
ocket_test.cpp
ockets.cpp
c8fab89f1b5ae8c3752979e1a1004eda8b185687 21-Sep-2016 Tao Wu <lepton@google.com> Ignore setsid error in some cases.

If the calling process has already been a leading process of session.
setsid just fail with EPERM, ignore such error.

Test: killall adb;exec 3>f;adb fork-server server --reply-fd 3 & cat f
Change-Id: I1aeac079f29e10aa63ed724b5a43663f25c25ad5
Signed-off-by: Tao Wu <lepton@google.com>
lient/main.cpp
11a172e5b73c9d3fbff61b708ceef4486020f0f1 21-Sep-2016 Josh Gao <jmgao@google.com> Merge "base: rename unique_fd::clear() to unique_fd::reset()." am: 14d3a1ac9d am: 8c9ecb9c2c
am: bac29cb665

Change-Id: I078430bfdd43d3fa14a220debc7623f4931158e8
bac29cb665cc50465ccaab33db85f19f5406969c 21-Sep-2016 Josh Gao <jmgao@google.com> Merge "base: rename unique_fd::clear() to unique_fd::reset()." am: 14d3a1ac9d
am: 8c9ecb9c2c

Change-Id: I9e4a3f5b303464fe7c3c162446c72157015ffec2
8c9ecb9c2c19cfb0d8138982ce81ce18f105ccd5 21-Sep-2016 Josh Gao <jmgao@google.com> Merge "base: rename unique_fd::clear() to unique_fd::reset()."
am: 14d3a1ac9d

Change-Id: Ic00aaca61c8e9eb68c30de00b825fc73d8b3cace
14d3a1ac9de9230bde676ed7067e35e45d0aaa9b 21-Sep-2016 Josh Gao <jmgao@google.com> Merge "base: rename unique_fd::clear() to unique_fd::reset()."
1099215e30c3b09dfa390c638a45487c43b2b1e1 20-Sep-2016 Josh Gao <jmgao@google.com> adb: parse tcp socket specs with base::ParseNetAddress.

libbase already has IPv6-aware address parsing, so use it instead of
adb's handrolled IPv4-only parsing.

Bug: http://b/31537253
Change-Id: I4e9ce56b55d7d02787c0fa67b724490bf49ce479
Test: mma && adb start-server && \
adb -L 'tcp:[::ffff:127.0.0.1]:5037' devices && \
adb -L 'tcp:localhost:5037' devices && \
adb -L 'tcp:127.0.0.1:5037' devices && \
adb -L 'tcp:5037' devices && \
$ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
ndroid.mk
ocket_spec.cpp
ocket_spec.h
ocket_spec_test.cpp
502231b6bef1dbaa6e7cf1dc33a578be580f2d16 20-Sep-2016 Tao Wu <lepton@google.com> Merge "Fix bug: Doesn't respect ANDROID_ADB_SERVER_PORT" am: 4159568548 am: bcc419edad
am: 18b1a9901e

Change-Id: If85d3cf002bde9ee29b9aa4062e360646a1ebff0
18b1a9901e9e1551207c2e1216a2d39a7cf7945d 19-Sep-2016 Tao Wu <lepton@google.com> Merge "Fix bug: Doesn't respect ANDROID_ADB_SERVER_PORT" am: 4159568548
am: bcc419edad

Change-Id: Ib9ea8fb0b2a571417a1bfd0c1e5a6fd75eb08ef4
bcc419edadad93ab0ba4ce864d184bf46edeaa1e 19-Sep-2016 Tao Wu <lepton@google.com> Merge "Fix bug: Doesn't respect ANDROID_ADB_SERVER_PORT"
am: 4159568548

Change-Id: I8f2b4b1a5914642790e18e58d376ffcd37311d1f
41595685482aec3ec4413c4e0bedf03c34a35a94 19-Sep-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Fix bug: Doesn't respect ANDROID_ADB_SERVER_PORT"
5d1b1a8b91a35f465e5af146bcfd5d7b4346854c 14-Sep-2016 Josh Gao <jmgao@google.com> base: rename unique_fd::clear() to unique_fd::reset().

unique_fd is modeled on unique_ptr, so make this consistent.

Test: m checkbuild
Change-Id: Ia6a77095dc18746fbb432e96bb8dccfc049c57f6
hell_service.cpp
135f4ab3dd6c14f10a7bd1b1a4f9bfcf2135acb8 16-Sep-2016 Tao Wu <lepton@google.com> Fix bug: Doesn't respect ANDROID_ADB_SERVER_PORT

BUG: 31549442
Test: export ANDROID_ADB_SERVER_PORT=12345;killall adb;adb devices

Change-Id: If2bfaf44c6567af16cae0d4def2f11be39c2d437
Signed-off-by: Tao Wu <lepton@google.com>
ommandline.cpp
48b0a6b4714e01c180d1c04f91407a23e8f34b94 17-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Merge "Use <condition_variable> and <mutex.h> from MinGW" am: a3d7b240f1 am: 331ec060ca
am: 11836956bc

Change-Id: I9317665b9cf3f415b3c3e64e95a5ee4f2e3c2798
11836956bcf3e72191c0e15a6bb31a72a3b06a5a 17-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Merge "Use <condition_variable> and <mutex.h> from MinGW" am: a3d7b240f1
am: 331ec060ca

Change-Id: I8205259a82445aa6ff50509c58c58bb1429f3c49
331ec060cac3c50d712cebf8cb46940e6a423259 17-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Merge "Use <condition_variable> and <mutex.h> from MinGW"
am: a3d7b240f1

Change-Id: I319a164694fe67a008915249811dc39567184d08
a3d7b240f19863ee71dafe9494fddfc6629117d2 16-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Merge "Use <condition_variable> and <mutex.h> from MinGW"
264b3465dd9e48d133343599355b549e56abcc36 15-Sep-2016 Josh Gao <jmgao@google.com> adb: let `adb push` follow symlinks. am: 94dc19ff57 am: 30ecda227c
am: 3e64efbced

Change-Id: Ifbedcf881b2724f6203059037b37032b7a2d3ddd
3e64efbced289853e2b55b63d0dd144bcb09c828 15-Sep-2016 Josh Gao <jmgao@google.com> adb: let `adb push` follow symlinks. am: 94dc19ff57
am: 30ecda227c

Change-Id: I10dfdd0265403628c2ef163771cdb576c90419c6
30ecda227c30aac0940823dc77c764276d1b4c4e 15-Sep-2016 Josh Gao <jmgao@google.com> adb: let `adb push` follow symlinks.
am: 94dc19ff57

Change-Id: I408ebb7b3091e67bd7025b3a6404f57c7f3af377
94dc19ff57a2c5a09d74362d0c1a1231cc027d7f 15-Sep-2016 Josh Gao <jmgao@google.com> adb: let `adb push` follow symlinks.

Bug: http://b/31491920
Test: touch foo; ln -s foo bar; adb push bar /data/local/tmp
Test: python test_device.py
Change-Id: I0a00b3d49fdf7206e27d66ac110b56e22449a1ad
ile_sync_client.cpp
est_device.py
7eaef8a494b1e8c6f015d8ca239865c6032facf3 06-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Use <condition_variable> and <mutex.h> from MinGW

New MinGW prebuilts update includes pthreads and C++11 threads support.
Use mutex.h and condition_variable provided by MinGW.

Test: Build AOSP with new MinGW prebuilts
Change-Id: Ia8f890f86652612df3fc2618c2bfbb450a5a2f52
db_auth_host.cpp
ockets.cpp
ysdeps/condition_variable.h
ysdeps/mutex.h
ysdeps_test.cpp
ransport_local.cpp
cdf8fba6a10243edd543b3884799265474b6897c 06-Sep-2016 Eyal Lezmy <eyal.lezmy@gmail.com> Merge "Precise command constants on adb/protoxol.txt" am: 85a78f19b1 am: f8188895a1
am: 7bcc5bd0d0

Change-Id: Ic9d0fd2fc6336ac0c2883e32983c855e10dc4a95
7bcc5bd0d09f3fea59e2d0205724c8f4fd9a8b9b 06-Sep-2016 Eyal Lezmy <eyal.lezmy@gmail.com> Merge "Precise command constants on adb/protoxol.txt" am: 85a78f19b1
am: f8188895a1

Change-Id: Iaf6f8f2b7a13f733d8a9612ada75876031938a9d
f8188895a14834a4d5ef571d14542e39cf66bf40 06-Sep-2016 Eyal Lezmy <eyal.lezmy@gmail.com> Merge "Precise command constants on adb/protoxol.txt"
am: 85a78f19b1

Change-Id: Ied63c7e5fe798a646d5428aba4fdfa94cf1c53f1
85a78f19b17c4afa0366f6f8dfad59fb00bc6618 06-Sep-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Precise command constants on adb/protoxol.txt"
5195499e97c6b85b93750dfc2e24cf2a31d75376 02-Sep-2016 Josh Gao <jmgao@google.com> Merge "Fix adb." am: 50d606528d am: ff6d1a9656
am: e95214c467

Change-Id: Ibd72432b3572eab1559faed63ab60f69c22fbea4
e95214c46776940ca2eb2512ef0df4f36e6df97c 02-Sep-2016 Josh Gao <jmgao@google.com> Merge "Fix adb." am: 50d606528d
am: ff6d1a9656

Change-Id: I270efbd5555b7ef8088225f5ea8cdc6ea0cd343d
ff6d1a9656014dd24fd0246d780fb0d1af561bd6 02-Sep-2016 Josh Gao <jmgao@google.com> Merge "Fix adb."
am: 50d606528d

Change-Id: I55b6c174b4e57086b370e44ff7c0de053f2b4ad6
7f4ab76240a77e586e7737636a4752332be8ffe6 02-Sep-2016 Elliott Hughes <enh@google.com> Fix adb.

9460de1ce80a41cd6171a7e03d9fa7aef2db9dce had a backwards test that means
all adb commands abort. Fix the sense of the test.

Bug: http://b/30445394
Change-Id: I4b8ee697f7d305b57f9cd1a70ae919869dee994d
db_client.cpp
b6e4f08cb7e373fb1f34624d209dc431caa55449 02-Sep-2016 Josh Gao <jmgao@google.com> adb: allow use of arbitrary socket specs for command socket. am: 9c869b58a8 am: 15f75ef520
am: df3b28c002

Change-Id: Id4e66150fa1591edfcd51ebed86ce30d66b7fb6e
8e6cbca28dc5854b89403a78554a785eccab8398 02-Sep-2016 Josh Gao <jmgao@google.com> adb: extract the adb-specific unique_fd out into its own header. am: 924d35a8d5 am: 2c6ff3d2b5
am: d70699ef75

Change-Id: I68baa3ce5c91882fe5edc43a4fc2ff287e334af7
0c17ae6217c6c4c03de62f1fdd67482714832ad0 02-Sep-2016 Josh Gao <jmgao@google.com> adb: add helper to get the ~/.android directory. am: e0b7502c7f am: 36796df275
am: 74693b9ea6

Change-Id: Ie69aae9d28fadab70753c26418bd9753f71a0a8a
df3b28c002e0512b15378beb99a51b8de0de10f3 02-Sep-2016 Josh Gao <jmgao@google.com> adb: allow use of arbitrary socket specs for command socket. am: 9c869b58a8
am: 15f75ef520

Change-Id: Iab390aeb784541535da85cc8d6f734339f0c1ed7
d70699ef75738b8341ebde1385bc4142ed96d80b 02-Sep-2016 Josh Gao <jmgao@google.com> adb: extract the adb-specific unique_fd out into its own header. am: 924d35a8d5
am: 2c6ff3d2b5

Change-Id: I921ef808d09872901454a6ed92e2c164df435c0c
74693b9ea643a4822bd97c943082d405cb6be165 02-Sep-2016 Josh Gao <jmgao@google.com> adb: add helper to get the ~/.android directory. am: e0b7502c7f
am: 36796df275

Change-Id: I1a070b831ec9e749d5a8dd4f7481f13068b20685
15f75ef52082f711c45537a1922f3ff3be3c61c8 02-Sep-2016 Josh Gao <jmgao@google.com> adb: allow use of arbitrary socket specs for command socket.
am: 9c869b58a8

Change-Id: Ide2b50bf204657de7d93908970c4e7ab85f7eed5
2c6ff3d2b5592f5177910e895f59b412ecb7ca04 02-Sep-2016 Josh Gao <jmgao@google.com> adb: extract the adb-specific unique_fd out into its own header.
am: 924d35a8d5

Change-Id: Ib557fbafefe6c281230fdeaaea4db03f6cbd7df0
36796df27552b3d817075c29e7b9f92c80a005ac 02-Sep-2016 Josh Gao <jmgao@google.com> adb: add helper to get the ~/.android directory.
am: e0b7502c7f

Change-Id: I2859a6b3022a97d2b01d6850bcefe77307726904
1f5a49f77af80677f442e639a1b2ac856bc62042 02-Sep-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'adb_cmd_socket'

* changes:
adb: allow use of arbitrary socket specs for command socket.
adb: extract the adb-specific unique_fd out into its own header.
adb: add helper to get the ~/.android directory.
ccccbeca435c4f22f3e6b87de8ac9cba94c37877 02-Sep-2016 Josh Gao <jmgao@google.com> Merge "libcutils: try all addresses in socket_network_client_timeout." am: f3d43032d2 am: b7011e0410
am: 03da262702

Change-Id: I59153454f926ce0bcb68b2c5774f275cbc7db3bd
03da2627022a0b3048828e30ed2194f77641789d 02-Sep-2016 Josh Gao <jmgao@google.com> Merge "libcutils: try all addresses in socket_network_client_timeout." am: f3d43032d2
am: b7011e0410

Change-Id: Iabdfba4a3546e7a6f335d3d8b7ad2bb75f47d972
b7011e04101f93cf0fe8c4fb55eae0a761918e2b 02-Sep-2016 Josh Gao <jmgao@google.com> Merge "libcutils: try all addresses in socket_network_client_timeout."
am: f3d43032d2

Change-Id: I373ce6f43a7164754930c62c7fe249ed6530cfd0
78cc20f00730c5f017550bec2e494523bc052c42 01-Sep-2016 Josh Gao <jmgao@google.com> libcutils: try all addresses in socket_network_client_timeout.

If a connection fails to an address that resolves to multiple
sockaddrs, attempt connecting to subsequent addresses if the initial
connection fails to a reason other than timeout. This is primarily
useful for localhost, which can resolve to both an IPv4 and and IPv6
address.

Also, add an adb test to verify that this behavior.

Bug: http://b/30313466
Change-Id: Ib2df706a66cf6ef8c1097fdfd7aedb69b8df2d6e
Test: python test_adb.py (+ the test fails before this patch)
est_adb.py
9c869b58a8cf4f7c3bc88931fbd27d3f5187b2db 26-Aug-2016 Josh Gao <jmgao@google.com> adb: allow use of arbitrary socket specs for command socket.

Bug: http://b/30445394
Change-Id: I474ede35ec3c56ad86da503c9703f83ef5e80862
db.cpp
db.h
db_client.cpp
db_client.h
lient/main.cpp
ommandline.cpp
ocket_spec.cpp
ocket_spec.h
924d35a8d5f82e2d2f7e4dcedaa60791306b5fb5 31-Aug-2016 Josh Gao <jmgao@google.com> adb: extract the adb-specific unique_fd out into its own header.

Some POSIX-only files would like to use functions declared in
adb_utils.h without being forced to use the sysdeps stuff for open,
close, etc. Extract the adb-specific unique_fd into its own header so
those files can use adb_utils.h alongside the real unique_fd.

Change-Id: I10344ef26b7e72fce46bf7e3033f89aa54bd6118
Test: mm
db_unique_fd.h
db_utils.cpp
db_utils.h
ommandline.cpp
dwp_service.cpp
hell_service.cpp
e0b7502c7fb12b0ac03a5903562c74820975b833 31-Aug-2016 Josh Gao <jmgao@google.com> adb: add helper to get the ~/.android directory.

Extract the logic for creating ~/.android out of get_user_key_path into
its own function. Also, fall back to getpwuid_r when $HOME isn't
defined.

Change-Id: I676a7c750cb364f89b544818ffda07903d14fb97
Test: ran adb with ~/.android missing
db_auth_host.cpp
db_utils.cpp
db_utils.h
onsole.cpp
c5adf7774ba3d26516df4b77c9c17160cd4322d7 01-Sep-2016 Josh Gao <jmgao@google.com> Merge "Add android::base::GetExecutablePath, switch adb and fastboot over." am: 945d1aaa32 am: 289240f0bf
am: feb044f575

Change-Id: Id634d43107687664bb8afbc51190d35c51d0cb7b
feb044f575114fb717ea3dcfc42d866fa1afd46e 01-Sep-2016 Josh Gao <jmgao@google.com> Merge "Add android::base::GetExecutablePath, switch adb and fastboot over." am: 945d1aaa32
am: 289240f0bf

Change-Id: I5a8ccc66a82b75db495c8461550339c2ec7e639e
289240f0bf7526d5cd4c5b3a43c170ad6bd71dec 01-Sep-2016 Josh Gao <jmgao@google.com> Merge "Add android::base::GetExecutablePath, switch adb and fastboot over."
am: 945d1aaa32

Change-Id: I978edcc27401c174a771ab22be1a8b9abcb55d5f
82ff315bb0fecb9127970e01b399be53c92ca14f 01-Sep-2016 Elliott Hughes <enh@google.com> Add android::base::GetExecutablePath, switch adb and fastboot over.

We'd long had two copies of this stuff, so rather than rewrite both
Linux versions to use android::base::Readlink, let's kill the duplication
too...

Bug: http://b/30988271
Change-Id: I4de58a94a22a4b1faf969a6fc70ca1560a4d5121
ndroid.mk
db.cpp
db.h
et_my_path_darwin.cpp
et_my_path_linux.cpp
680f4a488837bbadb8f341e67baac57b7cf5a29a 16-Aug-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Split 'generating' and 'pulling' in 2 messages.

BUG: 30799929
Change-Id: I0af0ad2478c57ffc5b2c953118e01677f788d14a
(cherry picked from commit 9c0be90528baee54182334048af467e3dde74d72)
(cherry picked from commit 321c21e2df13cb375a9c96dbdbb7c849734a9293)
ugreport.cpp
ugreport_test.cpp
f33fcb6418ec16fa91b17966106d135e0541f34a 04-Aug-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Ignore bugreportz output when it's not supported.

On devices running M or below, calling 'bugreportz -v' writes
'/system/bin/sh: bugreportz: not found' in the stdout output, which must
be redirected to stderr so it's not shown in the flat-file bugreport,
above the bugreport header.

BUG: 30451114

Change-Id: I942c92fdf6ae85e0cde7b9f94b9eb0b1fecad77a
(cherry picked from commit 9a882a3ef38c487eaa26dee845bb738997d5023d)
(cherry picked from commit b0022b036e10bbad8536286a32228a8f90c80068)
ugreport.cpp
ugreport_test.cpp
b3239728bbb1ffd77e3ac3dda5089d96e0580ee3 30-Jul-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Deprecated 'adb bugreport' with flat files.

Starting on Android N, zipped bugreports contain more information than
flat-file, text bugreports. On N, calls to 'adb bugreport' would still
generate a flat-file bugreport, but with a warning.

With this change, 'adb bugreport' will generate a zipped bugreport in
the current directory, using the bugreport name provided by the
device. Similarly, calling 'adb bugreport dir' will generate a bugreport
with a device-provided name, but in such directory.

BUG: 30451114
BUG: 29448020

Change-Id: Ibc8920dd44a5f62feb15bf3fefdcb0bdbf389a90
(cherry picked from commit 307951e124afc0ab385dc679a57562d339049e2b)
(cherry picked from commit f8d9e4eb0062c0122fc87ced5c6c6b6a6e3f4521)
ugreport.cpp
ugreport_test.cpp
ommandline.cpp
6e2869680c2d841da85531d6ecf23adfb55b4e71 30-Jul-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Minor improvements on bugreport generation.

- Skipped artificial 100/100 message, since pulling will take care of
the final 100% progress.
- Consolidated unsupported lines in just one message.
- Let user know the bugreport can still be recovered when it could not
be copied to the destination directory.

BUG: 30451114

Change-Id: Icfce9c1e8e7ed407719728b9874679ac40b21eab
(cherry picked from commit 80a65d03c997637c9fc8a41d878aa3f25ef9e668)
(cherry picked from commit 5f6eacaeda3aad9b60a6cf4a139bd1e544c7aecb)
ugreport.cpp
ugreport_test.cpp
daf4628f365cb0ab2e9734ef9152b109a241bd63 28-Jul-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Removed extra 'pulling file' message.

Taking a zip bugreport has 2 phases: generating the bugreport and
pulling the file.

Initially adb was printing 2 messages, but since the latter is almost
instantaneously, it could be confusing to have 2 lines...

Fixes: 30451250
Change-Id: I1c6cc6163492c1fb6064667dfdb7aaf6ed4c4c6f
(cherry picked from commit f7c38b4c03d75c9cb27610acab96f4e7f4169de8)
(cherry picked from commit 33ae849fefa1605a472ac82c2c4ee8eb0af23463)
ugreport.cpp
ugreport.h
ugreport_test.cpp
6f5080faa5c95ba7fc9d4c73eaecf4684a79d00c 26-Jul-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Show bugreport progress.

adb calls bugreportz to generate a bugreport; initially, bugreportz
would only report the final status of the operation (OK or FAIL), but
now it sends intermediate PROGRESS lines reporting its progress (in the
form of current/max).

Similarly, the initial implementation of 'adb bugreport <zip_file>'
would print an initial 'please wait' message and wait for the full
stdout before parsing the result, but now it uses a new callback class
to handle the stdout as it is generated by bugreportz.

BUG: 28609499

Change-Id: I6644fc39a686279e1635f946a47f3847b547d1c1
(cherry picked from commit cd42d658b2d08ace81b5ae3b108acbaca1a1d439)
(cherry picked from commit 97b73a0daf74081a6324bb41cc34d9f0598cfe29)
ndroid.mk
ugreport.cpp
ugreport.h
ugreport_test.cpp
0d4f0508c0c20847c8f44353ce00d36fcc3d0788 26-Jul-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Refactored functions that copy sdout and stderr to strings to use a callback.

BUG: 28609499

Change-Id: I04aea346e18678ea00797f7f659480edba4436c2
(cherry picked from commit 07ac8554b477dc81579a5e63a2fbabc740fa8a92)
(cherry picked from commit d18854218ec1e9fa2659f6c8be1ca17adefe68fb)
ugreport.cpp
ugreport.h
ugreport_test.cpp
ommandline.cpp
ommandline.h
698e065e14840541f218a80241fa880703a7dbc5 20-Jul-2016 Felipe Leme <felipeal@google.com> DO NOT MERGE: Split bugreport() into its own file and added unit tests.

bugreport() will be soon refactored to track progress, which will
require more comprehensive unit tests.

As such, it's better to move it to its own files, which in turn also
requires moving send_shell_command() and usage() to commandline.h.

Fixes: 30100363
Bug: 30268737

Change-Id: I3cdf114a0b5547293320042ff0749a60886440b0
(cherry picked from commit 78e0963e4bce9cc9f0bbf0b686004ba15b1e3929)
(cherry picked from commit 218e1ff75998052c7bb30b483c15e75a853283a8)
ndroid.mk
db.h
db_client.h
ugreport.cpp
ugreport.h
ugreport_test.cpp
lient/main.cpp
ommandline.cpp
ommandline.h
248722e7eb8d184677b2d858d3309d7ce055e532 21-Jul-2016 Todd Kennedy <toddke@google.com> DO NOT MERGE: use 'cmd' command for install-multiple

adb install-multiple makes a minimum of 3 calls to the 'pm' command. This
causes at least 3 separate "pm" processes to be spun up. Instead, use the
'cmd' command which runs in the existing system_server process.

Bug: 27483932
Change-Id: Ia1bed405c3d7e675a1a56ff82c692aaa94388a5c
(cherry picked from commit 4838ae1ab52a6364e74c8607206f0a9ea302c80e)
ommandline.cpp
c42f1bb3e91bb7fbce893da289ea143f2dda3c6c 06-Jul-2016 Christopher Tate <ctate@google.com> DO NOT MERGE: Ensure the target sees a proper EOD marker during restore

Malformed or corrupt archives may be missing their in-band EOD
content, so make sure that the target sees one regardless rather
than continuing to block on read, expecting in-band signaling.

Bug 28056941

Change-Id: Ic39966d3448787a8c511783d39172032ed9589c3
(cherry picked from commit 2bcdda8e5dfdb33409fce062fdfd9d0735432ef8)
ommandline.cpp
39e999e9912ed0a27585d82868c99cdd9644996a 30-Aug-2016 Eyal Lezmy <eyal.lezmy@gmail.com> Precise command constants on adb/protoxol.txt

Try to improve the documentation by adding, for each commands explained
on the adb/protocol.txt file (CONNECT, WRITE, AUTH, ...), the
corresponding constant used by the protocol (A_CNXN, A_WRTE,
A_AUTH, ...).

I've seen a few engineers having problems matching these both
information by simply reading the doc and they loose time before
getting it. Most of the time they understand it by finally reading the
source code.

By adding this simple information at the end of each command
description I'm sure it will help onboarding developers to
understand more quickly the way the ADB protocol works.

Change-Id: Ibb949fd6a6d34a2bc7f47f0e7af2f57138c9a369
Signed-off-by: Eyal Lezmy <eyal.lezmy@gmail.com>
rotocol.txt
b1cadcfc5b3cd632da7205cf727699b0ce9ecdb8 27-Aug-2016 Josh Gao <jmgao@google.com> Merge "adb: factor out socket specification." am: bd7d2e2ec0 am: f95e728431
am: 4c58c8a892

Change-Id: Idcb03acf63ba3e64f81f55c6b7708eb2cf945d8d
4c58c8a892c129693429640d95958da57c701e98 27-Aug-2016 Josh Gao <jmgao@google.com> Merge "adb: factor out socket specification." am: bd7d2e2ec0
am: f95e728431

Change-Id: Ibbed2dea019538491650eab41bd75e4f7546a909
cfb21412e5e3a716fc45601f35d3b58ce5f78f46 25-Aug-2016 Josh Gao <jmgao@google.com> adb: factor out socket specification.

Move the logic for string socket specification out to separate
functions to facilitate using arbitrary sockets for the adb command
socket.

Bug: http://b/30445394
Change-Id: Icd8fdb853272edc029fb3a0f5b18e941dc8ef52c
Test: adb_test, adbd_test, test_device.py
ndroid.mk
db_listeners.cpp
ervices.cpp
ocket_spec.cpp
ocket_spec.h
ysdeps.h
7424dfa361d175bfd1aaf01826f1682a2516524f 25-Aug-2016 Josh Gao <jmgao@google.com> Merge changes I0ee130db,I33d356fd am: e461b37965 am: 59561a64b7
am: 87ff463d6e

Change-Id: I72ac706e6866b6f391cc950a677a598df79fa9a0
87ff463d6e8e6c5112f7722032b5a2f8ff6a6240 25-Aug-2016 Josh Gao <jmgao@google.com> Merge changes I0ee130db,I33d356fd am: e461b37965
am: 59561a64b7

Change-Id: If05615e9e5e69bb496fa9eb3c49ba7f9f5a41c45
e461b37965ff609ea36c1fbb6e4e8df1fb7b7d7f 25-Aug-2016 Josh Gao <jmgao@google.com> Merge changes I0ee130db,I33d356fd

* changes:
adb: remove unnecessary addr arguments to accept.
adb: check our socketpair ends in our win32 emulation.
78e1eb1949fd48bcb0578276ffdc2ff3c7ddd89b 24-Aug-2016 Josh Gao <jmgao@google.com> adb: remove unnecessary addr arguments to accept.

Follow up to https://android-review.googlesource.com/#/c/261412/

Change-Id: I0ee130db302940f3224cc823a26b02fc45da0fca
Test: mma
db_auth_client.cpp
db_listeners.cpp
dwp_service.cpp
ransport_local.cpp
5990191c4e4802567881db2f19db4adbddc64e1e 24-Aug-2016 Josh Gao <jmgao@google.com> adb: check our socketpair ends in our win32 emulation.

In our Win32 socketpair emulation, check that the ends are properly
connected before returning.

Change-Id: I33d356fd9ebcac89fc6a89a5200e926032220383
Test: no additional failing tests in adb_test.exe
ysdeps.h
ysdeps_win32.cpp
0426ecaf823818cf9418a713613f3ed814f538a5 24-Aug-2016 Elliott Hughes <enh@google.com> Merge "Most accept/accept4 calls in system/core don't actually want the remote address." am: 299d64144b am: 8615d79d85
am: 66e5e2432a

Change-Id: I5d7b98fa3e9c2d8c16a1aa73e3d5a197dc150c2b
66e5e2432a88a4b2ba8bacbc3137438e95eb4011 24-Aug-2016 Elliott Hughes <enh@google.com> Merge "Most accept/accept4 calls in system/core don't actually want the remote address." am: 299d64144b
am: 8615d79d85

Change-Id: I89aeabf6efa8217c9acd3f8a766bbd18f7e994fa
8615d79d85e53c86028b702152bc00864b18f9d5 24-Aug-2016 Elliott Hughes <enh@google.com> Merge "Most accept/accept4 calls in system/core don't actually want the remote address."
am: 299d64144b

Change-Id: I3fb9678dfed08f0b1d6e90e547ecae6cdcabc9a1
3dcfa3fb1cec36b21ad026c618c85790a2353f72 23-Aug-2016 Elliott Hughes <enh@google.com> Most accept/accept4 calls in system/core don't actually want the remote address.

So don't write the extra code for it or waste the kernel's time
copying it around.

Change-Id: I93de64064c2d4fe58ba5b5322cfa69bf31a76dad
ocket_test.cpp
5bb5dd0eb65846865ff752d3c3055865d37cf4a4 23-Aug-2016 Josh Gao <jmgao@google.com> Merge "adb: increase the authentication throttling limit." am: 393e5258f6 am: e4d79532de
am: a2408aaf2f

Change-Id: Ibc53b45c09cc4462175d52daa532ff305ce19145
a2408aaf2f40199a531217f174c2dccce8d04b22 23-Aug-2016 Josh Gao <jmgao@google.com> Merge "adb: increase the authentication throttling limit." am: 393e5258f6
am: e4d79532de

Change-Id: I4a0b0700cdee5f3b0e1577132080860402318851
e4d79532de4c6e89d973dcc9f93dc16377672b70 23-Aug-2016 Josh Gao <jmgao@google.com> Merge "adb: increase the authentication throttling limit."
am: 393e5258f6

Change-Id: I483cf75ced8d9fb896c2f5e417d258970d7cabb1
536c5ad0f30c0b330924f3b12e56b5a415c60fe7 22-Aug-2016 Josh Gao <jmgao@google.com> Merge changes I9761298a,I8d3312b2 am: 0b4fcb75d4 am: 8270912ed0
am: 7f3a776ac4

Change-Id: Ia348ecf331e2e10365a5b23e257888f4794a06ea
7f3a776ac466802e668b304c939c20bb5eb992e2 22-Aug-2016 Josh Gao <jmgao@google.com> Merge changes I9761298a,I8d3312b2 am: 0b4fcb75d4
am: 8270912ed0

Change-Id: I4eafebc37f15f817ac2fa035a03e0aae90aa6fb0
8270912ed0ab160847bfcc1f5f4be7b3174333b1 22-Aug-2016 Josh Gao <jmgao@google.com> Merge changes I9761298a,I8d3312b2
am: 0b4fcb75d4

Change-Id: I330c467e408bc10ebdab0f5708d24d2297cf39a2
c8cb38803af20e922419760663ed1627e865fad2 22-Aug-2016 Josh Gao <jmgao@google.com> adb: increase the authentication throttling limit.

Previously, after 10 failed authentications, we'd sleep for a second,
and we're up to 11 vendor keys in internal now...

Bug: http://b/30927527
Change-Id: I094e830521f6a2768a880c6684f32ff1ce2a3c2e
db.cpp
8a0d0773bdc6392386e1dd1910eeb6d2155557c8 22-Aug-2016 Josh Gao <jmgao@google.com> adb: fix public key authorization.

This was broken by commit e8b663fe, which removed the null-terminator
from the message sent. For some reason, adbd requires the key to be
null terminated, despite an explicit length being part of the message.

Bug: http://b/30971808
Change-Id: I9761298a57ed76ca2bc02b05490f98cdffbaa0c3
Test: manually tested, adb authorization dialog box shows up
db_auth.cpp
2e671202c38a9b17b0b034438a305e3067abb4ab 19-Aug-2016 Josh Gao <jmgao@google.com> adb: add support for vendor key directories.

Allow directories to be specified in ADB_VENDOR_KEYS. On Linux, monitor
this directory for new keys to be added.

Additionally, deduplicate keys by hashing their public key.

Bug: http://b/29273531
Bug: http://b/30927527
Change-Id: I8d3312b216b7f2c11900f2235f1f1b1d1c7aa767
Test: manually tested by adding a key to a directory, and verifying
that devices became authorized after replugging.
db_auth.cpp
db_auth.h
db_auth_host.cpp
ransport.cpp
ransport.h
e965ddd835eaddae4ce42d8bf2066b9900abc34f 17-Aug-2016 Felipe Leme <felipeal@google.com> Split 'generating' and 'pulling' in 2 messages.
am: 321c21e2df

Change-Id: I0099c4da6f88a9b6804365c81cd28b6b5a9bbdcc
321c21e2df13cb375a9c96dbdbb7c849734a9293 16-Aug-2016 Felipe Leme <felipeal@google.com> Split 'generating' and 'pulling' in 2 messages.

BUG: 30799929
Change-Id: I0af0ad2478c57ffc5b2c953118e01677f788d14a
(cherry picked from commit 9c0be90528baee54182334048af467e3dde74d72)
ugreport.cpp
ugreport_test.cpp
b0022b036e10bbad8536286a32228a8f90c80068 04-Aug-2016 Felipe Leme <felipeal@google.com> Ignore bugreportz output when it's not supported.

On devices running M or below, calling 'bugreportz -v' writes
'/system/bin/sh: bugreportz: not found' in the stdout output, which must
be redirected to stderr so it's not shown in the flat-file bugreport,
above the bugreport header.

BUG: 30451114

Change-Id: I942c92fdf6ae85e0cde7b9f94b9eb0b1fecad77a
(cherry picked from commit 9a882a3ef38c487eaa26dee845bb738997d5023d)
ugreport.cpp
ugreport_test.cpp
f8d9e4eb0062c0122fc87ced5c6c6b6a6e3f4521 30-Jul-2016 Felipe Leme <felipeal@google.com> Deprecated 'adb bugreport' with flat files.

Starting on Android N, zipped bugreports contain more information than
flat-file, text bugreports. On N, calls to 'adb bugreport' would still
generate a flat-file bugreport, but with a warning.

With this change, 'adb bugreport' will generate a zipped bugreport in
the current directory, using the bugreport name provided by the
device. Similarly, calling 'adb bugreport dir' will generate a bugreport
with a device-provided name, but in such directory.

BUG: 30451114
BUG: 29448020

Change-Id: Ibc8920dd44a5f62feb15bf3fefdcb0bdbf389a90
(cherry picked from commit 307951e124afc0ab385dc679a57562d339049e2b)
ugreport.cpp
ugreport_test.cpp
ommandline.cpp
5f6eacaeda3aad9b60a6cf4a139bd1e544c7aecb 30-Jul-2016 Felipe Leme <felipeal@google.com> Minor improvements on bugreport generation.

- Skipped artificial 100/100 message, since pulling will take care of
the final 100% progress.
- Consolidated unsupported lines in just one message.
- Let user know the bugreport can still be recovered when it could not
be copied to the destination directory.

BUG: 30451114

Change-Id: Icfce9c1e8e7ed407719728b9874679ac40b21eab
(cherry picked from commit 80a65d03c997637c9fc8a41d878aa3f25ef9e668)
ugreport.cpp
ugreport_test.cpp
33ae849fefa1605a472ac82c2c4ee8eb0af23463 28-Jul-2016 Felipe Leme <felipeal@google.com> Removed extra 'pulling file' message.

Taking a zip bugreport has 2 phases: generating the bugreport and
pulling the file.

Initially adb was printing 2 messages, but since the latter is almost
instantaneously, it could be confusing to have 2 lines...

Fixes: 30451250
Change-Id: I1c6cc6163492c1fb6064667dfdb7aaf6ed4c4c6f
(cherry picked from commit f7c38b4c03d75c9cb27610acab96f4e7f4169de8)
ugreport.cpp
ugreport.h
ugreport_test.cpp
97b73a0daf74081a6324bb41cc34d9f0598cfe29 26-Jul-2016 Felipe Leme <felipeal@google.com> Show bugreport progress.

adb calls bugreportz to generate a bugreport; initially, bugreportz
would only report the final status of the operation (OK or FAIL), but
now it sends intermediate PROGRESS lines reporting its progress (in the
form of current/max).

Similarly, the initial implementation of 'adb bugreport <zip_file>'
would print an initial 'please wait' message and wait for the full
stdout before parsing the result, but now it uses a new callback class
to handle the stdout as it is generated by bugreportz.

BUG: 28609499

Change-Id: I6644fc39a686279e1635f946a47f3847b547d1c1
(cherry picked from commit cd42d658b2d08ace81b5ae3b108acbaca1a1d439)
ndroid.mk
ugreport.cpp
ugreport.h
ugreport_test.cpp
d18854218ec1e9fa2659f6c8be1ca17adefe68fb 26-Jul-2016 Felipe Leme <felipeal@google.com> Refactored functions that copy sdout and stderr to strings to use a callback.

BUG: 28609499

Change-Id: I04aea346e18678ea00797f7f659480edba4436c2
(cherry picked from commit 07ac8554b477dc81579a5e63a2fbabc740fa8a92)
ugreport.cpp
ugreport.h
ugreport_test.cpp
ommandline.cpp
ommandline.h
218e1ff75998052c7bb30b483c15e75a853283a8 20-Jul-2016 Felipe Leme <felipeal@google.com> Split bugreport() into its own file and added unit tests.

bugreport() will be soon refactored to track progress, which will
require more comprehensive unit tests.

As such, it's better to move it to its own files, which in turn also
requires moving send_shell_command() and usage() to commandline.h.

Fixes: 30100363
Bug: 30268737

Change-Id: I3cdf114a0b5547293320042ff0749a60886440b0
(cherry picked from commit 78e0963e4bce9cc9f0bbf0b686004ba15b1e3929)
ndroid.mk
db.h
db_client.h
ugreport.cpp
ugreport.h
ugreport_test.cpp
lient/main.cpp
ommandline.cpp
ommandline.h
98fb12188f2240c15117fb7cc8dae304fc5c6b4e 12-Aug-2016 Josh Gao <jmgao@google.com> Merge "Clean up key handling in adb." am: b859830450 am: 81a3f71e45
am: f648fb4539

Change-Id: I66e49d47f732677e234cd6dfa85d722fc0dae0f4
f648fb4539795e94916beb408e5a4a897cefaac7 12-Aug-2016 Josh Gao <jmgao@google.com> Merge "Clean up key handling in adb." am: b859830450
am: 81a3f71e45

Change-Id: I7013113e72eefd68a9329d0da72a45946d860e14
81a3f71e45af5f19d426c7d0cc116ba3921d968a 12-Aug-2016 Josh Gao <jmgao@google.com> Merge "Clean up key handling in adb."
am: b859830450

Change-Id: I8d8ff82167a97e89eacbfcc97f3b704466927aa3
0aeb50500c76ea67d6f452907f5503d590e81a54 30-Jun-2016 Elliott Hughes <enh@google.com> Clean up key handling in adb.

This includes the locking we need to be able to re-load the keys at runtime.

We should rename "adb_auth_client.cpp" to "adb_auth_adbd.cpp" or
"adbd_auth.cpp" in a later change.

Change-Id: I9e1d5b6b7d0497d6f6e5d9c4fb660118cdff05a8
Test: "adb devices" works against a non-AOSP device with $ADB_VENDOR_KEYS set, says "unauthorized" without.
Bug: http://b/29273531
db.cpp
db_auth.cpp
db_auth.h
db_auth_client.cpp
db_auth_host.cpp
lient/main.cpp
ysdeps.h
ransport.cpp
ransport.h
0ce32b03e4732dbf018d539efb647c3ccb9b4691 08-Aug-2016 Elliott Hughes <enh@google.com> Merge "std::unqiue_ptr<..., decltype(&fn)> seems to be the preferred idiom." am: 2f21b7cecd am: f2f4e784a4
am: 236a9903fe

Change-Id: I298f2cd8013d2a6fffe7dde212c28198eea044bb
236a9903fe639e1beb98ad80dd44fa537356cb95 08-Aug-2016 Elliott Hughes <enh@google.com> Merge "std::unqiue_ptr<..., decltype(&fn)> seems to be the preferred idiom." am: 2f21b7cecd
am: f2f4e784a4

Change-Id: I6ca3c3471189b2c15f25ac44ee7985f2e121e441
f2f4e784a451bdf4f13767ab1112e5601b55ed9f 08-Aug-2016 Elliott Hughes <enh@google.com> Merge "std::unqiue_ptr<..., decltype(&fn)> seems to be the preferred idiom."
am: 2f21b7cecd

Change-Id: I9fa6d99a61053dae4ad60c0b73ddac755b29cf61
aea1683c12f4771757d60a6f4afa5e9ab9af33d0 08-Aug-2016 Elliott Hughes <enh@google.com> std::unqiue_ptr<..., decltype(&fn)> seems to be the preferred idiom.

This is the only decltype(fn)* outside aapt2 in the whole tree.

Change-Id: I2e19d2031b56fdb808c62c2c07ca6080c9ec6fe3
ysdeps_win32.cpp
748077190918012948f145d97a5d5b4028207ee8 08-Aug-2016 Josh Gao <jmgao@google.com> Merge "libcrypto_utils: convert to Soong." am: c1a9a21ffe am: 87ef590bc1
am: a1da027a3c

Change-Id: Ie693d3de13b0df24ea83e70af3fa385a77ed8b33
a1da027a3c00ad90973dae97fa679747f08ccd11 08-Aug-2016 Josh Gao <jmgao@google.com> Merge "libcrypto_utils: convert to Soong." am: c1a9a21ffe
am: 87ef590bc1

Change-Id: I3cdf2f27f953f40a5d5b9257cf588b093d22233d
87ef590bc1ab795add250d6946ab18994b6b64a8 08-Aug-2016 Josh Gao <jmgao@google.com> Merge "libcrypto_utils: convert to Soong."
am: c1a9a21ffe

Change-Id: I9cf76646d4537750c4d4080234d3384fb307e610
c1a9a21ffeee43c3b59f7269a66dd603b44ac5e3 08-Aug-2016 Josh Gao <jmgao@google.com> Merge "libcrypto_utils: convert to Soong."
47763c3a09e8581338c307c5a5de4ae359c3b6e7 06-Aug-2016 Josh Gao <jmgao@google.com> libcrypto_utils: convert to Soong.

Bug: http://b/30708454
Change-Id: Iaad64272ced766f87e67f2877e990afccc558065
ndroid.mk
52dd7ae138f1dcf38fa87799508635ce83f2b275 05-Aug-2016 Josh Gao <jmgao@google.com> adb: correctly fix merge conflict. am: 1286c1f878
am: d067dcdaa3

Change-Id: Ib6a4f905e878b2681c44a5075647925b8d5f61e1
d067dcdaa3af17a5950271dbe80c4ae9b2d694e2 05-Aug-2016 Josh Gao <jmgao@google.com> adb: correctly fix merge conflict.
am: 1286c1f878

Change-Id: I865cc05bef06ec33941766993e6aef2171be3e67
1286c1f878ebbd8389745608ac57c75666822a4f 05-Aug-2016 Josh Gao <jmgao@google.com> adb: correctly fix merge conflict.

Change-Id: Ic637c0ef5499e2893cd0adfcc41dd5d3481524c2
ile_sync_client.cpp
c59b46d0c4fb8fbea4ed461709efdceaa4d27375 05-Aug-2016 Josh Gao <jmgao@google.com> resolve merge conflicts of e012de5 to stage-aosp-master am: 4ff7f9f62a
am: aef02526b5

Change-Id: I6c07ac4d130aba1056f9cbd28d41c0b299832eeb
aef02526b593521678f6c671611571286214e3a4 05-Aug-2016 Josh Gao <jmgao@google.com> resolve merge conflicts of e012de5 to stage-aosp-master
am: 4ff7f9f62a

Change-Id: I91b285de08f184efa8bdada92ff9aac9b73f7a8f
4ff7f9f62ae5d283fb62ee87c615a801642cba8f 05-Aug-2016 Josh Gao <jmgao@google.com> resolve merge conflicts of e012de5 to stage-aosp-master

Change-Id: I3d9f8b4421fa6122261dbd821561a2236f810a47
fb0c5cb28c13693c82f213ac99cb6b546ea44eda 04-Aug-2016 Josh Gao <jmgao@google.com> adb: improve display of transfer rate.

Show transfer rate for individual files, and for the overall transfer.

Bug: http://b/30411535
Change-Id: If2f3008f1287b1d1add4a23c3430b39885b6c904
Test: inspected output manually
ile_sync_client.cpp
9844ebe81e30256ac7b3738d8354d2771ef04102 05-Aug-2016 Felipe Leme <felipeal@google.com> Ignore bugreportz output when it's not supported. am: 9a882a3ef3
am: 62d4ead5f4

Change-Id: I9110a6c31cc3a2d935967312185ffbdc1f03ccd2
1a9979ec1ee913157a0e8e570ca93feacf58634e 04-Aug-2016 Josh Gao <jmgao@google.com> adb: add missing newline when printing transfer rate.

Previously, we weren't printing a newline when reporting transfer
rates, so only the last transfer rate printed would be visible.

Bug: http://b/30667841
Change-Id: Id341147912d057673de4ad26a8f618f04a8c02f3
Test: inspected output manually
ile_sync_client.cpp
ine_printer.cpp
baa215ea59842f0f94880b1a59830a557954588a 04-Aug-2016 Josh Gao <jmgao@google.com> adb: fix output of `sync -l`

sync with list-only was using SyncConnection::Error to print its output
persistently, which would prepend "adb: error: " to messages.

Change-Id: I90df5fc1123b8c613c811cf66c37aef05663b1e4
ile_sync_client.cpp
9a882a3ef38c487eaa26dee845bb738997d5023d 04-Aug-2016 Felipe Leme <felipeal@google.com> Ignore bugreportz output when it's not supported.

On devices running M or below, calling 'bugreportz -v' writes
'/system/bin/sh: bugreportz: not found' in the stdout output, which must
be redirected to stderr so it's not shown in the flat-file bugreport,
above the bugreport header.

BUG: 30451114

Change-Id: I942c92fdf6ae85e0cde7b9f94b9eb0b1fecad77a
ugreport.cpp
ugreport_test.cpp
9cc9d18a51b310f93141c0e024900d90345fd8b9 04-Aug-2016 Felipe Leme <felipeal@google.com> Deprecated 'adb bugreport' with flat files. am: 307951e124
am: 617cedac2f

Change-Id: I041654671242f2607f9de0eff2ab4bc21dcc7a0b
f89226dae656227d41030a5f4919712aef3d0314 04-Aug-2016 Felipe Leme <felipeal@google.com> Minor improvements on bugreport generation. am: 80a65d03c9
am: 7939117c98

Change-Id: I67bdbda273cbf8240bbd1517760c156652e7cfaa
617cedac2f18f387b72bbc644e9489fe9bfcdf93 04-Aug-2016 Felipe Leme <felipeal@google.com> Deprecated 'adb bugreport' with flat files.
am: 307951e124

Change-Id: I909ae170479cba54338b03426bcee123abececc1
7939117c98a884529defcf344920bed000b17e74 04-Aug-2016 Felipe Leme <felipeal@google.com> Minor improvements on bugreport generation.
am: 80a65d03c9

Change-Id: I5b6036489d1d5094a6e1632a4580b23578d85983
aed7048ce0c8ff20a2ed7ce46a848d8af1d3142d 04-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'bug_30451114' into nyc-mr1-dev

* changes:
Deprecated 'adb bugreport' with flat files.
Minor improvements on bugreport generation.
29e7e3edb1edb4567ef9f354d9a5290b92394492 29-Jul-2016 Josh Gao <jmgao@google.com> adb: fix stat on Windows.

stat on Windows fails with ENOENT when passed a path with a trailing
slash or backslash, regardless of whether the target is actually a
directory. Emulate the correct POSIX behavior by stripping trailing
path separators and then checking if the target is a directory if
successful.

Bug: http://b/30481559
Bug: https://code.google.com/p/android/issues/detail?id=214633
Change-Id: I1d398d19a9bce1ecb3fdc4aabc31aa98c82c3f93
Test: Relevant adb_tests pass on Linux and Windows 10.
(cherry picked from commit f551ea0f6309465eeab70404076bd881320f4883)
ndroid.mk
db_utils_test.cpp
ysdeps.h
ysdeps/stat.h
ysdeps/stat_test.cpp
ysdeps/win32/stat.cpp
ysdeps_win32.cpp
89b97677765cdc8d99319d85619f551ed5107d25 29-Jul-2016 Josh Gao <jmgao@google.com> adb: extract Windows bits out of directory_exists test.

Bug: http://b/30481559
Bug: https://code.google.com/p/android/issues/detail?id=214633
Change-Id: I8f20b3cd5aef6a77c2b4f194b914b4295397d73f
(cherry picked from commit 3bdc76025b9b1a8416f00b5f1b57a51c6c9c604d)
db_utils_test.cpp
307951e124afc0ab385dc679a57562d339049e2b 30-Jul-2016 Felipe Leme <felipeal@google.com> Deprecated 'adb bugreport' with flat files.

Starting on Android N, zipped bugreports contain more information than
flat-file, text bugreports. On N, calls to 'adb bugreport' would still
generate a flat-file bugreport, but with a warning.

With this change, 'adb bugreport' will generate a zipped bugreport in
the current directory, using the bugreport name provided by the
device. Similarly, calling 'adb bugreport dir' will generate a bugreport
with a device-provided name, but in such directory.

BUG: 30451114
BUG: 29448020

Change-Id: Ibc8920dd44a5f62feb15bf3fefdcb0bdbf389a90
ugreport.cpp
ugreport_test.cpp
ommandline.cpp
0538bcd4ed754e8044548df2e043f28f2600c974 02-Aug-2016 Josh Gao <jmgao@google.com> Merge changes I1d398d19,I8f20b3cd am: c97b73aa83 am: 0889353fa5
am: 6c41b5efb1

Change-Id: I6d24400da63131d42083a9885200386d0bf8bccb
6c41b5efb172c77b6b011861c4ca5c52bbfb2780 02-Aug-2016 Josh Gao <jmgao@google.com> Merge changes I1d398d19,I8f20b3cd am: c97b73aa83
am: 0889353fa5

Change-Id: I7f9f866d38f18206dff5738050d31ed27400294a
0889353fa583d282c7782ccc9f155a4d76365b4e 02-Aug-2016 Josh Gao <jmgao@google.com> Merge changes I1d398d19,I8f20b3cd
am: c97b73aa83

Change-Id: I9a22ba63f4306c17933624f4c99380702f6e701e
c97b73aa83fc7b80b60d88d856675d4ab502296d 01-Aug-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge changes I1d398d19,I8f20b3cd

* changes:
adb: fix stat on Windows.
adb: extract Windows bits out of directory_exists test.
b143c9708cfe9b17d17e3864c93d6a9c5e5a0569 01-Aug-2016 Chih-Hung Hsieh <chh@google.com> resolve merge conflicts of d072ed3 to nyc-mr1-dev-plus-aosp

Change-Id: Ifdd67548e252fcd73833a9d017aa8205bf749f70
80a65d03c997637c9fc8a41d878aa3f25ef9e668 30-Jul-2016 Felipe Leme <felipeal@google.com> Minor improvements on bugreport generation.

- Skipped artificial 100/100 message, since pulling will take care of
the final 100% progress.
- Consolidated unsupported lines in just one message.
- Let user know the bugreport can still be recovered when it could not
be copied to the destination directory.

BUG: 30451114

Change-Id: Icfce9c1e8e7ed407719728b9874679ac40b21eab
ugreport.cpp
ugreport_test.cpp
d072ed36344ea06b53d6e821ccf58aef16c3c260 01-Aug-2016 Chih-Hung Hsieh <chh@google.com> Merge \\"Fix clang-tidy performance warnings in syste/core.\\" am: 4efbce14b5
am: 4c4fa90462

Change-Id: I66bacc66df316cca09afba3ae043bd0a3035da22
4c4fa90462afc8b187a65238f26d9b66db66e428 01-Aug-2016 Chih-Hung Hsieh <chh@google.com> Merge \"Fix clang-tidy performance warnings in syste/core.\"
am: 4efbce14b5

Change-Id: I84f6b0134fae6e9f40710f243f4825e3f31fa15f
f551ea0f6309465eeab70404076bd881320f4883 29-Jul-2016 Josh Gao <jmgao@google.com> adb: fix stat on Windows.

stat on Windows fails with ENOENT when passed a path with a trailing
slash or backslash, regardless of whether the target is actually a
directory. Emulate the correct POSIX behavior by stripping trailing
path separators and then checking if the target is a directory if
successful.

Bug: http://b/30481559
Bug: https://code.google.com/p/android/issues/detail?id=214633
Change-Id: I1d398d19a9bce1ecb3fdc4aabc31aa98c82c3f93
Test: Relevant adb_tests pass on Linux and Windows 10.
ndroid.mk
db_utils_test.cpp
ysdeps.h
ysdeps/stat.h
ysdeps/stat_test.cpp
ysdeps/win32/stat.cpp
ysdeps_win32.cpp
8f7b9e3d39cdae8363816aa7bcbab0d79fd70cea 28-Jul-2016 Chih-Hung Hsieh <chh@google.com> Fix clang-tidy performance warnings in syste/core.

* Use const reference type for parameters to avoid unnecessary copy.
* Suppress warning of not using faster overloaded string find function.

Bug: 30407689
Bug: 30411878
Change-Id: I6cfdbbd50cf5e8f3db6e5263076d3a17a9a791ee
Test: build with WITH_TIDY=1
Merged-In: Ie79dbe21899867bc62031f8618bb1322b8071525
db_utils_test.cpp
ommandline.cpp
ile_sync_client.cpp
3bdc76025b9b1a8416f00b5f1b57a51c6c9c604d 29-Jul-2016 Josh Gao <jmgao@google.com> adb: extract Windows bits out of directory_exists test.

Bug: http://b/30481559
Bug: https://code.google.com/p/android/issues/detail?id=214633
Change-Id: I8f20b3cd5aef6a77c2b4f194b914b4295397d73f
db_utils_test.cpp
fb2df9be5340fe01ac025dc6fc378926485b4a48 28-Jul-2016 Felipe Leme <felipeal@google.com> Removed extra \\'pulling file\\' message. am: f7c38b4c03
am: c25802879d

Change-Id: I4f6fd72916a55ce13fdd042cd59a52510a14d9ce
f7c38b4c03d75c9cb27610acab96f4e7f4169de8 28-Jul-2016 Felipe Leme <felipeal@google.com> Removed extra 'pulling file' message.

Taking a zip bugreport has 2 phases: generating the bugreport and
pulling the file.

Initially adb was printing 2 messages, but since the latter is almost
instantaneously, it could be confusing to have 2 lines...

Fixes: 30451250
Change-Id: I1c6cc6163492c1fb6064667dfdb7aaf6ed4c4c6f
ugreport.cpp
ugreport.h
ugreport_test.cpp
c3519d1d99110e1e19203c003e5ded275df5703e 27-Jul-2016 Felipe Leme <felipeal@google.com> Show bugreport progress.
am: cd42d658b2

Change-Id: Ia413cfcb9cf2cfb55c606ce92492027cc5191988
8123240126e855a39d3d77a0f8c1dbb370c683e8 27-Jul-2016 Felipe Leme <felipeal@google.com> Refactored functions that copy sdout and stderr to strings to use a callback.
am: 07ac8554b4

Change-Id: Ia98cd1f03e6d5fdf88297211f263835243790068
5c01124f378d8a4ae4c0e3f6858bb00ca8b7b46f 27-Jul-2016 Felipe Leme <felipeal@google.com> Split bugreport() into its own file and added unit tests.
am: 78e0963e4b

Change-Id: I0ae6ba38b62f714895e8d9abb5b36c5d8a82c6f2
cd42d658b2d08ace81b5ae3b108acbaca1a1d439 26-Jul-2016 Felipe Leme <felipeal@google.com> Show bugreport progress.

adb calls bugreportz to generate a bugreport; initially, bugreportz
would only report the final status of the operation (OK or FAIL), but
now it sends intermediate PROGRESS lines reporting its progress (in the
form of current/max).

Similarly, the initial implementation of 'adb bugreport <zip_file>'
would print an initial 'please wait' message and wait for the full
stdout before parsing the result, but now it uses a new callback class
to handle the stdout as it is generated by bugreportz.

BUG: 28609499

Change-Id: I6644fc39a686279e1635f946a47f3847b547d1c1
ndroid.mk
ugreport.cpp
ugreport.h
ugreport_test.cpp
07ac8554b477dc81579a5e63a2fbabc740fa8a92 26-Jul-2016 Felipe Leme <felipeal@google.com> Refactored functions that copy sdout and stderr to strings to use a callback.

BUG: 28609499

Change-Id: I04aea346e18678ea00797f7f659480edba4436c2
ugreport.cpp
ugreport.h
ugreport_test.cpp
ommandline.cpp
ommandline.h
78e0963e4bce9cc9f0bbf0b686004ba15b1e3929 20-Jul-2016 Felipe Leme <felipeal@google.com> Split bugreport() into its own file and added unit tests.

bugreport() will be soon refactored to track progress, which will
require more comprehensive unit tests.

As such, it's better to move it to its own files, which in turn also
requires moving send_shell_command() and usage() to commandline.h.

Fixes: 30100363
Bug: 30268737

Change-Id: I3cdf114a0b5547293320042ff0749a60886440b0
ndroid.mk
db.h
db_client.h
ugreport.cpp
ugreport.h
ugreport_test.cpp
lient/main.cpp
ommandline.cpp
ommandline.h
4af32c615a8fb7fcbbbaedc4312d4b9a2a5efb27 22-Jul-2016 Todd Kennedy <toddke@google.com> use \'cmd\' command for install-multiple
am: 7549a460b1

Change-Id: Ie156783ef10ca96652febc262c137ba25d7a4838
7549a460b1c57bb73909a83c53b0de2b8883dee7 21-Jul-2016 Todd Kennedy <toddke@google.com> use 'cmd' command for install-multiple

adb install-multiple makes a minimum of 3 calls to the 'pm' command. This
causes at least 3 separate "pm" processes to be spun up. Instead, use the
'cmd' command which runs in the existing system_server process.

Bug: 27483932
Change-Id: Ia1bed405c3d7e675a1a56ff82c692aaa94388a5c
(cherry picked from commit 4838ae1ab52a6364e74c8607206f0a9ea302c80e)
ommandline.cpp
dae8d5407361774e3e7867d57320596a4b3dd043 18-Jul-2016 Jorge Lucangeli Obes <jorgelo@google.com> Merge \\\"Use arraysize() for supplementary groups.\\\" am: ddbcecec3a am: 3ab30ecf4c
am: c2999fb33b

Change-Id: I604790f5634628df7168985d14f6e8f03aefac61
3ab30ecf4ce502b4fe9430a92d125358e2bdc871 18-Jul-2016 Jorge Lucangeli Obes <jorgelo@google.com> Merge \"Use arraysize() for supplementary groups.\"
am: ddbcecec3a

Change-Id: Ia8405d8bc181b1cdbf1f0812c0dbe8f7701747ef
bae15b4f46e2848b43b32a85f346ad2a3163240c 18-Jul-2016 Jorge Lucangeli Obes <jorgelo@google.com> Use arraysize() for supplementary groups.

Also make adbd use ScopedMinijail.

Bug: 30191189
Change-Id: I5e259aa466817b51037912aba043ba75bd35f9e1
aemon/main.cpp
2d54ec0f3117c41ec496355b122f1129428d687c 15-Jul-2016 Christopher Tate <ctate@google.com> Merge \"Ensure the target sees a proper EOD marker during restore\" into nyc-mr1-dev
am: 3fed75d404

Change-Id: I9433bd557be8913939a1441fef1357e34e2b98ed
2bcdda8e5dfdb33409fce062fdfd9d0735432ef8 06-Jul-2016 Christopher Tate <ctate@google.com> Ensure the target sees a proper EOD marker during restore

Malformed or corrupt archives may be missing their in-band EOD
content, so make sure that the target sees one regardless rather
than continuing to block on read, expecting in-band signaling.

Bug 28056941

Change-Id: Ic39966d3448787a8c511783d39172032ed9589c3
ommandline.cpp
7191a56e96a114d142b0bfadf3f127f17c6180a3 29-Jun-2016 Elliott Hughes <enh@google.com> Merge \"Remove unnecessary ARRAY_SIZE macros.\"
am: c37d8ea22a

Change-Id: Id3443d7247e893ee549ae5b799a8f0bf42088d35
749ae2d32f81301a2f998cf09d7a7d67aefd4104 28-Jun-2016 Elliott Hughes <enh@google.com> Remove unnecessary ARRAY_SIZE macros.

Use the canonical one instead.

Change-Id: Id80f19455f37fd2a29d9ec4191c1a0af80c5c0e7
db.cpp
a4e35be4a44331f22582593d7934620a9422b534 24-Jun-2016 Josh Gao <jmgao@google.com> Merge \"adb: refactor jdwp_service.cpp.\"
am: 71d11ade9d

Change-Id: If7940e3a0b3a457d9be29dfb6c0707dbe8961397
71d11ade9d3ffc48dbed965c74986012b05accf3 24-Jun-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: refactor jdwp_service.cpp."
05f889dd4e6200e3d49d985a774d2f044dc9619e 24-Jun-2016 Josh Gao <jmgao@google.com> Merge \"adb: add test for SIGHUP behavior.\"
am: a355dd6110

Change-Id: Ib786fefd55a2a4533bf66dc1e47f88e398beb8e1
fe50bb713bdd281dfc92b8bb826cebd088d46dff 23-Jun-2016 Josh Gao <jmgao@google.com> adb: add test for SIGHUP behavior.

This keeps regressing, so add a test to keep this from happening.

Bug: http://b/23603716
Bug: http://b/25965770
Bug: http://b/29565233
Test: Ran test with/without commit cd5d737, fails before, passes after
Change-Id: I8c431e10fc76da5a9fd404dd70f17bb8a8df24e6
est_device.py
79a69f0bd71c0c5f14bc337b83aedd067fa02c30 23-Jun-2016 Josh Gao <jmgao@google.com> Merge changes Ia59c6dbe,I13b17bcd
am: 0b47d08303

Change-Id: Ica4c5de30e12f6950f0a9f3a2dc94213ef2fe70a
e31a7a4ce4a294e6ceafc30efd964dea35366131 23-Jun-2016 Josh Gao <jmgao@google.com> adb: fix fd leak when shell fails to create a thread.

Bug: http://b/29565233
Change-Id: Ia59c6dbe5ac033425c11739579e85cbcad1170d1
hell_service.cpp
cd5d7376dceb14b5bb5d84540192b63b3c86b4d3 23-Jun-2016 Josh Gao <jmgao@google.com> adb: don't dup local socket fd.

SIGHUP handling depends on the local socket fd being fully closed in
order to trigger an event on its counterpart. Release the local socket
fd inside of Subprocess when returning it to ensure this.

Functionally, a cherry-pick of internal commit 42afe20.

Bug: http://b/29565233
Change-Id: I13b17bcddf0b396a5f4880f9e410fbbf24d9370d
hell_service.cpp
42afe2033fddc7c43ccfeb5f20defe992d0bc1a2 23-Jun-2016 Josh Gao <jmgao@google.com> adb: don't dup local socket fd.

SIGHUP handling depends on the local socket fd being fully closed in
order to trigger an event on its counterpart. Release the local socket
fd inside of Subprocess when returning it to ensure this.

Bug: http://b/29565233
Change-Id: I13b17bcddf0b396a5f4880f9e410fbbf24d9370d
hell_service.cpp
a81117b8f98f68456daf9d49783684e98c3bf74f 22-Jun-2016 Elliott Hughes <enh@google.com> Merge \"Address old review comments in adb_auth_host.cpp.\"
am: 57bbedc036

Change-Id: I0ab20c9258d42e6b0b847e8eb69382005f086706
57bbedc036e298878f7a3af57492123393879e0e 22-Jun-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Address old review comments in adb_auth_host.cpp."
625faf019648255ba1133a67ad1fa844b6de79ec 22-Jun-2016 Elliott Hughes <enh@google.com> Address old review comments in adb_auth_host.cpp.

Comments from:
https://android-review.googlesource.com/#/c/212781/4/adb/adb_auth_host.cpp@107

Bug: http://b/28152031
Change-Id: I27d062f3eeb8db90f94b1b4f5d7204000a7ac73d
Test: manually removed ~/.android/adb* and checked they were recreated correctly.
db_auth_host.cpp
1c01bae82aaa459a469318386a5c9da1fe57dc3d 21-Jun-2016 David 'Digit' Turner <digit@google.com> Merge \"[qemu]: Move qemu_pipe.h from include/system/ directory.\"
am: 44b7339aa2

Change-Id: I59b9a896058dea76f69b9ba757890d4a42952a66
44b7339aa207e212dd10b0991488d77665b50df0 21-Jun-2016 David Turner <digit@google.com> Merge "[qemu]: Move qemu_pipe.h from include/system/ directory."
69d2f9819785775c86137f5ff3298cd46b14a516 23-Mar-2016 Josh Gao <jmgao@google.com> adb: fix fd double close, Subprocess lifetime issue.

This commit fixes two somewhat related issues in shell_service.

- The fd returned by StartSubprocess is owned by a unique_fd
contained in the Subprocess object, but also gets closed by the
caller. Resolve this by duping the returned file descriptor.

- A Subprocess object can be destroyed immediately after its initial
construction in StartSubprocess if we're sufficiently unlucky.
Split up the fork/exec and "start management thread" steps, so that
we can safely do everything we need to do on the Subprocess before
handing it over to the thread that'll eventually destroy it.

Also includes squashed patches from AOSP master that allow for use of
unique_fd inside adb.

Bug: http://b/29254462
Change-Id: Id9cf0b7e7a7293bee7176919edc758597691c636
(cherry picked from commit c0e6e40cc916747a0a22c2538874348cda0ef607)
(cherry picked from commit 54c72aaccc45edf4832cfdc5053d9ae6acc9bcdf)
(cherry picked from commit 2c5d1d7cd914ec8ebf76c8a59d0889ebf5b538cd)
(cherry picked from commit 2a7b86337f7b149887588e4df532272abe3e931c)
(cherry picked from commit 13ea01db451b3993d175110a3336a58482be883d)
(cherry picked from commit 344778da411ebb47966961f3a70ca0848425194f)
db_utils.h
hell_service.cpp
ysdeps.h
88347e1430191ab7dd4f82afe13ef58a63c5c421 20-Jun-2016 Josh Gao <jmgao@google.com> Merge changes from topic \'debuggerd_client\'
am: abf88685e3

Change-Id: I2a61e4e8b5ec5a4ab6566ab4f8eb31653255fbc5
34c6ca01ff7f4750c5865923e2d4d0a2fd33a15a 20-Jun-2016 Josh Gao <jmgao@google.com> Merge \"adb: fix fd double close, Subprocess lifetime issue.\"
am: b23e5729a8

Change-Id: I96db140e4316b767fb632307a435bc3e22cbfb36
abf88685e3aba6725ceef9273605548555b5e05f 20-Jun-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge changes from topic 'debuggerd_client'

* changes:
adb: use libdebuggerd_client.
debuggerd: add libdebuggerd_client.
344778da411ebb47966961f3a70ca0848425194f 17-Jun-2016 Josh Gao <jmgao@google.com> adb: fix fd double close, Subprocess lifetime issue.

This commit fixes two somewhat related issues in shell_service.

- The fd returned by StartSubprocess is owned by a unique_fd
contained in the Subprocess object, but also gets closed by the
caller. Resolve this by duping the returned file descriptor.

- A Subprocess object can be destroyed immediately after its initial
construction in StartSubprocess if we're sufficiently unlucky.
Split up the fork/exec and "start management thread" steps, so that
we can safely do everything we need to do on the Subprocess before
handing it over to the thread that'll eventually destroy it.

Bug: http://b/29254462
Change-Id: Id9cf0b7e7a7293bee7176919edc758597691c636
hell_service.cpp
809607ae288350ec20ef0dc1bb7f722b312038ef 16-Jun-2016 Josh Gao <jmgao@google.com> adb: use libdebuggerd_client.

Bug: http://b/24414818
Change-Id: I177708877488e5c4f99c453498485a2daa9b79b0
ndroid.mk
aemon/main.cpp
c7b098ceb528afc62b1545377201e45f5d37f974 16-Jun-2016 David 'Digit' Turner <digit@google.com> [qemu]: Move qemu_pipe.h from include/system/ directory.

The <hardware/qemu_pipe.h> header isn't related to any loadable
hardware module, this patch thus relocates it to <system/qemu_pipe.h>
which is a much more logical location.

Note the following changes:

- The pipe name must begin with the 'pipe:' prefix to avoid an
un-necessary snprintf() and buffer copy.

- Does not probe for the obsolete /dev/goldfish_pipe device, i.e.
only use /dev/qemu_pipe instead.

- Use QEMU_PIPE_DEBUG() instead of D() as the debugging macro.

+ Update ADB to use the newest <system/qemu_pipe.h>

+ Add qemu_pipe_frame_send() and qemu_pipe_frame_recv() utility
functions which replace the obsolete qemud_channel_send() and
qemud_channel_recv() from the defunct <hardware/qemud.h>
header.

BUG=25875346

Change-Id: Ic290a5b79d466c2af64b49bd9134643277c11bfd
ransport_local.cpp
ba7aea829b6a7196eb62effc3bc558c413b61dc7 17-Jun-2016 Josh Gao <jmgao@google.com> Merge \"adb: make adb root not wait-for-device.\"
am: 81e59ca5a7

Change-Id: I231ad44c7b6293256f33eb3fd617b4e5da728ca1
81e59ca5a7612706a154b528e7b3bc055f5be231 17-Jun-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: make adb root not wait-for-device."
05824734ace954da0d2fabcd9862fd9f88813f29 16-Jun-2016 Josh Gao <jmgao@google.com> adb: make adb root not wait-for-device.

`adb root` would hang for devices connected over TCP/IP, because they
never come back. Unfortunately, there doesn't seem to be an easy way to
find out what we're talking to, so replace it with a long sleep for now.

Bug: http://b/27836058
Change-Id: Icd6e6bf817ca9e2124c2961665c37b2f31f7ef29
ommandline.cpp
c63439ae7fab952228b68a10a08eb762f0d22ccc 16-Jun-2016 Elliott Hughes <enh@google.com> Merge \"Better diagnostics from \"adb sideload\".\"
am: edd401e24e

Change-Id: I36b23f7533bbd4d6d9d9e171c297155846734a63
edd401e24ef5c965360157fc0157193112565a98 16-Jun-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Better diagnostics from "adb sideload"."
b94f3c597cd657267a6431463bfd6c58010cb516 16-Jun-2016 Elliott Hughes <enh@google.com> Merge \"Minor adb style fixes.\"
am: 35151f49ca

Change-Id: I84187cdafe76026ac58d90f4510979cff4e2afe5
14415142c99223a98a539ec296f6de3f5d51e59f 15-Jun-2016 Elliott Hughes <enh@google.com> Better diagnostics from "adb sideload".

Well, slightly less bad diagnostics, anyway.

Change-Id: Idf5612f7dcb9bdbd7252163889e2612ba197426d
ommandline.cpp
ffc73a39fd813c8823ca0e4cdc52b79521ce84da 15-Jun-2016 Elliott Hughes <enh@google.com> Minor adb style fixes.

Change-Id: Ic4b45828dfdf88ef6c0fc468f66df3e62d2fbe51
db.cpp
ockets.cpp
e691def5dfef8d524b27561940bee2f0ec3d6a66 14-Jun-2016 Elliott Hughes <enh@google.com> Merge \\"Fix the sense of a test in \\"adb sideload\\".\\" am: 62cc17de8c
am: e9dfa4f753

Change-Id: If5dbbcaa7452b17b3e383daf7bbfc037108c10a3
356fd364adb98548ca4c285896e98559fdf549f9 14-Jun-2016 Elliott Hughes <enh@google.com> Fix the sense of a test in "adb sideload".

Change-Id: I516a2ad2d74d9322ff9eb2e4cd3c3829e5cbda99
ommandline.cpp
e1d64b4eaf5ed1ffa060e3cfa06dd00264005211 09-Jun-2016 Felipe Leme <felipeal@google.com> Merge \"Redirect bugreport stderr to host\'s stderr.\" into nyc-dev
am: 6d349051ce

Change-Id: I7ed56de80ff6ac698fb62820f24fca940d7c0905
6d349051ce3fb932fa39a4ccb3afd2f633b3f5f6 09-Jun-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Redirect bugreport stderr to host's stderr." into nyc-dev
d1dd125bc2438baf596ddbead5708af57c620465 07-Jun-2016 Felipe Leme <felipeal@google.com> Redirect bugreport stderr to host's stderr.

Change-Id: I46f474f0b0d5cacdc4b129eab1bb0a7f52ccece0
Fixes: 29161586
ommandline.cpp
e4e6864e72c0502849da3778ac8a2b139d15853b 08-Jun-2016 Elliott Hughes <enh@google.com> Merge \\"Set file capabilities on adb sync/push.\\" am: a500cf9cdf
am: 4e4a274e96

Change-Id: Ife5e12dcbf019d740ac642adf25aec75c006b2c8
a500cf9cdfc44f00b79412d21c57f4230018e8ae 08-Jun-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Set file capabilities on adb sync/push."
32c60b4ced8ca0d0eaa3e32f04436a7246ad18f8 08-Jun-2016 Elliott Hughes <enh@google.com> Set file capabilities on adb sync/push.

Bug: http://b/29180022
Change-Id: Ia21ebf0972af41b0a3becc1189ed836fd74ae5c8
ile_sync_service.cpp
75f42d7ea7affec9235c43ad3c3bb4126371ddcd 07-Jun-2016 Elliott Hughes <enh@google.com> Allow multiple (sequential) adb users on Linux.

Before this, adb will fail to start for the second user who tries because
/tmp/adb.log already exists and isn't writable by the second user.

Also allow $TMPDIR to override the use of /tmp.

Bug: http://b/29201686
Bug: https://code.google.com/p/android/issues/detail?id=211420

(cherry picked from commit d89a6c2285b64320918b25b1c818da24dd4d02b4)

Change-Id: Ibb1369e8043feb9774593e317dcd7bb93323fd89
lient/main.cpp
fff3e526175404925a322f38da845265f45d43e5 08-Jun-2016 Elliott Hughes <enh@google.com> Merge \\"Allow multiple (sequential) adb users on Linux.\\" am: 6bf8d26c82
am: b227e61c41

Change-Id: Ibed97f2d5ac4ae9c307871cc516a81c2eb761bcd
d89a6c2285b64320918b25b1c818da24dd4d02b4 07-Jun-2016 Elliott Hughes <enh@google.com> Allow multiple (sequential) adb users on Linux.

Before this, adb will fail to start for the second user who tries because
/tmp/adb.log already exists and isn't writable by the second user.

Also allow $TMPDIR to override the use of /tmp.

Bug: https://code.google.com/p/android/issues/detail?id=211420
Change-Id: Ic53da981ac0fa45bfed62e7b351d75dca0540235
lient/main.cpp
27a68ef007734929a6cfb46c233c5b1757f7786c 06-Jun-2016 David Pursell <dpursell@google.com> Merge "adbd: properly close subprocess pipes on Ctrl+C." am: 605628d325
am: 5701c58296

* commit '5701c58296b7ae84e8b9e67b6103ffdf63550fc7':
adbd: properly close subprocess pipes on Ctrl+C.

Change-Id: I361b9ed8ce1d12487d88850635bf1b60c1b675c4
a6d56611404f2e1c0c9f4ab7c8471af0e80b2026 06-Jun-2016 David Pursell <dpursell@google.com> adbd: properly close subprocess pipes on Ctrl+C.

When non-interactive sessions exit via Ctrl+C, adbd sends SIGHUP
to the child process to let it know to exit. However, adbd was not
closing the pipes to the child process, so if the subprocess ignored
SIGHUP and continued writing it could fill up the pipe and block
forever while adbd waits for it to exit.

This CL adds the necessary calls to close the subprocess pipe after
sending SIGHUP.

Bug: 28981563
Change-Id: I318e322e563241052648361172f4859c297837fb
(cherry picked from commit f2aa186c7b0792ef4d3e106e2a03be5c3c215118)
hell_service.cpp
f2aa186c7b0792ef4d3e106e2a03be5c3c215118 06-Jun-2016 David Pursell <dpursell@google.com> adbd: properly close subprocess pipes on Ctrl+C.

When non-interactive sessions exit via Ctrl+C, adbd sends SIGHUP
to the child process to let it know to exit. However, adbd was not
closing the pipes to the child process, so if the subprocess ignored
SIGHUP and continued writing it could fill up the pipe and block
forever while adbd waits for it to exit.

This CL adds the necessary calls to close the subprocess pipe after
sending SIGHUP.

Bug: 28981563
Change-Id: I318e322e563241052648361172f4859c297837fb
hell_service.cpp
8edfe2040b4c612915bc2cbf1a6db321f586f9fc 03-Jun-2016 Siqi Lin <siqilin@google.com> Revert "adb: close ep0 on disconnection."
am: 8c4076295e

* commit '8c4076295ebd867d276636d673b9f8e6a8df01a6':
Revert "adb: close ep0 on disconnection."

Change-Id: I74112ef3f508016238a3eb1224292aa4d77334d5
8c4076295ebd867d276636d673b9f8e6a8df01a6 26-May-2016 Siqi Lin <siqilin@google.com> Revert "adb: close ep0 on disconnection."

This reverts commit 69e97e4bee9ee43ef55d1bb205bc4ca065d089bc.

Bug: 28932120
Change-Id: I5e2569abed316c089886556c432bfe59bca08549
(cherry picked from commit 57de0514f0aeabe092ce3a122402721c93a70a2c)
sb_linux_client.cpp
52338a3f9364847b0b469e8e6d951a90cc9bb875 14-May-2016 Josh Gao <jmgao@google.com> adb: refactor jdwp_service.cpp.

Refactor jdwp_service.cpp to be more idiomatic C++.

Bug: http://b/28347842
Change-Id: I8c463069fe489819cb7c248f4aff2689877bfe45
dwp_service.cpp
8d96370fb2e13afc53d00f64822065b9da257110 28-May-2016 Elliott Hughes <enh@google.com> Merge "Kill adb\'s ScopedFd for unique_fd." am: 0f3fde210d
am: b8901de2ad

* commit 'b8901de2adca421ad10d91cdfd35851f0473464a':
Kill adb's ScopedFd for unique_fd.

Change-Id: Idb0559a08423b9985058866ba906580353e5a7e5
2ce86e527b9593b97d14b9f07aa85b60000564a2 28-May-2016 Elliott Hughes <enh@google.com> Kill adb's ScopedFd for unique_fd.

It's the adb unique_fd, but at least it's the same API...

Change-Id: If5d6642457e145c450374fde6f1358e5ac386a96
db_utils.h
hell_service.cpp
500c7e5bc7f9288631fe1ed575f6633027c5edf8 28-May-2016 Elliott Hughes <enh@google.com> Merge "Kill load_file." am: b42e4a6b63
am: 198a727891

* commit '198a727891aef33469d82b263fc222e4f4335b1b':
Kill load_file.

Change-Id: I81d715153b8b882ace9deb073abfc4dde5535811
e8b663fec3acfefbef6396a23c6f48d66e1f19fc 27-May-2016 Elliott Hughes <enh@google.com> Kill load_file.

Change-Id: I6c332f7d8e94d513605295b3d4d32c4e1cf878dc
db_auth.cpp
db_auth.h
db_auth_host.cpp
db_utils.h
ommandline.cpp
ysdeps.h
ysdeps_win32.cpp
dace01526996ee221796c4627a615d393eee205b 26-May-2016 Yurii Zubrytskyi <zyy@google.com> [adb] Followup CL to clean up adb_auth_host.cpp

Get rid of unused includes + replace a fixed-size buffer with an
std::string

(cherry-pick of 049ebb810f466d916ec9e73cdf28624b57a8c25d.)

Change-Id: I4f9927b900a79a012b5d52908b9d22ac3d2a401c
db_auth_host.cpp
376b27532cba70545f63d7e5d32da876a636ac0d 26-May-2016 Yurii Zubrytskyi <zyy@google.com> [adb] Issue the "auth" emulator command before any other one

Emulator console now requires authentication; this means
'adb emu ...' commands silently fail because of it.
This CL adds an 'auth <token>' command to each user command,
making sure it won't be silently ignored.

(cherry-pick of a9e2b99a7fdd31bcd6d852c6db26fe592236a24f.)

Bug: https://code.google.com/p/android/issues/detail?id=211233
Change-Id: Id9ca4999fd2e6393cc88278eaf444243e13c0ec0
db_auth_host.cpp
db_utils.cpp
db_utils.h
onsole.cpp
1098c529d1dd41a03f6ca75bc1776e13b448f46b 27-May-2016 Yurii Zubrytskyi <zyy@google.com> [adb] Followup CL to clean up adb_auth_host.cpp
am: 049ebb810f

* commit '049ebb810f466d916ec9e73cdf28624b57a8c25d':
[adb] Followup CL to clean up adb_auth_host.cpp

Change-Id: I6e7d1a1e0fe58648f3a3bf12aef6507f990de123
f48adf63512f1d5a4dbe40ce37e5946b434e8be9 27-May-2016 Yurii Zubrytskyi <zyy@google.com> resolve merge conflicts of a9e2b99 to nyc-dev-plus-aosp

Change-Id: Ic77afb008f68ebc455d3a788119b669a52a254dc
049ebb810f466d916ec9e73cdf28624b57a8c25d 26-May-2016 Yurii Zubrytskyi <zyy@google.com> [adb] Followup CL to clean up adb_auth_host.cpp

Get rid of unused includes + replace a fixed-size buffer with an
std::string

Change-Id: I4f9927b900a79a012b5d52908b9d22ac3d2a401c
db_auth_host.cpp
a9e2b99a7fdd31bcd6d852c6db26fe592236a24f 26-May-2016 Yurii Zubrytskyi <zyy@google.com> [adb] Issue the "auth" emulator command before any other one

Emulator console now requires authentication; this means
'adb emu ...' commands silently fail because of it.
This CL adds an 'auth <token>' command to each user command,
making sure it won't be silently ignored.

Bug: https://code.google.com/p/android/issues/detail?id=211233
Change-Id: Id9ca4999fd2e6393cc88278eaf444243e13c0ec0
db_auth_host.cpp
db_utils.cpp
db_utils.h
onsole.cpp
16dad488b362d3812f9d67b4b751ba6cde22590d 26-May-2016 Yabin Cui <yabinc@google.com> Merge "adb: retry connecting disconnected emulators instead of always looping." am: 50e91fec0e
am: cfb0c5cd91

* commit 'cfb0c5cd913b689c8f9d0d930c92c6a0804e2995':
adb: retry connecting disconnected emulators instead of always looping.

Change-Id: I4b7f30bd3738ce53eb343e5d0e20f3d20faf7e2a
50e91fec0e33b92e7991622ac1e8be8817208692 26-May-2016 Yabin Cui <yabinc@google.com> Merge "adb: retry connecting disconnected emulators instead of always looping."
b74c6498aa2be70d591c900bda9ab7712c682a63 30-Apr-2016 Yabin Cui <yabinc@google.com> adb: retry connecting disconnected emulators instead of always looping.

Previously we loop through local ports every second, this patch improves
the strategy by retrying only just disconnected emulators.

Bug: 26468076
Bug: 19974213
Bug: 22920867

Change-Id: I43ccb746922d104202b0f81a3d163d850bbc890e
db.h
ysdeps/condition_variable.h
ysdeps/mutex.h
ysdeps_test.cpp
ransport.cpp
ransport.h
ransport_local.cpp
8fc9d258415cf1eec2bfb5d4a5ef8168d28c22ef 24-May-2016 Yabin Cui <yabinc@google.com> Merge "adb: close ep0 on disconnection." into nyc-dev
am: fcab9a8507

* commit 'fcab9a85076c83e5b6808935db0f89e4f10dda87':
adb: close ep0 on disconnection.

Change-Id: I2597ec4471378b341ef92b6aa0362511e09ac3ac
638420ef31b06dbf90956bafcabf1a49a8fd9563 27-Apr-2016 Yabin Cui <yabinc@google.com> adb: close ep0 on disconnection.

adbd on device kicks the usb connection when usb IO fails. But to notify
adb on host to reconnect it, adbd needs to close ep0 to reset the usb
connection. Otherwise, adb on host cann't connect the device unless the
usb cable is reconnected or adb host server is restarted.

This can be tested by using `adb reconnect device` command.

Bug: 25935458

Change-Id: I80979d6029e60b9cfd218f7b9b5201810238ec07
(cherry picked from commit 69e97e4bee9ee43ef55d1bb205bc4ca065d089bc)
sb_linux_client.cpp
fcab9a85076c83e5b6808935db0f89e4f10dda87 24-May-2016 Yabin Cui <yabinc@google.com> Merge "adb: close ep0 on disconnection." into nyc-dev
bb89e7e6b5403297689f62b8f86d7a3cbab4037e 21-May-2016 Yabin Cui <yabinc@google.com> Merge "adb: check return value of register_socket_transport." am: 3d981c87c9
am: 1a78ec8f65

* commit '1a78ec8f6525e7101cb8f7d75f42955bbdbbd98e':
adb: check return value of register_socket_transport.

Change-Id: I94be64825d5908d52d930125808f431fd6b96503
3d981c87c929ec4946ce53d2aaa3503c86886eb1 21-May-2016 Yabin Cui <yabinc@google.com> Merge "adb: check return value of register_socket_transport."
014b01706cc64dc9c2ad94a96f62e07c058d0b5d 18-May-2016 Josh Gao <jmgao@google.com> adb: use asocket's close function when closing.

close_all_sockets was assuming that all registered local sockets used
local_socket_close as their close function. However, this is not true
for JDWP sockets.

Bug: http://b/28347842
Change-Id: I40a1174845cd33f15f30ce70828a7081cd5a087e
(cherry picked from commit 53eb31d87cb84a4212f4850bf745646e1fb12814)
ockets.cpp
268068f25673242d1d5130d96202d3288c91b700 18-May-2016 Josh Gao <jmgao@google.com> adb: switch the socket list mutex to a recursive_mutex.

sockets.cpp was branching on whether a socket close function was
local_socket_close in order to avoid a potential deadlock if the socket
list lock was held while closing a peer socket.

Bug: http://b/28347842
Change-Id: I5e56f17fa54275284787f0f1dc150d1960256ab3
(cherry picked from commit 9b587dec6d0a57c8fe1083c1c543fbeb163d65fa)
utex_list.h
ockets.cpp
63760409ad833cf803482e098367f49741b5f6d3 18-May-2016 Josh Gao <jmgao@google.com> adb: clang-format sockets.cpp.

Bug: http://b/28347842
Change-Id: Ie3748b6c803d4e8056e9d7abd065a8b99d945a5b
(cherry picked from commit 52bd8526aaaf10511177fb42c55c26bc722b0833)
ockets.cpp
6e106990cf20ab15768365e23ae49db37aff05b7 18-May-2016 Josh Gao <jmgao@google.com> adb: add implementations of mutex, recursive_mutex.

Our version of mingw doesn't support std::mutex or
std::recursive_mutex, so implement our own using the Windows primitives.

Bug: http://b/28347842
Change-Id: I4e1d56a89bc5fcb5f859bf5014343697a4a85b77
(cherry picked from commit 903b749f7883394213933f733b902e104ce6dda7)
ysdeps/mutex.h
ysdeps_test.cpp
a41a0c2acc4cebfd8d47522fe57756d7f90e49e1 19-May-2016 Josh Gao <jmgao@google.com> Merge "adb: use asocket\'s close function when closing." am: 684d543922
am: 43c058e51a

* commit '43c058e51a652874cfdf0c687ba1dee18f13f993':
adb: use asocket's close function when closing.

Change-Id: I0681ff8c31c2f221e246a86857fbff779d2b7dcf
684d543922465538dd233c99c0cf492f1f24233c 19-May-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: use asocket's close function when closing."
dccd3a3698f46a16a551c5ae8e6550879492d5e6 19-May-2016 Chih-Hung Hsieh <chh@google.com> Merge "Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace." am: dab7d9de03
am: fa7569c921

* commit 'fa7569c921b9ca0db894287ea826cbd3b041d880':
Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace.

Change-Id: I63223e36f3627d312051c86d54919b6cef33766c
dab7d9de03369feeb099be6c8f7748df3f466bd3 19-May-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace."
ebb08fb9a6653a35823bf26ca3ec6af3d0b81dca 19-May-2016 Josh Gao <jmgao@google.com> Merge changes I5e56f17f,Ie3748b6c,I4e1d56a8 am: cea14958d2
am: 71c062f40a

* commit '71c062f40ac9ac5175f55bce03ce0cb8eb540710':
adb: switch the socket list mutex to a recursive_mutex.
adb: clang-format sockets.cpp.
adb: add implementations of mutex, recursive_mutex.

Change-Id: Icd8a74f1052f7b4c4616ddf23b65c7208195202c
67867dbd79a0cbc9b603b23ac460f9f58ea14d1e 19-May-2016 Chih-Hung Hsieh <chh@google.com> Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace.

Bug: 28705665
Change-Id: I469b2a882f6d1f399bfc22c75a26da245991fc33
db_trace.h
53eb31d87cb84a4212f4850bf745646e1fb12814 18-May-2016 Josh Gao <jmgao@google.com> adb: use asocket's close function when closing.

close_all_sockets was assuming that all registered local sockets used
local_socket_close as their close function. However, this is not true
for JDWP sockets.

Bug: http://b/28347842
Change-Id: I40a1174845cd33f15f30ce70828a7081cd5a087e
ockets.cpp
9b587dec6d0a57c8fe1083c1c543fbeb163d65fa 18-May-2016 Josh Gao <jmgao@google.com> adb: switch the socket list mutex to a recursive_mutex.

sockets.cpp was branching on whether a socket close function was
local_socket_close in order to avoid a potential deadlock if the socket
list lock was held while closing a peer socket.

Bug: http://b/28347842
Change-Id: I5e56f17fa54275284787f0f1dc150d1960256ab3
utex_list.h
ockets.cpp
52bd8526aaaf10511177fb42c55c26bc722b0833 18-May-2016 Josh Gao <jmgao@google.com> adb: clang-format sockets.cpp.

Bug: http://b/28347842
Change-Id: Ie3748b6c803d4e8056e9d7abd065a8b99d945a5b
ockets.cpp
903b749f7883394213933f733b902e104ce6dda7 18-May-2016 Josh Gao <jmgao@google.com> adb: add implementations of mutex, recursive_mutex.

Our version of mingw doesn't support std::mutex or
std::recursive_mutex, so implement our own using the Windows primitives.

Bug: http://b/28347842
Change-Id: I4e1d56a89bc5fcb5f859bf5014343697a4a85b77
ysdeps/mutex.h
ysdeps_test.cpp
666d9aa507a8118a54146f08c6a4dad02773868d 18-May-2016 Josh Gao <jmgao@google.com> Merge "adb: replace failing exits in adbd with abort()." am: eb62619ff9
am: 4e1149bb15

* commit '4e1149bb152829a016873bbc7795646b5ff5f384':
adb: replace failing exits in adbd with abort().

Change-Id: I78b30130181d09a7755a48c6b769e33def622f7b
12090927692b7d63dcfca435f57fb5d350ecb3a7 18-May-2016 Josh Gao <jmgao@google.com> Merge "adb: add track-jdwp and track-devices commands." am: f8f40a1e2e
am: 32045567be

* commit '32045567be1f5af449dfa16173f16b70ae34e85b':
adb: add track-jdwp and track-devices commands.

Change-Id: I60e9899b403fa68e3037aed3a4bce498c66c6c7d
01401823fb36026cf2b605b80923ca9a44949b3f 18-May-2016 Yabin Cui <yabinc@google.com> adb: check return value of register_socket_transport.

Change-Id: I45e30861cf292323e3264a815e4ffd23d6610c52
ransport_local.cpp
8781256b19619a142b671db94eef12cbcbe59bd9 17-May-2016 Josh Gao <jmgao@google.com> Merge "adb/base: allow use of unique_fd inside adb." am: 210fdc2742
am: 881b440b7a

* commit '881b440b7a228e065d4b42ec71add07fbcb336c4':
adb/base: allow use of unique_fd inside adb.

Change-Id: Ib1c437bcc6462235b8a753fb8cdedb9ff7261e9c
4abdeee073aecd2130e82f301ceff03dbd27fd72 14-May-2016 Josh Gao <jmgao@google.com> adb: replace failing exits in adbd with abort().

This makes it possible to get a core dump from adbd when it decides to
exit.

Bug: http://b/28347842
Change-Id: I4cfe5f273f62b2c32e61232d3c39881ecdd6b582
db.cpp
hell_service.cpp
b463baf610b83f2c439748216e3985bcd6beece0 14-May-2016 Josh Gao <jmgao@google.com> adb: add track-jdwp and track-devices commands.

Expose these to the command line client to make it easier to poke
around.

Bug: http://b/28347842
Change-Id: Ia939b3a41eb8201365d50cd2996b83d884e42b64
ndroid.mk
ommandline.cpp
est_track_devices.cpp
13ea01db451b3993d175110a3336a58482be883d 13-May-2016 Josh Gao <jmgao@google.com> adb/base: allow use of unique_fd inside adb.

adb implements its own file descriptor emulation layer on Windows,
which requires the use of adb_close instead of close throughout the
codebase. Add a template argument to unique_fd that allows for this.

Bug: http://b/28347842
Change-Id: I6397261f4973d49f2f8e04257bf67b348585bb63
db_utils.h
ysdeps.h
1e57ab6f7b703848a3023d6367bff26019632588 13-May-2016 David Pursell <dpursell@google.com> Merge "adb: support forwarding TCP port 0." am: cb90562bcf
am: 5aaffac37e

* commit '5aaffac37e2b2b32e645c0c03c96a88a3133b3ae':
adb: support forwarding TCP port 0.

Change-Id: I2e7bd29de76a87b80e71ce00ed2da4666f3cbb56
eaae97e127717750b4264d9b6617b845f9bc701f 07-Apr-2016 David Pursell <dpursell@google.com> adb: support forwarding TCP port 0.

This CL adds support to forward or reverse TCP port 0 to allow the
system to automatically select an open port. The resolved port number
will be printed to stdout:
$ adb forward tcp:0 tcp:8000
12345
$ adb reverse tcp:0 tcp:9000
23456
This allows testing to be more robust by not hardcoding TCP ports which
may already be in use.

Forwarding port 0 is a host-only change and will work with any device,
but reversing port 0 requires the device to be updated with a new adbd
binary.

This CL also does a little bit of cleanup such as moving the alistener
class out of adb.h, and adds some error checking and additional tests.

Bug: 28051746
Test: python -m unittest discover
Test: adb_test
Test: `adb forward` and `adb reverse` with tcp:0
Change-Id: Icaa87346685b403ab5da7f0e6aa186aa091da572
ndroid.mk
db.cpp
db.h
db_listeners.cpp
db_listeners.h
db_listeners_test.cpp
db_utils.cpp
db_utils.h
db_utils_test.cpp
lient/main.cpp
ommandline.cpp
aemon/main.cpp
ysdeps.h
ysdeps_win32.cpp
est_device.py
2928f7df70e4b0768dd7f2bd0b2b1077d1b3d25f 06-May-2016 Josh Gao <jmgao@google.com> Merge "adb: search for a maximum of 16 emulators." into nyc-dev
am: 72e47300fb

* commit '72e47300fb2d7842509c492fcb8ee363d43ef446':
adb: search for a maximum of 16 emulators.

Change-Id: I51d01d4d1d8985c37c6cf3c4dbaa19eba49ae306
72e47300fb2d7842509c492fcb8ee363d43ef446 06-May-2016 Josh Gao <jmgao@google.com> Merge "adb: search for a maximum of 16 emulators." into nyc-dev
9fe742684c9d154c6ca9b6e035d6d380e0cc4bdf 06-May-2016 Josh Gao <jmgao@google.com> adb: search for a maximum of 16 emulators.

Android Wear has unfortunately been using port 5601 for years, which
falls into the range of ports we were previously polling for Android
emulators. Reduce the maximum number of emulators we can support so
that 5601 no longer falls within our range.

Bug: http://b/26468076
Change-Id: I931809cfa412122f4781eebe0164facab12c95f0
ransport_local.cpp
6993211d38547d7007a87cbcd006f0f19c598ff9 05-May-2016 Felipe Leme <felipeal@google.com> Merge "Display warning about bugreport delay." into nyc-dev
am: f99193b7aa

* commit 'f99193b7aa8eedb0f5be448c6df6d2688c1bfb2e':
Display warning about bugreport delay.

Change-Id: I19de3a7c8e98127322a4f8454d87e4be39c2d071
42e45c70689f5d601357fe9f768ec1de4b14b274 05-May-2016 Felipe Leme <felipeal@google.com> Display warning about bugreport delay.

BUG: 28569299
Change-Id: Ide6109fd24737cbaf6296ef7326127e85d6420cb
ommandline.cpp
d4611a9680296d0053f7fa30ebc34d195a79c77a 03-May-2016 Felipe Leme <felipeal@google.com> Automatically add a .zip to adb bugreport file when missing.
am: 644a36c209

* commit '644a36c20942029ece43ea9fbeb6163d4b706c56':
Automatically add a .zip to adb bugreport file when missing.

Change-Id: I081fbac07cba3c7e3cbfc263ed71ee4832224d9b
644a36c20942029ece43ea9fbeb6163d4b706c56 29-Apr-2016 Felipe Leme <felipeal@google.com> Automatically add a .zip to adb bugreport file when missing.

BUG: 27653204
Change-Id: Ib322f1f9eeedd8e78c9a51a845a20c462442a0fe
ommandline.cpp
fb44ca5178143c1f4417dde4e98b959b3a4c2539 30-Apr-2016 Chih-hung Hsieh <chh@google.com> Merge "Fix google-explicit-constructor warnings." am: 7bdd6a8b5a
am: 427d8d840f

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

Change-Id: I26dc45aca83f991aa7993f6d4233e0439dd44a22
1c563d96f000876d77b2d33fbfb03c241bc503e1 30-Apr-2016 Chih-Hung Hsieh <chh@google.com> Fix google-explicit-constructor warnings.

Bug: 28341362
Change-Id: I4504e98a8db31e0edcbe63c23f9af43eb13e9d86
devent.cpp
69e97e4bee9ee43ef55d1bb205bc4ca065d089bc 27-Apr-2016 Yabin Cui <yabinc@google.com> adb: close ep0 on disconnection.

adbd on device kicks the usb connection when usb IO fails. But to notify
adb on host to reconnect it, adbd needs to close ep0 to reset the usb
connection. Otherwise, adb on host cann't connect the device unless the
usb cable is reconnected or adb host server is restarted.

This can be tested by using `adb reconnect device` command.

Bug: 25935458

Change-Id: I80979d6029e60b9cfd218f7b9b5201810238ec07
sb_linux_client.cpp
9b53e4c42c595390dc0fa68a5340e0dfe59dd279 05-Apr-2016 Yabin Cui <yabinc@google.com> adb: fix adb usb operations on device.

Problem: For devices using /dev/usb-ffs/adb, Run
`while true; do adb reconnect device; sleep 1; done`. And the
device soon becomes offline. The adbd log shows that calling
adb_read(h->bulk_out) in usb_ffs_read() gets EOVERFLOW error.

Reason: When kicking a transport using usb-ffs, /dev/usb-ffs/adb/ep0
is not closed, and the device will not notify a usb connection reset
to host. So the host will continue to send unfinished packets even
if a new transport is started on device. The unfinished packets may
not have the same size as what is expected on device, so adbd on
device gets EOVERFLOW error. At the worst case, adbd has to create new
transports for each unfinished packet.

Fixes:
The direct fix is to make the usb connection reset when kicking transports,
as in https://android-review.googlesource.com/#/c/211267/1. And I think
we can make following improvements beside that.
1. Close a file that is used in other threads isn't safe. Because the file
descriptor may be reused to open other files, and other threads may operate
on the wrong file. So use dup2(dummy_fd) to replace close() in kick function,
and really close the file descriptor after the read/write threads exit.

2. Open new usb connection after usb_close() instead of after
usb_kick(). After usb_kick(), the transport may still exist and
reader/writer for the transport may be still running. But after
usb_close(), the previous transport is guaranteed to be destroyed.

Bug: 25935458
Change-Id: I1eff99662d1bf1cba66af7e7142f4c0c4d82c01b
(cherry picked from commit 005bf1e05be5de518184c376ebf88268bb191d09)
sb_linux_client.cpp
02e8b642af057ed5ad046d8d5f9eba7cd1464897 27-Apr-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: decrease the number of fds used in fd_count test." am: c296440
am: dbb3e3b

* commit 'dbb3e3ba92b090afa32808cbb504d4c653f5311c':
adb: decrease the number of fds used in fd_count test.

Change-Id: Id48542904272ac506eec121fa21cbed374b9408d
71bddf842dd015328676585db4985c5cf739112b 25-Mar-2016 Yabin Cui <yabinc@google.com> adb: use a custom thread to poll for usb devices on mac.

On mac, if the adb server kicks a transport on some error, mac usb driver
will not report a new usb device. So instead of relying on mac usb driver
to report new usb devices, this CL uses a loop to search for usb devices
not exist before. Note that this is also the behavior on windows and linux
host.
`adb reconnect` can be used to verity this CL.

Bug: 25935458
Change-Id: I890e0eb1fae173f2e7a0c962ededa294d821e015
(cherry picked from commit 48d4c0c42afc1cb77c4573ac22adb61d2f92ccd3)
ransport.cpp
sb_osx.cpp
858f133d41f3e573455c59e71a4c9867b265c558 27-Apr-2016 Josh Gao <jmgao@google.com> adb: decrease the number of fds used in fd_count test.

Default limit is 1024 fds, which means 512 socketpairs will hit the
limit.

Bug: http://b/28386497
Change-Id: Ib36404c050e4be3db51378e250f300f7ec5aab13
ysdeps_test.cpp
023dc9ab5ce6fae8f0abb0053fe971a70cbafa96 26-Apr-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "adb: fix test_device.py shell protocol checks." am: 52eb602
am: 8a77b30

* commit '8a77b300bead94a90a62dce2e53526cd2d2071ae':
adb: fix test_device.py shell protocol checks.

Change-Id: I92176c64aeabb9195b69efc2ced1b2c38a70de6c
cf46741b4fe9c9d62aa16635bee7680c853b31a8 26-Apr-2016 David Pursell <dpursell@google.com> adb: fix test_device.py shell protocol checks.

https://android-review.googlesource.com/#/c/210646/ added a
has_shell_protocol() function but the test_device.py tests were still
trying to use the now-missing SHELL_PROTOCOL_FEATURE constant.

This CL just switches test_device.py to correctly use the
has_shell_protocol() method.

Change-Id: Ie0a2f0dc07529843d25051a01e08fb677551a4e1
Test: `python -m unittest discover -v` on devices with and without
the shell protocol.
est_device.py
ba8498b41b7e3e7fda6e70221a21c1a9559fe72a 26-Apr-2016 Yabin Cui <yabinc@google.com> Merge "adb: fix socket tests." am: e998abd
am: 61f6d1d

* commit '61f6d1df52649eb9611ca908cddd55bbad3149bc':
adb: fix socket tests.

Change-Id: I686c5799014abdf00203a4c4df0b5c02b9ac7102
2407d7c3d936eb9649d2e1614f440f89bf9d5bed 26-Apr-2016 Yabin Cui <yabinc@google.com> adb: fix socket tests.

Bug: 28386497

Change-Id: I9f37ecadf3cfc6bb4e5da502d40f49e1f3a16d8a
devent_test.h
ocket_test.cpp
a28918cf30035edce887c7987a8b27033eeaa317 18-Apr-2016 Yabin Cui <yabinc@google.com> Fix kick_transport test.

Fix broken kick_transport test, and make it not access atransport
internal variables.

Bug: 25935458
Change-Id: I91b4d32a222b2f369f801bbe3903acac9c8ea4f7
(cherry picked from commit 7f27490e7f386401dc38287a67dcb8826e2260c5)
ransport.cpp
ransport.h
ransport_local.cpp
ransport_test.cpp
ransport_usb.cpp
799e80334ccecba09a9cb8138c4ae0ce29a4d1c4 25-Apr-2016 Yabin Cui <yabinc@google.com> Merge "adb: fix adb usb operations on device." am: ad2021a
am: ec4db8f

* commit 'ec4db8f14f8ecc122505f17f93ca7e34ced409b4':
adb: fix adb usb operations on device.

Change-Id: I6daa50bfdb968ef3f1371f30ee3a378630169ce7
ad2021a1b1144f8b307c11ff0a8b47fd85c3cc7a 25-Apr-2016 Yabin Cui <yabinc@google.com> Merge "adb: fix adb usb operations on device."
f9f0b5f41351990968065020a67445d20b93616c 22-Apr-2016 Zach Riggle <riggle@google.com> Merge "Fix NULL deref on exec-in with insufficient arguments" am: 245e4dbfd4
am: a0690543da

* commit 'a0690543dac2792508caef09e9e97804b31fea24':
Fix NULL deref on exec-in with insufficient arguments

Change-Id: Ic5e62d01fecc77aace676bf6cdf4218f93806860
ccafc79de7c46c53c33f38a6623f6d2d379d3d58 14-Apr-2016 Zach Riggle <riggle@google.com> Fix NULL deref on exec-in with insufficient arguments

(cherry-pick of 566a28169b84836fddd5ae96db9b147237ea054f.)

Bug: 28152091
Change-Id: Ib59e3bf7f26974aa09d2e6a0e1d9281d7ce25511
ommandline.cpp
e618f6cb367b83774274786bc28badae34a6c638 19-Apr-2016 Yabin Cui <yabinc@google.com> Merge "adb: use a custom thread to poll for usb devices on mac." am: 09c5fcf
am: 507f38f

* commit '507f38f6d7e8dcae4b513ea6c5f638ae43204245':
adb: use a custom thread to poll for usb devices on mac.

Change-Id: Idc21e33a8b0942afe0f6fa18076718d71d9d34f6
48d4c0c42afc1cb77c4573ac22adb61d2f92ccd3 25-Mar-2016 Yabin Cui <yabinc@google.com> adb: use a custom thread to poll for usb devices on mac.

On mac, if the adb server kicks a transport on some error, mac usb driver
will not report a new usb device. So instead of relying on mac usb driver
to report new usb devices, this CL uses a loop to search for usb devices
not exist before. Note that this is also the behavior on windows and linux
host.
`adb reconnect` can be used to verity this CL.

Bug: 25935458
Change-Id: I890e0eb1fae173f2e7a0c962ededa294d821e015
ransport.cpp
sb_osx.cpp
2f46a7d0ecdbff4cc8f08d2f63e855dde681cb25 19-Apr-2016 Yabin Cui <yabinc@google.com> Merge "Fix kick_transport test." am: a960864
am: 119ca23

* commit '119ca2345d97db04d4114f5031d172f3694350d4':
Fix kick_transport test.

Change-Id: I4625174a1d62edfa8a1db52ced70356798d53c95
a960864355d40fc4d56d2317c99fb4df13a1baa7 19-Apr-2016 Yabin Cui <yabinc@google.com> Merge "Fix kick_transport test."
a9e818f4632eca67a5ffd1fb680d15550591ecd9 19-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes Ia4a2ff77,I970806e3,I47daa338 into nyc-dev

* changes:
adb: increase the FD table size on Win32.
adb: bump the server version to 36.
adb: add reconnect command.
826bdace3d756055560643e831ccf91fbc5e6bc8 19-Apr-2016 Josh Gao <jmgao@google.com> Merge changes Iaf0efc0c,Ia4a2ff77 am: c4f3546
am: c5b388f53a

* commit 'c5b388f53a5666daa368f597c7e190f7f31f2b8a':
adb: disable tests that are expected to fail on Win32.
adb: increase the FD table size on Win32.

Change-Id: Ifcc55e62935c95c8b34fa0d1973277a08916fad2
d1e2300a719d1effeea85cda9ac5a8f795c38390 18-Apr-2016 Josh Gao <jmgao@google.com> adb: increase the FD table size on Win32.

128 maximum FDs is a pretty low limit, which can easily be exhausted by
port forwarding. Bump the maximum up to 2048, and add a test that checks
whether we can actually use a few hundred sockets.

Bug: https://code.google.com/p/android/issues/detail?id=12141
Bug: http://b/28246942
Change-Id: Ia4a2ff776e8e58ec13378756f19d80392679ece9
(cherry picked from commit b31e17107cfe5fe34e952657b846b1f93f568e88)
ysdeps_test.cpp
ysdeps_win32.cpp
988e9bc1f80230c99f7b171b6669cdec77c62396 15-Apr-2016 Josh Gao <jmgao@google.com> adb: bump the server version to 36.

The recent `adb root` changes are incompatible with older versions of
the server. Bump the version number to force the server to restart.

Bug: http://b/28194507
Change-Id: I970806e3b68c1f8e3273a4b1f0ecc4aca5086be9
(cherry picked from commit 057095d2076dfe571fb2a3c6904f77282aaeacaa)
db.h
03468c8c509975f2f410b402b2bc211b42aa0ed9 05-Apr-2016 Yabin Cui <yabinc@google.com> adb: add reconnect command.

Add reconnect command for debugging. `reconnect` kicks a transport
from the host side, `reconnect device` kicks a transport from
the device side. They can be used to produce transport errors.

Bug: 25935458

Change-Id: I47daa338796b561941e7aba44a51a6dd117d1e98
(cherry picked from commit 1f4ec19e499ba981e4117f647d191603c2713e79)
db.cpp
db_client.cpp
ommandline.cpp
ervices.cpp
ransport.cpp
c4f3546e9ff410bf106ba6d97231be40e24e1adb 19-Apr-2016 Josh Gao <jmgao@google.com> Merge changes Iaf0efc0c,Ia4a2ff77

* changes:
adb: disable tests that are expected to fail on Win32.
adb: increase the FD table size on Win32.
68c63d75c9c451ae196ef7bf20cd03dbeeb371ba 18-Apr-2016 Josh Gao <jmgao@google.com> adb: disable tests that are expected to fail on Win32.

Bug: http://b/28247676
Change-Id: Iaf0efc0c12835c0915a752a365651eb9bc78b3b8
db_io_test.cpp
b31e17107cfe5fe34e952657b846b1f93f568e88 18-Apr-2016 Josh Gao <jmgao@google.com> adb: increase the FD table size on Win32.

128 maximum FDs is a pretty low limit, which can easily be exhausted by
port forwarding. Bump the maximum up to 2048, and add a test that checks
whether we can actually use a few hundred sockets.

Bug: https://code.google.com/p/android/issues/detail?id=12141
Bug: http://b/28246942
Change-Id: Ia4a2ff776e8e58ec13378756f19d80392679ece9
ysdeps_test.cpp
ysdeps_win32.cpp
e929e115bef6a7129bd18c33fb32c5f2eebdcf02 18-Apr-2016 Josh Gao <jmgao@google.com> Merge "adb: bump the server version to 36." am: 3009b7c
am: a0b5c62

* commit 'a0b5c62525e7b79131df337619b268794c92374f':
adb: bump the server version to 36.

Change-Id: I910cd4e32bd38796025d603ee86d245d33f6c61a
3009b7cbe017e0d6f87d31b52a32bdc8fa77b095 18-Apr-2016 Josh Gao <jmgao@google.com> Merge "adb: bump the server version to 36."
7f27490e7f386401dc38287a67dcb8826e2260c5 18-Apr-2016 Yabin Cui <yabinc@google.com> Fix kick_transport test.

Fix broken kick_transport test, and make it not access atransport
internal variables.

Bug: 25935458
Change-Id: I91b4d32a222b2f369f801bbe3903acac9c8ea4f7
ransport.cpp
ransport.h
ransport_local.cpp
ransport_test.cpp
ransport_usb.cpp
1a3ce9b3a6e70620b49fc6937280ecb7b6624f83 16-Apr-2016 Yabin Cui <yabinc@google.com> Merge "adb: add reconnect command." am: 643bc36
am: 1dd696a

* commit '1dd696a52687106d9926374d18895a911cc6fd28':
adb: add reconnect command.

Change-Id: Ibfdfe1675a8d3627d4fb8eef3592b9b836dc4d19
643bc369ef8dbeeb22ee87bfa04eb3621ffa16a2 16-Apr-2016 Yabin Cui <yabinc@google.com> Merge "adb: add reconnect command."
005bf1e05be5de518184c376ebf88268bb191d09 05-Apr-2016 Yabin Cui <yabinc@google.com> adb: fix adb usb operations on device.

Problem: For devices using /dev/usb-ffs/adb, Run
`while true; do adb reconnect device; sleep 1; done`. And the
device soon becomes offline. The adbd log shows that calling
adb_read(h->bulk_out) in usb_ffs_read() gets EOVERFLOW error.

Reason: When kicking a transport using usb-ffs, /dev/usb-ffs/adb/ep0
is not closed, and the device will not notify a usb connection reset
to host. So the host will continue to send unfinished packets even
if a new transport is started on device. The unfinished packets may
not have the same size as what is expected on device, so adbd on
device gets EOVERFLOW error. At the worst case, adbd has to create new
transports for each unfinished packet.

Fixes:
The direct fix is to make the usb connection reset when kicking transports,
as in https://android-review.googlesource.com/#/c/211267/1. And I think
we can make following improvements beside that.
1. Close a file that is used in other threads isn't safe. Because the file
descriptor may be reused to open other files, and other threads may operate
on the wrong file. So use dup2(dummy_fd) to replace close() in kick function,
and really close the file descriptor after the read/write threads exit.

2. Open new usb connection after usb_close() instead of after
usb_kick(). After usb_kick(), the transport may still exist and
reader/writer for the transport may be still running. But after
usb_close(), the previous transport is guaranteed to be destroyed.

Bug: 25935458
Change-Id: I1eff99662d1bf1cba66af7e7142f4c0c4d82c01b
sb_linux_client.cpp
057095d2076dfe571fb2a3c6904f77282aaeacaa 15-Apr-2016 Josh Gao <jmgao@google.com> adb: bump the server version to 36.

The recent `adb root` changes are incompatible with older versions of
the server. Bump the version number to force the server to restart.

Bug: http://b/28194507
Change-Id: I970806e3b68c1f8e3273a4b1f0ecc4aca5086be9
db.h
1c8bf422d957c5b6995120f23f050320620a435d 13-Apr-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge changes Ibc8038b1,I1876ecd7,I57d70f8b am: 3e0eaa4
am: c35de74

* commit 'c35de74b2b9d017a74ca3da99f8c23aad033f0f5':
adb: after `adb root`, wait for the device in any state.
adb: add support for 'wait-for-any'.
adb: make 'wait-for-{recovery,sideload,bootloader} work.

Change-Id: I153b8e88cea2b2e6d5916145bf1e1145c4721b14
3e0eaa4103f4497463dd8b5daa1ee7ffe3921211 13-Apr-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge changes Ibc8038b1,I1876ecd7,I57d70f8b

* changes:
adb: after `adb root`, wait for the device in any state.
adb: add support for 'wait-for-any'.
adb: make 'wait-for-{recovery,sideload,bootloader} work.
9ea7795d38e92d8d01135fdfe7e9a0b74a65e5c8 13-Apr-2016 Josh Gao <jmgao@google.com> adb: after `adb root`, wait for the device in any state.

Otherwise, `adb root` while the device is in recovery will hang.

Bug: http://b/28168212
Change-Id: Ibc8038b1745139fb505e466c74c605b9df474c8c
(cherry picked from commit 48a348183f5f4478ca5b0ca2059fa829648fc090)
ommandline.cpp
5863fb61e142ec8494443ba341e240f9fe86934b 13-Apr-2016 Josh Gao <jmgao@google.com> adb: add support for 'wait-for-any'.

Allow waiting for a device in any state.

Bug: http://b/28168212
Change-Id: I1876ecd70089ca88f2da5de4182e13724ec50501
(cherry picked from commit 86441c31fe256f37625743e2818377ce5e3dec05)
ommandline.cpp
ervices.cpp
3d8df3cb2a80676b35a0641c03e1164eb876883f 13-Apr-2016 Josh Gao <jmgao@google.com> adb: make 'wait-for-{recovery,sideload,bootloader} work.

The help for wait-for-* documents this as working, but we only had a
special case for 'wait-for-device'. Make the others work as well.

Bug: http://b/28170823
Change-Id: I57d70f8b9a383947c4f761919bfbd8515a013520
(cherry picked from commit 08881e72f4b01302742e027225145b061202c528)
ommandline.cpp
48a348183f5f4478ca5b0ca2059fa829648fc090 13-Apr-2016 Josh Gao <jmgao@google.com> adb: after `adb root`, wait for the device in any state.

Otherwise, `adb root` while the device is in recovery will hang.

Bug: http://b/28168212
Change-Id: Ibc8038b1745139fb505e466c74c605b9df474c8c
ommandline.cpp
86441c31fe256f37625743e2818377ce5e3dec05 13-Apr-2016 Josh Gao <jmgao@google.com> adb: add support for 'wait-for-any'.

Allow waiting for a device in any state.

Bug: http://b/28168212
Change-Id: I1876ecd70089ca88f2da5de4182e13724ec50501
ommandline.cpp
ervices.cpp
08881e72f4b01302742e027225145b061202c528 13-Apr-2016 Josh Gao <jmgao@google.com> adb: make 'wait-for-{recovery,sideload,bootloader} work.

The help for wait-for-* documents this as working, but we only had a
special case for 'wait-for-device'. Make the others work as well.

Bug: http://b/28170823
Change-Id: I57d70f8b9a383947c4f761919bfbd8515a013520
ommandline.cpp
1e0161e9342451c4f274707d210895c567a8a098 13-Apr-2016 Felipe Leme <felipeal@google.com> Merge "Implements \'adb bugreport <ZIP_FILE>\'." into nyc-dev
am: e04c9f3

* commit 'e04c9f34364d76ad0f3580f566ea710285426c83':
Implements 'adb bugreport <ZIP_FILE>'.

Change-Id: I7c5112d8e804394c705bee3e4cae227f5da68702
44a42677cfde5f1ae6d0be67dcd07659d9c0f265 02-Apr-2016 Felipe Leme <felipeal@google.com> Implements 'adb bugreport <ZIP_FILE>'.

Dumpstate now supports zipped bugreport, whose output is more complete
than the flat-file bugreports provided prior to N. As such, adb now has
a 'adb bugreport <ZIP_FILE>' name whose implementation:

- Calls the new bugreportz binary.
- Parses its output, which in case of success is the path of the .zip
file.
- Pulls the device file and renames it according to the command-line
argument.

BUG: 27653204

Change-Id: I7169fe157c77bbef1684d0cb4e43095d95ddf2b8
ommandline.cpp
ile_sync_client.cpp
ile_sync_service.h
9c4a0e021607f9da6130658530110e84eefc8ed9 13-Apr-2016 Elliott Hughes <enh@google.com> Merge changes from topic \'boringssl_conversion\' am: 52eb93c
am: 0781351

* commit '07813516502d12cfeabef94838e916c0cf4f3b46':
Switch fs_mgr and adb to libcrypto_utils.
Add libcrypto_utils.

Change-Id: Ib50abd66d546a2b2c7a1249043e1b39c2147c674
097b6bbc76231f4148c9dd28b6ea0c1189d40fc3 31-Mar-2016 Mattias Nissler <mnissler@google.com> Switch fs_mgr and adb to libcrypto_utils.

Update code and dependencies to use BoringSSL + libcrypto_utils
instead of mincrypt.

Change-Id: Ic75164bd50c84b81b6310e27a67d4b3c174984f9
ndroid.mk
db.cpp
db_auth.h
db_auth_client.cpp
db_auth_host.cpp
1f4ec19e499ba981e4117f647d191603c2713e79 05-Apr-2016 Yabin Cui <yabinc@google.com> adb: add reconnect command.

Add reconnect command for debugging. `reconnect` kicks a transport
from the host side, `reconnect device` kicks a transport from
the device side. They can be used to produce transport errors.

Bug: 25935458

Change-Id: I47daa338796b561941e7aba44a51a6dd117d1e98
db.cpp
db_client.cpp
ommandline.cpp
ervices.cpp
ransport.cpp
7b2125d2b1e55836d9c4381de23303dda3a72bfa 30-Mar-2016 Dan Austin <danielaustin@google.com> Merge "Address const issues in preparation for libcxx rebase." am: b2cb35e
am: 4e39764

* commit '4e3976417b4e43c2a3969fb3305d9f069ec8c8f8':
Address const issues in preparation for libcxx rebase.

Change-Id: I7b25949ccdae45398f47c43f79fa532d66d4d3a2
0bab7c3dbd7aa92f31c1fe1d6eade07384ca3d5d 30-Mar-2016 Dan Austin <danielaustin@google.com> Merge "Address const issue in preparation for libcxx rebase." am: a2a13e3
am: 61e5a66

* commit '61e5a6625dfdb586abb9f83b20bc1d727a783225':
Address const issue in preparation for libcxx rebase.

Change-Id: I883b8210df7c8ddd1f82914ba448af0175f53437
b2cb35ef96b6d1cc03c6c39a57a4eb9b6484e100 30-Mar-2016 Dan Austin <danielaustin@google.com> Merge "Address const issues in preparation for libcxx rebase."
b4cff495a1f93b6c92f4327cbfb9e564b28913d8 29-Mar-2016 Dan Austin <danielaustin@google.com> Address const issues in preparation for libcxx rebase.

Change-Id: I4eccc1b5a70da9dd325e1a7e10ab0a3fe588c03f
ocket.h
ocket_test.cpp
ockets.cpp
80fd4549e39aa5c14229d1b2f46fe3f98f148f51 28-Mar-2016 Dan Austin <danielaustin@google.com> Address const issue in preparation for libcxx rebase.

Change-Id: I80c3349ee93d2b3f16c6fadc7f34b2bf4f2cc0d3
hell_service.cpp
b80557a6081d48743254c1f12a141f3270dbc223 11-Mar-2016 Elliott Hughes <enh@google.com> Merge "Fix buffer overrun in adb wait-for-device."
am: 1f13c1a208

* commit '1f13c1a208394b74a8c60e677546a8c8ed697091':
Fix buffer overrun in adb wait-for-device.
1ef5bf839e5b467e8014c751390045cd02b4128f 10-Mar-2016 Elliott Hughes <enh@google.com> Fix buffer overrun in adb wait-for-device.

Bug: http://b/27444063

(cherry picked from commit 34e560b9a1e44dcfa0c220c9499bbb833a95a2b4)

Change-Id: Ic71cb2070f509d76fb4208dbab6711c5dd5e1f62
ommandline.cpp
1f13c1a208394b74a8c60e677546a8c8ed697091 11-Mar-2016 Elliott Hughes <enh@google.com> Merge "Fix buffer overrun in adb wait-for-device."
34e560b9a1e44dcfa0c220c9499bbb833a95a2b4 10-Mar-2016 Elliott Hughes <enh@google.com> Fix buffer overrun in adb wait-for-device.

Bug: http://b/27444063
Change-Id: I72339d7215aae28069484b9796d71fe0c53dff96
ommandline.cpp
d387acc9b84e951d000a84816969bde56f42e51e 09-Mar-2016 Prathmesh Prabhu <pprabhu@google.com> emulator: Use distinct serial names for simultaneous qemu pipes.

ADB local transport for the emulator based on qemu pipes uses a socket
transport. Before this CL, multiple connection requests accepted by the
qemu pipe device would result in ADB transport with the same serial.
The register function would fail as a result, and all subsequent
connections would fail.

Test:
while true; do adb kill-server; adb devices; done
Doesn't fail for > 10 minutes.

This CL replaces an earlier CL
(I0fdcf2694516151c5f8f8e1580648b940679c981) that was unsafe for real
devices.

BUG=27441661

Change-Id: I7d801b175f3bee10fc7e0ab1b12d5623984371b9
ransport_local.cpp
f7b6d9cea9b4a9a2da42c17fe4a393e9332518f1 10-Mar-2016 Prathmesh Prabhu <pprabhu@google.com> Merge "emulator: Use distinct serial names for simultaneous qemu pipes." into nyc-dev
am: 01d76eb1ec

* commit '01d76eb1ecb943db042eb6618087c0e22588e6b3':
emulator: Use distinct serial names for simultaneous qemu pipes.
01d76eb1ecb943db042eb6618087c0e22588e6b3 10-Mar-2016 Prathmesh Prabhu <pprabhu@google.com> Merge "emulator: Use distinct serial names for simultaneous qemu pipes." into nyc-dev
251d46e68a279df2eb359e87a24b0e47fdfe4b78 09-Mar-2016 Prathmesh Prabhu <pprabhu@google.com> emulator: Use distinct serial names for simultaneous qemu pipes.

ADB local transport for the emulator based on qemu pipes uses a socket
transport. Before this CL, multiple connection requests accepted by the
qemu pipe device would result in ADB transport with the same serial.
The register function would fail as a result, and all subsequent
connections would fail.

Test:
while true; do adb kill-server; adb devices; done
Doesn't fail for > 10 minutes.

This CL replaces an earlier CL
(I0fdcf2694516151c5f8f8e1580648b940679c981) that was unsafe for real
devices.

BUG=27441661

Change-Id: I7d801b175f3bee10fc7e0ab1b12d5623984371b9
ransport_local.cpp
8238dd84992988ecbaa8b8e2b5691d2cf2391e35 05-Mar-2016 Josh Gao <jmgao@google.com> adbd: fix spurious close of uninitialized fd.

forkpty only returns an fd on the master side; trying to keep track of
it on both sides is incorrect.

Bug: http://b/27504427
Change-Id: Ia4a454d8490c77738f9c3350a4236b3d99c8758b
(cherry picked from commit fcb063ce378419ad1511d3395d44701b4ebaceb0)
hell_service.cpp
5767d0dd5ae44978b7a80ba08de32fe51822cbb4 05-Mar-2016 Josh Gao <jmgao@google.com> adb: wait for restore to complete before returning.

If we return before waiting for the other side to finish, it'll get sent
SIGHUP.

Bug: http://b/27414382
Change-Id: I93514d2242ed0d7aa93a6ec6836270dc0783506d
(cherry picked from commit d26abed750640b4225a11763510f61ade3dd225c)
ommandline.cpp
06c73ae94214cc72b82d4c686bd490c21f61257a 05-Mar-2016 Josh Gao <jmgao@google.com> adb: wait for adbd to die and respawn in root/unroot.

Bug: http://b/19749057
Change-Id: I57dbc113803b6fd3016c1801410be0f4023245d9
(cherry picked from commit d26212207d9bc9412dbc528307185694f8e6d082)
db_client.cpp
db_client.h
ommandline.cpp
a9eb38d6a539e2e994ddd14c1e5d1d8ff157d0c9 05-Mar-2016 Josh Gao <jmgao@google.com> adb: make ScopedFd universally accessible and useful.

Change-Id: I707ffbd10958e7449b4c95dff48638480c746939
(cherry picked from commit f0d3b4fc11b35ce295bd698555579ed242473e69)
db_utils.h
hell_service.cpp
ysdeps.h
3bb90a6acd50e1ebbd5ef06755e6afcfb181f5f8 05-Mar-2016 Josh Gao <jmgao@google.com> Merge changes I93514d22,I57dbc113,I707ffbd1 am: 1cd680ce75
am: 6aafa03c60

* commit '6aafa03c606d06a5cb6549c1cc382a2038552256':
adb: wait for restore to complete before returning.
adb: wait for adbd to die and respawn in root/unroot.
adb: make ScopedFd universally accessible and useful.
f5b960538f95c5b42f97595bc1325fffa0e591f1 05-Mar-2016 Josh Gao <jmgao@google.com> Merge "adbd: fix spurious close of uninitialized fd." am: 3c608c7425
am: 97b9935fba

* commit '97b9935fba43cfa892ef4ae2792a68c276b6f128':
adbd: fix spurious close of uninitialized fd.
1cd680ce759effd33602de82197790fb027c1721 05-Mar-2016 Josh Gao <jmgao@google.com> Merge changes I93514d22,I57dbc113,I707ffbd1

* changes:
adb: wait for restore to complete before returning.
adb: wait for adbd to die and respawn in root/unroot.
adb: make ScopedFd universally accessible and useful.
fcb063ce378419ad1511d3395d44701b4ebaceb0 05-Mar-2016 Josh Gao <jmgao@google.com> adbd: fix spurious close of uninitialized fd.

forkpty only returns an fd on the master side; trying to keep track of
it on both sides is incorrect.

Bug: http://b/27504427
Change-Id: Ia4a454d8490c77738f9c3350a4236b3d99c8758b
hell_service.cpp
d26abed750640b4225a11763510f61ade3dd225c 05-Mar-2016 Josh Gao <jmgao@google.com> adb: wait for restore to complete before returning.

If we return before waiting for the other side to finish, it'll get sent
SIGHUP.

Bug: http://b/27414382
Change-Id: I93514d2242ed0d7aa93a6ec6836270dc0783506d
ommandline.cpp
d26212207d9bc9412dbc528307185694f8e6d082 05-Mar-2016 Josh Gao <jmgao@google.com> adb: wait for adbd to die and respawn in root/unroot.

Bug: http://b/19749057
Change-Id: I57dbc113803b6fd3016c1801410be0f4023245d9
db_client.cpp
db_client.h
ommandline.cpp
f0d3b4fc11b35ce295bd698555579ed242473e69 05-Mar-2016 Josh Gao <jmgao@google.com> adb: make ScopedFd universally accessible and useful.

Change-Id: I707ffbd10958e7449b4c95dff48638480c746939
db_utils.h
hell_service.cpp
ysdeps.h
a996c2963a9c1fa9d2339e560c7d6dad2be4a2f8 03-Mar-2016 Josh Gao <jmgao@google.com> adb: clean up quotes in test_device.py.

Change-Id: I7fe7724578ad89a004665d1bbff0d5c02c34c35e
(cherry picked from commit 255c5c80777da296499ce0644defc9337ebda785)
est_device.py
379612b1283c7289fbf21e1105b8bec9b0fed7ae 03-Mar-2016 Josh Gao <jmgao@google.com> adb: mkdir the correct directory name when pulling.

The directory name should be based off of the local path, not the remote
path.

Change-Id: I75b089b8734e9dbf8e466b1e00ea18549fd101bb
(cherry picked from commit 89ec3a8d0feac727257b428a91b6f84b6a4b1395)
ile_sync_client.cpp
est_device.py
48bc0d7853c34a174fa6c9ddd85c30a1b54b137d 03-Mar-2016 Josh Gao <jmgao@google.com> adb: cleanup file skipping logic.

Bug: http://b/26355212
Change-Id: Iafa250ce6c5ea8da9f5f00125165e5b67ef1013f
(cherry picked from commit a31ea55c555aaa9cddab06c038f6e3285770f664)
ile_sync_client.cpp
74e0fe73c02531e2aa3c4b9f72527bb7a1731158 26-Feb-2016 Josh Gao <jmgao@google.com> adb: symlinks to dirs count as dirs for pull destination.

This matches scp's behavior when pulling a directory that collides
with a symlink to a directory.

Bug: http://b/27362811
Change-Id: I0936d1ad48f13e24cd382e8e8400cc752bac3b66
(cherry picked from commit 1e611a33d524a7c7a31181aca10d1f4a4c9fc1b2)
db_utils.cpp
est_device.py
802c54ebb79453256a8c7fd3c3cab88acc8a84e8 01-Mar-2016 David Pursell <dpursell@google.com> adb: relax serial matching rules.

Currently targeting a device by serial requires matching the serial
number exactly. This CL relaxes the matching rules for local transports
to ignore protocol prefixes and make the port optional:
[tcp:|udp:]<hostname>[:port]

The purpose of this is to allow a user to set ANDROID_SERIAL to
something like "tcp:100.100.100.100" and have it work for both fastboot
and adb (assuming the device comes up at 100.100.100.100 in both
modes).

This CL also adds some unit tests for the modified functions to make
sure they work as expected.

Bug: 27340240
Change-Id: I006e0c70c84331ab44d05d0a0f462d06592eb879
(cherry picked from commit 3f902aad5b427a8162bf860a758878b55b13e775)
ocket.h
ocket_test.cpp
ockets.cpp
ransport.cpp
ransport.h
ransport_test.cpp
f22bc60fc9b16148cd82e2c23b22ca3f62b00d96 01-Mar-2016 Josh Gao <jmgao@google.com> adb: report progress for small files.

Bug: http://b/27407725
Change-Id: I7515144402a487fb3d4d403e2f5f82423c1b5ed6
(cherry picked from commit 9fd2f77dcce09aa38bf8f1798ebaac2abeef1598)
ile_sync_client.cpp
f48503b4a0b5075fa6919260d873887d14916f2d 01-Mar-2016 Ying Wang <wangying@google.com> Also archive adb.exe/fastboot.exe when building win_sdk.

On linux we archive both Linux and Windows binaries.

Bug: 27315911
Change-Id: I17d25cd1ea611a9c917f1e78b47f21a8959eea20
(cherry picked from commit 71edfc8b9ab78f00206828993526aedd115c46b1)
ndroid.mk
a63b17f76c54d937c779848ae3f4212539f8873f 26-Feb-2016 Josh Gao <jmgao@google.com> adb: fix directory creation logic.

Previously, for `adb pull $remote $local`, we would do the equivalent of
mkdir -p on `dirname $local`. This patch changes the behavior to only
creating directories that are being pulled, like scp.

Bug: http://b/27362811
Change-Id: I79f975ee9f2d9bc9e8be6a7c4f2de6d7ae2d2d23
(cherry picked from commit 71728ca300d1bc168fae89c8139e72db3d4591cb)
ile_sync_client.cpp
d382d2bb5176a21bf1265ff2f80fbeaf9bfdce63 25-Feb-2016 Josh Gao <jmgao@google.com> adb: fix mistaken use of PLOG.

Change-Id: I60bfa3d8cf1572a877d6f0c9369d8f72f10e5aef
(cherry picked from commit 443a52c298f54a087aff7664f0c4c508b10dc2db)
db_auth_client.cpp
1f6ff07516a56f62c809d0b60ab6d9f28673c369 04-Mar-2016 Josh Gao <jmgao@google.com> Merge changes I7fe77245,I75b089b8,Iafa250ce am: afa76a3028
am: 55592371dc

* commit '55592371dca3ccb25d516635b41bab73ed8b6059':
adb: clean up quotes in test_device.py.
adb: mkdir the correct directory name when pulling.
adb: cleanup file skipping logic.
a76e5f035eeffeb53c6bf0e667fe13625d5ffbac 22-Feb-2016 David Pursell <dpursell@google.com> adb: use TCP keepalive.

Currently adb only realizes a TCP transport has gone away when it tries
to send a packet, which caused problems in particular for `adb reboot`
since no packets are sent, leading to the client hanging until Ctrl+C.

This CL turns on TCP keepalive packets to send 1 packet every second,
allowing up to 10 failures before disconnecting. Using built-in TCP
functionality turns out to be much cleaner in this case than trying to
implement our own keepalive packets at the application layer, and
should be more lightweight since it's all done in the TCP stack.

Bug: http://b/23093474

Change-Id: Ifb41cbb85b9752a9f394e1eed3c6ac4da47a4e4d
(cherry picked from commit bfd9503d1dfc652d0497fa1a5994b3d73e296898)
ndroid.mk
ervices.cpp
ysdeps.h
ysdeps_unix.cpp
ysdeps_win32.cpp
afa76a302803fb9f25478c177486c218d713bc19 04-Mar-2016 Josh Gao <jmgao@google.com> Merge changes I7fe77245,I75b089b8,Iafa250ce

* changes:
adb: clean up quotes in test_device.py.
adb: mkdir the correct directory name when pulling.
adb: cleanup file skipping logic.
255c5c80777da296499ce0644defc9337ebda785 03-Mar-2016 Josh Gao <jmgao@google.com> adb: clean up quotes in test_device.py.

Change-Id: I7fe7724578ad89a004665d1bbff0d5c02c34c35e
est_device.py
89ec3a8d0feac727257b428a91b6f84b6a4b1395 03-Mar-2016 Josh Gao <jmgao@google.com> adb: mkdir the correct directory name when pulling.

The directory name should be based off of the local path, not the remote
path.

Change-Id: I75b089b8734e9dbf8e466b1e00ea18549fd101bb
ile_sync_client.cpp
est_device.py
a31ea55c555aaa9cddab06c038f6e3285770f664 03-Mar-2016 Josh Gao <jmgao@google.com> adb: cleanup file skipping logic.

Bug: http://b/26355212
Change-Id: Iafa250ce6c5ea8da9f5f00125165e5b67ef1013f
ile_sync_client.cpp
29f8993098cbcb51a6218972c32aa2fd39555124 03-Mar-2016 David Pursell <dpursell@google.com> Merge "adb: relax serial matching rules." am: b4709c2cfd
am: a942881fdb

* commit 'a942881fdb8925373a8b8756301fa3a4d92cf174':
adb: relax serial matching rules.
b4709c2cfd2a31b032d25c6b9eaa495c3092aeaa 03-Mar-2016 David Pursell <dpursell@google.com> Merge "adb: relax serial matching rules."
7f766bc87b82fd653baa19bcb5f3e6f42bb9958f 03-Mar-2016 Josh Gao <jmgao@google.com> Merge "adb: symlinks to dirs count as dirs for pull destination." am: 543093cb97
am: 3b198fd8bb

* commit '3b198fd8bbbbb783f07e3cbd7c78973e94119534':
adb: symlinks to dirs count as dirs for pull destination.
543093cb97958049d175ecd77d5232659b014f7d 03-Mar-2016 Josh Gao <jmgao@google.com> Merge "adb: symlinks to dirs count as dirs for pull destination."
1e611a33d524a7c7a31181aca10d1f4a4c9fc1b2 26-Feb-2016 Josh Gao <jmgao@google.com> adb: symlinks to dirs count as dirs for pull destination.

This matches scp's behavior when pulling a directory that collides
with a symlink to a directory.

Bug: http://b/27362811
Change-Id: I0936d1ad48f13e24cd382e8e8400cc752bac3b66
db_utils.cpp
est_device.py
3f902aad5b427a8162bf860a758878b55b13e775 01-Mar-2016 David Pursell <dpursell@google.com> adb: relax serial matching rules.

Currently targeting a device by serial requires matching the serial
number exactly. This CL relaxes the matching rules for local transports
to ignore protocol prefixes and make the port optional:
[tcp:|udp:]<hostname>[:port]

The purpose of this is to allow a user to set ANDROID_SERIAL to
something like "tcp:100.100.100.100" and have it work for both fastboot
and adb (assuming the device comes up at 100.100.100.100 in both
modes).

This CL also adds some unit tests for the modified functions to make
sure they work as expected.

Bug: 27340240
Change-Id: I006e0c70c84331ab44d05d0a0f462d06592eb879
ocket.h
ocket_test.cpp
ockets.cpp
ransport.cpp
ransport.h
ransport_test.cpp
32e55d70c44077b1c9ed922df8857e339d9e2c95 02-Mar-2016 bohu <bohu@google.com> Merge "Emulator: fix adbd qemu pipe partial write" am: ae607e149b
am: 4cc3354fb7

* commit '4cc3354fb75363cc8107162f338bc3872c22550c':
Emulator: fix adbd qemu pipe partial write
8ac1b044afd879ff6e0bb969d6c25c89b1869ea8 29-Feb-2016 bohu <bohu@google.com> Emulator: fix adbd qemu pipe partial write

It does happens that the adb_write only writes to the
qemu pipe partially which throws host side's adb backend
into confusion and crashes.

This CL replaces adb_write with WriteFdExactly;
adb_read with ReadFdExactly.

(cherry picked from commit f66c5938be56c6fe607725c80129e677e196f03a)

Change-Id: I684f5df79b1e3f00b4b7a2452c2712a73c15973c
ransport_local.cpp
ae607e149bbb4b8a8e441fd64147856c69862710 02-Mar-2016 Bo Hu <bohu@google.com> Merge "Emulator: fix adbd qemu pipe partial write"
f66c5938be56c6fe607725c80129e677e196f03a 29-Feb-2016 bohu <bohu@google.com> Emulator: fix adbd qemu pipe partial write

It does happens that the adb_write only writes to the
qemu pipe partially which throws host side's adb backend
into confusion and crashes.

This CL replaces adb_write with WriteFdExactly;
adb_read with ReadFdExactly.

Change-Id: I10424ad730c73516d16b0eb7318e8c9beea9b36b
ransport_local.cpp
b012c1cb1f8e8410ced868af3934e6661477db66 01-Mar-2016 Josh Gao <jmgao@google.com> Merge "adb: report progress for small files." am: 4c87588fa2
am: d799184236

* commit 'd799184236e8a63310f21d1509e656f9322ee300':
adb: report progress for small files.
9fd2f77dcce09aa38bf8f1798ebaac2abeef1598 01-Mar-2016 Josh Gao <jmgao@google.com> adb: report progress for small files.

Bug: http://b/27407725
Change-Id: I7515144402a487fb3d4d403e2f5f82423c1b5ed6
ile_sync_client.cpp
3905db7616152f12366e564a00fa0ea442a16556 01-Mar-2016 Ying Wang <wangying@google.com> 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.
71edfc8b9ab78f00206828993526aedd115c46b1 01-Mar-2016 Ying Wang <wangying@google.com> Also archive adb.exe/fastboot.exe when building win_sdk.

On linux we archive both Linux and Windows binaries.

Bug: 27315911
Change-Id: I17d25cd1ea611a9c917f1e78b47f21a8959eea20
ndroid.mk
56b3731203244f75f48d26e68a75c0cf71a97c21 29-Feb-2016 David Pursell <dpursell@google.com> Merge "adb: use TCP keepalive." am: e663c163ac
am: 89d749dbfc

* commit '89d749dbfc6f9f1544e59de1c1157fc1eadc205e':
adb: use TCP keepalive.
e663c163ac5f1931c2f9ebb091bf09a8a588432b 29-Feb-2016 David Pursell <dpursell@google.com> Merge "adb: use TCP keepalive."
e561a8bc4fd864896f7f94b5be8e16c7c7d5c1be 27-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: fix directory creation logic." am: a887c4faca
am: 8564dc9085

* commit '8564dc9085b9a8cccf4021a441f76b3af364d3ca':
adb: fix directory creation logic.
a887c4faca223765956200a86316eee196a49b43 27-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: fix directory creation logic."
71728ca300d1bc168fae89c8139e72db3d4591cb 26-Feb-2016 Josh Gao <jmgao@google.com> adb: fix directory creation logic.

Previously, for `adb pull $remote $local`, we would do the equivalent of
mkdir -p on `dirname $local`. This patch changes the behavior to only
creating directories that are being pulled, like scp.

Bug: http://b/27362811
Change-Id: I79f975ee9f2d9bc9e8be6a7c4f2de6d7ae2d2d23
ile_sync_client.cpp
d3ff759988c53bdbd6b52e6f5ab015b7b3d8b9c0 25-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: fix mistaken use of PLOG." am: a692f431d6
am: 95891e5a70

* commit '95891e5a70f9b0aed6332e92f9a3204b3e5b3d58':
adb: fix mistaken use of PLOG.
443a52c298f54a087aff7664f0c4c508b10dc2db 25-Feb-2016 Josh Gao <jmgao@google.com> adb: fix mistaken use of PLOG.

Change-Id: I60bfa3d8cf1572a877d6f0c9369d8f72f10e5aef
db_auth_client.cpp
73c6fd1af2b0f03fac107f1e1ab3d46cb483aac4 25-Feb-2016 Alex Klyubin <klyubin@google.com> Merge "Only debuggable packages can be downgraded." into nyc-dev
am: 8a67c09e7d

* commit '8a67c09e7d630ccecf8eb17463511dde2f16b548':
Only debuggable packages can be downgraded.
8a67c09e7d630ccecf8eb17463511dde2f16b548 25-Feb-2016 Alex Klyubin <klyubin@google.com> Merge "Only debuggable packages can be downgraded." into nyc-dev
2eaa41a6dfb97ad1015e456692318af8de13af5c 24-Feb-2016 Josh Gao <jmgao@google.com> adb: fix leak of framework_fd.

Move the fdevent for the framework authentication connection out of
atransport into its own static variable in adb_auth_client, since its
lifetime is completely unrelated to that of the USB connection.

Bug: http://b/27297963
Change-Id: Ie6180d0b59d133120c5755e239e76ab33ed3cc1d
(cherry picked from commit 9f4861155447ce813d06f39ea7b739837b1a4e2d)
db_auth_client.cpp
ransport.h
ransport_test.cpp
b6117c4397a711d0e70cade978de97faffb6d4b7 25-Feb-2016 Josh Gao <jmgao@google.com> adb: bail out if wait_for_device fails in send_shell_command.

Bug: http://b/27166186
Change-Id: Ib7e9d7e6b909d67a3af94c3517a6a0b54cf17db7
(cherry picked from commit f56c39194f1c2a4f0ea5d2ac20aebf80de4b0ae7)
ommandline.cpp
63b8571dcec08aafd424f43ca1432e218fb7a9eb 25-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: bail out if wait_for_device fails in send_shell_command." am: 4e5b292299
am: 2b7f69d0f1

* commit '2b7f69d0f1bdaa60d52e6841f2bda52506ab5ad2':
adb: bail out if wait_for_device fails in send_shell_command.
e0ed0f0608ee8e94d9f405ce58f6fb3f3f5bd143 25-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: fix leak of framework_fd." am: 77dc40f2fa
am: 2ea5bf7b55

* commit '2ea5bf7b551799468a1f5378a2f82412db81a4c2':
adb: fix leak of framework_fd.
4e5b2922991dddf03c122963fb197968de5764e3 25-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: bail out if wait_for_device fails in send_shell_command."
77dc40f2fa3126871f64bc9e13a374d29bc3440f 25-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: fix leak of framework_fd."
9f4861155447ce813d06f39ea7b739837b1a4e2d 24-Feb-2016 Josh Gao <jmgao@google.com> adb: fix leak of framework_fd.

Move the fdevent for the framework authentication connection out of
atransport into its own static variable in adb_auth_client, since its
lifetime is completely unrelated to that of the USB connection.

Bug: http://b/27297963
Change-Id: Ie6180d0b59d133120c5755e239e76ab33ed3cc1d
db_auth_client.cpp
ransport.h
ransport_test.cpp
85ed97518c0c1ea312bb3b4941cd03de90f873fa 25-Feb-2016 Alex Klyubin <klyubin@google.com> Only debuggable packages can be downgraded.

This reflects the change in PackageManager service:
frameworks/base commit 921dd754ab49df0cd580ff96503f7616c4c85f4a.

Bug: 27327503
Change-Id: Ifcc7268cd271640417b8cfc9db81ea954b491cb1
ommandline.cpp
f56c39194f1c2a4f0ea5d2ac20aebf80de4b0ae7 25-Feb-2016 Josh Gao <jmgao@google.com> adb: bail out if wait_for_device fails in send_shell_command.

Bug: http://b/27166186
Change-Id: Ib7e9d7e6b909d67a3af94c3517a6a0b54cf17db7
ommandline.cpp
48a1b15db1d198d66c521c35afbb347129281dde 24-Feb-2016 Jorge Lucangeli Obes <jorgelo@google.com> Merge "adbd: Remove explicit capability bounding set code." am: d458730b64
am: c41b28b8bc

* commit 'c41b28b8bc03526b6ec6ec19a6d6a26ffb493a5b':
adbd: Remove explicit capability bounding set code.
d458730b649a044268807d1458867e3c1d0577b2 24-Feb-2016 Jorge Lucangeli Obes <jorgelo@google.com> Merge "adbd: Remove explicit capability bounding set code."
ed1d7aeee4e4aabac980563fc745d5c33f7945fb 23-Feb-2016 Dan Willemsen <dwillemsen@google.com> Remove duplicate fdevent.cpp entry

Fixes the following warnings:

build/core/binary.mk:894: warning: overriding commands for target
`out/target/product/bullhead/obj/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: ignoring old commands for target
`out/target/product/bullhead/obj/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: overriding commands for target
`out/target/product/bullhead/obj_arm/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: ignoring old commands for target
`out/target/product/bullhead/obj_arm/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'

Change-Id: Id4b13574e568284cefbc3a763d40843e73ddbd3d
(cherry picked from commit 582c8fe1d4d5d1a0042a71bc1e8228d66d2600b0)
ndroid.mk
eafc2fdc7d95ed16addc698fe58ca3aca850531d 24-Feb-2016 Dan Willemsen <dwillemsen@google.com> Merge "Remove duplicate fdevent.cpp entry" am: 978cda5cc6
am: 1fa1791a04

* commit '1fa1791a04f03e9d3a58e599233051b94cfa08a3':
Remove duplicate fdevent.cpp entry
582c8fe1d4d5d1a0042a71bc1e8228d66d2600b0 23-Feb-2016 Dan Willemsen <dwillemsen@google.com> Remove duplicate fdevent.cpp entry

Fixes the following warnings:

build/core/binary.mk:894: warning: overriding commands for target
`out/target/product/bullhead/obj/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: ignoring old commands for target
`out/target/product/bullhead/obj/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: overriding commands for target
`out/target/product/bullhead/obj_arm/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: ignoring old commands for target
`out/target/product/bullhead/obj_arm/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'

Change-Id: Id4b13574e568284cefbc3a763d40843e73ddbd3d
ndroid.mk
4d186ad96447df8d0d39235fb9b3f2022767aefe 20-Feb-2016 Jorge Lucangeli Obes <jorgelo@google.com> adbd: Remove explicit capability bounding set code.

Minijail supports dropping capabilities from the bounding set.
Use that code instead.

This cleans up one small loose end in the work started with
https://android-review.googlesource.com/#/c/187775/

Final diff: fewer lines, more unit-tested code.
"""
$ git diff --stat 52cf4fa6aa3e8d13f61b1 adb/daemon/main.cpp
adb/daemon/main.cpp | 56
1 file changed, 27 insertions(+), 29 deletions(-)
"""

Bug: 27314096
Change-Id: I238975920b85fae376522eb26f5ad6d9fee0762a
aemon/main.cpp
bfd9503d1dfc652d0497fa1a5994b3d73e296898 22-Feb-2016 David Pursell <dpursell@google.com> adb: use TCP keepalive.

Currently adb only realizes a TCP transport has gone away when it tries
to send a packet, which caused problems in particular for `adb reboot`
since no packets are sent, leading to the client hanging until Ctrl+C.

This CL turns on TCP keepalive packets to send 1 packet every second,
allowing up to 10 failures before disconnecting. Using built-in TCP
functionality turns out to be much cleaner in this case than trying to
implement our own keepalive packets at the application layer, and
should be more lightweight since it's all done in the TCP stack.

Bug: http://b/23093474

Change-Id: Ifb41cbb85b9752a9f394e1eed3c6ac4da47a4e4d
ndroid.mk
ervices.cpp
ysdeps.h
ysdeps_unix.cpp
ysdeps_win32.cpp
fa3e0bc67fa336e23e8fb44b0e1f3c030ad55e48 20-Feb-2016 Josh Gao <jmgao@google.com> adb: sysdeps_test: improve smoke test.

Make sure that adb_poll sets revents for all of the structs passed in.
Also, zero initialize all of the adb_pollfd structs in the tests.

Change-Id: Ia639679a7e6f77483655f1552e89081c4673aa87
(cherry picked from commit 2275f7da7370d5b403a5d4a9d558c34a38ee5c94)
ysdeps_test.cpp
da8119596fc6b9bb3d2208cc675036efac24fb6b 20-Feb-2016 Josh Gao <jmgao@google.com> adb: check for an error response from adbd between each write.

When sending a file, do a 0-timeout poll to check to see if an error has
occurred, so that we can immediately report failure.

Bug: http://b/26816782
Change-Id: I4a8aa8408a36940bfda7b0ecfa5d13755f4aa14d
(cherry picked from commit afcdcd703e3023dfc60638cf6b67b530ec18cb18)
ile_sync_client.cpp
est_device.py
4d74811cd422438855cac67702e9535c43d502fe 19-Feb-2016 Josh Gao <jmgao@google.com> adbd: restore the old error handling behavior.

Restore the previous file sync error handling behavior of reporting
failure, and then consuming packets from the other end until receiving a
DONE packet.

Bug: http://b/26816782
Change-Id: I9708f2a36c072547e191fa0b6b42dffc31f8a2f2
(cherry picked from commit 20a96c7d792cf55c76b6291b46480e584face9bf)
ile_sync_service.cpp
8d68591c46716a855cca4c8af6c36656310f55dc 19-Feb-2016 Josh Gao <jmgao@google.com> adb: change unsigned to uint32_t in sync struct definitions.

Change-Id: I9757ab853cfad1a2e1393ef32bcab222ab84acef
(cherry picked from commit 69469c4e9ffac450f6807a06ca35edcbf2071071)
ile_sync_service.h
cd2039e484e470a463ccf903feed373d10ab86e0 19-Feb-2016 Josh Gao <jmgao@google.com> adb: detect when the client disconnects in wait-for-device.

Avoid leaking a thread and its associated resources when a user cancels
wait-for-device.

Bug: http://b/26966721
Bug: https://code.google.com/p/android/issues/detail?id=199088
Change-Id: Idac80a24e9739ddd24e500fe14826a78f350c018
(cherry picked from commit 09855472f421dd249ec2721ad255ffc15acab2c1)
ervices.cpp
ysdeps_test.cpp
b582fa3bd8223ba1cf5936ffcb10e078d4ff13e1 10-Feb-2016 Josh Gao <jmgao@google.com> adb: make fdevent_test, socket_test compile on Windows.

Switch pthread_* to use the adb_thread_* abstractions to allow the fdevent
and socket tests to compile on Win32.

Bug: http://b/27105824
Change-Id: I6541bb1398780b999837e701837d7f86a5eee8ca
(cherry picked from commit 022d447e9efcff59e22f0ab13764282116f235dd)
ndroid.mk
devent.cpp
devent.h
devent_test.cpp
devent_test.h
ocket_test.cpp
c1d252bec233b422a445cf6b711b33d7f541e4ef 18-Feb-2016 Josh Gao <jmgao@google.com> adb: add fd exhaustion test, fix errno reporting in sysdeps_win32.

Add a test for FD exhaustion, and fix cases where we weren't properly
setting errno.

Change-Id: I486055bb9ead31089ce76b210c11de9e973f3256
(cherry picked from commit 6487e74a5991263cda5e59dbd21710d2372b0fa1)
ysdeps_test.cpp
ysdeps_win32.cpp
8443fd994a19b685d5f93b2a233b9a04170f9172 18-Feb-2016 Josh Gao <jmgao@google.com> adb: move win32 fd base to 2048, fix fd allocation.

Windows has a maximum fd limit of 2048, so we can avoid collision with
real file descriptors by starting from there. Also, fds would be
previously be allocated by a linear walk from the last allocated FD,
instead of the lowest available FD, as required by POSIX. Keep track of
the lowest available file descriptor to make things feel more familiar.

Change-Id: Id6ac1c54f4f7964a6cdfa8d3f4f96262e4881964
(cherry picked from commit b6232b96ddda96f3d72dd787fae0b0087ddbcab9)
ysdeps_win32.cpp
addab3d84dccd01cae9ca7b8a4b274b935f18fd4 17-Feb-2016 Josh Gao <jmgao@google.com> adb: don't emulate fdevent or socketpair on Windows.

Change-Id: I16cf7d4427eb79f36db39e91f85402a268fa72f5
(cherry picked from commit 3777d2ecc05d397ca501f4ee296e4e66568bb1bd)
ndroid.mk
db_utils.cpp
devent.cpp
ysdeps.h
ysdeps_test.cpp
ysdeps_win32.cpp
0b57ef735a0ae56d35fd034a2892dd2f3a92788d 18-Feb-2016 Josh Gao <jmgao@google.com> adb: fix clang-format for access modifier dedent.

It was previously -1 (the default from Google style, since it uses 2
space indentation), instead of -2.

Change-Id: I1865505ce17a2cc13b85de58bda55c3b1dfcf08c
(cherry picked from commit 5da522ec4553ff512f9b237152c92354343ae6db)
/system/core/.clang-format-4
8b642e42b4a30bb4ffef1427da3660241a13b046 13-Feb-2016 Dimitry Ivanov <dimitry@google.com> Add missing liblog dependency

Bug: http://b/27171986
Change-Id: Ia7f03c72de9a8e5d61896bde6b4b1af396376f54
(cherry picked from commit 01f21da7329ed88bff94e82bab1a889e9244cad9)
ndroid.mk
2674cd922e439e1d9e1db80e2dae5638a25f0390 13-Feb-2016 Josh Gao <jmgao@google.com> adb: sysdeps_win32: actually change ExitThread to _endthreadex.

Forgot to amend this into b5fea14e.

Change-Id: Id04e639eb87043901681db789d7a7925300fa867
(cherry picked from commit d7b3749202df90b49d4ab554944e0dd3564fe35a)
ysdeps.h
d9db09c3158d3da6aad34fbb926888ceafab3a55 12-Feb-2016 Josh Gao <jmgao@google.com> adb: make adb_thread_func_t return void, add adb_thread_exit.

Windows restricts the return value of threads to 32-bits, even on 64-bit
platforms. Since we don't actually return meaningful values from thread,
resolve this inconsistency with POSIX by making adb's thread abstraction
only take void functions.

Change-Id: I5c23b4432314f13bf16d606fd5e6b6b7b6ef98b5
(cherry picked from commit b5fea14e13bb6e41b36f374c954dc55faeef4627)
ommandline.cpp
ervices.cpp
hell_service.cpp
ysdeps.h
ysdeps_test.cpp
ransport.cpp
ransport_local.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
sb_windows.cpp
7e76c895443850c7da5a5e4f07a7a16fa483c5bd 12-Feb-2016 Josh Gao <jmgao@google.com> adb: redact reference to secret internal time machine.

Change-Id: Ic6744cc7c858576d7e6172460b32902e007b6fd3
(cherry picked from commit 6b42a2bfd5fcfabd8e80fa062a35a7e584c510a7)
ysdeps_test.cpp
a1071c6924654de89e077f50f47271bc3e08c569 11-Feb-2016 Spencer Low <CompareAndSwap@gmail.com> adb: mkdirs fixes

Fix pathological case where the directory to be created can't be created
because there is already a file there. This was previously returning
success because the wrong var was passed to directory_exists().

Fix test to exercise this situation. Also clarify tests.

Change-Id: I0dc0f14084e0eda4e1498874d4ab2a6445d322ac
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
(cherry picked from commit 85c45bd5a185f09f24bb0d790b2038fe72b567a9)
db_utils.cpp
db_utils_test.cpp
d302a15a60feb453bb018da99b9abae8dab2ca01 09-Feb-2016 Josh Gao <jmgao@google.com> adb: sysdeps: add support for joining threads.

Bug: http://b/27105824
Change-Id: I44e4edbb2a59565c35f1f3e6a6394ac258591f95
(cherry picked from commit 3b3e10d0465506abc7d9e07c0381396b3726f183)
ndroid.mk
ysdeps.h
ysdeps_test.cpp
32a2b60c4e2213b6303031768dc71c4fd6ceb4cf 10-Feb-2016 Josh Gao <jmgao@google.com> adb: allow wine's output for sysdeps_win32 strerror test.

Change-Id: Ia5d04a2347df1bcd8c7efcc1da9cec9725007a58
(cherry picked from commit 22554c91676d8981fbfc8b4811d8be3b78a0b74a)
ysdeps_win32_test.cpp
65f7080c6681aaf6e9bb60d6f62c26939e4f9901 09-Feb-2016 Yabin Cui <yabinc@google.com> adb: setsid() for adb host server.

To create a daemon for adb host server, we should call setsid()
for the daemon process. However, previously we call setsid() for
the adb client process, which results in nothing but EPERM error.

Bug: 26982628
Change-Id: I2763ae3d5a243706927d7ef6af5095138c0ce2d8
(cherry picked from commit 6bf323b97a11194d6186f8db2ee4a5eaca8d0141)
db.cpp
lient/main.cpp
9ad736a637de57d56b682674346b279dff5fea90 04-Feb-2016 Josh Gao <jmgao@google.com> adb: make ctrl-c when spawning a daemon not kill the daemon.

Previously, using ctrl-c in a command that needs to spawn a daemon
because one isn't already available would kill the daemon along with the
foreground process.

Bug: http://b/26982628
Change-Id: I7fefc531c3e4895423e7b466322b5426d01dc9ef
(cherry picked from commit b72b3f8c92a0b2d4377d5bec15eb45869b8711ac)
lient/main.cpp
db262ffa62d789d4889ebe73abbb29fa0f373125 08-Feb-2016 Josh Gao <jmgao@google.com> adb: fix mkdirs test.

The behavior of mkdirs was changed a while ago, without updating the
test.

Change-Id: I2aaa73818933b281e911c42a14e3c843d8bd972a
(cherry picked from commit 1172b2ec71db29533231ddc4d979be98d7503f0b)
db_utils_test.cpp
3b1c31c216039a811615730df29ad347431691cc 20-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: sysdeps_test: improve smoke test." am: 0fc006685c
am: 2975a58f3c

* commit '2975a58f3c9ec1a76b9b3e975827d15b3e24eac3':
adb: sysdeps_test: improve smoke test.
2275f7da7370d5b403a5d4a9d558c34a38ee5c94 20-Feb-2016 Josh Gao <jmgao@google.com> adb: sysdeps_test: improve smoke test.

Make sure that adb_poll sets revents for all of the structs passed in.
Also, zero initialize all of the adb_pollfd structs in the tests.

Change-Id: Ia639679a7e6f77483655f1552e89081c4673aa87
ysdeps_test.cpp
98ab5c1dc804b73b0b3b38eef2c7e1aa176437fd 20-Feb-2016 Josh Gao <jmgao@google.com> Merge changes I4a8aa840,I9708f2a3 am: 44b08c722d
am: fe07481ff9

* commit 'fe07481ff944cde33e6546579f83755000453e63':
adb: check for an error response from adbd between each write.
adbd: restore the old error handling behavior.
44b08c722d05f650c9b6872e28c73affe68eb55a 20-Feb-2016 Josh Gao <jmgao@google.com> Merge changes I4a8aa840,I9708f2a3

* changes:
adb: check for an error response from adbd between each write.
adbd: restore the old error handling behavior.
3f8e3b79c65df4e4dafebe7dc6161fdfb42f23ff 20-Feb-2016 Josh Gao <jmgao@google.com> Merge changes I9757ab85,Idac80a24 am: 2e70b2d5d8
am: 0640b14df2

* commit '0640b14df292cf48fc3aaee2058908c88cfc0419':
adb: change unsigned to uint32_t in sync struct definitions.
adb: detect when the client disconnects in wait-for-device.
2e70b2d5d82d6776fe8715de97220a8d7b11afd2 20-Feb-2016 Josh Gao <jmgao@google.com> Merge changes I9757ab85,Idac80a24

* changes:
adb: change unsigned to uint32_t in sync struct definitions.
adb: detect when the client disconnects in wait-for-device.
afcdcd703e3023dfc60638cf6b67b530ec18cb18 20-Feb-2016 Josh Gao <jmgao@google.com> adb: check for an error response from adbd between each write.

When sending a file, do a 0-timeout poll to check to see if an error has
occurred, so that we can immediately report failure.

Bug: http://b/26816782
Change-Id: I4a8aa8408a36940bfda7b0ecfa5d13755f4aa14d
ile_sync_client.cpp
est_device.py
20a96c7d792cf55c76b6291b46480e584face9bf 19-Feb-2016 Josh Gao <jmgao@google.com> adbd: restore the old error handling behavior.

Restore the previous file sync error handling behavior of reporting
failure, and then consuming packets from the other end until receiving a
DONE packet.

Bug: http://b/26816782
Change-Id: I9708f2a36c072547e191fa0b6b42dffc31f8a2f2
ile_sync_service.cpp
8a907122f8705c344661e6e4edaf4188e55b3a0e 20-Feb-2016 Josh Gao <jmgao@google.com> Merge changes I6541bb13,I486055bb,Id6ac1c54,I16cf7d44 am: 4a9084228a
am: 38d258ef70

* commit '38d258ef7005d0ac336e8571d72c092df6d42606':
adb: make fdevent_test, socket_test compile on Windows.
adb: add fd exhaustion test, fix errno reporting in sysdeps_win32.
adb: move win32 fd base to 2048, fix fd allocation.
adb: don't emulate fdevent or socketpair on Windows.
4a9084228a447658dc7beda9334dad0b1f8bb780 20-Feb-2016 Josh Gao <jmgao@google.com> Merge changes I6541bb13,I486055bb,Id6ac1c54,I16cf7d44

* changes:
adb: make fdevent_test, socket_test compile on Windows.
adb: add fd exhaustion test, fix errno reporting in sysdeps_win32.
adb: move win32 fd base to 2048, fix fd allocation.
adb: don't emulate fdevent or socketpair on Windows.
69469c4e9ffac450f6807a06ca35edcbf2071071 19-Feb-2016 Josh Gao <jmgao@google.com> adb: change unsigned to uint32_t in sync struct definitions.

Change-Id: I9757ab853cfad1a2e1393ef32bcab222ab84acef
ile_sync_service.h
09855472f421dd249ec2721ad255ffc15acab2c1 19-Feb-2016 Josh Gao <jmgao@google.com> adb: detect when the client disconnects in wait-for-device.

Avoid leaking a thread and its associated resources when a user cancels
wait-for-device.

Bug: http://b/26966721
Bug: https://code.google.com/p/android/issues/detail?id=199088
Change-Id: Idac80a24e9739ddd24e500fe14826a78f350c018
ervices.cpp
ysdeps_test.cpp
022d447e9efcff59e22f0ab13764282116f235dd 10-Feb-2016 Josh Gao <jmgao@google.com> adb: make fdevent_test, socket_test compile on Windows.

Switch pthread_* to use the adb_thread_* abstractions to allow the fdevent
and socket tests to compile on Win32.

Bug: http://b/27105824
Change-Id: I6541bb1398780b999837e701837d7f86a5eee8ca
ndroid.mk
devent.cpp
devent.h
devent_test.cpp
devent_test.h
ocket_test.cpp
6487e74a5991263cda5e59dbd21710d2372b0fa1 18-Feb-2016 Josh Gao <jmgao@google.com> adb: add fd exhaustion test, fix errno reporting in sysdeps_win32.

Add a test for FD exhaustion, and fix cases where we weren't properly
setting errno.

Change-Id: I486055bb9ead31089ce76b210c11de9e973f3256
ysdeps_test.cpp
ysdeps_win32.cpp
b6232b96ddda96f3d72dd787fae0b0087ddbcab9 18-Feb-2016 Josh Gao <jmgao@google.com> adb: move win32 fd base to 2048, fix fd allocation.

Windows has a maximum fd limit of 2048, so we can avoid collision with
real file descriptors by starting from there. Also, fds would be
previously be allocated by a linear walk from the last allocated FD,
instead of the lowest available FD, as required by POSIX. Keep track of
the lowest available file descriptor to make things feel more familiar.

Change-Id: Id6ac1c54f4f7964a6cdfa8d3f4f96262e4881964
ysdeps_win32.cpp
3777d2ecc05d397ca501f4ee296e4e66568bb1bd 17-Feb-2016 Josh Gao <jmgao@google.com> adb: don't emulate fdevent or socketpair on Windows.

Change-Id: I16cf7d4427eb79f36db39e91f85402a268fa72f5
ndroid.mk
db_utils.cpp
devent.cpp
ysdeps.h
ysdeps_test.cpp
ysdeps_win32.cpp
cc5b2c737b5216c8fbbd095ada554f7e3862e6ec 19-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: fix clang-format for access modifier dedent." am: d5126ddf71
am: 728da79e9c

* commit '728da79e9c973f02c97847ed49b81d0d3018484f':
adb: fix clang-format for access modifier dedent.
d5126ddf7119461d1dbd549f832bfb944f109225 19-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: fix clang-format for access modifier dedent."
5da522ec4553ff512f9b237152c92354343ae6db 18-Feb-2016 Josh Gao <jmgao@google.com> adb: fix clang-format for access modifier dedent.

It was previously -1 (the default from Google style, since it uses 2
space indentation), instead of -2.

Change-Id: I1865505ce17a2cc13b85de58bda55c3b1dfcf08c
/system/core/.clang-format-4
d362cc5da943d7d6e7707adebd535b532cb4c3fb 13-Feb-2016 Dimitry Ivanov <dimitry@google.com> Merge "Add missing liblog dependency"
am: 8b68829c06

* commit '8b68829c06bf6acaae20d632d7f210c58692f73e':
Add missing liblog dependency
01f21da7329ed88bff94e82bab1a889e9244cad9 13-Feb-2016 Dimitry Ivanov <dimitry@google.com> Add missing liblog dependency

Bug: http://b/27171986
Change-Id: Ia7f03c72de9a8e5d61896bde6b4b1af396376f54
ndroid.mk
731b519cbf19670abc55267534cd581262a66ff8 13-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: sysdeps_win32: actually change ExitThread to _endthreadex."
am: 519f9aea43

* commit '519f9aea436b957371061544da380cebc2cafb96':
adb: sysdeps_win32: actually change ExitThread to _endthreadex.
1c98db1ab19639d46f4b76b3ee4253fb8970143f 13-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: make adb_thread_func_t return void, add adb_thread_exit."
am: 69c81c75df

* commit '69c81c75df2e196aea679d24464a68233dcb5393':
adb: make adb_thread_func_t return void, add adb_thread_exit.
d7b3749202df90b49d4ab554944e0dd3564fe35a 13-Feb-2016 Josh Gao <jmgao@google.com> adb: sysdeps_win32: actually change ExitThread to _endthreadex.

Forgot to amend this into b5fea14e.

Change-Id: Id04e639eb87043901681db789d7a7925300fa867
ysdeps.h
69c81c75df2e196aea679d24464a68233dcb5393 13-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: make adb_thread_func_t return void, add adb_thread_exit."
0a508d35e742f2c51908c7e60e030747d17a31e1 13-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: mkdirs fixes"
am: 7fea044de9

* commit '7fea044de9c7c941360b7af5efff79d2e8e98e37':
adb: mkdirs fixes
b5fea14e13bb6e41b36f374c954dc55faeef4627 12-Feb-2016 Josh Gao <jmgao@google.com> adb: make adb_thread_func_t return void, add adb_thread_exit.

Windows restricts the return value of threads to 32-bits, even on 64-bit
platforms. Since we don't actually return meaningful values from thread,
resolve this inconsistency with POSIX by making adb's thread abstraction
only take void functions.

Change-Id: I5c23b4432314f13bf16d606fd5e6b6b7b6ef98b5
ommandline.cpp
ervices.cpp
hell_service.cpp
ysdeps.h
ysdeps_test.cpp
ransport.cpp
ransport_local.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
sb_windows.cpp
7fea044de9c7c941360b7af5efff79d2e8e98e37 13-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: mkdirs fixes"
2c54fa5460b7be574c2d642fcb152b981116271e 12-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: redact reference to secret internal time machine."
am: e8a974091a

* commit 'e8a974091ae5d8846d6f326f7430e84f90782d2e':
adb: redact reference to secret internal time machine.
6b42a2bfd5fcfabd8e80fa062a35a7e584c510a7 12-Feb-2016 Josh Gao <jmgao@google.com> adb: redact reference to secret internal time machine.

Change-Id: Ic6744cc7c858576d7e6172460b32902e007b6fd3
ysdeps_test.cpp
90c9c6ce1535b2193d37e7943f0f77d711e302c0 11-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: sysdeps: add support for joining threads."
am: dda68c0fcf

* commit 'dda68c0fcfe4ced4ae410821c7681f02a2b9aff2':
adb: sysdeps: add support for joining threads.
dda68c0fcfe4ced4ae410821c7681f02a2b9aff2 11-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: sysdeps: add support for joining threads."
85c45bd5a185f09f24bb0d790b2038fe72b567a9 11-Feb-2016 Spencer Low <CompareAndSwap@gmail.com> adb: mkdirs fixes

Fix pathological case where the directory to be created can't be created
because there is already a file there. This was previously returning
success because the wrong var was passed to directory_exists().

Fix test to exercise this situation. Also clarify tests.

Change-Id: I0dc0f14084e0eda4e1498874d4ab2a6445d322ac
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db_utils.cpp
db_utils_test.cpp
3b3e10d0465506abc7d9e07c0381396b3726f183 09-Feb-2016 Josh Gao <jmgao@google.com> adb: sysdeps: add support for joining threads.

Bug: http://b/27105824
Change-Id: I44e4edbb2a59565c35f1f3e6a6394ac258591f95
ndroid.mk
ysdeps.h
ysdeps_test.cpp
b3a6e343fbffdd7cdf2c1d48f2b174b5f84eac78 10-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: allow wine\'s output for sysdeps_win32 strerror test."
am: 76d3308dd2

* commit '76d3308dd27a73e7ec0617f8438d24d0165a2d01':
adb: allow wine's output for sysdeps_win32 strerror test.
76d3308dd27a73e7ec0617f8438d24d0165a2d01 10-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: allow wine's output for sysdeps_win32 strerror test."
22554c91676d8981fbfc8b4811d8be3b78a0b74a 10-Feb-2016 Josh Gao <jmgao@google.com> adb: allow wine's output for sysdeps_win32 strerror test.

Change-Id: Ia5d04a2347df1bcd8c7efcc1da9cec9725007a58
ysdeps_win32_test.cpp
617fe1eb6d065ce27ecdfc0a5cedd7167a2e1ec8 10-Feb-2016 Yabin Cui <yabinc@google.com> Merge "adb: setsid() for adb host server."
am: 250f5956d6

* commit '250f5956d69c87ab573d4593951616997c3317c0':
adb: setsid() for adb host server.
6bf323b97a11194d6186f8db2ee4a5eaca8d0141 09-Feb-2016 Yabin Cui <yabinc@google.com> adb: setsid() for adb host server.

To create a daemon for adb host server, we should call setsid()
for the daemon process. However, previously we call setsid() for
the adb client process, which results in nothing but EPERM error.

Bug: 26982628
Change-Id: I2763ae3d5a243706927d7ef6af5095138c0ce2d8
db.cpp
lient/main.cpp
13aba8848833ae874a70c138e232a29e976a1212 09-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: make ctrl-c when spawning a daemon not kill the daemon."
am: b2803b5060

* commit 'b2803b5060b3a790277bf17a97651c30102a183a':
adb: make ctrl-c when spawning a daemon not kill the daemon.
cba3b1888e82353d8751cd21e1f32bac6231b103 09-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: fix mkdirs test."
am: 1a34944cde

* commit '1a34944cde5c8241bb74cde992d09f9115d5b53a':
adb: fix mkdirs test.
b2803b5060b3a790277bf17a97651c30102a183a 09-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: make ctrl-c when spawning a daemon not kill the daemon."
b72b3f8c92a0b2d4377d5bec15eb45869b8711ac 04-Feb-2016 Josh Gao <jmgao@google.com> adb: make ctrl-c when spawning a daemon not kill the daemon.

Previously, using ctrl-c in a command that needs to spawn a daemon
because one isn't already available would kill the daemon along with the
foreground process.

Bug: http://b/26982628
Change-Id: I7fefc531c3e4895423e7b466322b5426d01dc9ef
lient/main.cpp
1172b2ec71db29533231ddc4d979be98d7503f0b 08-Feb-2016 Josh Gao <jmgao@google.com> adb: fix mkdirs test.

The behavior of mkdirs was changed a while ago, without updating the
test.

Change-Id: I2aaa73818933b281e911c42a14e3c843d8bd972a
db_utils_test.cpp
3a45f945c793d8a5cd11e46d835da7659e622aee 04-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: don\'t append a slash to a path that already ends with one." am: aae1eb2c4f
am: 4b09d2f084

* commit '4b09d2f084dfe2df3314a10c59090be2c97b9a9e':
adb: don't append a slash to a path that already ends with one.
2b012f2059db1a1bfc24f08a803040fef080298a 04-Feb-2016 Elliott Hughes <enh@google.com> Merge "adb: win32: fix start-server to properly display UTF-8 on the console" am: 1617dd4fe9
am: 89df186cda

* commit '89df186cdab8eb21c7610de9a8348b6f050543d7':
adb: win32: fix start-server to properly display UTF-8 on the console
d8e0108418a777edcb9e1c3452866db62e1ba5ab 04-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: report subprocess creation errors to the client." am: 7aa7a81eb1
am: 046bf3b212

* commit '046bf3b212e9a01c3f2671c208ae3bfc8fdcd62b':
adb: report subprocess creation errors to the client.
6832ddbc980b0a61d92d1d8c14b802144a1b0f9b 04-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: fix mistaken uses of SendFail in file_sync_service.cpp." am: 2d2185ee09
am: f2610942ef

* commit 'f2610942efca1857c377df4f427ffaa3eefe65e8':
adb: fix mistaken uses of SendFail in file_sync_service.cpp.
aae1eb2c4f10f3d2c49455eb37c4ae4b38ffa47d 04-Feb-2016 Josh Gao <jmgao@google.com> Merge "adb: don't append a slash to a path that already ends with one."
53a0a99fe8197984acd5ed6324e945c09772a73e 22-Nov-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix start-server to properly display UTF-8 on the console

fwrite() is a macro that maps to adb_fwrite(), which can write UTF-8 to
the console. Use it to write the output that comes from the subprocess
adb server.

To do this, dup the stdout/stderr file descriptor and make a duplicate
FILE* stream, in binary mode (since we're reading raw bytes from the
subprocess), and unbuffered.

Change-Id: I480761bae0bd576dc9e03fa4d31266f4e49635ed
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
323899b6d3d63a9cf3fbb7f47946a9c411e5f8d2 03-Feb-2016 Josh Gao <jmgao@google.com> adb: don't append a slash to a path that already ends with one.

Bug: http://b/26964908
Change-Id: I1fbd752fd97f5414a306b46f7bfce3373362f8b3
ile_sync_client.cpp
4323507a7eecb2384a872086ab933948bd8cbe80 26-Jan-2016 Josh Gao <jmgao@google.com> adb: report subprocess creation errors to the client.

Bug: http://b/26589627
Change-Id: I38e7a33ea8274f0eb47dc0ed87fcbca08a0ab22a
hell_service.cpp
6ad06b9ea944555a55b4a9da858f241ef07121eb 29-Jan-2016 Josh Gao <jmgao@google.com> adb: fix mistaken uses of SendFail in file_sync_service.cpp.

SendFail and SendSyncFail are similarly named, and have the same
prototype. Use `#pragma GCC poison` to prevent use of SendFail in
file_sync_service.cpp, and fix the places where it was used
accidentally.

Change-Id: I6b9a7e565b76dfab10f8ae38f889d046ad80a403
ile_sync_service.cpp
fc04da854037e7197b8c2e5548b9bb7d1555611e 01-Feb-2016 David Pursell <dpursell@google.com> Merge "adb: win32: handle incomplete UTF-8 in console output, other fixes" am: 85c65dab42
am: 8467ab758c

* commit '8467ab758ccc99391dddfc875377052d89f46697':
adb: win32: handle incomplete UTF-8 in console output, other fixes
85c65dab429f1f47b6f07e26f9637084fb314eb5 01-Feb-2016 David Pursell <dpursell@google.com> Merge "adb: win32: handle incomplete UTF-8 in console output, other fixes"
488275b8f6180dd664f4c15e6f03968e82088b37 01-Feb-2016 David Pursell <dpursell@google.com> Merge "base: add SystemErrorCodeToString() function." am: 79d8f07a6f
am: cbb5d714d7

* commit 'cbb5d714d79dbc785a90fd17082227321cee9d92':
base: add SystemErrorCodeToString() function.
79d8f07a6f97511397d96dbb0676d710ce604f8c 01-Feb-2016 David Pursell <dpursell@google.com> Merge "base: add SystemErrorCodeToString() function."
5f787ed2b3b9f6cc02aa5923b95d77e2a5865438 27-Jan-2016 David Pursell <dpursell@google.com> base: add SystemErrorCodeToString() function.

Pulls the Windows error string generation out of adb into libbase so
that it can be used by fastboot as well. Also makes a Unix equivalent
that just wraps strerror() so that upcoming fastboot error reporting
code can be platform-independent.

The intent here is just to provide a portable way to report an error to
the user. More general cross-platform error handling is out of scope.

Bug: http://b/26236380
Change-Id: I5a784a844775949562d069bb41dcb0ebd13a32bc
db.cpp
db_auth_host.cpp
lient/main.cpp
ysdeps.h
ysdeps_win32.cpp
sb_windows.cpp
da870abcf48305312bdea618bb97a4280ab7e444 01-Feb-2016 Josh Gao <jmgao@google.com> Merge changes I93287b87,I30a3eb0b am: d18aea9974
am: 831bd4f043

* commit '831bd4f0436a81c5ebf9ec4417948b8195cb01d6':
adb: add nullability specifiers to adb_client.h.
adb: add adb_get_feature_set.
d18aea99746d9befed6d596521ea3aa10e07d23f 01-Feb-2016 Josh Gao <jmgao@google.com> Merge changes I93287b87,I30a3eb0b

* changes:
adb: add nullability specifiers to adb_client.h.
adb: add adb_get_feature_set.
a166e71e216dbfe4bff8dfc369b10ab08e183427 29-Jan-2016 Josh Gao <jmgao@google.com> adb: add nullability specifiers to adb_client.h.

Change-Id: I93287b876cb06d871b4330d2733ef6f43c58fbbf
db_client.h
ysdeps.h
f3f6a1d0d4279930be1434fa66cc0b3fbbb850f0 01-Feb-2016 Josh Gao <jmgao@google.com> adb: add adb_get_feature_set.

Extract a feature set getter function from commandline.cpp.

Change-Id: I30a3eb0b060a88379e29be16264637816e378978
db_client.cpp
db_client.h
ommandline.cpp
7fd384bf774863ae13a1b9091e0118e8c28e8d5c 29-Jan-2016 David Pursell <dpursell@google.com> Merge "adb: fix subprocess termination for legacy shell." am: a9352202dd
am: 4c0a6a1677

* commit '4c0a6a16772700146c4edb894af46f90138e9170':
adb: fix subprocess termination for legacy shell.
a9352202dd52a404199fbdca160d9d2d0992cf63 29-Jan-2016 David Pursell <dpursell@google.com> Merge "adb: fix subprocess termination for legacy shell."
f74da513c8cc4c44f7cf54af3da86f62d29deda8 29-Jan-2016 Josh Gao <jmgao@google.com> Merge "adb: SIGWINCH support for Windows" am: c1eb5ba0fb
am: 41b04cf896

* commit '41b04cf89677836dba14903226df5c7a3d39adcd':
adb: SIGWINCH support for Windows
2e02dc630f6449f2a79d9130a6346de7761e2be2 08-Nov-2015 Spencer Low <CompareAndSwap@gmail.com> adb: SIGWINCH support for Windows

- Introduces unix_read_interruptible() which is like unix_read() except
that it can return EINTR.

- The big idea is that the Windows ReadConsoleInput() API will return an
event on window resize and then we return EINTR from
unix_read_interruptible() just like Unix.

- Only handles horizontal resize since Windows doesn't seem to give an
event for vertical resize when no special screen buffer is used. This
should be sufficient for the primary use case of adb on Windows
(people are not running vi in the first place).

Change-Id: Id8d1710b559834c8098f2d7fbecedf2d0ade4b88
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ommandline.cpp
ysdeps.h
ysdeps_win32.cpp
a30b79a2d9af3850da23b62703bf3b76db076ab9 16-Nov-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: handle incomplete UTF-8 in console output, other fixes

Previously, the various adb_printf, adb_fwrite, etc. functions did not
correctly handle the case of the passed buffer ending with an incomplete
UTF-8 sequence. This is fixed by buffering up incomplete UTF-8 sequences
in g_console_output_buffer (protected by the mutex
g_console_output_buffer) and outputting it later once the full sequence
is available.

A unittest for the main worker function, ParseCompleteUTF8(), was added
to adb_test.

Other fixes:

- Fix the return value of number-of-chars written to be number of UTF-8
bytes instead of number of UTF-16 characters.

- Don't overwrite errno in success cases of various adb_printf, etc.
functions. This might be excessive, but might be useful in the case
when these functions are used for debugging/tracing.

- Add missing UTF-8 stdio functions that aren't currently used by adb,
but might be in the future: vprintf, putc, putchar, puts.

- stdin_raw_init: If we can't get the console handle, don't call
SetConsoleMode(). Not a big deal, but this will prevent erroneous
trace output.

Change-Id: I8730e8af92882c42b884ad921b39a17b54465085
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ysdeps.h
ysdeps_win32.cpp
ysdeps_win32_test.cpp
8c43666958372987b325df1bedcda3a117587e5f 28-Jan-2016 Rubin Xu <rubinxu@google.com> Merge "ADB security logging" am: 8dfe21eaad
am: e37103a375

* commit 'e37103a375de00d0300b49d2af3550db663f2f2e':
ADB security logging
8dfe21eaad739d297b34dbb1d2b9851d64a42dda 28-Jan-2016 Rubin Xu <rubinxu@google.com> Merge "ADB security logging"
57dd5ae1e3004daec664263e24dc4dcf4475bb02 28-Jan-2016 David Pursell <dpursell@google.com> adb: fix subprocess termination for legacy shell.

http://r.android.com/166419 changed `adb shell` behavior to not
allocate a remote PTY for non-interactive commands, but adbd relied on
having a PTY to properly terminate the subprocess.

One impact of this is that when using older versions of adb or passing
the -x flag, `adb screenrecord` wasn't properly terminating and closing
out the video file.

This CL restores the old behavior for legacy shell connections: always
use a PTY, but put it in raw mode if the client is doing local PTY
input/output processing itself.

Bug: http://b/26742824
Change-Id: I9ee630c0ff0d2d6a0db367387af7123deea79676
ommandline.cpp
hell_service.cpp
hell_service_test.cpp
aa8af387d3e5b7d90275ac44946247a6eac8ad7f 22-Jan-2016 David Pursell <dpursell@google.com> Merge "adb: fix GetFeatureSet() to indicate failure." am: 921b8e19ee
am: ff81cd2727

* commit 'ff81cd2727a8abbbad7754ffdbea5783120769e7':
adb: fix GetFeatureSet() to indicate failure.
b5a43c45902494e6a8b526627798d3feaac8239b 22-Jan-2016 David Pursell <dpursell@google.com> Merge "base: add network address parsing function from adb." am: 7fc87c9bc2
am: cee5418fe4

* commit 'cee5418fe413ce966b20ed4e6f9c6de45629dece':
base: add network address parsing function from adb.
0aacbbe9f3039df0413363e808ac0592add11a9d 22-Jan-2016 David Pursell <dpursell@google.com> adb: fix GetFeatureSet() to indicate failure.

Previously GetFeatureSet() on an invalid target would just return an
empty feature set, leading to some invalid assumptions, e.g. if there
isn't exactly one device connected this happens:

$ adb shell -t
error: target doesn't support PTY args -Tt

This CL adds a success/failure return value to GetFeatureSet(), and
also adds an option to print errors to stderr since that's the most
common behavior.

This will cause a slight difference in behavior for install/uninstall.
Previously they would block until the device was available, now they
print an error and quit immediately, which seems to be the more common
behavior for adb functions.

Bug: http://b/26387641
Change-Id: I0ea6ffaec922e04b9946e84f05c3870e5b549fde
ommandline.cpp
706955ff0d159d28bb6eb06dc10178624c505f4e 21-Jan-2016 David Pursell <dpursell@google.com> base: add network address parsing function from adb.

This CL moves the network address parsing function from adb to libbase
so that it can be used by fastboot as well as adb.

libbase seemed like the right choice because:
1. It already has some parsing functions (parseint)
2. The net address parsing function uses the libbase string
functions so we have a libbase dependency anyway.

The parsing function has been modified slightly to make the canonical
address optional, and debug logging on success has been removed.

For adb the only functional difference is that parsing a network
address will no longer print the result to the debug log, which seemed
unnecessary.

Bug: http://b/26236380
Change-Id: Ife6df02937225fc66de87884d3572d79c092c522
db.cpp
db_utils.cpp
db_utils.h
db_utils_test.cpp
ervices.cpp
d61a25c17204b74b81558cb5d67c347f1e87fef1 11-Jan-2016 Rubin Xu <rubinxu@google.com> ADB security logging

Log adb shell, pull and push operations to the security log.

Bug: 22860162
Change-Id: I5d24e9d51040ae05a41d9fcb079e84351a217bd3
ile_sync_service.cpp
ecurity_log_tags.h
hell_service.cpp
870c10cd4fbb88d878ae6de3d6acf0d8bad0d739 21-Jan-2016 Josh Gao <jmgao@google.com> Merge "adbd: use pty to determine whether a session is interactive." am: 7e923fb3c5
am: 43568a558d

* commit '43568a558d8ce9a27d47e7be1d840440ba8e7649':
adbd: use pty to determine whether a session is interactive.
b5028e46b0d97c84144f660b5e47f7fd4a716fe5 20-Jan-2016 Josh Gao <jmgao@google.com> adbd: use pty to determine whether a session is interactive.

Bug: http://b/26236990
Change-Id: I8baa4009a2fbe9a4c93f6ef5350ce61161b7237d
hell_service.cpp
61762989298b1299db3ff1cc2c2c217672c4736c 20-Jan-2016 Josh Gao <jmgao@google.com> Merge "adbd: don\'t leave zombies when subprocess creation fails." am: fb494eb40d
am: da0678946c

* commit 'da0678946c771f0cae418f866cbb9d2f0b2a4276':
adbd: don't leave zombies when subprocess creation fails.
c65fae9ef56163d17bcc86b6b6324be2b56b4aa5 20-Jan-2016 Josh Gao <jmgao@google.com> adbd: don't leave zombies when subprocess creation fails.

Bug: http://b/26660675
Change-Id: I8e65d51af73f409c30be47575f76bc6b0f227c54
devent.cpp
hell_service.cpp
3ed4d4d47be7f85ba5efa28d1f9e2c090a1a6302 16-Jan-2016 Josh Gao <jmgao@google.com> Merge "adb: tag fatal, fatal_errno with printf attribute." am: 7db2cb67be
am: a05fbcff42

* commit 'a05fbcff42427e9f8597391157942d81aba8fd36':
adb: tag fatal, fatal_errno with printf attribute.
c93cf8a75ead250eae9ec22b02339a72deedd07d 16-Jan-2016 Josh Gao <jmgao@google.com> Merge "Increase the maximum shell command length to 4096ish." am: 3472410eac
am: 2783126cab

* commit '2783126cab5ca2a1aae5779c988a84abff97cb19':
Increase the maximum shell command length to 4096ish.
2dd90a20a054ae45626f08f0168acd541dd5d20e 16-Jan-2016 Dan Albert <danalbert@google.com> Merge "Fix a couple sign-comparison warnings." am: 422359aad4
am: b2d312749e

* commit 'b2d312749efe6b46dc0faf67f72d3a4b40434934':
Fix a couple sign-comparison warnings.
7db2cb67be36a96d614c31a8b272b2df41e2d706 16-Jan-2016 Josh Gao <jmgao@google.com> Merge "adb: tag fatal, fatal_errno with printf attribute."
56e9bb9bd6861c7e5c60a5d304966f39c44b6c23 16-Jan-2016 Josh Gao <jmgao@google.com> adb: tag fatal, fatal_errno with printf attribute.

Also, fix bugs that this uncovered. In particular, the sysdeps_win32
FATAL macro would only print __FUNCTION__.

Change-Id: I6307ec9749edec21b4fee192e135a86ec445c84b
db.h
ysdeps_win32.cpp
3472410eac9e0c4a01b949c9e9d2ab2fe93e1acd 16-Jan-2016 Josh Gao <jmgao@google.com> Merge "Increase the maximum shell command length to 4096ish."
7e6683ce40ba79c94ccc1e3b984cd39e63651dd5 15-Jan-2016 Josh Gao <jmgao@google.com> Increase the maximum shell command length to 4096ish.

The actual maximum length will depend on the version of the shell
protocol being used, and any additional parameters being passed through
(e.g. TERM=xterm-256color). This should be able to be raised to 64K for
devices with commit 3d2904c (L-MR1 and above), but that'll require some
plumbing.

Bug: http://b/20467103
Change-Id: Idf0c46af5b18b854110aba58df13a53297d2475f
db.cpp
db_client.cpp
db_io.cpp
ockets.cpp
bac7bb5c16b6725436c61c6785701d9b51ed28f6 15-Jan-2016 Dan Albert <danalbert@google.com> Fix a couple sign-comparison warnings.

Bug: http://b/26523949
Change-Id: Id33146b5544147945fee3f14f7f72f39bae449f6
ysdeps_win32_test.cpp
c76e2a8dadaa1f6cd38ef125d381022c160a45db 09-Jan-2016 Jorge Lucangeli Obes <jorgelo@google.com> Merge "adbd: Depend only on libminijail." am: 6fe9930722
am: 3cdfb3b0aa

* commit '3cdfb3b0aa6ae36663fb80a628ceda388da95cd6':
adbd: Depend only on libminijail.
81a70ac08e492f337fe96700fff1de90236915b1 09-Jan-2016 Elliott Hughes <enh@google.com> Merge "Improve dumb terminal support (emacs is dumb)." am: 46798ecd17
am: ec97cb8b50

* commit 'ec97cb8b509f06e658cfa2a2fb86e0fbe8e28e25':
Improve dumb terminal support (emacs is dumb).
6fe993072282c14419198e4a5bd84872637d30a5 09-Jan-2016 Jorge Lucangeli Obes <jorgelo@google.com> Merge "adbd: Depend only on libminijail."
d68ad69d1dc8dad9245acb75d827a201e2e282ee 09-Jan-2016 Elliott Hughes <enh@google.com> Improve dumb terminal support (emacs is dumb).

Bug: http://b/26444032
Change-Id: Iaff4b09b613fd30ab7c4c73e096da34f37e0de07
ine_printer.cpp
4fc0c3d92ac91a0d89d226a0299d9e85787dd2b1 09-Jan-2016 Jorge Lucangeli Obes <jorgelo@google.com> Merge "adbd: Remove check for set_supplementary_gids." am: fd3c12d224
am: 7356218161

* commit '7356218161220848920d5e117d304d442b79f44f':
adbd: Remove check for set_supplementary_gids.
218eb7c820dccbc58b48a0f3c4cf7f2d58934064 08-Jan-2016 Jorge Lucangeli Obes <jorgelo@google.com> adbd: Depend only on libminijail.

With https://android-review.googlesource.com/#/c/195460,
adbd can depend only on libminijail, without having to include its
dependencies.

Bug: 26099611
Change-Id: I2312d8584dda88b4a4619d3100d0983fa2833ba5
ndroid.mk
fd79a5d9c1b1bc9588c228bbc8ac6e289638b1ee 08-Jan-2016 Jorge Lucangeli Obes <jorgelo@google.com> adbd: Remove check for set_supplementary_gids.

With https://android-review.googlesource.com/#/c/195400, Minijail will
check for this failure so there's no need to do it here, which allows
to simplify the code.

Bug: 26099611
Change-Id: I7c876fdcab874ed403f82bdd5a4048c0f1e5db58
aemon/main.cpp
62d65862a488243d9ebaf2cf3ba861382ef1d91b 07-Jan-2016 Josh Gao <jmgao@google.com> Merge "WA: Fix adb wait-for-device command" am: bf867cac7e
am: 4da27b1014

* commit '4da27b101499c59eb85e9650a97a7b2f980a2dee':
WA: Fix adb wait-for-device command
94e0776eb88a12c52f9d9869a67822bf83171215 05-Jan-2016 Leo Sartre <leox.sartre@intel.com> WA: Fix adb wait-for-device command

Without -s argument, adb wait-for-device will make a call to
acquire_one_transport() with sinfo->serial.c_str() == "".
Waiting for acquire_one_transport() to be reworked to use std::string
rather than const char * for serial, work around this by passing NULL
when sinfo->serial is not initialized in host_service_to_socket().

Change-Id: Ifef53e0e82850364f5029ee36560376f2a4a5104
Signed-off-by: Leo Sartre <leox.sartre@intel.com>
ervices.cpp
2b787e2b78f967d11eaa92259cde30795883f585 22-Dec-2015 Dan Willemsen <dwillemsen@google.com> Merge "Limit adb_test to first multilib" am: 3fb7d97689
am: 03e6f710bc

* commit '03e6f710bc5263cbaf53149dac1d7f775a9ab051':
Limit adb_test to first multilib
1e20e0aa1d5bef60377376195abd244ceae81c7c 22-Dec-2015 Dan Willemsen <dwillemsen@google.com> Limit adb_test to first multilib

It uses libadb, which is also only compiled for the primary
architecture. BUILD_HOST_NATIVE_TEST is changing the default
LOCAL_MULTILIB to match BUILD_NATIVE_TEST.

Change-Id: Ia9c002e641125eb996a7f198af1f182d0d6171c6
ndroid.mk
ee5910c3ee2feffde6bb46164bf56fc686bea834 19-Dec-2015 Elliott Hughes <enh@google.com> Merge "Give adb a proper progress bar." am: 0e6a23c7d5
am: 91c228f1ef

* commit '91c228f1ef6845535e7e490f0d938cf5e4271f11':
Give adb a proper progress bar.
a00e6ef1fff0c45a8d07a42dead9caf49b945f53 18-Dec-2015 Elliott Hughes <enh@google.com> Give adb a proper progress bar.

This factors out the duplication in the single-file progress, and adds a
whole-sync progress percentage to the front of the line. A number that's
both more interesting and easier to read.

This also fixes the >100 percentage reporting for files of unknown size.

Bug: http://b/26189482
Change-Id: I51501ccef6ae1f52425db0eb0862d87e90947a6c
ile_sync_client.cpp
f6e7622aea1573813dae446248b7179a61cebf72 18-Dec-2015 Elliott Hughes <enh@google.com> Merge "adb host: add device state in "adb wait-for-*"" am: 82509e7925
am: ba7a198c29

* commit 'ba7a198c2976baf9574dd01d7719ec0443caba47':
adb host: add device state in "adb wait-for-*"
3f165e8d5b82fb6f0bb20c114f51ca9b0a388202 18-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: extract USB FFS read/write limit constants." am: 1ff73936a7
am: 67a6d861ce

* commit '67a6d861ce47b2d555a0e6d4288f3c3d35a9155b':
adb: extract USB FFS read/write limit constants.
c85c7e84cc64df898db90e49bced23298f00c188 18-Dec-2015 Elliott Hughes <enh@google.com> Merge "Improve "adb install"\'s error message slightly." am: d361582dc0
am: 79abeb68f2

* commit '79abeb68f26c3ff9b99929fe15b25fd202225ffc':
Improve "adb install"'s error message slightly.
135405fd201655c7df61887224dab795384642a5 18-Dec-2015 Jorge Lucangeli Obes <jorgelo@google.com> Merge "adb: Use Minijail for privilege dropping." am: 297a8381b5
am: f733d6acad

* commit 'f733d6acad6582fb7d816ef65bbeecfd745af5ec':
adb: Use Minijail for privilege dropping.
065c723db28809f99f9683d094f938213c11eed9 18-Dec-2015 Tom Cherry <tomcherry@google.com> Merge "Use selinux_android_setcon() instead of setcon()" am: 64cc0825a6
am: 4692984e92

* commit '4692984e92de83299f4c03ec176c9a4b4dcb0292':
Use selinux_android_setcon() instead of setcon()
82509e79253309af7d78ebc833ca922b7f7b3c48 17-Dec-2015 Elliott Hughes <enh@google.com> Merge "adb host: add device state in "adb wait-for-*""
1ff73936a77df18395b347bd9245308141269e36 17-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: extract USB FFS read/write limit constants."
ae72b5aa4bf079aa1c5edc0d0f9b91831d4ecfbb 17-Dec-2015 Josh Gao <jmgao@google.com> adb: extract USB FFS read/write limit constants.

Change-Id: I5e9fb7959a1c4744cb8d53ece4634138239d4e49
sb_linux_client.cpp
d361582dc04063ca93d9939d0315373b10b9200f 17-Dec-2015 Elliott Hughes <enh@google.com> Merge "Improve "adb install"'s error message slightly."
fe01885c9ba3cf2781411f1d6a7e4bffd9d164a4 17-Dec-2015 Elliott Hughes <enh@google.com> Improve "adb install"'s error message slightly.

We still don't really have a clue what went wrong, but "Failed to write"
made it sound like we did.

Change-Id: Ic58b13202e2d8ea6b095f7046db9d0771d77ce65
ommandline.cpp
683dc4817f1e3cb3a043a7ce6496c00d19fa27f5 14-Dec-2015 Jorge Lucangeli Obes <jorgelo@google.com> adb: Use Minijail for privilege dropping.

By using Minijail we avoid writing the same priv-dropping code over
and over again. This also enables future hardening opportunities.
We're already using Minijail for priv-dropping on Brillo.

Minijail is unit- and integration-tested on the
Chrome OS CI infrastructure (pulling from the same repo, see
https://wmatrix.googleplex.com/security?tests=security_Minijail0).
Once CI comes to Android, it will be continuously tested there as well.

Both 'adb root' and 'adb unroot' still work.

Bug: 26099611
Change-Id: I52c456ea272d27bd6fbc71200f4fdd928a592158
ndroid.mk
aemon/main.cpp
64cc0825a639bf022b052cf4fa6aa3e8d13f61b1 17-Dec-2015 Tom Cherry <tomcherry@google.com> Merge "Use selinux_android_setcon() instead of setcon()"
1fbc9dbd0f78d755e42a7100a8a24d2ff31c7f6a 27-Nov-2015 Leo Sartre <leox.sartre@intel.com> adb host: add device state in "adb wait-for-*"

The current implementation of the host commands "adb wait-for-*" allows
to specify only the transport layer (local, usb or any).
This patch allows the specification of the expected device state
(bootloader, recovery, device or sideload), this is usefull for
scripting purposes.

Use case:
$ adb reboot sideload-auto-reboot
$ adb wait-for-usb-sideload && adb sideload package.zip

Change-Id: I276a6be4d82f8b7901f74e1e5395b86d16548e8f
Signed-off-by: Leo Sartre <leox.sartre@intel.com>
ommandline.cpp
ervices.cpp
38cd57a1450874d4c045ab3612f2dd11d04fca13 11-Dec-2015 Tom Cherry <tomcherry@google.com> Use selinux_android_setcon() instead of setcon()

Bug 26114086

Change-Id: I02d20ee7a5f487fc73d7a33d50b0b8f1cd9ad3a4
aemon/main.cpp
a61bd45f83fbc630ac5a09c97006a629e7fcfba6 16-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: split up reads longer than 16k." am: 56d7d4e85f
am: bf2c482b56

* commit 'bf2c482b5625d7f0722e85415221a02795cb72ca':
adb: split up reads longer than 16k.
0b19540dee9d0eee56f87705eea771b13800290f 16-Dec-2015 Josh Gao <jmgao@google.com> adb: split up reads longer than 16k.

Reads from functionfs allocate contiguous buffers in the kernel, causing
long ones to sometimes fail because of memory fragmentation.

Bug: http://b/26206622
Change-Id: Id40753d6f29b37b5ca97c3e2fa3921f52b4242de
sb_linux_client.cpp
0eb8f2942ac9d580d8f419febd4a5f4a4bed99b9 16-Dec-2015 Elliott Hughes <enh@google.com> Merge "More idiomatic cleanup of 9f75a035713d216469f1cabfe4a65f7864e2145a." am: a48dc55f32
am: 14f74dae87

* commit '14f74dae876482a2eb41e8a3802cc5b39224662a':
More idiomatic cleanup of 9f75a035713d216469f1cabfe4a65f7864e2145a.
9e7893bf86a18b8a3f709d32811f56ccc2df3449 16-Dec-2015 Elliott Hughes <enh@google.com> More idiomatic cleanup of 9f75a035713d216469f1cabfe4a65f7864e2145a.

Change-Id: Id936946375d2be56ba10bf3aa5804f52cdbecc2d
aemon/main.cpp
eba19367fe05b5bffd8bfe57a318de191927a661 16-Dec-2015 Nick Kralevich <nnk@google.com> Merge "adbd: make a PR_CAPBSET_DROP error fatal." am: 57134adecb
am: 85ac05f480

* commit '85ac05f4805c3f12a923817ab4939f760ac460ca':
adbd: make a PR_CAPBSET_DROP error fatal.
9f75a035713d216469f1cabfe4a65f7864e2145a 16-Dec-2015 Nick Kralevich <nnk@google.com> adbd: make a PR_CAPBSET_DROP error fatal.

Back in 080427e4e2b1b72718b660e16b6cf38b3a3c4e3f, we said:

If the kernel doesn't support file capabilities, we ignore
a prctl(PR_CAPBSET_DROP) failure. In a future CL, this could
become a fatal error.

Make it a fatal error. With SELinux support, all devices are
required to support file capabilities.

Change-Id: I0ce0c4cb9387c42e325cbf1a63c5d82e6aab530c
aemon/main.cpp
2e83684537326b027ef042d5712d2b861af8e626 14-Dec-2015 Elliott Hughes <enh@google.com> 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.
1b708d368f29e6053064c9cf6949ab6ebdbb7ac5 12-Dec-2015 Elliott Hughes <enh@google.com> Share the new adb USB diagnostic code with fastboot.

Bug: http://b/26134129
Change-Id: Ieaf0651c7b3f8a028760982091ec63a21a5484ba
ndroid.mk
db.h
iagnose_usb.cpp
iagnose_usb.h
ransport.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
sb_windows.cpp
9b42cea202fa15a024485d1afd551ceb100ae656 13-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: handle some edge cases with process environments." am: 80f3b0438d
am: 412f6aaead

* commit '412f6aaead3c414fe65e8a9ca129e3218d28f633':
adb: handle some edge cases with process environments.
80f3b0438d84fba3c36cc73cfef992032cd33eb0 12-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: handle some edge cases with process environments."
e03c988748d860527248d4aca01bb7903d3799aa 12-Dec-2015 Josh Gao <jmgao@google.com> adb: handle some edge cases with process environments.

Change-Id: I0c20e58e14ef756a8c45dd5ea85f7301157a3c8e
hell_service.cpp
25ec5c097afb550baae50b80b68cbb08364cef50 12-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: don\'t use setenv after forking." am: 5e15568c07
am: 7b74dc83e6

* commit '7b74dc83e6e3c81f534f4422c14402ecd04b9015':
adb: don't use setenv after forking.
5e15568c077e3c4df5218f78363864a6f7280c06 12-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: don't use setenv after forking."
9b3fd6721392b16dee00caeca9586070496471e1 11-Dec-2015 Josh Gao <jmgao@google.com> adb: don't use setenv after forking.

Previously, for `adb shell`, we were using setenv after forking to set
up the child's environment. This would occasionally deadlock in the
child, which would cause the main thread to deadlock waiting for the
child to complete. This patch constructs the environment before forking
and passes it to execle, eliminating the deadlock.

Bug: http://b/25847115
Change-Id: I720d472770564b1449819ddaab945a89844244a8
hell_service.cpp
c56e68f0ebb1827a7d8df4309eadc52b73aaba79 11-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: make pulling symlinks and devices work." am: c8e793685c
am: 8b99185552

* commit '8b99185552fd49e7902404352e0b5fda266263fd':
adb: make pulling symlinks and devices work.
c8e793685c816531cd2f2af7229b3f6b41d14a7c 11-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: make pulling symlinks and devices work."
f264224191793d754aff8937849cf956d689bdfa 09-Dec-2015 Josh Gao <jmgao@google.com> adb: make pulling symlinks and devices work.

Bug: http://b/25972989
Bug: http://b/26085751
Change-Id: I43842871522ea5f67a8c258dcb6ddafa8dd744c8
ile_sync_client.cpp
est_device.py
7e4d906f2f373fac5747ab39fdffb5325606d613 11-Dec-2015 Mike Frysinger <vapier@google.com> Merge "adbd: refactor priv dropping logic" am: 6945e36060
am: e2d0403e1c

* commit 'e2d0403e1c6fc610e1536090e903ddced58a2015':
adbd: refactor priv dropping logic
6945e360601a37301a6a678389d7bc9e974b1e23 11-Dec-2015 Mike Frysinger <vapier@google.com> Merge "adbd: refactor priv dropping logic"
eaad29ed539f17df9b4cacf78314884b0b36ec5e 11-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: shell: add -n flag to not read from stdin." am: aae38d9704
am: 5abed250dd

* commit '5abed250dd8a808271527c02a8c7758a863541fc':
adb: shell: add -n flag to not read from stdin.
d1de91b26ca901c6cfe5f86a201b54cc25acaac0 11-Dec-2015 Nick Kralevich <nnk@google.com> Merge "Revert "adb: Make HOME=/data/local/tmp"" am: ce4bbcfb08
am: a09565ad1d

* commit 'a09565ad1d4c552b6d1dc8be28cf674d2ec8b3ec':
Revert "adb: Make HOME=/data/local/tmp"
0f871e8257e59dabba1ef21319121968bd1e238f 11-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: make the test_pull_dir test actually test something." am: f31aba9e8d
am: e0dcc75107

* commit 'e0dcc751072591e471a489e18d2d30abc045ffa4':
adb: make the test_pull_dir test actually test something.
12debfc4cbcfb24006002018be342e644bdbb588 11-Dec-2015 Josh Gao <jmgao@google.com> Merge "Move adb tests to system/core/adb." am: 4d0e10b24e
am: fe5c23b388

* commit 'fe5c23b388d1c4166558f4b3d3222f9015528afb':
Move adb tests to system/core/adb.
aae38d9704a6c5a2a7dfd9b628bd89822f1cbb60 10-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: shell: add -n flag to not read from stdin."
7d586073609723cb2f6ed37de0ad1a7996e621ae 21-Nov-2015 Josh Gao <jmgao@google.com> adb: shell: add -n flag to not read from stdin.

Shell scripts of the following form do not work properly with adb:
echo "foo\nbar\nbaz" | {
read FOO
while [ "$FOO" != "" ]; do
adb shell echo $FOO
read FOO
done
}
The first run of adb shell will consume all of the contents of stdin,
causing the loop to immediately end. ssh solves this by providing a -n
flag that causes it to not read from stdin. This commit adds the same.

Bug: http://b/25817224
Change-Id: Id74ca62ef520bcf03678b50f4bf203916fd81038
db_utils.cpp
db_utils.h
lient/main.cpp
ommandline.cpp
aemon/main.cpp
ce4bbcfb08bea39dce8c4f71da7326814edfb247 10-Dec-2015 Nick Kralevich <nnk@google.com> Merge "Revert "adb: Make HOME=/data/local/tmp""
b118762241da6676fce834728be4a10260ac28a1 10-Dec-2015 Nick Kralevich <nnk@google.com> Revert "adb: Make HOME=/data/local/tmp"

During early boot, we may be mounting and unmounting /data.
Having the home directory for adb shell commands, such as
"adb shell logcat", on the /data directory prevents unmounting.

This reverts commit 173eb396c7854a3b6c18d0d65865ad05c8b0e195.

Bug: 26132185
Change-Id: Ib7c2f9e696f52bf5bbb79223d90dd76791779587
hell_service.cpp
4120ebc635b41b17a7283b5c2d0ef1e4425a169f 09-Dec-2015 Mike Frysinger <vapier@google.com> adbd: refactor priv dropping logic

Makes the code a little cleaner.

Change-Id: I961b6fc8730c45d8fd4f9fd2981a6d6ab8f51fb6
aemon/main.cpp
f31aba9e8d976039398dbc694f7a1bd57da6e8e6 10-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: make the test_pull_dir test actually test something."
4d0e10b24e6535297424ebfe6682a1239d1a6d18 10-Dec-2015 Josh Gao <jmgao@google.com> Merge "Move adb tests to system/core/adb."
ffc39903c6e2b9574b1c7a927d7155a98e7769ca 10-Dec-2015 Elliott Hughes <enh@google.com> Merge "Simplify adb LinePrinter newline handling." am: 9fa5cefea4
am: ab31c07ce9

* commit 'ab31c07ce9a9d6df3483c326c42a50c63f737695':
Simplify adb LinePrinter newline handling.
77f539ab4918514706f986f77529c17a38650be0 09-Dec-2015 Elliott Hughes <enh@google.com> Simplify adb LinePrinter newline handling.

We had mostly-working hacks before, but it's time to just modify LinePrinter
to suit our needs. If we tell LinePrinter what kind of output we're giving
it, it can manage things automatically.

This fixes the minor bug where we'd sometimes have a blank line after an
error message.

Change-Id: I07ff52437f2402de311e237dd1b2dd338d9b668a
ile_sync_client.cpp
ine_printer.cpp
ine_printer.h
ce8f2cdcd09b24e3deb88ffefb071752f79ab1bb 09-Dec-2015 Josh Gao <jmgao@google.com> adb: make the test_pull_dir test actually test something.

Change-Id: I8b525377557528d5bc70c44d587891fad9f739bd
est_device.py
191c15483294ffe67be3ead880e788059b1c3e25 09-Dec-2015 Josh Gao <jmgao@google.com> Move adb tests to system/core/adb.

Change-Id: If240f45817a46d1e055a8e5173ee7191b9d6c8ea
est_device.py
9046c23ed69214bcec87568cbe082320ffc6fc81 08-Dec-2015 David Pursell <dpursell@google.com> Merge "adb: add help text for USB permission errors." am: 663e949b2b am: e37325defc
am: 4542b62cca

* commit '4542b62ccafb749542bddaf0b442db554e7210e3':
adb: add help text for USB permission errors.
663e949b2bbda5dcc2b92e4d1936555019cdd66b 08-Dec-2015 David Pursell <dpursell@google.com> Merge "adb: add help text for USB permission errors."
e042ff867cbfd558728855d00f4ce1a99265cd07 08-Dec-2015 Nick Kralevich <nnk@google.com> Merge "adb: Make HOME=/data/local/tmp" am: 5358093225 am: 65ab87dd9b
am: b87df11678

* commit 'b87df11678c22d56d02c776f8f91031bf81a963d':
adb: Make HOME=/data/local/tmp
53580932250c9f3ba4a052c9fe31aa1de7bf411d 08-Dec-2015 Nick Kralevich <nnk@google.com> Merge "adb: Make HOME=/data/local/tmp"
79a3210eda7060735b25579eea49602bceee8ac4 08-Dec-2015 Erik Kline <ek@google.com> Merge "Switch from using sockaddr to sockaddr_storage." am: 46b0b1c694 am: 4c1b3840f0
am: cbc6f68e32

* commit 'cbc6f68e320bd30d0cd7fbe73847deacbd54e073':
Switch from using sockaddr to sockaddr_storage.
46b0b1c694bd873bd8130440d9ec1367dbe6da6e 08-Dec-2015 Erik Kline <ek@google.com> Merge "Switch from using sockaddr to sockaddr_storage."
173eb396c7854a3b6c18d0d65865ad05c8b0e195 08-Dec-2015 Nick Kralevich <nnk@google.com> adb: Make HOME=/data/local/tmp

Make the home directory for adb shell be /data/local/tmp and
automatically change into that directory.

Change-Id: Ib5cc6e1ecdd31a37e986cf03836f7589ebd40868
hell_service.cpp
ef119a14b8f5a7eca18930e272e550ebf25217bd 08-Dec-2015 Elliott Hughes <enh@google.com> Merge "Track rename of base/ to android-base/." am: 912ed3d8ca am: e2a9563be1
am: 3608ee5e90

* commit '3608ee5e903689ea7c433587be664649689816e1':
Track rename of base/ to android-base/.
7e16cc15b5e16ec35f4c9f0516a6cacf90326856 01-Dec-2015 Erik Kline <ek@google.com> Switch from using sockaddr to sockaddr_storage.

This is to ensure sufficient space is always available.

Change-Id: Ifa87b93ecdc90dcacbfb24446c872344da6703d3
db_auth_client.cpp
db_listeners.cpp
dwp_service.cpp
ransport_local.cpp
4f71319df011d796a60a43fc1bc68e16fbf7d321 05-Dec-2015 Elliott Hughes <enh@google.com> Track rename of base/ to android-base/.

Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
db.cpp
db.h
db_auth_host.cpp
db_client.cpp
db_io.cpp
db_io_test.cpp
db_listeners.cpp
db_trace.cpp
db_trace.h
db_utils.cpp
db_utils_test.cpp
lient/main.cpp
ommandline.cpp
onsole.cpp
aemon/main.cpp
devent.cpp
ile_sync_client.cpp
ile_sync_service.cpp
ervices.cpp
hell_service.cpp
hell_service.h
hell_service_test.cpp
ysdeps.h
ysdeps_win32.cpp
ysdeps_win32_test.cpp
est_track_devices.cpp
ransport.cpp
ransport_local.cpp
sb_linux.cpp
sb_osx.cpp
02025afe2be7c8268b0a50c1fbba5ebdcbc9d037 04-Dec-2015 Josh Gao <jmgao@google.com> Merge "adbd: split up writes longer than 16k." am: 1c6cd21c43 am: eb4426f2b4
am: 8e7bde369b

* commit '8e7bde369b8cdd8b65a3e91bf77d60c1c5ed308c':
adbd: split up writes longer than 16k.
1c6cd21c43e3acd8b275c21a88099c5fe9f56e38 03-Dec-2015 Josh Gao <jmgao@google.com> Merge "adbd: split up writes longer than 16k."
6b531c4e6ddfaef4bef9b04a2d94c56ae85b748d 03-Dec-2015 Josh Gao <jmgao@google.com> adbd: split up writes longer than 16k.

Also, inline the bulk_read and bulk_write functions which were only
being used by one other function.

Bug: http://b/25847115
Change-Id: I218a869030219f606577a5529601c542488115e0
sb_linux_client.cpp
d2acbd19312a66cbee2c49f455eddd82b6700d1d 03-Dec-2015 David Pursell <dpursell@google.com> adb: add help text for USB permission errors.

The current permission messages can be confusing for users who don't
know about udev and USB access permissions. This CL adds some checks to
try to identify common udev problems, and adds a link to online
documentation.

Example messages:

1) adb server is in plugdev group but access is still denied:
$ adb devices
List of devices attached
082f59270073e1e3 no permissions (verify udev rules); see [developer.android.com/tools/device.html]

2) plugdev group exists but adb server is not in it:
$ adb shell
error: USB permission failure: udev requires plugdev group membership.
See [developer.android.com/tools/device.html] for more information.

3) plugdev group does not exist:
$ adb shell
error: USB permission failure.
See [developer.android.com/tools/device.html] for more information.

Bug: http://b/25777880
Change-Id: I536565adc12ab657c75151309795674181205db0
db.h
ransport.cpp
ransport.h
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
sb_windows.cpp
f681478787066768e82d0f2416568d333039cb82 02-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: don\'t divide by zero" am: 1702f427b5 am: e53fadf4b3
am: 9f941b96f5

* commit '9f941b96f52e975e97f3f3c41bc5d931fe8fb0e6':
adb: don't divide by zero
1702f427b53b88d9517bb994844a9a15e02f2bba 02-Dec-2015 Josh Gao <jmgao@google.com> Merge "adb: don't divide by zero"
b69320e215bee2eb1e3b027fa5b769bfb024148b 02-Dec-2015 Elliott Hughes <enh@google.com> Merge "Fix "adb sync" (and "adb push") error reporting." am: d0d87f78e5 am: 59021ad415
am: fa454c1faa

* commit 'fa454c1faab102458d18fc07d1f8211bd89da80b':
Fix "adb sync" (and "adb push") error reporting.
d0d87f78e55362e3792ddec5faeab247f3493858 02-Dec-2015 Elliott Hughes <enh@google.com> Merge "Fix "adb sync" (and "adb push") error reporting."
68e26811f02fb1c8d634c818ea3971ca111fbf2d 01-Dec-2015 Josh Gao <jmgao@google.com> Merge changes I25bdcbc5,I12314da5,I055b0821 am: a3892504ac am: 81d3447fa9
am: fd3770a5a2

* commit 'fd3770a5a26b23303d49686cd24bab2939e5776b':
adb: don't pull symlinks when pulling a directory
adb: remove extraneous newline from skip message
adb: correctly count skipped files in push/pull
b0e039f4ca1dd59a13078bb9bb4c24daac93cd84 30-Nov-2015 Josh Gao <jmgao@google.com> adb: don't divide by zero

If we stat a file and get a size of 0, and then successfully read bytes
from that file, we would previously divide by zero when calculating the
percentage completion of the file. This case happens either when we're
racing against something else writing to the file, or when we're pulling
magical files such as the ones in /dev/cpuctl/ that lie about their
size.

Bug: http://b/25925733
Change-Id: I980b9c14f44a1eb4a42bc8736c94fa6db06c08d1
ile_sync_client.cpp
7b284b2f22a3c1076bbb483d6ab49afe191adc3d 30-Nov-2015 Josh Gao <jmgao@google.com> adb: don't pull symlinks when pulling a directory

The previous change to do this (f96dc73b) only skipped individually
named symlinks, not symlinks inside of a directory that was being
pulled.

Bug: http://b/25601283
Change-Id: I25bdcbc546a9d3a0dbd8dacdb065fb134d96022b
ile_sync_client.cpp
d3266e058e9b4c609491e4115887407446d8ace1 30-Nov-2015 Josh Gao <jmgao@google.com> adb: remove extraneous newline from skip message

Change-Id: I12314da589bf0db14b37ae4c1f526665182f4776
ile_sync_client.cpp
dd6cc4d7eee1669a44cbe1f72ce3325aba2bf0f9 30-Nov-2015 Josh Gao <jmgao@google.com> adb: correctly count skipped files in push/pull

Bug: http://b/25650207
Change-Id: I055b08216938640c4f7c5e96a7ea3719bf90ba70
ile_sync_client.cpp
cc65c3b9f8edc6fb48ffe725376e65fac42851d6 21-Nov-2015 Elliott Hughes <enh@google.com> Fix "adb sync" (and "adb push") error reporting.

This patch ensures that we read any error response from the server if the
server closes the connection. Unfortunately, that's not sufficient to ensure
that we always see the server's error message --- sometimes the data just
gets thrown away because we keep writing without reading. Setting SO_LINGER
avoids this.

Bug: http://b/25230872
Change-Id: I96c019cc72bd139198de79bf29e6536cc462c20f
db_listeners.cpp
ile_sync_client.cpp
ile_sync_service.cpp
ysdeps.h
e68e3f458c1449a3236ffd22f1eef43d1553fe21 21-Nov-2015 Elliott Hughes <enh@google.com> Merge "Move SendLargeFile into SyncConnection." am: ddf41f1ad0 am: 49f4f575f9
am: d88988970c

* commit 'd88988970c72434eda97319882436b40fe348a6b':
Move SendLargeFile into SyncConnection.
6aab58c49914a9e50d1862d29e240e98b441f9c3 21-Nov-2015 Elliott Hughes <enh@google.com> Move SendLargeFile into SyncConnection.

Just a trivial refactor. Code change comes later.

Change-Id: If9e509a8c44649e5be4daaca57972939b037b8db
ile_sync_client.cpp
159b455fcbedf13d5c8118b07784989ec96a0079 20-Nov-2015 Elliott Hughes <enh@google.com> Merge "Avoid SIGPIPE in adb." am: 8c5511c692 am: 1146ae0205
am: bd9a852e10

* commit 'bd9a852e10c7af3f2eddd6c3b9401849b792a808':
Avoid SIGPIPE in adb.
65433da1cbd8d2869a60ce3bf18b6b440461741d 19-Nov-2015 Elliott Hughes <enh@google.com> Avoid SIGPIPE in adb.

We're now able to send packets faster than the device can handle them,
meaning that sometimes we're several packets through before the device
says "hey, wait, I can't write" and closes the connection. At best this
led to us reporting that we couldn't sync because "Connection reset";
at worst we'd get SIGPIPE because we were still streaming to a connection
that had already been closed.

This change renames adb_main adb_server_main, and moves the ignoring of
SIGPIPE into adb_commandline so it applies to both client and server (but
not adbd).

This change doesn't address the "wrong error message" part of the problem,
but at least it means you'll get *an* error message.

Bug: http://b/25230872
Change-Id: Ic60e4d13ed03fdcdf0d5cbc97201ebd1097c16ed
db.h
lient/main.cpp
ommandline.cpp
25092744d9ec9b95505de7356d56f978e570462f 19-Nov-2015 Elliott Hughes <enh@google.com> Merge "Don\'t send screen unless we\'re talking to a new adbd." am: 9f90368701 am: 5e3589da14
am: 7a2f48eb01

* commit '7a2f48eb01a64886fdf0064041daafe29a07289e':
Don't send $TERM unless we're talking to a new adbd.
c2252df25a9821b95e93b8842042a282574e7c5e 18-Nov-2015 Elliott Hughes <enh@google.com> Don't send $TERM unless we're talking to a new adbd.

I put the conditional in the wrong place, not realizing that even the
old shell system allowed one 'argument'.

Bug: http://b/25765657
Change-Id: I2752fb838d6377bf24e5b4cf959462557a196c87
ommandline.cpp
00be90244d4142e885d566a189114785679767da 18-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: don\'t use adb_dirname in between getting and printing errno." am: 44901f1147 am: 975c9a6863
am: 01f7f6fb03

* commit '01f7f6fb0323187a413dda937b9b893964fca5c9':
adb: don't use adb_dirname in between getting and printing errno.
b5d763b0536e1b18a6295e9ca0da70293296bec9 18-Nov-2015 Josh Gao <jmgao@google.com> Merge changes Ice07f892,Ie1f082a0 am: 74a33fbcef am: 053eba0bc1
am: cb601eb981

* commit 'cb601eb981f70d395e9bac5c1bf39c7773141eca':
libcutils: don't build for Windows.
adb: don't link against libcutils on Windows.
44901f1147104f9f5726e250052e0bcb14823f5c 18-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: don't use adb_dirname in between getting and printing errno."
9a373a160cbdea1c3cbffac199f315f13e9db83b 18-Nov-2015 Elliott Hughes <enh@google.com> Merge "Pass screen to the device." am: c40f213b67 am: 1fd0ea9e0e
am: cc1ef0afae

* commit 'cc1ef0afae0ebbd818232e0252454d5591847f85':
Pass $TERM to the device.
f6e65e3f80e59866bfe74f4d82a9850216a65234 17-Nov-2015 Josh Gao <jmgao@google.com> adb: don't use adb_dirname in between getting and printing errno.

adb_dirname might trample over the errno value we want to print. Move
the adb_dirname call out to a local to prevent this.

Change-Id: I8a62cb2e1be8704225a9c3b72dd01259c7eaaae4
ile_sync_client.cpp
a629e2e578acf83dbadd55b70c3221c4289d7031 14-Nov-2015 Josh Gao <jmgao@google.com> adb: don't link against libcutils on Windows.

Bug: http://b/25693157
Change-Id: Ie1f082a094371124b4d66c87c7ab1a0706271b9d
ndroid.mk
18ddf5c6a233bd56d20548fd834c0ecbf8216410 16-Nov-2015 Elliott Hughes <enh@google.com> Pass $TERM to the device.

Unfortunately, this isn't backwards-compatible with the current shell
protocol because we made unknown shell: arguments errors. We could try
to commit the change to make them just warnings first, but how would
we know when everyone was running adbd with that change? Bumping the
protocol version doesn't help because that only affects the code running
on the host. And although we could add another feature to the reported
features, since shell_v2 is still in development, that doesn't seem
worthwhile.

Bug: http://b/25601436
Change-Id: I12b81aa656cd25b91d14ef691dcbd2b7dab49535
ommandline.cpp
ervices.cpp
hell_service.cpp
hell_service.h
hell_service_test.cpp
4fde9d5698c35107b330801e94d86eddd2bad8ad 14-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: don\'t pull symlinks." am: 29843cf141 am: e01de06892
am: b5706b5f08

* commit 'b5706b5f0830fa87244e3bf1685050a9b1da5703':
adb: don't pull symlinks.
f96dc73b9f218f464640a9cdd80c389723665d5c 12-Nov-2015 Josh Gao <jmgao@google.com> adb: don't pull symlinks.

Pulling symlinks was broken for directories, and it doesn't seem like
there's a good way to make it not broken, given that the protocol doesn't
have readlink (and we don't want to create symlinks on Windows, anyway).
The behavior for files doesn't seem to be especially useful, either.

Bug: http://b/25601283
Change-Id: Ie1d27e93dd09cbc0c178623b390041d1cb11f726
ile_sync_client.cpp
28f238893854bc23752fe557425b2be48de05701 13-Nov-2015 Elliott Hughes <enh@google.com> Merge "Improve adb help text and adb backup error reporting." am: 82a2b2441c am: da2319bf4d
am: 7274d3fdc7

* commit '7274d3fdc70dc6abb5780f110c113f078a195cf3':
Improve adb help text and adb backup error reporting.
56e6813e2701ee4a775e5e098801cbf16dc9a3d1 13-Nov-2015 Elliott Hughes <enh@google.com> Improve adb help text and adb backup error reporting.

Bug: https://code.google.com/p/android/issues/detail?id=188220
Bug: http://b/25677893
Change-Id: If174049e86d65d95db93a6e071c089dcd1d7cd4f
ommandline.cpp
846ba1676798818e29397f66664923e10555f963 13-Nov-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: Unicode USB device names" am: 76aefd5f9b am: 01f5c3afc8
am: 84a2145033

* commit '84a214503382d9bb335a12872aa404c4a643ec12':
adb: win32: Unicode USB device names
bb2900098a4b930e9129c8fb7cf703d491955da7 13-Nov-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: Unicode USB device names

Cleanup TODO and instead of (poorly) converting the device name from
wchar_t to char, just retrieve and store it as wchar_t, simplifying the
code.

This probably isn't necessary since device names are probably always
ASCII, but this cleans things up.

Change-Id: Ib780dcdc1e0e06b97b61e25d29a23874b35d7800
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
sb_windows.cpp
dd6543e4e82c8c77c752104c43fb3af718df785f 13-Nov-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: remove widen()/narrow() in favor of UTF8ToWide()/WideToUTF8()" am: 61a560aeb1 am: 187858496b
am: 395156a270

* commit '395156a270f43eaf4f489b5ef76af6d0f1ddaf06':
adb: win32: remove widen()/narrow() in favor of UTF8ToWide()/WideToUTF8()
d21dc825bbecad6ce480c5e5c574cc77eadcd779 13-Nov-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: remove widen()/narrow() in favor of UTF8ToWide()/WideToUTF8()

Now that we have a more standardized API (also available in Chromium),
switch to it. Another benefit is real error handling instead of just
killing the process on invalid Unicode.

Make UTF8ToWide()/WideToUTF8() set errno to EILSEQ on bad input. This is
the same error code that wcsrtombs(3) uses.

Update the unittest to check for EILSEQ.

Change-Id: Ie92acf74d37adaea116cf610c1bf8cd433741e16
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ndroid.mk
db_auth_host.cpp
lient/main.cpp
ine_printer.cpp
ysdeps.h
ysdeps_win32.cpp
80a9bc872c7add5da12f7a23f79a44a1a0b81675 13-Nov-2015 Josh Gao <jmgao@google.com> Merge changes Ic124ecb9,I94de55d2 am: 26f2e1fd4f am: 9a3f299ec0
am: 33bc6f38e7

* commit '33bc6f38e7946108ff2fba947e2a2be0c8d62d7f':
libbase: remove exit-time destructors.
adb: remove exit-time destructors.
3bcdde6286285f9168cdf31e3789403a1ae4c27b 13-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: properly handle path separators on Windows." am: 8591f719d0 am: 82f9eef468
am: 55e1c43714

* commit '55e1c4371402f202988fd961ab30e66167918588':
adb: properly handle path separators on Windows.
26f2e1fd4ff02cb8a3927c86a90656269ebcb412 12-Nov-2015 Josh Gao <jmgao@google.com> Merge changes Ic124ecb9,I94de55d2

* changes:
libbase: remove exit-time destructors.
adb: remove exit-time destructors.
8591f719d0c7f8db6bd5dc742e0d210afb12eb03 12-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: properly handle path separators on Windows."
b7b1edf974a93cc4bb9a2de7a5e9c9bce9ad178b 12-Nov-2015 Josh Gao <jmgao@google.com> adb: remove exit-time destructors.

On exit, these destructors get invoked while other threads might
still be using them, potentially causing a crash, and definitely
causing tsan to report a race condition.

Bug: http://b/23384853
Change-Id: I94de55d22f97f4edd1d7cc1f34e8c1f8dfd56a5a
ndroid.mk
ommandline.cpp
devent.cpp
emount_service.cpp
ysdeps_win32.cpp
ransport.cpp
sb_linux.cpp
14e74b1b92ec2d60a6d5050dfb3c4a61ac624c8f 12-Nov-2015 Elliott Hughes <enh@google.com> Merge "Revert "Revert "adb/base: fix adb push of Unicode filenames on Win32""" am: dcb8b288ca am: 1391792ba4
am: 64de36a893

* commit '64de36a89355f2c021adef849654a9e91a3cc94b':
Revert "Revert "adb/base: fix adb push of Unicode filenames on Win32""
c1fd492ac5c14a42acfbbd9b47ed178fbf1378d3 11-Nov-2015 Elliott Hughes <enh@google.com> Revert "Revert "adb/base: fix adb push of Unicode filenames on Win32""

This reverts commit cc8cd59456ca485a51cd6fd388c8bcb1af4a8f9b.

With the dependency on libcutils (for gettid for non-bionic) removed,
this no longer breaks the build.

Change-Id: I645bd6876e2502ddc1535b69af1e645c0df9d178
ysdeps_win32.cpp
f99c144c155e4ab21ad57adad55ef6169f425aa4 12-Nov-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: fix adb shell" am: 524716889b am: ecdf5f3947
am: acab0b0054

* commit 'acab0b00544f11bd0c95478b1165e5d4831884c4':
adb: win32: fix adb shell
32762f4afdcb0eab4114c9c3c2206a39a8200a62 11-Nov-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix adb shell

28416d6d33267f92768116e269966d61eac01db9 broke adb shell on Windows
because it was calling unix_read() with a buffer size of 1 byte which
wasn't supported by unix_read()/_console_read().

This change makes _console_read() support such a small buffer by
maintaining an internal input buffer.

This lets us simplify the existing code that was already maintaining a
cached INPUT_RECORD.

Also eliminate some duplicate code in the big switch statement.

Change-Id: I8f0aed4fb9f6f2f5b9a6b68ce60d2e368fec81c7
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ysdeps_win32.cpp
bf5537dd2cbeb3da508b91b62ac29bc959895c18 12-Nov-2015 Josh Gao <jmgao@google.com> Merge changes from topic \'adb_dir\' am: bf666599b3 am: f30d0aeb55
am: 1cc5459eac

* commit '1cc5459eac3a00eebc188a1b3bed41cfab655356':
adb: don't explode directories when pushing/pulling.
adb: improve error handling, comments.
bf666599b32ec668f009076b594cccdd338e3cc5 12-Nov-2015 Josh Gao <jmgao@google.com> Merge changes from topic 'adb_dir'

* changes:
adb: don't explode directories when pushing/pulling.
adb: improve error handling, comments.
abc3544c8267806e42585eea63431b539114547f 11-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: add 100 column limit to .clang-format." am: 389cab802a am: ddb8244bc8
am: bc74fa9bed

* commit 'bc74fa9bedc4029594221b0b10f345f21d02d6ac':
adb: add 100 column limit to .clang-format.
32b24cfb5f721ed1cd79d42403cb9afed5b4fd9a 11-Nov-2015 Josh Gao <jmgao@google.com> adb: add 100 column limit to .clang-format.

Change-Id: I7d96a6d505d2ddd92ffe7ad12ffc777c03c63caf
/system/core/.clang-format-4
5f160d907dc52641c526616e4356adf6ab1cdd95 11-Nov-2015 Jorge Lucangeli Obes <jorgelo@google.com> Merge "Fix typo, caps in error messages." am: ae0f53cf69 am: af8f8a1561
am: 9155aa3035

* commit '9155aa30350b2ee444d4061f97d13c1200a79d41':
Fix typo, caps in error messages.
1a0253092d07cc6497c4dc207ec0cbf03c0020e5 09-Nov-2015 Josh Gao <jmgao@google.com> adb: properly handle path separators on Windows.

Bug: http://b/25573669
Change-Id: Ic82981e1dfe40d5e3b3ffa06e18e62ecf80d81fc
ile_sync_client.cpp
07db1196e7bd5856b5e2ebe4ea6791d2ae8c9e76 08-Nov-2015 Josh Gao <jmgao@google.com> adb: don't explode directories when pushing/pulling.

Previously, `adb pull /data/local/tmp` would spew all of the contents of
/data/local/tmp into the current directory. This patch makes push/pull
keep directories intact.

Bug: http://b/25394682
Change-Id: I2304ae9e61745a2b9536f58a6012640bf8ff422a
ile_sync_client.cpp
ysdeps.h
12a2ae9a0c21edaf8e80984519108631bdf3c9e6 08-Nov-2015 Josh Gao <jmgao@google.com> adb: improve error handling, comments.

This commit fixes two cases:
`adb pull /data/local/tmp nonexistent/path` would succeed.
`adb pull /data/local/tmp nonexistent/` would fail.

Change-Id: I60c39eb2816946686241af42cfa2ad5cdc63fb0e
ile_sync_client.cpp
f39c56456d1f9bb910a9bc1187027a75942c8658 11-Nov-2015 Jorge Lucangeli Obes <jorgelo@google.com> Fix typo, caps in error messages.

Bug: None
Change-Id: I673189f84812637c240321b72cf77b26b170b6ad
aemon/main.cpp
eaeafe13b3400d5cec39a5dc764ead20c6929c1b 11-Nov-2015 Elliott Hughes <enh@google.com> Merge "Revert "adb/base: fix adb push of Unicode filenames on Win32"" am: fdebc26ad5 am: 7d223253cb
am: 210111a0d0

* commit '210111a0d02511d379471700359d9065783b1cb9':
Revert "adb/base: fix adb push of Unicode filenames on Win32"
fdebc26ad5c61dd9198960ecda65fddcadc07c80 11-Nov-2015 Elliott Hughes <enh@google.com> Merge "Revert "adb/base: fix adb push of Unicode filenames on Win32""
cc8cd59456ca485a51cd6fd388c8bcb1af4a8f9b 11-Nov-2015 Elliott Hughes <enh@google.com> Revert "adb/base: fix adb push of Unicode filenames on Win32"

This reverts commit ac9514a4524f98b2029dbcda9326a763d25492b1.

The new gettid dependency caused other breakage.

Change-Id: I74a75e40c30a45beb275f9dd38eb5c7beac15fbd
ysdeps_win32.cpp
b979a787ffe6b4ce8fd0d0fb3b22edaa22118a4f 11-Nov-2015 Elliott Hughes <enh@google.com> Merge "adb/base: fix adb push of Unicode filenames on Win32" am: 332166a31a am: 9cadb93394
am: 9d7da02815

* commit '9d7da028150b1682ab3b686fe3a6a72a329dfd3e':
adb/base: fix adb push of Unicode filenames on Win32
332166a31acea49203a390579de51a055bc05740 11-Nov-2015 Elliott Hughes <enh@google.com> Merge "adb/base: fix adb push of Unicode filenames on Win32"
ac9514a4524f98b2029dbcda9326a763d25492b1 22-Oct-2015 Spencer Low <CompareAndSwap@gmail.com> adb/base: fix adb push of Unicode filenames on Win32

ae5a6c06cdd9ae1a0a7cdc42711f0a5594e54dcd made adb push use
android::base::ReadFileToString() for small files, but that API did not
support UTF-8 filenames on Windows, until this fix which does the
following:

- Add android::base::{WideToUTF8,UTF8ToWide}() which are only available
on Windows. The signatures are based on Chromium's APIs of the same
name.

- Add the namespace android::base::utf8 which has versions of APIs that
take UTF-8 strings. To use this, make sure your code is in a namespace
and then do "using namespace android::base::utf8;". On Windows, this will
make calls to open() call android::base::utf8::open(), and on other
platforms, it will just call the regular ::open().

- Make ReadFileToString() and WriteStringToFile() use utf8::open() and
utf8::unlink().

- Adapt unittests from Chromium.

- fastboot needs to link with libcutils because it links with libbase
which depends on libcutils for gettid() for logging.

Change-Id: I1aeac40ff358331d7a1ff457ce894bfb17863904
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ysdeps_win32.cpp
ef0ac03c4a8a88ff5feaf72df9be6cb50b2dede6 10-Nov-2015 Elliott Hughes <enh@google.com> Merge "Add -e to the adb shell documentation." am: 3c540aec24 am: eaf0ea050f
am: 992c0f4b5c

* commit '992c0f4b5ccbdd78e8b8a6754dc50b643c96f35c':
Add -e to the adb shell documentation.
3c540aec245f6c010ef2d5e82a22b871335dd1c6 10-Nov-2015 Elliott Hughes <enh@google.com> Merge "Add -e to the adb shell documentation."
0e42c2a4ad06be7601377da0b3abc2cc2ad86cbf 10-Nov-2015 Elliott Hughes <enh@google.com> Add -e to the adb shell documentation.

Change-Id: I7be5d198ef174e969bbb670e629369894c7b0994
ommandline.cpp
5a499973acd8c87c5b2b8543abf135710dfca8b5 10-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: don\'t try to pull character or block devices." am: 0bb1ce06ea am: 85a4b33302
am: 155d62feb0

* commit '155d62feb0ae0fe5e119b28a23bb69f22ca52ec5':
adb: don't try to pull character or block devices.
bae6190af8df9b28b20db9550b7bbf6d92eb8058 10-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: demote skipping a file from an error to a warning." am: 5a08fd35c9 am: 234dbb840a
am: 1a770d624d

* commit '1a770d624df978444c12ce9af66e807f19463412':
adb: demote skipping a file from an error to a warning.
0bb1ce06ea46f14d5b6bc57db8c8d6c463b5b1de 10-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: don't try to pull character or block devices."
8d00a39eff5f4047a4a4ad007900df2bdd1c1e9a 10-Nov-2015 Josh Gao <jmgao@google.com> adb: don't try to pull character or block devices.

Change-Id: I1a9e2c0097fe9c4017a9b338e812366c8e1154f0
ile_sync_client.cpp
21abf5a7c1099b06625f516997c4291f577c3444 08-Nov-2015 Josh Gao <jmgao@google.com> adb: demote skipping a file from an error to a warning.

Change-Id: If6c88e8855369bd7feb570ac5310fc7f44994083
ile_sync_client.cpp
cd8bcd812f0bb955a39ef81360f9f0c0a658b886 10-Nov-2015 Elliott Hughes <enh@google.com> Merge "Fix adb shell escape handling." am: 79964cdf86 am: a55d6810b7
am: 1098a6202b

* commit '1098a6202b58989048fc7d9e78b5807583fb8057':
Fix adb shell escape handling.
79964cdf86ce18f5911873249aa5f505be59051f 10-Nov-2015 Elliott Hughes <enh@google.com> Merge "Fix adb shell escape handling."
51c05ec56832811eefff96bc76440a54e75c61cb 10-Nov-2015 Todd Kennedy <toddke@google.com> Revert "Revert "use new cmd command""

This reverts commit 3e3b4ec00770258f4e66684addded262dc13003a.

Change-Id: I8bfcd8a2a285f4254539ebca9f70222aa2448ef4
db.h
ommandline.cpp
ransport.cpp
ransport.h
28416d6d33267f92768116e269966d61eac01db9 04-Nov-2015 Elliott Hughes <enh@google.com> Fix adb shell escape handling.

Start of input is, by definition, the start of a line. Give the states
names to make the error clearer. We should also swallow the escape
character until/unless it's proven not to have been part of an escape
sequence. Finally, implement an ssh(1)-like -e option so the user can
choose -- or, more importantly, disable -- escape character handling.

Change-Id: I28a91db47e15f3e7de96303c0b9a98d302b9c92e
ommandline.cpp
bdf20142b93999acf59c8e488972ede62ce3a39b 09-Nov-2015 Nick Kralevich <nnk@google.com> Merge "Enable hidepid=2 on /proc" am: 2d8f1d4c47 am: ea8452cc72
am: 7dafe5b818

* commit '7dafe5b818f7771cb00c4a0ea3ab1dbf74593185':
Enable hidepid=2 on /proc
2d8f1d4c478b9d921730d3fc9b290315e2ff9f04 09-Nov-2015 Nick Kralevich <nnk@google.com> Merge "Enable hidepid=2 on /proc"
4cb77fc2a343839ce2dfc00e0d73033b5650482c 09-Nov-2015 Elliott Hughes <enh@google.com> Merge "adb/base: minor compiler portability improvements" am: 892f0e9300 am: 8163cbc535
am: 3396ad2c16

* commit '3396ad2c16037c0fda6273708a750eb6a15e2038':
adb/base: minor compiler portability improvements
363af568b8491af1a4256b09b04cfa8a0606d8cc 08-Nov-2015 Spencer Low <CompareAndSwap@gmail.com> adb/base: minor compiler portability improvements

I've been using these changes to compile with Visual Studio.

- GetFileBasename(): __FILE__ uses \ with Visual Studio.

- adb_trace.cpp: Apparently VS needs an ampersand before the function name.

- "expr1 ? : expr2" is a GCC extension.

- <algorithm> contains std::min().

- seekdir can't always be #define'd because some headers have members
named seekdir.

- adb_utils.cpp: Not really a compiler issue, just a random fix:
0x7F/DEL is not printable.

Change-Id: I0dfb634f1ba4ccbc0d1b9f71b00e838fbebb3b41
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db_trace.cpp
db_utils.cpp
ile_sync_client.cpp
ockets.cpp
ysdeps.h
ransport.cpp
ccf1335e3b8dcc495ac006df0abb8c041e24537e 09-Nov-2015 Guang Zhu <guangzhu@google.com> Merge "Revert "use new cmd command""
c39ba5ae32afb6329d42e61d2941d87ff66d92e3 08-Nov-2015 Nick Kralevich <nnk@google.com> Enable hidepid=2 on /proc

Add the following mount options to the /proc filesystem:

hidepid=2,gid=3009

This change blocks /proc access unless you're in group 3009
(aka AID_READPROC).

Please see
https://github.com/torvalds/linux/blob/master/Documentation/filesystems/proc.txt
for documentation on the hidepid option.

hidepid=2 is preferred over hidepid=1 since it leaks less information
and doesn't generate SELinux ptrace denials when trying to access
/proc without being in the proper group.

Add AID_READPROC to processes which need to access /proc entries for
other UIDs.

Bug: 23310674
Change-Id: I22bb55ff7b80ff722945e224845215196f09dafa
aemon/main.cpp
3e3b4ec00770258f4e66684addded262dc13003a 09-Nov-2015 Todd Kennedy <toddke@google.com> Revert "use new cmd command"

This reverts commit d039800a4e008b52c532f901e3bb34b40877cf30.

Change-Id: Ia9b81c47120088593a56ae09a9b002338d524b8a
db.h
ommandline.cpp
ransport.cpp
ransport.h
d7122586f78e9b37871b49f6370a73381bf24213 07-Nov-2015 Elliott Hughes <enh@google.com> Revert "AOSP master doesn't have "cmd"."

This reverts commit 79e1c7a7f8a6caf8fe77c6fa1ef46b3ddac9fb99.

Internal master (where I'm reverting this) does have "cmd".
ransport.cpp
79e1c7a7f8a6caf8fe77c6fa1ef46b3ddac9fb99 07-Nov-2015 Elliott Hughes <enh@google.com> AOSP master doesn't have "cmd".

Change-Id: I0f524b779a623a9e2db923fd9003b102460ae46f
ransport.cpp
6fa848adbab275c76d590a133290a59a6ef9a4d5 04-Nov-2015 Todd Kennedy <toddke@google.com> use new cmd command

Instead of using the pm command, 'adb install' and 'adb uninstall' will now
use the cmd command. Additionally, the APK will be streamed directly to
package installer instead of creating a temporary file.

(cherry-pick of d039800a4e008b52c532f901e3bb34b40877cf30.)
Change-Id: Ie7529afa5b039d29cc8183f36085ff4e66b3457a
db.h
ommandline.cpp
ransport.cpp
ransport.h
7fc45c3326ba4ecaa49ec0713dce61b053c9b9e4 07-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: pull empty directories."
a837df85908bdf5b00fa6d328dd622b59b91ef8b 07-Nov-2015 Josh Gao <jmgao@google.com> adb: remove superfluous checks.

Change-Id: I4d9ceb301b0d242b0bad9a0faa8e2a1824f36cca
ile_sync_client.cpp
6580096c97a2cb0750f4f7cb60bc05e7e84f4d7d 04-Nov-2015 Josh Gao <jmgao@google.com> adb: pull empty directories.

Pushing empty directories is more troublesome, and probably either
requires changes to the server, or hacky `adb shell mkdir` stuff.

Bug: http://b/25395071
Change-Id: I4db6a993429a56e5c5ca994752418503b6f5d7c4
ile_sync_client.cpp
f00db9d8b89ad919aa61f17fb9f773a400aebe5e 06-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: add basename_lock to mutex_list.h."
250107e9f7167507c8c038d17c0729a91830dc69 06-Nov-2015 Josh Gao <jmgao@google.com> adb: add basename_lock to mutex_list.h.

Fixes crash on Windows.

Change-Id: Ic87d8ff30a2e824b6012e7e94b8d83442e17d000
utex_list.h
d039800a4e008b52c532f901e3bb34b40877cf30 04-Nov-2015 Todd Kennedy <toddke@google.com> use new cmd command

Instead of using the pm command, 'adb install' and 'adb uninstall' will now
use the cmd command. Additionally, the APK will be streamed directly to
package installer instead of creating a temporary file.

Change-Id: Ie7529afa5b039d29cc8183f36085ff4e66b3457a
db.h
ommandline.cpp
ransport.cpp
ransport.h
cd7c1ed700707e3f3aea341c38d38e18ae410987 04-Nov-2015 Josh Gao <jmgao@google.com> adb: make local_build_list match remote_build_list.

local_build_list previously was returning an int, 0 on success and -1 on
failure, while remote_build_list was returning a bool, true on success
and false on failure.

Change-Id: Iced6c4142e2f843048d81c4e133d6b6dc75a35dd
ile_sync_client.cpp
d97315731ff13274916be0f731ede15e81187c79 04-Nov-2015 Josh Gao <jmgao@google.com> adb: C++ify more of the push/pull functions.

Change-Id: Ie82d51ecadf5c94f3b138f5b13a17c3b46c61899
ile_sync_client.cpp
11d18f1491430902939e8d3be4d895e6e950f00c 05-Nov-2015 Josh Gao <jmgao@google.com> Merge changes I70c94c4b,Ifd8769ed

* changes:
adb: make mkdirs/secure_mkdirs do what they say.
adb: remove use of mkdirs from `adb backup`.
45b6fc878ab5ba0f76b6bb1947fe04ac6667c2f5 04-Nov-2015 Josh Gao <jmgao@google.com> adb: make mkdirs/secure_mkdirs do what they say.

Previously, mkdirs/secure_mkdirs wouldn't create a directory at the
specified path, only the ones above it.

Bug: http://b/25459942
Change-Id: I70c94c4b44d90723cb4a063657fc40e5bcb3b10e
db_utils.cpp
ile_sync_client.cpp
ile_sync_service.cpp
09c5bbf0fb22eb4734bdb05365bba8a12a870939 04-Nov-2015 Josh Gao <jmgao@google.com> adb: remove use of mkdirs from `adb backup`.

`adb backup -f nonexistent/directories/foo <pkg>` shouldn't create the
directory structure if they don't already exist.

Change-Id: Ifd8769ed7ee5e733a6635751ad09b714ab58ea4b
ommandline.cpp
77cdfbd50c2110ade6e57319f99c966c45174fd8 04-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: make adb_basename match the POSIX behavior."
787f3442cc7d7b1f07189d77413893e2c2c81447 04-Nov-2015 Josh Gao <jmgao@google.com> adb: make adb_basename match the POSIX behavior.

Previously, adb_basename was behaving according to the GNU, POSIX-incompatible
basename, despite POSIX adb_dirname existing alongside it. This patch changes
adb_basename to pass through to the POSIX basename.

Bug: http://b/25456821
Change-Id: I62a4865cccf3b9cdbc112e3e53ff475aa4a23bd9
db_utils.cpp
db_utils_test.cpp
0fbf9618bb595a93a83d034f04bb63e7881d8bf3 04-Nov-2015 Elliott Hughes <enh@google.com> Fix Mac adb build.

The Mac doesn't have <termio.h>, and it looks like the canonical place for
struct winsize is <sys/ioctl.h> anyway.

system/core/adb/commandline.cpp:44:10: fatal error: 'termio.h' file not found
#include <termio.h>

Bug: http://b/19734542
Change-Id: I3bfbf58cdb9b582f3b7e2c9ef0977613001cd3ac
ommandline.cpp
1358e2869c5816c74582cbc1f21eba50512375c1 04-Nov-2015 Elliott Hughes <enh@google.com> Merge "adb shell SIGWINCH support."
c288d485135b61653fda3b1aff3602affd6dd1d3 04-Nov-2015 Joon :ee <joonlee@google.com> Fix adb GCC build (for google3).

Allow adb to build using gcc by explicitly using global scope for the
type for pollfd. An alternative would be to rename the pollfd field to
different, but I did not have a better name in mind.

Change-Id: I7925df1dca7e1acc5a289256f228e5fc3755e86e
devent.cpp
c15b17f1acfcdbda8602ab135371f7b7238b4b39 03-Nov-2015 Elliott Hughes <enh@google.com> adb shell SIGWINCH support.

Bug: http://b/19734542
Change-Id: Ic9404a132cb9c42cb6a378bcd4b3dea9188d0a44
ommandline.cpp
hell_service.cpp
hell_service.h
ysdeps_win32.cpp
fc7c3b682b4c9cf77e45ec2db8610d7d963705c6 03-Nov-2015 Josh Gao <jmgao@google.com> adb: rename 'flag' to something less meaningless.

Change-Id: I7f7644a0a6f9a7d48508ddaad2e6a51266ae8ee6
ile_sync_client.cpp
19d9454ee3c2c3c11272ec34cee0e263a621fd98 03-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: C++ify local_build_list and remote_build_list."
aff48cbb3fce8c1529181166f21e8b9952b47f2d 03-Nov-2015 Elliott Hughes <enh@google.com> Merge "adb: fix adb reverse --no-rebind help text"
am: 4f23917299

* commit '4f2391729951ead5f0d15862bd19213962438776':
adb: fix adb reverse --no-rebind help text
4f2391729951ead5f0d15862bd19213962438776 03-Nov-2015 Elliott Hughes <enh@google.com> Merge "adb: fix adb reverse --no-rebind help text"
58ee99e4545c96938faa2cb14839089b2df2606c 03-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: allow multiple args to push/pull."
am: fe54c96ab2

* commit 'fe54c96ab28a59a87c0c26ac4e6664826b4644ea':
adb: allow multiple args to push/pull.
fe54c96ab28a59a87c0c26ac4e6664826b4644ea 03-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: allow multiple args to push/pull."
587ea20f83bd0d7b4077b5700ab3dd8c257cc344 03-Nov-2015 Spencer Low <CompareAndSwap@gmail.com> adb: fix adb reverse --no-rebind help text

There was a typo in the option.

Change-Id: I5c074a883a7b384663ed65cd8de0d891dc2b6606
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ommandline.cpp
9ea31c72857b63ddcac92616e107a9f9aae73c93 03-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: add SyncConnection::Printf."
am: e9af735de3

* commit 'e9af735de36eade81adc490635ee0076bdb6c79e':
adb: add SyncConnection::Printf.
cda6a2bd3e9c8c9644e833162d513009681e8e25 03-Nov-2015 Josh Gao <jmgao@google.com> adb: C++ify local_build_list and remote_build_list.

Change-Id: I71586488869c4827c5bd7294faa7c0f433bb9fbc
ile_sync_client.cpp
983c41c35375227fe11de41b83e1861f07647313 03-Nov-2015 Josh Gao <jmgao@google.com> adb: add SyncConnection::Printf.

Replaces `sc.Print(android::base::StringPrintf(...)` with one call
to sc.Printf.

Change-Id: Ib7c98103dbca0b6a951f8e5a0f860ec6eacf6772
ile_sync_client.cpp
34e0d64719ad43b9a85b36e05115e1dae1d5983f 03-Nov-2015 David Pursell <dpursell@google.com> Merge "adb: create unix_isatty() function."
am: d9ff9873df

* commit 'd9ff9873df4ef68c105bc84d8dbe098feaaa6c50':
adb: create unix_isatty() function.
c5b8ad88ce6e74216198f14c6e33d55cb1681370 28-Oct-2015 David Pursell <dpursell@google.com> adb: create unix_isatty() function.

Our Windows code has several different ways it checks whether an FD is
a console or not, some of which aren't exactly correct as they may
treat character devices (e.g. NUL) as consoles.

This CL disallows using the builtin isatty() function and provides
unix_isatty() instead which correctly checks these corner cases.

Change-Id: I6d551c745dae691c7eb3446b585265d62c1e62fa
db_trace.cpp
ommandline.cpp
ine_printer.cpp
ysdeps.h
ysdeps_win32.cpp
ysdeps_win32_test.cpp
5b51ac7a5931c2e9c491c61233a6bbaba5edb6fa 02-Nov-2015 Elliott Hughes <enh@google.com> Merge "Set HOME, LOGNAME, SHELL, and USER from adbd."
am: 36d7af4cf6

* commit '36d7af4cf635816ecbcb9bd300f4c9d60cb012d4':
Set HOME, LOGNAME, SHELL, and USER from adbd.
36d7af4cf635816ecbcb9bd300f4c9d60cb012d4 02-Nov-2015 Elliott Hughes <enh@google.com> Merge "Set HOME, LOGNAME, SHELL, and USER from adbd."
fbe4332e373208637dd928edf06a0da6cba92feb 02-Nov-2015 Elliott Hughes <enh@google.com> Set HOME, LOGNAME, SHELL, and USER from adbd.

Previously we've set these from /system/etc/mkshrc, which caused a behavioral
difference between interactive and non-interactive shells.

Bug: http://b/19635681
Change-Id: I4608c42dd3de821046220fdb1770ab3216b5d5eb
hell_service.cpp
7782bbdef30648f547c538f586f2eeb8c07efd79 02-Nov-2015 Yabin Cui <yabinc@google.com> Merge "adb: run reverse_service() in main thread."
am: 1060739bfe

* commit '1060739bfe26a6c0eb74e10a40787ed1d781e296':
adb: run reverse_service() in main thread.
1060739bfe26a6c0eb74e10a40787ed1d781e296 02-Nov-2015 Yabin Cui <yabinc@google.com> Merge "adb: run reverse_service() in main thread."
05786779f390b23cc8611b101458cd174cf4e938 31-Oct-2015 Josh Gao <jmgao@google.com> adb: allow multiple args to push/pull.

Bug: http://b/25324823
Change-Id: I369dd97adbe1d08e18e84af776ce8b1d61251835
ommandline.cpp
ile_sync_client.cpp
ile_sync_service.h
dcaf6932fde9df11f415f683589f962858084cb1 02-Nov-2015 Josh Gao <jmgao@google.com> Merge "adb: use correct _WIN32 macro."
am: 5c75b529f6

* commit '5c75b529f684b388c91c7e7d0b2c7fece376ac1d':
adb: use correct _WIN32 macro.
fbfa84045d30a8288c3feab9d7ce7c0c20d7728b 31-Oct-2015 Yabin Cui <yabinc@google.com> adb: run reverse_service() in main thread.

reverse_service() calls handle_forward_request(), which calls
functions in fdevent.cpp. fdevent functions is only supposed
to be called in the main thread.
Add check in fdevent.cpp to make sure all operations come from
main thread.

Bug: 25355808
Change-Id: Iceb9273f3056acc0713eaafe086ac950ca80ff4f
devent.cpp
ervices.cpp
4a1397264b998442aacf0e7e79bdd65ba72867dd 31-Oct-2015 Josh Gao <jmgao@google.com> adb: use correct _WIN32 macro.

Change-Id: I5af7957162ae7f8472a5a262434eaba84e64325a
ommandline.cpp
edb78620fbef1fa592407a5c6917b92c43a3ce7d 31-Oct-2015 Elliott Hughes <enh@google.com> Merge "adb: fix adb client running out of sockets on Windows"
am: 1e2382a027

* commit '1e2382a0277eb36fb57a3a54202945556dfd234b':
adb: fix adb client running out of sockets on Windows
351ecd15b29f0ce528ffac119640b9c01874562b 15-Oct-2015 Spencer Low <CompareAndSwap@gmail.com> adb: fix adb client running out of sockets on Windows

Background
==========

On Windows, if you run "adb shell exit" in a loop in two windows,
eventually the adb client will be unable to connect to the adb server. I
think connect() is returning WSAEADDRINUSE: "Only one usage of each
socket address (protocol/network address/port) is normally permitted.
(10048)". The Windows System Event Log may also show Event 4227, Tcpip.
Netstat output is filled with:

# for the adb server
TCP 127.0.0.1:5037 127.0.0.1:65523 TIME_WAIT
# for the adb client
TCP 127.0.0.1:65523 127.0.0.1:5037 TIME_WAIT

The error probably means that the client is running out of free
address:port pairs.

The first netstat line is unavoidable, but the second line exists
because the adb client is not waiting for orderly/graceful shutdown of
the socket, and that is apparently required on Windows to get rid of the
second line. For more info, see
https://github.com/CompareAndSwap/SocketCloseTest .

This is exacerbated by the fact that "adb shell exit" makes 4 socket
connections to the adb server: 1) host:version, 2) host:features, 3)
host:version (again), 4) shell:exit. Also exacerbating is the fact that
the adb protocol is length-prefixed so the client typically does not
have to 'read() until zero' which effectively waits for orderly/graceful
shutdown.

The Fix
=======

Introduce a function, ReadOrderlyShutdown(), that should be called in
the adb client to wait for the server to close its socket, before
closing the client socket.

I reviewed all code where the adb client makes a connection to the adb
server and added ReadOrderlyShutdown() when it made sense. I wasn't able
to add it to the following:

* interactive_shell: this doesn't matter because this is interactive and
thus can't be run fast enough to use up ports.
* adb sideload: I couldn't get enough test coverage and I don't think
this is being called frequently enough to be a problem.
* send_shell_command, backup, adb_connect_command, adb shell, adb
exec-out, install_multiple_app, adb_send_emulator_command: These
already wait for server socket shutdown since they already call
recv() until zero.
* restore, adb exec-in: protocol design can't have the server close
first.
* adb start-server: no fd is actually returned
* create_local_service_socket, local_connect_arbitrary_ports,
connect_device: probably called rarely enough not to be a problem.

Also in this change
===================

* Clarify comments in when adb_shutdown() is called before exit().
* add some missing adb_close() in adb sideload.
* Fixup error handling and comments in adb_send_emulator_command().
* Make SyncConnection::SendQuit return a success boolean.
* Add unittest for adb emu kill command. This gets code coverage over
this very careful piece of code.

Change-Id: Iad0b1336f5b74186af2cd35f7ea827d0fa77a17c
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
db_client.cpp
db_io.cpp
db_io.h
ommandline.cpp
onsole.cpp
ile_sync_client.cpp
est_adb.py
39f7a1f0260166c107b794f0b194941b7413f216 30-Oct-2015 Elliott Hughes <enh@google.com> Merge "Show transfer progress in adb sync/pull/push."
am: 26352bf1fb

* commit '26352bf1fbbc8efdfdd0ef4d7c008fcbec445f29':
Show transfer progress in adb sync/pull/push.
b708d1628332ea9266d08f0297cd9e9ee341a64f 28-Oct-2015 Elliott Hughes <enh@google.com> Show transfer progress in adb sync/pull/push.

Change-Id: If5439877d060f9bab29cf84be996071cf680c2d4
ndroid.mk
ommandline.cpp
ile_sync_client.cpp
ile_sync_service.h
ine_printer.cpp
ine_printer.h
ebd5badd8405ede63f622453bb69d991ebf29583 27-Oct-2015 Elliott Hughes <enh@google.com> Merge "Don\'t use VLAs in adb."
am: 24704399cd

* commit '24704399cdd58a396831fce2ba678642bd3a8ba5':
Don't use VLAs in adb.
24704399cdd58a396831fce2ba678642bd3a8ba5 27-Oct-2015 Elliott Hughes <enh@google.com> Merge "Don't use VLAs in adb."
6d92997ec4285caebe94064158a8cc017bbf5caa 27-Oct-2015 Elliott Hughes <enh@google.com> Don't use VLAs in adb.

This makes no measurable difference to the sync time; "adb sync" of
everything on /system for a Nexus 9 still takes 20s.

Change-Id: Ifa2626f7453937e43856b9c4ee06e1f5db0aa273
ndroid.mk
ile_sync_client.cpp
ysdeps_win32.cpp
f856b39141fec5b1d165216d265f237fcdcaf2f2 27-Oct-2015 David Pursell <dpursell@google.com> Merge "adb: fix -Tt options to match ssh."
am: 76e9236a42

* commit '76e9236a42d8652f46cc690e4fdb7636d5e8386f':
adb: fix -Tt options to match ssh.
08a27094d94bec29a4dfa1fd9acfedebc80e4600 20-Oct-2015 David Pursell <dpursell@google.com> adb: fix -Tt options to match ssh.

ssh has slightly more sophisticated -Tt options that we want to match.
This CL changes -Tt behavior to match ssh so that we allocate a remote
PTY in these cases:
-T: never.
: if stdin is a terminal and user wants an interactive shell.
-t: if stdin is a terminal (otherwise print a warning message).
-t -t: always.

Now this will work as expected:
$ adb shell < my_script.sh

Also corrects a small unrelated bug with escape sequences so that only
a single tilde is accepted for the disconnect sequence.

Bug: http://b/24565284
Change-Id: Idab57ac98d81233b45c2613fe64ceb4398add961
ommandline.cpp
d75b1ff0d33d115d75ad5c591831130abc7ac0d0 26-Oct-2015 Elliott Hughes <enh@google.com> Merge "Fix adb sync/pull/push error reporting."
am: b42e7e8f05

* commit 'b42e7e8f05d4ad3aa0fc3cfcc997684a4446c7b4':
Fix adb sync/pull/push error reporting.
8b43c3e65a05aff709a7e62a85198cdd7abfa88f 24-Oct-2015 Elliott Hughes <enh@google.com> Fix adb sync/pull/push error reporting.

I fixed the server side to send detailed error reports, but the client-side
code for pull was broken because it had already read the "FAIL" header before
calling the general error reporting code that expects to be able to read
the header. This meant we'd always report that we failed to read the failure
message.

Also add a couple of missing "\n"s, make sure every error message is prefixed
by "adb: ", and remove a useless path length check that would silently ignore
over-long paths rather than relying on SendRequest to detect and report the
problem.

Bug: http://b/6205106
Change-Id: I23862ececf03b761115ffa3f7725b7e1cecb48c7
ile_sync_client.cpp
04c64dba9fe42110a1ed45bda5f8faa24715d75f 24-Oct-2015 Josh Gao <jmgao@google.com> Merge "adb: Mask SIGTTIN so that I/O works when backgrounded."
am: 69ccb9532c

* commit '69ccb9532cb822685d27142a5117d881be21ab01':
adb: Mask SIGTTIN so that I/O works when backgrounded.
8dcdb57dafd554e801de97012e7d0ef6ec63a5ac 24-Oct-2015 Josh Gao <jmgao@google.com> adb: Mask SIGTTIN so that I/O works when backgrounded.

SIGTTIN gets sent to the process when we attempt to read from
stdin when we're in the background, which stops the process by
default. Mask the signal so that the read returns -1 with errno
set to EIO, instead.

Change-Id: I4ae626b0670c05a1a05165539b9eed709e83d536
ommandline.cpp
27ff12443decc42bcabd5fa91664bc1de3338369 23-Oct-2015 Daniel Cashman <dcashman@google.com> Merge "init/adb: correct static lib dependencies for libselinux"
am: 38aee48fc6

* commit '38aee48fc695c25e15435e4ef235c8bc2e0afde9':
init/adb: correct static lib dependencies for libselinux
bd2d961cc2875259677e34211d2e8ec071b0d8da 04-Aug-2015 William Roberts <william.c.roberts@intel.com> init/adb: correct static lib dependencies for libselinux

Now that libselinux uses libpackagelistparser, in order
for libpackagelistparser to be properly statically linked
liblog must come after libselinux for all the liblog
references to be defined in libpackagelistparser which
is included in libselinux. This patch corrects that order.

Change-Id: I7aee10c9395310919779ed2463aab6b2f8b380cc
Signed-off-by: William Roberts <william.c.roberts@intel.com>
ndroid.mk
5d5e8c2f4d7e44e620c401b3b68730dd1a563437 20-Oct-2015 Elliott Hughes <enh@google.com> Merge "Fix lseek argument order."
am: 56543606b5

* commit '56543606b55e1e1455ef5c0bf9aa9f4febab967f':
Fix lseek argument order.
56543606b55e1e1455ef5c0bf9aa9f4febab967f 20-Oct-2015 Elliott Hughes <enh@google.com> Merge "Fix lseek argument order."
c96de0d36eb2954be0d5009d72f965e805d58f23 20-Oct-2015 Elliott Hughes <enh@google.com> Fix lseek argument order.

Change-Id: I12feed2de8a4e0782f90609254a3e2ec66d7d98e
db_io_test.cpp
17e80ff5fc161900e83a7e200832e65be003be2e 20-Oct-2015 Sami Tolvanen <samitolvanen@google.com> Merge "adb: use libfec in disable-verity"
am: ed38714426

* commit 'ed38714426b0f6bf67057dd28d6417a13807590c':
adb: use libfec in disable-verity
8ad80763e4b3bdcd80d16c63f03b19eb9df989b2 20-Oct-2015 Sami Tolvanen <samitolvanen@google.com> adb: use libfec in disable-verity

Use libfec to locate verity metadata and disable verity.

Needs changes from
I02f83b0d1d4e7ef5cd5d13a37ff0b84f17e23376

Bug: 21893453
Change-Id: Ib43c352400a368664c949c7b8c9961829adf48f4
ndroid.mk
et_verity_enable_state_service.cpp
3f9ad41e0a1d23c3d8801733dbcb728f109c232e 19-Oct-2015 Elliott Hughes <enh@google.com> am c2492937: Merge "adb: win32: Improve Winsock error code mappings and strings"

* commit 'c24929373ec0686e0695320d8f10f3bf4fc4547e':
adb: win32: Improve Winsock error code mappings and strings
0a79600e723de2da76ce7f3a44fb3821a484931b 19-Oct-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: Improve Winsock error code mappings and strings

Improved mapping of Winsock error codes to POSIX error codes, especially
WSAECONNABORTED to EPIPE (which WriteFdExactly() looks for) when sending
to a closed socket and WSAECONNRESET to ECONNRESET when the peer resets
the connection.

Use a macro to map strerror() to adb_strerror() which handles these
POSIX error codes that the Windows C Runtime doesn't recognize.

Also:

* Unittest for adb_strerror().

* Don't trace when send() returns WSAEWOULDBLOCK because that is
expected.

Change-Id: If46aeb7b36de3eebfbbccf5478ff5b1bb087714b
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ysdeps.h
ysdeps_win32.cpp
ysdeps_win32_test.cpp
2535ea1e181ea1a0de1c5199db40bede5dc32d95 15-Oct-2015 David Pursell <dpursell@google.com> am ca0d66d5: Merge "adb: non-interactive shell stdin."

* commit 'ca0d66d597dde0a76adc3f5da15aedff4b6cb70b':
adb: non-interactive shell stdin.
1ed57f0dc333c0bc0800e222c569cca8a71deb89 07-Oct-2015 David Pursell <dpursell@google.com> adb: non-interactive shell stdin.

Non-interactive `adb shell` previously only read from the remote shell,
but we want it to write as well so interactive and non-interactive
shells can both send data. With this CL, we can now do:
$ echo foo | adb shell cat
foo

This is primarily usable with newer devices that support the shell_v2
features. Older devices will receive stdin but the shell will still
hang after all input has been sent, requiring user Ctrl+C. This seems
better than closing communication altogether which could potentially
miss an unpredictable amount of return data by closing too early.

Known issue: non-interactive stdin to a PTY shell isn't reliable.
However I don't think this is a common case as ssh doesn't seem to
handle it properly either. Examples:
* echo 'echo foo' | adb shell
* echo 'foo' | adb shell -t cat

Bug: http://b/24565284
Change-Id: I5b017fd12d8478765bb6e8400ea76d535c24ce42
ommandline.cpp
hell_service.cpp
hell_service.h
hell_service_test.cpp
ysdeps.h
ysdeps_win32.cpp
4b542afe05beb3820b980358e5d5eaba8a46e292 14-Oct-2015 Badhri Jagan Sridharan <badhri@google.com> am ba000511: Merge "adbd: Add os descriptor support for adb."

* commit 'ba0005118b78dc8ff456492bb1e16947ab26be9e':
adbd: Add os descriptor support for adb.
ba0005118b78dc8ff456492bb1e16947ab26be9e 14-Oct-2015 Badhri Jagan Sridharan <badhri@google.com> Merge "adbd: Add os descriptor support for adb."
ebe9ffc48e8c6343510b5702cb892073b288dca7 08-Oct-2015 Elliott Hughes <enh@google.com> am 21f99c08: Merge "Use const auto&/auto&& in adb."

* commit '21f99c089e2691f308cb5f24ca3db5eef4aa59ae':
Use const auto&/auto&& in adb.
65fe2516b402ed8903f2ce39a86fa0bdc2b263a6 08-Oct-2015 Elliott Hughes <enh@google.com> Use const auto&/auto&& in adb.

Change-Id: I74a7e511302e15e207906f572d181634e0ed5604
db.cpp
db_auth_host.cpp
devent.cpp
ile_sync_service.cpp
ransport.cpp
28a3e4958e74c4a3537e36329a3511410918c4e4 08-Oct-2015 Elliott Hughes <enh@google.com> am 1407b286: Merge "Fix adb -d/-e error reporting."

* commit '1407b28628afec6c06eb6cb818f800083df668e1':
Fix adb -d/-e error reporting.
1407b28628afec6c06eb6cb818f800083df668e1 08-Oct-2015 Elliott Hughes <enh@google.com> Merge "Fix adb -d/-e error reporting."
8d28e191c5ba81b82e51e3fd120d03851e1d905f 07-Oct-2015 Elliott Hughes <enh@google.com> Fix adb -d/-e error reporting.

If -d/-e fail, get-serialno and friends will now report an error
and return a failure status code on exit.

Also fix the behavior of -d/-e with $ANDROID_SERIAL --- -d/-e
should override $ANDROID_SERIAL, not the other way round.

I'm deleting my own comment here about always returning "unknown"
for scripts. I can't find any evidence that there are scripts
relying on that, so I think my comment meant "I fear that there
are scripts doing so".

Bug: http://b/24403699
Change-Id: Ie13a751f1137abcfe0cc6c46a0630ba5e02db676
db.cpp
db_client.cpp
ommandline.cpp
ervices.cpp
ockets.cpp
ransport.cpp
ransport.h
ca2a0bdcb5badab6b8fc7b752e7ab1963fb660dd 05-Oct-2015 Badhri Jagan Sridharan <Badhri@google.com> adbd: Add os descriptor support for adb.

Eventhough windows does not rely on extended os
descriptor for adbd, when android usb device is
configures as a composite device such as mtp+adb,
windows discards the extended os descriptor even
if one of the USB function fails to send
the extended compat descriptor. This results in automatic
install of MTP driverto fail when Android device is in
"File Transfer" mode with adb enabled.

https://msdn.microsoft.com/en-us/library/windows/hardware/gg463179.aspx

BUG=24583401
BUG=chromium:43409

Change-Id: I87341683a9337848cac66daf9055b0d05cedd3d3
sb_linux_client.cpp
ff32110e1e061ec100894d915a2d55ecf08608a2 07-Oct-2015 Yabin Cui <yabinc@google.com> am 7f9d4c97: Merge "adb: keep file flags in fdevent_install."

* commit '7f9d4c97c35bbc5357126731bbb9faad1825c090':
adb: keep file flags in fdevent_install.
6dfef255b8fa77e3b5c0a69b7f276ea8e25e22cd 07-Oct-2015 Yabin Cui <yabinc@google.com> adb: keep file flags in fdevent_install.

Bug: 24615098
Change-Id: Ia791ecbe612f09aca3bbd5787513f121fae54da5
db_utils.cpp
db_utils.h
db_utils_test.cpp
devent.cpp
devent_test.cpp
dwp_service.cpp
hell_service.cpp
7d46e88936afdfbf10f2cd7ac59d9b2c819bea58 05-Oct-2015 Elliott Hughes <enh@google.com> am 8c47bb52: am 8a69e031: Merge "Speed up adb sync."

* commit '8c47bb52c41f461ee15bf0bc94378f0cc4fcb7d4':
Speed up adb sync.
8c47bb52c41f461ee15bf0bc94378f0cc4fcb7d4 05-Oct-2015 Elliott Hughes <enh@google.com> am 8a69e031: Merge "Speed up adb sync."

* commit '8a69e0315a3288ca14213602f5bec1173bc3216e':
Speed up adb sync.
8a69e0315a3288ca14213602f5bec1173bc3216e 05-Oct-2015 Elliott Hughes <enh@google.com> Merge "Speed up adb sync."
49a59bf31788077ce3a53ed8acb6dd665ea9a421 03-Oct-2015 Elliott Hughes <enh@google.com> am 450b592d: am 42b8df38: Merge "adb: win32: specify socket protocol"

* commit '450b592da5e630fad028e3a112651b7071971fd7':
adb: win32: specify socket protocol
fb068b39e0c12adeba46d00c7682751bd9381b22 03-Oct-2015 Elliott Hughes <enh@google.com> am f6d28fca: am e412cc89: Merge "Explain adb client/server version mismatch better."

* commit 'f6d28fcaf048dba2e422824f52ac687b48768c0b':
Explain adb client/server version mismatch better.
450b592da5e630fad028e3a112651b7071971fd7 03-Oct-2015 Elliott Hughes <enh@google.com> am 42b8df38: Merge "adb: win32: specify socket protocol"

* commit '42b8df38439b390f9c67eee567717f30143cf64f':
adb: win32: specify socket protocol
f6d28fcaf048dba2e422824f52ac687b48768c0b 03-Oct-2015 Elliott Hughes <enh@google.com> am e412cc89: Merge "Explain adb client/server version mismatch better."

* commit 'e412cc891ebdbcc64137ef3c91950124ff633d6f':
Explain adb client/server version mismatch better.
42b8df38439b390f9c67eee567717f30143cf64f 03-Oct-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: specify socket protocol"
5b73a10f64712e27429836210d665afac2f12e11 03-Oct-2015 Elliott Hughes <enh@google.com> Explain adb client/server version mismatch better.

"Out of date" is only probably true. You might equally well have an older
client talking to a newer server. So tell the truth and include the actual
version numbers.

Change-Id: I821de88f5baf65bf2623363129c60c496b407bff
db_client.cpp
ae5a6c06cdd9ae1a0a7cdc42711f0a5594e54dcd 27-Sep-2015 Elliott Hughes <enh@google.com> Speed up adb sync.

Sending the SEND/DATA/DONE packets all in one write makes small file and
symbolic link transfer orders of magnitude faster. Transferring all the
symbolic links in /system/bin or all the cacerts in /system/etc goes down
from about 6s in each case to less than 0.5s.

Change-Id: Ia1706cef25535d0b685d3744241a0557a52b22ff
ile_sync_client.cpp
40bc602445a7f7d206f1037b5cacfa3e0a4f8f36 01-Oct-2015 Yabin Cui <yabinc@google.com> am fb070f3c: am 7377398b: Merge "adb: fdevent fixes"

* commit 'fb070f3c2b1b2e5398a4cb0e67801192a5d90a94':
adb: fdevent fixes
fb070f3c2b1b2e5398a4cb0e67801192a5d90a94 01-Oct-2015 Yabin Cui <yabinc@google.com> am 7377398b: Merge "adb: fdevent fixes"

* commit '7377398be81a9a8a4256b4c11e7ed25b059c32bb':
adb: fdevent fixes
888a748bf23f7afb19c026d96245b31ca0abdd15 30-Sep-2015 Spencer Low <CompareAndSwap@gmail.com> adb: fdevent fixes

* fdevent_{set,add,del}()

* CHECK() that the fdevent is FDE_ACTIVE, otherwise the caller would
be waiting for events that will never arrive.

* Remove ~ from "fde->events &= ~events" to keep desired bits instead
of turning off desired bits.

* fdevent_call_fdfunc()

* CHECK(FDE_PENDING) since it should always be true if the fdevent was
on the pending list, or if fdevent_subproc_event_func() is faking
things. The goal is to try to avoid losing events.

Change-Id: I979c2fffa0b3d6b635488cde11dc544691193018
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
devent.cpp
5027ffd873ec75787c611cdc2d96b16a4a2e2d25 01-Oct-2015 Yabin Cui <yabinc@google.com> am 4b3ee266: am ffa866f5: Merge "adb: detect sockets in CLOSE_WAIT state to prevent socket leak on linux."

* commit '4b3ee2666cdddbace5b7115853780e1d969c2776':
adb: detect sockets in CLOSE_WAIT state to prevent socket leak on linux.
4b3ee2666cdddbace5b7115853780e1d969c2776 01-Oct-2015 Yabin Cui <yabinc@google.com> am ffa866f5: Merge "adb: detect sockets in CLOSE_WAIT state to prevent socket leak on linux."

* commit 'ffa866f5caefb13412f1814d0de06cda385feaa4':
adb: detect sockets in CLOSE_WAIT state to prevent socket leak on linux.
ffa866f5caefb13412f1814d0de06cda385feaa4 01-Oct-2015 Yabin Cui <yabinc@google.com> Merge "adb: detect sockets in CLOSE_WAIT state to prevent socket leak on linux."
428f3434ae9c245cda8676bcbdbfa0a5d97faa86 01-Oct-2015 David Pursell <dpursell@google.com> am de3faec6: am fd18d9e2: Merge "adb: put legacy shell: service back in."

* commit 'de3faec64d407e76013913cb39cf569f692e8f8f':
adb: put legacy shell: service back in.
de3faec64d407e76013913cb39cf569f692e8f8f 01-Oct-2015 David Pursell <dpursell@google.com> am fd18d9e2: Merge "adb: put legacy shell: service back in."

* commit 'fd18d9e254874557aa44d42bd6d6bdf4352b0e36':
adb: put legacy shell: service back in.
70ef7b40f96e44ebb86f4eb23ccfa1a9230cdb65 30-Sep-2015 David Pursell <dpursell@google.com> adb: put legacy shell: service back in.

ddmlib does not use the ADB client, but instead connects directly to
the adb server. This breaks some of the assumptions I previously made
when enabling the shell protocol.

To fix this, the adb server now defaults to no protocol for the
standalone command, and the shell protocol must be explicitly requested
by the client. For example:
shell:echo foo -- no shell protocol
shell,v2:echo foo -- shell protocol

As long as I was touching the shell service arguments I also changed
them to no longer duplicate the command-line arguments. This allows
more flexibility to change the adb client CLI if necessary and makes
the code more readable.

Bug: http://b/24148636
Change-Id: I28d5ae578cf18cbe79347dc89cea1750ff4571a8
db.h
ommandline.cpp
ervices.cpp
ervices.h
ransport.cpp
ransport.h
aa77e22d7384a97757e2d2194f4e265f7ad3b71a 29-Sep-2015 Yabin Cui <yabinc@google.com> adb: detect sockets in CLOSE_WAIT state to prevent socket leak on linux.

It is possible that the adb server on host has many sockets in
CLOSE_WAIT state. To prevent socket leak, always enable POLLRDHUP
in fdevent.cpp to detect sockets in CLOSE_WAIT state.

Update LocalSocketTest unit tests:
Change half_close_with_packet to read_from_closing_socket, as reading
from a SHUT_WR socket is not needed in adb.
Change close_with_no_events_installed to close_socket_in_CLOSE_WAIT_state,
as the latter is more close to the real situation in use.

Bug: 23314034

Change-Id: Ice4f4036624e5584eab6ba5848e7f169c92f037f
db.cpp
devent.cpp
ocket_test.cpp
677fb43b0f76fa34e7f5bc12f1e2292768f0097f 30-Sep-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: specify socket protocol

Instead of using socket(..., 0), pass IPPROTO_TCP or IPPROTO_UDP. Using
zero wasn't buying us anything and was different than popular apps like
Chrome. We should stick to what everyone else does so that we don't go
down different code-paths and potentially hit Winsock service provider
issues that everyone else is (accidentally) avoiding.

Also CHECK() if send() returns an erroneous value as described in the
Chromium source.

Also add comment about socket buffer sizing and Windows Vista.

Change-Id: I63db8f6de352fe1e9525cbc9cfc040eb02a4b9cd
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ysdeps_win32.cpp
88b71d41af2042037a3a82b317bc564a0a20245e 28-Sep-2015 David Pursell <dpursell@google.com> am edf0728e: am a36f4d68: Merge "adb: bump server version to prevent feature mismatch."

* commit 'edf0728e2de358bc1a0eb73626c2c7788a3cc808':
adb: bump server version to prevent feature mismatch.
0f427fead774fc3b45aba826cbbaff60945a38cd 28-Sep-2015 David Pursell <dpursell@google.com> am 5d1a943d: am 002f9d5c: Merge "adb: fix adbd feature parsing for no features."

* commit '5d1a943dc49dcb1513d64e281efb522d704dea02':
adb: fix adbd feature parsing for no features.
edf0728e2de358bc1a0eb73626c2c7788a3cc808 28-Sep-2015 David Pursell <dpursell@google.com> am a36f4d68: Merge "adb: bump server version to prevent feature mismatch."

* commit 'a36f4d680a02dbf2bf2166f148f4c5200ec1d8f4':
adb: bump server version to prevent feature mismatch.
5d1a943dc49dcb1513d64e281efb522d704dea02 28-Sep-2015 David Pursell <dpursell@google.com> am 002f9d5c: Merge "adb: fix adbd feature parsing for no features."

* commit '002f9d5c70058e8db78a61d65384fd9510cf4ffd':
adb: fix adbd feature parsing for no features.
a36f4d680a02dbf2bf2166f148f4c5200ec1d8f4 28-Sep-2015 David Pursell <dpursell@google.com> Merge "adb: bump server version to prevent feature mismatch."
d2b588e23901538f4b459a71fefdac6fc2748f7e 25-Sep-2015 David Pursell <dpursell@google.com> adb: fix adbd feature parsing for no features.

Previously the transport features list was only overwritten if a
new feature list was found. However, adbd can reuse the same atransport
object even if the adb server is killed and restarted, so the feature
list was not cleared properly if the newly started adb server didn't
provide one.

This CL fixes the bug by clearing the transport features list whenever
a connection banner is parsed.

Bug: http://b/24405971
Change-Id: Ia6ee6c9a46a621534681f6d4d7df77156b885eb9
db.cpp
ransport.cpp
ransport_test.cpp
bbe3d210ba9776f2e72f17c6213438890e1a8683 25-Sep-2015 David Pursell <dpursell@google.com> adb: bump server version to prevent feature mismatch.

Devices get a list of supported features from the adb server, not the
client, so a mismatch between client and server features can cause the
device to use an incorrect feature set.

Bumping the server version is the easiest way to make sure the client
and server features match and seems like the best solution at the
moment.

A more automated fix could be to compare client/server features on each
connection and restart if they don't match. This requires an extra
client <-> server round-trip per command, but removes the need to
manually bump the server version number on feature change. Unless the
feature set changes often it didn't seem worth the extra overhead.

Bug: http://b/24370690
Change-Id: I4e43825d1c15c61e5d924fc8d4110b467debde37
db.h
ransport.cpp
b8db64313adf4052e2d55734dfad202388c1473e 24-Sep-2015 Yabin Cui <yabinc@google.com> am 56ece709: am e4975da3: Merge "Adb: use VLOG() to replace D() for verbose logging."

* commit '56ece709b093aa7570aa2915fa98682113acc5cb':
Adb: use VLOG() to replace D() for verbose logging.
56ece709b093aa7570aa2915fa98682113acc5cb 24-Sep-2015 Yabin Cui <yabinc@google.com> am e4975da3: Merge "Adb: use VLOG() to replace D() for verbose logging."

* commit 'e4975da33326295885f4c606288516d73459c68e':
Adb: use VLOG() to replace D() for verbose logging.
aed3c61c4437ebb05eadfb3bf85d6962c30b9935 23-Sep-2015 Yabin Cui <yabinc@google.com> Adb: use VLOG() to replace D() for verbose logging.

As there are too many D(), we can keep both VLOG() and D() now, and get
rid of D() gradually.

Change-Id: I2f1cb70bcab3e82c99fed939341d03f6b2216076
ndroid.mk
db.cpp
db_auth.cpp
db_auth_client.cpp
db_auth_host.cpp
db_client.cpp
db_io.cpp
db_trace.cpp
db_trace.h
db_utils.cpp
db_utils.h
lient/main.cpp
ommandline.cpp
aemon/main.cpp
devent.cpp
ile_sync_service.cpp
dwp_service.cpp
emount_service.cpp
ervices.cpp
et_verity_enable_state_service.cpp
hell_service.cpp
ockets.cpp
ysdeps_win32.cpp
ransport.cpp
ransport_local.cpp
ransport_usb.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
sb_windows.cpp
90f297ada10254c0156f6e8488edf7663cd582ff 22-Sep-2015 David Pursell <dpursell@google.com> am b0d84d16: am 36856b73: Merge "adb: add -Tt options to `adb shell`."

* commit 'b0d84d16ffeabd3aa1b9d9ecf48110ff4f8508e7':
adb: add -Tt options to `adb shell`.
b0d84d16ffeabd3aa1b9d9ecf48110ff4f8508e7 22-Sep-2015 David Pursell <dpursell@google.com> am 36856b73: Merge "adb: add -Tt options to `adb shell`."

* commit '36856b7306b50e22f98c3299a6c951cb74fd1854':
adb: add -Tt options to `adb shell`.
4e2fd36bc8c16147cab323b0418a7666812d3bc7 22-Sep-2015 David Pursell <dpursell@google.com> adb: add -Tt options to `adb shell`.

Adds -T (no PTY) and -t (force PTY) options to `adb shell` to mimic
ssh options. Small cleanup to send an entire FeatureSet to the adb
client at once to avoid multiple round-trips when querying multiple
features.

Known issue: humans using `adb shell -T` to start a non-PTY interactive
session may experience problems since neither side will have PTY
features like echoing or newline translation. This is probably OK for
now as the -Tt options are primarily useful for scripting.

Bug: http://b/23825231
Change-Id: I4d0df300db0abd1f7410bab59dd4d5b991babda7
db.cpp
ommandline.cpp
ervices.cpp
ransport.cpp
ransport.h
ransport_test.cpp
03581ce1eadfe03a13060fc478d876f46735be81 21-Sep-2015 Yabin Cui <yabinc@google.com> am 46a005c3: am 2b5f5fb9: Merge "base logging: fix errno restoring, severity conditionality, dangling ifs"

* commit '46a005c3d9a6557985316a1ee802880e99cc2407':
base logging: fix errno restoring, severity conditionality, dangling ifs
46a005c3d9a6557985316a1ee802880e99cc2407 21-Sep-2015 Yabin Cui <yabinc@google.com> am 2b5f5fb9: Merge "base logging: fix errno restoring, severity conditionality, dangling ifs"

* commit '2b5f5fb9d94d13809af6967fb3adb40669ddfb49':
base logging: fix errno restoring, severity conditionality, dangling ifs
2b5f5fb9d94d13809af6967fb3adb40669ddfb49 21-Sep-2015 Yabin Cui <yabinc@google.com> Merge "base logging: fix errno restoring, severity conditionality, dangling ifs"
765ae6bcfc62148de629f68315fdf8cd1bc35342 18-Sep-2015 Spencer Low <CompareAndSwap@gmail.com> base logging: fix errno restoring, severity conditionality, dangling ifs

Fix LOG() to properly save and restore errno. Test this properly.

Only do logging if severity is >= the minimum.

Fix dangling if statements in CHECK(), CHECK_STR{EQ,NE}(). Test this
properly.

Fix base logging tests on Windows. All libbase_tests now pass on
Windows.

Change place to lock, so the lock can protect logging of all data in
LogMessage.

Change-Id: I7ff531c67ae10a99ef0a2bbfe279aa77282d5ae9
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db_trace.h
82b9e941731bb6e2c37ac17ac2c8ff23201e117c 21-Sep-2015 Dan Albert <danalbert@google.com> am 1bcb4677: am 71f878f8: Merge "Move python-adb to development/python-packages."

* commit '1bcb4677b0a9aaf4c62db073bc878a7249c8028c':
Move python-adb to development/python-packages.
1bcb4677b0a9aaf4c62db073bc878a7249c8028c 21-Sep-2015 Dan Albert <danalbert@google.com> am 71f878f8: Merge "Move python-adb to development/python-packages."

* commit '71f878f89b6bc6df960e857836467a059802c61e':
Move python-adb to development/python-packages.
885888338856f15347900cc7845546140011c24e 18-Sep-2015 Dan Albert <danalbert@google.com> Move python-adb to development/python-packages.

We want to be able to use this in the NDK without having to pull in
all of system core.

Also, this clarifies the separation of adb and its python interface.

Bug: http://b/22881740
Change-Id: I0b437d9bf621e371d4698d7f8e8828072c7ff347
_init__.py
evice.py
est_device.py
15b9dbad7f4da6d0d09814e7b81d1b58178333ac 18-Sep-2015 Elliott Hughes <enh@google.com> am 8fd98104: am a951a82d: Merge "adb unittest for win32 handle inheritance"

* commit '8fd981040d6396d74ccbaafbb28688aedc34e6bb':
adb unittest for win32 handle inheritance
8fd981040d6396d74ccbaafbb28688aedc34e6bb 18-Sep-2015 Elliott Hughes <enh@google.com> am a951a82d: Merge "adb unittest for win32 handle inheritance"

* commit 'a951a82dcc9cbefb4162a048d5d668dcb855cbf5':
adb unittest for win32 handle inheritance
1ce06087db2f7c7e39e30cdff6d307e38a24fc9e 17-Sep-2015 Spencer Low <CompareAndSwap@gmail.com> adb unittest for win32 handle inheritance

adb.cpp: launch_server() has a long comment about how
stdin/stdout/stderr handles have to be made non-inheritable to prevent
hangs in callers to adb.exe.

It would be disastrous to do this wrong, and I've modified this code, so
here's a unittest to verify that I'm doing it right.

The test also runs fine on unix.

Change-Id: I3672c3066bc7498635c19212f9e5c50757942439
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
est_adb.py
8057b81e22a1d0bfedaaa4687e06148b683b2ba2 17-Sep-2015 Elliott Hughes <enh@google.com> am 09a0d98b: am 1d758c90: Merge "adb unittest: make test_sync properly cleanup after itself"

* commit '09a0d98bebce23f014ea11af002c1fafaf6b8065':
adb unittest: make test_sync properly cleanup after itself
09a0d98bebce23f014ea11af002c1fafaf6b8065 17-Sep-2015 Elliott Hughes <enh@google.com> am 1d758c90: Merge "adb unittest: make test_sync properly cleanup after itself"

* commit '1d758c90959225c76ed4d318290ad1bf11532409':
adb unittest: make test_sync properly cleanup after itself
1d758c90959225c76ed4d318290ad1bf11532409 17-Sep-2015 Elliott Hughes <enh@google.com> Merge "adb unittest: make test_sync properly cleanup after itself"
c37556840191d38ddb718960b7549cafd1c54223 17-Sep-2015 Yabin Cui <yabinc@google.com> am eee68196: am 0b743df4: Merge "Add unit tests for local socket."

* commit 'eee68196e9198b781e23fa01d3f82bd60d515cca':
Add unit tests for local socket.
eee68196e9198b781e23fa01d3f82bd60d515cca 17-Sep-2015 Yabin Cui <yabinc@google.com> am 0b743df4: Merge "Add unit tests for local socket."

* commit '0b743df4c4813d59c0405fbb32d59441399d8478':
Add unit tests for local socket.
0b743df4c4813d59c0405fbb32d59441399d8478 17-Sep-2015 Yabin Cui <yabinc@google.com> Merge "Add unit tests for local socket."
853e6b79c2d386263b7b588805c1a3fdb967ed90 17-Sep-2015 Elliott Hughes <enh@google.com> am b9b05199: am d17cf08e: Merge "adb: win32: fix regression on older versions of Windows"

* commit 'b9b0519995d4beeee9c443f046315b18305d369f':
adb: win32: fix regression on older versions of Windows
b9b0519995d4beeee9c443f046315b18305d369f 17-Sep-2015 Elliott Hughes <enh@google.com> am d17cf08e: Merge "adb: win32: fix regression on older versions of Windows"

* commit 'd17cf08eca500a96f4808744b8a0a34664291de8':
adb: win32: fix regression on older versions of Windows
bc36bdbdc8bb64011bc573a14d54576946fa1006 17-Sep-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix regression on older versions of Windows

On Windows 7, GetStdHandle() may return console pseudo-handles. If you
call SetHandleInformation(h, HANDLE_FLAG_INHERIT, 0) on such a handle,
it will fail. These failures should be ignored like the old code.

Newer versions of Windows return real handles that don't have this
issue. Console pseudo-handles can apparently be identified by the values
3, 7, 11.

This is a regression from 2122c7a1483dc6050b33f58fad4a15d5acd79fdd.

https://code.google.com/p/android/issues/detail?id=186599

Change-Id: I287a74a81d37e0ebe62d673a3f5651ee5439c0d2
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
c1b1f6ff5de82b457923eea3f0bbad1ac2e459d7 16-Sep-2015 Yabin Cui <yabinc@google.com> Add unit tests for local socket.

Add has_write_error flag in asocket, so it will not wait on local_socket_closing_list
to write pending packets in local_socket_close(). Although it doesn't fix any problem,
it helps to make the code more stable.
Add a missing put_apacket() in error handling.
Add a check when adding local socket in local_socket_closing_list.

Bug: 23314034

Change-Id: I75b07ba8ee59b7f277fba2fb919db63065b291be
ndroid.mk
db.cpp
db.h
devent.cpp
devent.h
devent_test.cpp
ocket.h
ocket_test.cpp
ockets.cpp
971d17f25168d3af387607ed8e4b3c8791b5bcba 15-Sep-2015 Yabin Cui <yabinc@google.com> am c8a5b0b6: am fa965d96: Merge "adb: move adb to poll."

* commit 'c8a5b0b6535aed78e4f213ab4bf4262a6d475263':
adb: move adb to poll.
21bfc391ead9bd9d702bdedf394869445cd93b76 15-Sep-2015 David Pursell <dpursell@google.com> am 2017030b: am d9076f21: Merge "adb: Kill subprocess when the client exits."

* commit '2017030b49b22b9abc4b47cc1d15882d7e7f3e21':
adb: Kill subprocess when the client exits.
c8a5b0b6535aed78e4f213ab4bf4262a6d475263 15-Sep-2015 Yabin Cui <yabinc@google.com> am fa965d96: Merge "adb: move adb to poll."

* commit 'fa965d9639dc264bb0d18e71dff998a4f648b50d':
adb: move adb to poll.
2017030b49b22b9abc4b47cc1d15882d7e7f3e21 15-Sep-2015 David Pursell <dpursell@google.com> am d9076f21: Merge "adb: Kill subprocess when the client exits."

* commit 'd9076f2132006505227e5fec91926acb512c3d68':
adb: Kill subprocess when the client exits.
fa965d9639dc264bb0d18e71dff998a4f648b50d 15-Sep-2015 Yabin Cui <yabinc@google.com> Merge "adb: move adb to poll."
544e795fbb8a750f67796d7d0cad898f3f5f711c 15-Sep-2015 David Pursell <dpursell@google.com> adb: Kill subprocess when the client exits.

When the client exits (e.g. with Ctrl+C) the subprocess should be
notified as well so it can cleanup if needed.

Bug: http://b/23825725
Change-Id: Idb771710b293e0a9f7bebc9e2814b3a816e2c50e
hell_service.cpp
est_device.py
a10801674cb9e23ae549fb7f861cb33d8c629e80 05-Sep-2015 Yabin Cui <yabinc@google.com> adb: move adb to poll.

It is reported that the registered fd can be bigger than FD_SETSIZE, and can't be
handled by select(). By moving to poll(), we can remove the limitation.
Although we can't ignore the possibility that there is a fd leak, but we can
still make the potential bug more explicit by moving to poll().
We didn't move to epoll() because it is not supported on mac.

Bug: 23820751

Change-Id: Icb39329c4984f1fef749472c9e088682ee8c3444
db.cpp
devent.cpp
devent_test.cpp
de6aed81c8c8b9a7c339c58c9018bb260ff064b7 15-Sep-2015 David Pursell <dpursell@google.com> am a3ef4fad: am 0af19a0e: Merge "adb: Fix missing shell protocol usage."

* commit 'a3ef4fad70692c88819b95a41437c03e9a3398a6':
adb: Fix missing shell protocol usage.
a3ef4fad70692c88819b95a41437c03e9a3398a6 15-Sep-2015 David Pursell <dpursell@google.com> am 0af19a0e: Merge "adb: Fix missing shell protocol usage."

* commit '0af19a0e82d7808678f3b92a8c5b4b8cb80ee216':
adb: Fix missing shell protocol usage.
80fdc0bf867cbfbbe4f1ce99e6e01ca4c5b26e3c 15-Sep-2015 Spencer Low <CompareAndSwap@gmail.com> adb unittest: make test_sync properly cleanup after itself

It wasn't deleting the tempfile.mkdtemp() dir that it made.

Change-Id: I59c5f98aa8297c7b28d38799dd21ffe9566f2145
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
est_device.py
71c83126a86de8986b24e5c7cd1a239d2fcc7fa1 15-Sep-2015 David Pursell <dpursell@google.com> adb: Fix missing shell protocol usage.

Some adb commands use the shell service but weren't using the
shell protocol, causing a protocol mismatch between the client and
the device. This CL uses the shell protocol whenever possible.

Change-Id: I4c9c75b7fd1d5bf3dc1f73900711840270527682
ommandline.cpp
e4c0454083f6e0a1d104235eb89c855ea1876b3c 14-Sep-2015 David Pursell <dpursell@google.com> am 07448e07: am 76f4a653: Merge changes from topic \'adb_shell\'

* commit '07448e072e50703b01aca9f99cf03ead030746de':
adb: add client side shell protocol and enable.
adb: implement shell protocol.
07448e072e50703b01aca9f99cf03ead030746de 14-Sep-2015 David Pursell <dpursell@google.com> am 76f4a653: Merge changes from topic \'adb_shell\'

* commit '76f4a6533c6b803e267225b42c5dda63f23bf3ea':
adb: add client side shell protocol and enable.
adb: implement shell protocol.
76f4a6533c6b803e267225b42c5dda63f23bf3ea 14-Sep-2015 David Pursell <dpursell@google.com> Merge changes from topic 'adb_shell'

* changes:
adb: add client side shell protocol and enable.
adb: implement shell protocol.
9a5c3775d45dcbb741960cb42960502d5179478b 12-Sep-2015 David Pursell <dpursell@google.com> am 3b43b161: am 7b749acd: Merge "adb: fix shell_service_protocol_test for Windows."

* commit '3b43b161824946cca173d66694c8941f94a7aca2':
adb: fix shell_service_protocol_test for Windows.
3b43b161824946cca173d66694c8941f94a7aca2 12-Sep-2015 David Pursell <dpursell@google.com> am 7b749acd: Merge "adb: fix shell_service_protocol_test for Windows."

* commit '7b749acd5f7de9448f851e84ac2d3d90d28e5f03':
adb: fix shell_service_protocol_test for Windows.
b404dec85ab07043c0a1933671aa76a159d797ac 12-Sep-2015 David Pursell <dpursell@google.com> adb: fix shell_service_protocol_test for Windows.

Adds missing #ifdef guards to shell_service_protocol_test.cpp so the
test compiles on Windows.

Also fixes a bug in Windows socketpair write implementation. Previously
it was only checking for a closed pipe if the write happened to block.
This adds an additional pre-check to exit immediately on a closed pipe.

These two changes allow the test to compile and pass on Windows.

Change-Id: Ib8853ed72f015fc0d623da47c32982cb3ffa4a3d
ndroid.mk
hell_service_protocol_test.cpp
ysdeps_win32.cpp
e3082990cd205ac0b068f546d8344ffcf4c97c6d 12-Sep-2015 Elliott Hughes <enh@google.com> am e917d8ed: am 9336ee38: Merge "Fix (Windows) build."

* commit 'e917d8ed629eda66fa1218ee6564a31409c2afe8':
Fix (Windows) build.
83226d0439ec34f2d9205b711b3ee3865821e485 12-Sep-2015 Elliott Hughes <enh@google.com> am 61eee363: am 0ad13cf2: Merge "fix adb_test Windows build"

* commit '61eee3636f96a0b32be3304796e6af4421d03a4e':
fix adb_test Windows build
e917d8ed629eda66fa1218ee6564a31409c2afe8 12-Sep-2015 Elliott Hughes <enh@google.com> am 9336ee38: Merge "Fix (Windows) build."

* commit '9336ee389f79296d04790d1a1dab6f55b6a4c221':
Fix (Windows) build.
61eee3636f96a0b32be3304796e6af4421d03a4e 12-Sep-2015 Elliott Hughes <enh@google.com> am 0ad13cf2: Merge "fix adb_test Windows build"

* commit '0ad13cf2982d428a4db742877720e5f4be738fa4':
fix adb_test Windows build
2f577205fccb969135105a947a9ceaa99049c04f 12-Sep-2015 Elliott Hughes <enh@google.com> Fix (Windows) build.

Change-Id: Ib9afd101d255d748ba6c15ed8075f3d10338c95c
ndroid.mk
a480aa1d67be77fadd9ef25be26a0c75c4b2a668 12-Sep-2015 Elliott Hughes <enh@google.com> am 0b60dae6: am ee46239c: Merge "adb: win32: make adb_getenv() case-insensitive"

* commit '0b60dae6d342d336a7e1c4ae86058d3099c643c5':
adb: win32: make adb_getenv() case-insensitive
0ad13cf2982d428a4db742877720e5f4be738fa4 12-Sep-2015 Elliott Hughes <enh@google.com> Merge "fix adb_test Windows build"
8b39e2ff5889b63b0b32addaa6ba4982ce9833c1 12-Sep-2015 David Pursell <dpursell@google.com> am 90ba84b2: am 31139af0: Merge "adb: create shell protocol class (take 2)."

* commit '90ba84b2868580ab357f8b5f049bc59df0a58d1f':
adb: create shell protocol class (take 2).
0b60dae6d342d336a7e1c4ae86058d3099c643c5 12-Sep-2015 Elliott Hughes <enh@google.com> am ee46239c: Merge "adb: win32: make adb_getenv() case-insensitive"

* commit 'ee46239c358fac90813128fccbcb49292f8b04f3':
adb: win32: make adb_getenv() case-insensitive
e6ae5735713f172eff39f9b8bc75b478b50aee7f 09-Sep-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: make adb_getenv() case-insensitive

adb_getenv() should be case-insensitive just like the real getenv() on
Windows.

Added a unittest for adb_getenv(). In the process, made adb_test link
with -municode so that the environment block is Unicode.

Move wmain() from main.cpp to sysdeps_win32.cpp so that adb_test could
also use it.

Because wmain() moved, it wasn't as easy to do the runtime check to
verify that -municode was used, so do that check in _ensure_env_setup()
since adb_getenv() is called early in adb anyway.

Added a utility ToLower() which is good enough for env vars whose keys
are probably always ASCII to begin with.

Change-Id: I082f7fdee9dfe2c7f76b878528d2f7863df6d8d1
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ndroid.mk
lient/main.cpp
ysdeps_win32.cpp
ysdeps_win32_test.cpp
ebf770fd735f843936b79df333f70319bade1cb7 08-Sep-2015 Spencer Low <CompareAndSwap@gmail.com> fix adb_test Windows build

adb/Android.mk: adb_test should build on Windows (and Darwin), so add to
the whitelist.

Change-Id: I778f6a7dff4caec92c48e0957591abf32f86ab1b
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ndroid.mk
90ba84b2868580ab357f8b5f049bc59df0a58d1f 12-Sep-2015 David Pursell <dpursell@google.com> am 31139af0: Merge "adb: create shell protocol class (take 2)."

* commit '31139af04f97c843db2a98c7fafc1d58d7f7c8ac':
adb: create shell protocol class (take 2).
606835ae5c4b9519009cdff8b1c33169cff32cb1 09-Sep-2015 David Pursell <dpursell@google.com> adb: add client side shell protocol and enable.

Adds the shell protocol functionality to the client side and enables it
if the transport supports the feature.

Bug:http://b/23031026
Change-Id: I9abe1c8b1d39f8dd09666321b1c761ad708a8854
ommandline.cpp
evice.py
est_device.py
ransport.cpp
0955c66b226db7a7f34613f834f7b0a145fd407d 31-Aug-2015 David Pursell <dpursell@google.com> adb: implement shell protocol.

Adds functionality for handling stdin/stdout/stderr streams and exit
codes using the shell protocol.

This CL just contains implementation for adbd which will not yet be
enabled. Once we have the ability to query transport features from the
adb client, another CL will add the implementation for the client side
and update the feature list to turn this on.

Note: this CL must be submitted together with a minadbd CL to update
the service_to_fd() function signature.

Bug: http://b/23030641

Change-Id: Ibed55e9c1946d8a35190696163ff63e8fb880238
ndroid.mk
db.cpp
db.h
ervices.cpp
hell_service.cpp
hell_service.h
hell_service_test.cpp
ockets.cpp
ransport.cpp
ransport.h
31139af04f97c843db2a98c7fafc1d58d7f7c8ac 11-Sep-2015 David Pursell <dpursell@google.com> Merge "adb: create shell protocol class (take 2)."
2f6d1e5486042887e4ca864f0921409fd219e192 09-Sep-2015 Dan Willemsen <dwillemsen@google.com> am a376c046: am aaf4fcf4: Merge "Remove HOST_OS==windows check"

* commit 'a376c046bf7f5f86b53190d1f8dab309dd80a58b':
Remove HOST_OS==windows check
a376c046bf7f5f86b53190d1f8dab309dd80a58b 09-Sep-2015 Dan Willemsen <dwillemsen@google.com> am aaf4fcf4: Merge "Remove HOST_OS==windows check"

* commit 'aaf4fcf482d427459c70e10a22fef5ea9c7bca1a':
Remove HOST_OS==windows check
aaf4fcf482d427459c70e10a22fef5ea9c7bca1a 09-Sep-2015 Dan Willemsen <dwillemsen@google.com> Merge "Remove HOST_OS==windows check"
4a53f6ec432d1d5389aaba35b233b7c36ab7070f 09-Sep-2015 Yabin Cui <yabinc@google.com> am b73eb268: am 4ddb6a32: Merge "adb: remove unnecessary dependencies of liblog."

* commit 'b73eb268ffdf61257342bdb256f6dd372666ffaf':
adb: remove unnecessary dependencies of liblog.
824a51eae48e941053ae6a15f514f7d9ae85e8d7 09-Sep-2015 Yabin Cui <yabinc@google.com> am bd9305ee: am 0df24ea2: Merge "adb: refactor _is_valid_ack_reply_fd"

* commit 'bd9305eeb7152058ba8255f0c2601d512c906f98':
adb: refactor _is_valid_ack_reply_fd
b73eb268ffdf61257342bdb256f6dd372666ffaf 09-Sep-2015 Yabin Cui <yabinc@google.com> am 4ddb6a32: Merge "adb: remove unnecessary dependencies of liblog."

* commit '4ddb6a3289d7cc1d1f60e3ae0af231da55f937ac':
adb: remove unnecessary dependencies of liblog.
bd9305eeb7152058ba8255f0c2601d512c906f98 09-Sep-2015 Yabin Cui <yabinc@google.com> am 0df24ea2: Merge "adb: refactor _is_valid_ack_reply_fd"

* commit '0df24ea234fcfb9ac57ed94701868426a41d8642':
adb: refactor _is_valid_ack_reply_fd
4ddb6a3289d7cc1d1f60e3ae0af231da55f937ac 09-Sep-2015 Yabin Cui <yabinc@google.com> Merge "adb: remove unnecessary dependencies of liblog."
cb992d9a2186f818e5e88d960707e16cd29a8240 09-Sep-2015 Yabin Cui <yabinc@google.com> adb: remove unnecessary dependencies of liblog.

Change-Id: I1aaa9e6c1b47a70f8daf91745f6aec13c92b789f
ndroid.mk
b9e2e84e7e3cc5c9f30d63ef7d1337363437d2c7 01-Sep-2015 David Pursell <dpursell@google.com> adb: create shell protocol class (take 2).

Adds a new class ShellProtocol to help read and write data with
`adb shell`. This will allow splitting streams and sending out-of-band
data such as exit codes.

Nothing uses the new class yet except the unit tests.

This is the second attempt at this CL, the first is at
http://r.android.com/169600. The problems was using sighandler_t
which is not available on mac. sig_t is used instead which is available
due to _GNU_SOURCE being defined in Android.mk, which causes
_BSD_SOURCE -> __USE_BSD -> sig_t to be defined. Nothing else has been
changed from the original CL.

Bug: http://b/23030641
Change-Id: I7bd7f5a82ad811fbca7a3eee1236d2c55ae57c48
ndroid.mk
hell_service.h
hell_service_protocol.cpp
hell_service_protocol_test.cpp
a13df3070f03da937219d92549a4dab8fb45b65c 08-Sep-2015 Spencer Low <CompareAndSwap@gmail.com> adb: refactor _is_valid_ack_reply_fd

Visual Studio's 'jump to reference' feature couldn't parse
adb_commandline() because I used an #ifdef in the middle of an if
statement, so this refactors the code into a separate helper function. I
just copied the code and inverted the comparisons.

No need for sysdeps since this is pretty minor.

Change-Id: Ifd5c62b0b505080ada6db5cc19739c6f07b94de9
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ommandline.cpp
beb81f48d8eacdb9e29e369a911c1195e5c7a76d 06-Sep-2015 David Pursell <dpursell@google.com> am 9432e753: am da0b0116: Merge "Revert "adb: create shell protocol class.""

* commit '9432e7538ac5ce57a0701bfe274b3eab8589544e':
Revert "adb: create shell protocol class."
9432e7538ac5ce57a0701bfe274b3eab8589544e 06-Sep-2015 David Pursell <dpursell@google.com> am da0b0116: Merge "Revert "adb: create shell protocol class.""

* commit 'da0b0116ba676203328906608a78dd240e0fea48':
Revert "adb: create shell protocol class."
da0b0116ba676203328906608a78dd240e0fea48 06-Sep-2015 David Pursell <dpursell@google.com> Merge "Revert "adb: create shell protocol class.""
d9b74192b8351c99dc0baf53f6e652edb443d1d1 06-Sep-2015 David Pursell <dpursell@google.com> Revert "adb: create shell protocol class."

This CL broke the mac build. I'll revert for now and take a look at how to get it working next week.

This reverts commit 73096f2e1d87da571187515af6aa7c2171a70693.

Change-Id: Icb3e015250bcbbc69a45675a1358699ebe01e77b
ndroid.mk
hell_service.h
hell_service_protocol.cpp
hell_service_protocol_test.cpp
04aa49346a015e179dff7a28853380eb0f4424fa 05-Sep-2015 David Pursell <dpursell@google.com> am 74b6e8ec: am e4c1bb53: Merge "adb: `features` passes transport features."

* commit '74b6e8ecfdb4e7f46d53f174e8ba21ce74f90482':
adb: `features` passes transport features.
897baffb759e2c6300ad59fef24bfc0b10387a99 05-Sep-2015 David Pursell <dpursell@google.com> am 3f742914: am 21541531: Merge changes from topic \'adb_shell_prework\'

* commit '3f742914b1dd66bdf172059fc7c4bf421e3a87a6':
adb: create shell protocol class.
adb: refactor subprocess code.
adb: move shell service to a separate file.
74b6e8ecfdb4e7f46d53f174e8ba21ce74f90482 05-Sep-2015 David Pursell <dpursell@google.com> am e4c1bb53: Merge "adb: `features` passes transport features."

* commit 'e4c1bb53068db184ee4cb19513ffe7764a09722f':
adb: `features` passes transport features.
e4c1bb53068db184ee4cb19513ffe7764a09722f 05-Sep-2015 David Pursell <dpursell@google.com> Merge "adb: `features` passes transport features."
3f742914b1dd66bdf172059fc7c4bf421e3a87a6 05-Sep-2015 David Pursell <dpursell@google.com> am 21541531: Merge changes from topic \'adb_shell_prework\'

* commit '215415318d8483d648955b72bb3b083e131cb62e':
adb: create shell protocol class.
adb: refactor subprocess code.
adb: move shell service to a separate file.
215415318d8483d648955b72bb3b083e131cb62e 05-Sep-2015 David Pursell <dpursell@google.com> Merge changes from topic 'adb_shell_prework'

* changes:
adb: create shell protocol class.
adb: refactor subprocess code.
adb: move shell service to a separate file.
880be434a9ec197100fe5c6f0b299353d13b916b 05-Sep-2015 David Pursell <dpursell@google.com> adb: `features` passes transport features.

`adb features` previously returned a list of host features which was
not terribly useful. This CL changes functionality to return the
transport features instead using the standard targeting args:
$ adb features # default target.
$ adb -e features
$ adb -s 123456 features

Also adds a "check-feature" service which is currently unused but will
allow the adb client to easily check for a specific feature.

Bug: http://b/23824036
Change-Id: Ibc0c420c75f73d363f3bba7705af616ba2059348
db.cpp
ommandline.cpp
66680c506ab67802626112e96a5ccef3ef7565c1 04-Sep-2015 Dan Willemsen <dwillemsen@google.com> Remove HOST_OS==windows check

With the HOST_CROSS_OS build system change, LOCAL_MULTILIB := first now
behaves the same way.

Change-Id: I03294403e5a106a53d4a0d48b176434221284901
ndroid.mk
73096f2e1d87da571187515af6aa7c2171a70693 01-Sep-2015 David Pursell <dpursell@google.com> adb: create shell protocol class.

Adds a new class ShellProtocol to help read and write data with
`adb shell`. This will allow splitting streams and sending out-of-band
data such as exit codes.

Nothing uses the new class yet except the unit tests.

Bug: http://b/23030641

Change-Id: Ieb02e127095c6dda25b7cb188a2e599173fd97e6
ndroid.mk
hell_service.h
hell_service_protocol.cpp
hell_service_protocol_test.cpp
a932058504ee20d28f1a5b3c17c377543e4eb281 29-Aug-2015 David Pursell <dpursell@google.com> adb: refactor subprocess code.

Refactor shell_service.cpp to remove dependencies on service.cpp and
combine some common logic between PTY and raw subprocesses.

This will make it easier to add additional common code paths for
the upcoming shell protocol.

Change-Id: I497d30dd388de61b6e68d9086dce38f33dd92876
hell_service.cpp
c74403b4c9c8acae326b39f06905a3a291a5471f 04-Sep-2015 Tom Cherry <tomcherry@google.com> am b00a8a06: am e8b0fcec: Merge "combine adbd.rc with init.usb.rc"

* commit 'b00a8a066f5b6ae5b8d0c03ee7f680389b38a260':
combine adbd.rc with init.usb.rc
b00a8a066f5b6ae5b8d0c03ee7f680389b38a260 04-Sep-2015 Tom Cherry <tomcherry@google.com> am e8b0fcec: Merge "combine adbd.rc with init.usb.rc"

* commit 'e8b0fcecf4a17cf37b5fefbcceef0920788f776e':
combine adbd.rc with init.usb.rc
80f67029e002a97dd4f752881d820b3161f729f1 29-Aug-2015 David Pursell <dpursell@google.com> adb: move shell service to a separate file.

Upcoming changes to the shell will require significant additions to
the subprocess code, and it will be cleaner if it's in a separate file.

The only functional change here is a new debug tag specifically for
the shell service. Everything else has been copied exactly as-is in
order to make it easier to determine what's changing in upcoming CLs.

Change-Id: I13bd4294059051ee10e0d0c6a06affd8eca62967
ndroid.mk
db.cpp
db_trace.h
ervices.cpp
hell_service.cpp
hell_service.h
2270dbbc841f0c98d2c7a6fafea128350aa3abf4 04-Sep-2015 Tom Cherry <tomcherry@google.com> combine adbd.rc with init.usb.rc

init.usb.rc and adbd.rc contain similar contents and belong in the same
file.

This file also belongs on the ramdisk as adbd is on the ramdisk, not the
system partition, therefore resolving to keep init.usb.rc in its current
location and combining the contents of adbd.rc is the best approach

Change-Id: I430f8fea58694679e7b8b7be69ce87daadd616f4
ndroid.mk
dbd.rc
27e427aaa2e56d68d914363df0c6b425837bab40 03-Sep-2015 Elliott Hughes <enh@google.com> am db31ac76: am 478da637: Merge "Improve adb sync_send error reporting."

* commit 'db31ac76baf732244b9492a96db43fd90070411a':
Improve adb sync_send error reporting.
db31ac76baf732244b9492a96db43fd90070411a 03-Sep-2015 Elliott Hughes <enh@google.com> am 478da637: Merge "Improve adb sync_send error reporting."

* commit '478da6374b5f4a5742566edfe3057c674a51615e':
Improve adb sync_send error reporting.
081696d27c3b3c6bc0e2b97449c1da791fa00d25 03-Sep-2015 Elliott Hughes <enh@google.com> Improve adb sync_send error reporting.

Bug: http://b/23786900
Change-Id: I71f10de8d767eaf8bf0f5d9b8c304527e2b953ff
ile_sync_client.cpp
9bbc68dd0782966b3e5e583afabb7b94c02e860a 03-Sep-2015 Yabin Cui <yabinc@google.com> am 7d0b4ada: am 6562c151: Merge "adb: clean up debug tracing a little."

* commit '7d0b4ada0bf539a0f48b00e211799400aa733f4d':
adb: clean up debug tracing a little.
7d0b4ada0bf539a0f48b00e211799400aa733f4d 03-Sep-2015 Yabin Cui <yabinc@google.com> am 6562c151: Merge "adb: clean up debug tracing a little."

* commit '6562c1513b2b7bd88da8b1d0c88b89e66b2dcd69':
adb: clean up debug tracing a little.
6562c1513b2b7bd88da8b1d0c88b89e66b2dcd69 03-Sep-2015 Yabin Cui <yabinc@google.com> Merge "adb: clean up debug tracing a little."
7a3f8d6691b3fbd8014a98de8455dbcfcc9629e4 03-Sep-2015 Yabin Cui <yabinc@google.com> adb: clean up debug tracing a little.

Always use LOG() for debug tracing.
Remove useless D_lock. I believe it is useless to lock just before and after fprintf.

I verified the log output both on host and on device. The output looks fine to me.

Change-Id: I96ccfe408ff56864361551afe9ad464d197ae104
db.cpp
db_auth.cpp
db_auth_client.cpp
db_auth_host.cpp
db_client.cpp
db_io.cpp
db_trace.h
db_utils.cpp
lient/main.cpp
ommandline.cpp
aemon/main.cpp
devent.cpp
ile_sync_service.cpp
dwp_service.cpp
utex_list.h
ervices.cpp
ockets.cpp
ysdeps_win32.cpp
ransport.cpp
ransport_local.cpp
ransport_usb.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_windows.cpp
54afdbaef79c7265395d0b84f54c96c7c9f11322 03-Sep-2015 Dan Willemsen <dwillemsen@google.com> am a4b8f9f1: am bfe32228: Merge "Remove USE_MINGW/CYGWIN; Whitelist windows modules"

* commit 'a4b8f9f1c2d9fb6795c81ae39441e720662602d0':
Remove USE_MINGW/CYGWIN; Whitelist windows modules
a4b8f9f1c2d9fb6795c81ae39441e720662602d0 03-Sep-2015 Dan Willemsen <dwillemsen@google.com> am bfe32228: Merge "Remove USE_MINGW/CYGWIN; Whitelist windows modules"

* commit 'bfe322285fdbe86fdc01fdc4c711e22e894bdaee':
Remove USE_MINGW/CYGWIN; Whitelist windows modules
87a419c8b1343c9025fe2593206a6e95b0aa9700 13-Aug-2015 Dan Willemsen <dwillemsen@google.com> Remove USE_MINGW/CYGWIN; Whitelist windows modules

CYGWIN is not supported, USE_MINGW and HOST_OS==windows are being
replaced with LOCAL_..._windows variables.

Bug: 23566667
Change-Id: I3e4a1e4097dc994cf5abdce6939e83a91758fd75
ndroid.mk
0b23a08b278b4565b5a4e72aec32989814ad770d 02-Sep-2015 Elliott Hughes <enh@google.com> am 1428640f: am 5d804006: Merge "adb/base win32 tests: fix comment and open() flags"

* commit '1428640f5cf69ede7dcafa7ae5ecca5a0a4fff50':
adb/base win32 tests: fix comment and open() flags
1428640f5cf69ede7dcafa7ae5ecca5a0a4fff50 02-Sep-2015 Elliott Hughes <enh@google.com> am 5d804006: Merge "adb/base win32 tests: fix comment and open() flags"

* commit '5d8040060515128f2bee9b4759d0618b90c4d70c':
adb/base win32 tests: fix comment and open() flags
2fbeb0cc713f47ec699bfed4bc530aa19e08e1a3 01-Sep-2015 Spencer Low <CompareAndSwap@gmail.com> adb/base win32 tests: fix comment and open() flags

Match base's use of O_BINARY.

Change-Id: I930b5c8fddde20966580069f2e681b99cb26f1a3
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db_io_test.cpp
59224c9537c0a0e96e3ead81084133ecab41c598 01-Sep-2015 Elliott Hughes <enh@google.com> resolved conflicts for merge of 46603db5 to mnc-dr-dev-plus-aosp

Change-Id: I3fb7ff8e9d9313c294620ae0ce63a17766940ec4
14bf82e21f7a8bec4bdeb8092cc2a86e3784fc4f 01-Sep-2015 Yabin Cui <yabinc@google.com> am 2ae47a0b: Merge "adb: add unit test for fdevent."

* commit '2ae47a0b54c51d05cfb5bab3e1d7a34d5d15ba1b':
adb: add unit test for fdevent.
7a3dc5eacfb4f016481f97304ad80c510f353ca3 01-Sep-2015 Yabin Cui <yabinc@google.com> am 1e19317e: Merge "adb: improve names for transport threads."

* commit '1e19317e575e1020cc0c241c4591a3f95f6a45c4':
adb: improve names for transport threads.
85c04dfeb6cf1a260ab87434fbeb8f315f6caa14 01-Sep-2015 Yabin Cui <yabinc@google.com> am 1531cee6: Merge "adb: remove workaround for b/6558362."

* commit '1531cee658ecc46a8eda3c1bc13a09fd4fa73eb9':
adb: remove workaround for b/6558362.
7dbc0936e858acb5842d35b67caf917e6f459dbb 01-Sep-2015 Elliott Hughes <enh@google.com> am b6bfd36c: Merge "Distinguish transport threads."

* commit 'b6bfd36c19626ef1aca3b5d28092721c6b498a34':
Distinguish transport threads.
1f9d3b07a6d1e1c1d537e4d9711fc2b3e43f3cb9 01-Sep-2015 Siva Velusamy <vsiva@google.com> am c9525ec3: Merge "adb: set thread names (linux & mac)"

* commit 'c9525ec366232aa6a0968be1cc8e8abc37df789f':
adb: set thread names (linux & mac)
2ae47a0b54c51d05cfb5bab3e1d7a34d5d15ba1b 01-Sep-2015 Yabin Cui <yabinc@google.com> Merge "adb: add unit test for fdevent."
1e19317e575e1020cc0c241c4591a3f95f6a45c4 31-Aug-2015 Yabin Cui <yabinc@google.com> Merge "adb: improve names for transport threads."
d6ab3c2245b6c71605bad746a535028b717e899a 31-Aug-2015 Yabin Cui <yabinc@google.com> adb: improve names for transport threads.

The old names seems confusing. output_thread was reading remote data and writing to
local sockets. input_thread was reading local sockets data and writing to remote.
This change tries to make it clear by renaming output_thread to read_transport thread,
and renaming input_thread to write_transport thread.

Change-Id: I2e7b4cde7a94d436f3745e9e3ab10780e7caa8ac
ransport.cpp
sb_linux.cpp
sb_osx.cpp
c6424585a27bbbf6922574a2cccc3bf6c42bfb2c 31-Aug-2015 Yabin Cui <yabinc@google.com> adb: remove workaround for b/6558362.

I believe the problem has been fixed in https://android-review.googlesource.com/#/c/168412/.
So it's time to remove the workaround.

Bug: 6558362
Change-Id: I399c18eda0693f3c51feac07ff59a0a4b5558128
ndroid.mk
lient/main.cpp
0c3914a44d608614a2cf5225e0072f41b2910d3c 31-Aug-2015 Elliott Hughes <enh@google.com> Distinguish transport threads.

Use "<-" and "->" to work around Linux's very short thread name limit.

Bug: http://b/23423333
Change-Id: I9f3f096415b47162dacb660cd0a97ac7ff6107e6
ransport.cpp
49ee7cf9a10f66ffa9a3490c69db5fa46e0a966b 29-Aug-2015 Siva Velusamy <vsiva@google.com> adb: set thread names (linux & mac)

Bug: 23423333
Change-Id: I0069f32ddbae2a10fb130064f721facf45b2cc09
db.cpp
ommandline.cpp
ervices.cpp
ysdeps.h
ransport.cpp
ransport_local.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
sb_windows.cpp
bec02fc43d917a4da817d4a02826f110ce340243 29-Aug-2015 Yabin Cui <yabinc@google.com> adb: add unit test for fdevent.

Change-Id: Ic26cda5d8e84425bc60ce36bc686bb6917c4ca3c
ndroid.mk
devent.h
devent_test.cpp
b77146ce7cbc5189e760b70d3e367f88bd13c405 29-Aug-2015 Elliott Hughes <enh@google.com> am 9f07f879: Merge "fatal and fatal_errno should be noreturn."

* commit '9f07f87908f072d63d8bb9ded91616af8d3edbb4':
fatal and fatal_errno should be noreturn.
432ea8f94e336e3be6f5f5fb5bdf963c05aaff55 29-Aug-2015 Yabin Cui <yabinc@google.com> am a3bdc6ab: Merge "adb: clean up transport disconnect operations."

* commit 'a3bdc6aba29950b38a4c8ab785e5828451e97140':
adb: clean up transport disconnect operations.
9f07f87908f072d63d8bb9ded91616af8d3edbb4 29-Aug-2015 Elliott Hughes <enh@google.com> Merge "fatal and fatal_errno should be noreturn."
a3bdc6aba29950b38a4c8ab785e5828451e97140 29-Aug-2015 Yabin Cui <yabinc@google.com> Merge "adb: clean up transport disconnect operations."
2f3342fa33a39df1ef0f5f94dfeca7687e16a346 29-Aug-2015 Elliott Hughes <enh@google.com> fatal and fatal_errno should be noreturn.

Change-Id: I9c5d9cb5ed743d13e65112a111cc9544ec5da339
db.h
b329824e6c5373ae303269dca285d835ce57e514 29-Aug-2015 Yabin Cui <yabinc@google.com> adb: clean up transport disconnect operations.

Move operations from global functions into member functions.
Add unit test.

Change-Id: Id4543d8e78541eb08c8e629f180c605c699737ec
db.cpp
db.h
db_auth_client.cpp
db_listeners.cpp
ransport.cpp
ransport.h
ransport_test.cpp
9382e6c07158f47315d5d5302300459b090c325f 29-Aug-2015 Elliott Hughes <enh@google.com> am f6224587: Merge "Improve adb tracing."

* commit 'f6224587e5fdb8d659172ba5a87a55685a94adf7':
Improve adb tracing.
f6224587e5fdb8d659172ba5a87a55685a94adf7 28-Aug-2015 Elliott Hughes <enh@google.com> Merge "Improve adb tracing."
bd4b1fa4a914552e450eb5a2bf398ba525c8adec 28-Aug-2015 Elliott Hughes <enh@google.com> Improve adb tracing.

The existing format was unreadable; putting the pid and tid first helps
somewhat. Also remove the unused qemu tracing which wasn't called anywhere.

Change-Id: I37ef3c556fe17b237ba1d8ca3216e2155ce5d0de
ndroid.mk
db_trace.h
aemon/main.cpp
emu_tracing.cpp
emu_tracing.h
bbe5de230764cff0656ae6d60aa0f33b4c35ea90 28-Aug-2015 Yabin Cui <yabinc@google.com> am 88a51cd4: Merge "adb: call run_transport_disconnects() only once."

* commit '88a51cd4d8377516f693720f427511cb40e90b75':
adb: call run_transport_disconnects() only once.
88a51cd4d8377516f693720f427511cb40e90b75 28-Aug-2015 Yabin Cui <yabinc@google.com> Merge "adb: call run_transport_disconnects() only once."
bffa890641de614668d3dafd8236e940f9ea6af7 28-Aug-2015 Elliott Hughes <enh@google.com> am e73a8a23: Merge "win32: adb start-server shows stdout/stderr output from actual server"

* commit 'e73a8a2388f019b0f7a6e468af27056edbb02521':
win32: adb start-server shows stdout/stderr output from actual server
e73a8a2388f019b0f7a6e468af27056edbb02521 28-Aug-2015 Elliott Hughes <enh@google.com> Merge "win32: adb start-server shows stdout/stderr output from actual server"
4417c38a1eb64fb7cfffa75a5f705a79484ed3d5 28-Aug-2015 Elliott Hughes <enh@google.com> am a54f14eb: Merge "adb unittest: get test_unicode_paths passing on win32"

* commit 'a54f14eb95d73c91aaa2a4387a79d897a4731060':
adb unittest: get test_unicode_paths passing on win32
a54f14eb95d73c91aaa2a4387a79d897a4731060 28-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb unittest: get test_unicode_paths passing on win32"
be881b65ca0dcd0f267a767eaecb61636e089399 28-Aug-2015 Elliott Hughes <enh@google.com> am 1d9253f2: Merge "adb: fix adb install and adb push exit code, error handling, unittest"

* commit '1d9253f255c60069c4187f0c43b2b22015fd5688':
adb: fix adb install and adb push exit code, error handling, unittest
1d9253f255c60069c4187f0c43b2b22015fd5688 28-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb: fix adb install and adb push exit code, error handling, unittest"
adab77ad50caab89127f0ba3baecd27a99ae6fc1 28-Aug-2015 Yabin Cui <yabinc@google.com> am 7b6fa7ed: Merge "adb: remove adisconnect in aremotesocket."

* commit '7b6fa7ed304cbd682e4c4cb539f2e4f8047aedc4':
adb: remove adisconnect in aremotesocket.
12d7f0909a4332c0f03ea0bd49741cc6c46a2353 28-Aug-2015 Yabin Cui <yabinc@google.com> adb: call run_transport_disconnects() only once.

Currently run_transport_disconnects() are called twice. One is in
handle_offline(), another is before destroying transport.
The users of disconnect callback are listener, adb_auth_client, and
remote_sockets. All of them need only to be called once. And after
handle_offline, no new listeners, adb_auth_client, or remote_sockets
can be connected to the offlined transport. So I think we can remove
the second call to run_transport_disconnects().

Change-Id: I1ef8b6b7b5ab7ae1bad109be107c85973d65a2e3
ransport.cpp
d8cce1817b02c23124e85b138d85acd8fc24a757 28-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: fix adb install and adb push exit code, error handling, unittest

adb push was not returning a bad exit code when write_data_file() or
write_data_link() failed. I encountered this when running the unittest
on Windows which can get into situations where stat() succeeds, but
open() fails due to pre-existing exclusive file access (which typically
doesn't exist on unix).

The same code is used by adb install, so this also fixes its error
handling.

Fixed some fd leaks and propagation of errors when reading a file.

Fixed a unittest to close temp files before reading them.

Change-Id: Ieba0026fa4c79eb0484676e4f2faaac9603ef584
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ile_sync_client.cpp
est_device.py
de4505f8196114a348d0735a940e507d630bbb63 28-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb unittest: get test_unicode_paths passing on win32

The Python 2 subprocess class doesn't use Unicode, so as a work-around
write the command line to a UTF-8 batch file and run that.

I modified the test to use u'blah' without .encode('utf-8') because the
Python docs recommend dealing with string variables like that. When
formatting a string with a unicode parameter, use u'foo' on the constant
string to make it unicode.

I also tested this on Linux and it seems to work fine (I did ls in the
middle of the test to make sure the filenames came out right, etc.).

I had to close the temporary files before adb tries to read/write them
because filesystem semantics are different on Windows (technically I
might be able to modify adb to try to open files with more permissive
share flags, but then I'm not sure if Python uses the right share flags.
Basically, I'd be opening another can of worms.).

Fixed the test to delete a temp file on the device once it is done.

Change-Id: Id0c34e26d7697fbbb47a44ae45298bed5e8c59d6
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
evice.py
est_device.py
fd28f327ee0e110208ef42ded829286643860394 28-Aug-2015 Yabin Cui <yabinc@google.com> adb: remove adisconnect in aremotesocket.

The function of remote_socket_disconnect() is to make sure
the local_sockets and remote_sockets are closed when the binded
transport is disconnected. However, as we call close_all_sockets()
in handle_offline(), we don't need remote_socket_disconnect() any more.

Change-Id: I575f632d9f8703149f34e0210eb698a56e2516a9
ockets.cpp
a483eae5b169571185731791dd70310cfd9e9290 28-Aug-2015 Yabin Cui <yabinc@google.com> am 4f8d5b01: Merge "adb: disconnect: fix write-after-free memory corruption and crash."

* commit '4f8d5b01281e751168718c7b0a74db34352aaf1e':
adb: disconnect: fix write-after-free memory corruption and crash.
f4b9928563e97620fc1d9bd5c2efdaa0ded96488 27-Aug-2015 Yabin Cui <yabinc@google.com> adb: disconnect: fix write-after-free memory corruption and crash.

Transport atransport objects are semi-reference counted: the input and
output threads each hold a reference. The adb disconnect command was
calling transport_unref to release a reference that it never had in the
first place. This meant that the refcount dropped to zero and the object
was deleted before either the input or output thread released its
reference. When that last thread released its reference, it wrote to
freed memory and also sometimes crashed.

This fix is to not release any unheld reference, instead it just kicks
the transport to break remote_read in output_thread. So all transport
close flow goes the following way:
output_thread (exit) -> main thread (offline the transport) ->
input thread (exit) -> main thread (destroy the transport)

Change-Id: Iad1fe718acc8716f3a79c8c22b426a1b2450452c
db.cpp
ransport.cpp
ransport.h
9f91681d5025a22851d7f666bc574a0a9d445281 27-Aug-2015 Yabin Cui <yabinc@google.com> am f3068123: Merge "adb: fix a fake data race on transport:kick reported by tsan."

* commit 'f3068123039e81cee85ce9103d01b5b2aceb2ba3':
adb: fix a fake data race on transport:kick reported by tsan.
f3068123039e81cee85ce9103d01b5b2aceb2ba3 27-Aug-2015 Yabin Cui <yabinc@google.com> Merge "adb: fix a fake data race on transport:kick reported by tsan."
860169cbf89ca007fd04823110e1157346d146f5 27-Aug-2015 Yabin Cui <yabinc@google.com> am 804180b2: Merge "adb: fix a data race in local_socket_event_func."

* commit '804180b2ccf2ef4dedad7d136c060ecbdda7aac5':
adb: fix a data race in local_socket_event_func.
2122c7a1483dc6050b33f58fad4a15d5acd79fdd 27-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> win32: adb start-server shows stdout/stderr output from actual server

When launching the adb server (typically from adb start-server),
redirect stdout/stderr to anonymous pipes which are read by threads in
the parent process, to make error diagnosis easier.

If there is an error during adb start-server, the output looks like:

> adb start-server
* daemon not running. starting it now on port 5037 *
error: could not blah # from server process
could not read ok from ADB Server # from launch_server
* failed to start daemon * # from adb_connect
error: cannot connect to daemon # from adb_commandline

Fix handle-leaks in launch_server by using new unique_handle class
that is based on std::unique_ptr.

In the server, close stdin and redirect to adb.log *before* sending the
ACK, so that any errors are reported early instead of after the ACK.

Change-Id: I943881210a0ea9458fc36851339f916c3d6a0830
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
lient/main.cpp
ysdeps.h
ysdeps_win32.cpp
24f165f121f3268c3239cabe5ac675a946fe6732 22-Aug-2015 Elliott Hughes <enh@google.com> Minimal fix for adb backup.

In master this code has been completely rewritten. This is the minimal fix
against the mnc-sdk-release source.

Bug: http://b/23015233
Bug: https://code.google.com/p/android/issues/detail?id=183490
Change-Id: Iac30993bd2b1b354f8518d8ea2a9ae680ebe4177
ommandline.cpp
d8459b3d3c8f9b1bfb3b6871b9c7d6e235cca6fa 26-Aug-2015 Yabin Cui <yabinc@google.com> adb: fix a fake data race on transport:kick reported by tsan.

It is reported by tsan as a double checked locking. But I think
it is not a real data race. Because I think the old code is able
to make sure t->kick() is only called once, and the caller of
kick_transport is not relying on the side-effect of calling
t->kick().
But as it is not perf critical, I don't mind breaking the double
checked locking pattern.

Bug: 23385662
Change-Id: Ie3597dd56bb514117c3865d2afcfd7c115731a78
ransport.cpp
804180b2ccf2ef4dedad7d136c060ecbdda7aac5 27-Aug-2015 Yabin Cui <yabinc@google.com> Merge "adb: fix a data race in local_socket_event_func."
00674124213d6a9f0564632a5ad172cbd78caf24 26-Aug-2015 Yabin Cui <yabinc@google.com> adb: fix a data race in local_socket_event_func.

If s->peer->enqueue() failed, s may be freed. So we should use
saved_xxx instead of s->xxx before verifying the return value.

Change-Id: I6c072406dceb98e2d02798d0dcdc428fa99e66fb
ockets.cpp
4edb97abb71c1d45214e723ce2b82bff0208ee98 26-Aug-2015 Yabin Cui <yabinc@google.com> am f03aa667: am fbdd5ee2: Merge "adb: keep all asocket operations in the main thread."

* commit 'f03aa6670e39ef1a46211960d134b2528a3649f5':
adb: keep all asocket operations in the main thread.
34f45c566365c966c78264e8a4dc0cf69957b6fa 26-Aug-2015 Yabin Cui <yabinc@google.com> adb: keep all asocket operations in the main thread.

As far as I can see, all asockets operations happen in fdevent_loop()
in the main thread, excepting close_all_sockets(). Instead of adding
lock and ref_count for each asocket, a simpler way would be moving
close_all_sockets() from input_thread to the main thread.

In input_thread(), there are two path to break the loop and call
close_all_sockets(). One path is when receiving offline A_SYNC, which
is sent by the main thread. The other path is when read_packet
fails, which I believe is almost not possible and doesn't matter
(Because t->fd is closed just before t is freed.). So I move
close_all_sockets() to handle_offline() in the main thread.

the socket_list_lock in sockets.cpp could be removed. But I prefer
to leave it for the following changes.

Bug: 6558362
Change-Id: I5da23f60a67a331262c62693b9b127fe2689c799
db.cpp
ransport.cpp
8303f54a588ba28fb519afe47c6c42d16ef83a2b 26-Aug-2015 Elliott Hughes <enh@google.com> am b6ae989a: am 0ac29519: Merge "Don\'t build 32-bit host libadb."

* commit 'b6ae989acf9958632ce91d2f06fd185aeb9fd0d3':
Don't build 32-bit host libadb.
daa6c463a98d1dde0b7713cbdd96e7bd3d3658c4 26-Aug-2015 Elliott Hughes <enh@google.com> Don't build 32-bit host libadb.

Change-Id: Ib6ad3db2dc160273d20fa14e0820f29ed649d75a
ndroid.mk
1533f95bbaf2a8895b05d146e578e47d8a69dadd 26-Aug-2015 Elliott Hughes <enh@google.com> am 615af25f: am a421c1e5: Merge "Possible Mac build fix."

* commit '615af25ffdde99331c173499446e08c3a7ec32a8':
Possible Mac build fix.
62077d32a245b5a5a687265671219b31f3e4f99c 26-Aug-2015 Elliott Hughes <enh@google.com> Possible Mac build fix.

The error was this:

system/core/adb/usb_osx.cpp:203:74: error: values of type 'UInt32' should not
be used as format arguments; add an explicit cast to 'unsigned int' instead
[-Werror,-Wformat]
snprintf(devpathBuf, sizeof(devpathBuf), "usb:%" PRIu32 "X", locationId);
~~~ ^~~~~~~~~~
(unsigned int)

Which seems to be because on LP64 UInt32 is "unsigned int" but on LP32 it was
"unsigned long". We don't have to care about LP32, so -- if we can -- we're
probably better off just using uint32_t instead of UInt32.

Change-Id: I576f76cf2016ee59caccbc317ef74b6e8d71d722
sb_osx.cpp
4f2015a155175f9da36574a378ce15ed74027ae9 26-Aug-2015 Elliott Hughes <enh@google.com> am 9492db23: am 62643302: Merge "Not all filesystems support setting SELinux labels."

* commit '9492db23b9feeb589be36fece46e55dc66d7f1dd':
Not all filesystems support setting SELinux labels.
383444085a28cfefcfc1d145462a0d124f373ebd 26-Aug-2015 Elliott Hughes <enh@google.com> Not all filesystems support setting SELinux labels.

Bug: http://b/23530370
Change-Id: Ie4deb3544304754696f049d17b12168cad4a51fd
ile_sync_service.cpp
39206a08d8780da3b15eddaf26918db2682b84b6 25-Aug-2015 Elliott Hughes <enh@google.com> am 1ce12d39: am 43f43d87: Merge "Move adb\'s selinux_android_restorecon up and check for failures."

* commit '1ce12d397f1f563ee3eac4c1fdb907909d6eeff1':
Move adb's selinux_android_restorecon up and check for failures.
0adc09721fa130bd1246e6dbee3da9ad9bd176b8 25-Aug-2015 Elliott Hughes <enh@google.com> Move adb's selinux_android_restorecon up and check for failures.

Change-Id: Ib3ff282cf52df03f3b9a0abecf0abda99d7df641
ile_sync_service.cpp
e4baae6d066c7d39af127a2ba1df5e91475db1a9 25-Aug-2015 Elliott Hughes <enh@google.com> am 12d762e1: am e8e272c5: Merge "EINTR is handled by adb_read/unix_read and friends."

* commit '12d762e17694c0137aa7570b4b71536e59643bb0':
EINTR is handled by adb_read/unix_read and friends.
e8e272c525fdfe73e646ff94f8b4d1913016919f 25-Aug-2015 Elliott Hughes <enh@google.com> Merge "EINTR is handled by adb_read/unix_read and friends."
9ccf4bfbde288119e6e90f9ad58351a5d2c59ff9 25-Aug-2015 Elliott Hughes <enh@google.com> resolved conflicts for merge of 068ee4d0 to mnc-dev-plus-aosp

Change-Id: If276934797138d13fe8c56711615b477e05ee484
9bc8005e079a1062751b5e9d62afeef3f2407dfb 25-Aug-2015 Elliott Hughes <enh@google.com> resolved conflicts for merge of 3ecba7f9 to mnc-dev-plus-aosp

Change-Id: I46452c03bbda9604f2af2e1edce5d48c6865d436
478bca2e728c108158fd68b469b3a48e2a432ad9 25-Aug-2015 Elliott Hughes <enh@google.com> resolved conflicts for merge of ba8fc829 to mnc-dev-plus-aosp

Change-Id: Ia4daf846df5a86ebca1b6c8d9e41f1633001836f
7baecbe6a372a23f86de9360ea96d86cbe6280e1 25-Aug-2015 Elliott Hughes <enh@google.com> Fix the fs_config call.

fs_config ORs in bits to the existing mode value.

Change-Id: I23f0655f9c4c8c8dc43ed979f3b519d7c03a11f8
ile_sync_service.cpp
56bf3098431f18e87bfcd4ccddae3f89fa59120f 25-Aug-2015 Elliott Hughes <enh@google.com> Fix 32-bit build.

fs_config uses "unsigned int" instead of mode_t. Work around this.

Change-Id: I57b97d5bfc1b88089a41b4e8a50f1391b5c5113b
ile_sync_service.cpp
8fcd8bc046188abe0b0e87754af472d4838b4c50 25-Aug-2015 Elliott Hughes <enh@google.com> EINTR is handled by adb_read/unix_read and friends.

No need to clutter the code with cases that won't happen.

Change-Id: I47c5a2e6170f902d2618719f44492234a4869567
ommandline.cpp
devent.cpp
ile_sync_client.cpp
ile_sync_service.cpp
ransport.cpp
sb_linux_client.cpp
fdd4e588689327f286dc1d42634bd6c95dc1888e 25-Aug-2015 Elliott Hughes <enh@google.com> Clean up error handling/reporting in file_sync_service.cpp.

In an earlier code review it was pointed out that there was something
very weird about fail_errno. It didn't seem to make sense that we'd
often try to continue after reporting failure. This patch cleans up
all that and assumes that if we've reported failure to the client,
we should stop what we're doing.

Bug: http://b/23437039
Change-Id: I39c38650ed9f9d5e30adbf68a7545c9e4a6ab812
ile_sync_service.cpp
e3bbb2ab00a117bf749d0c7e3072118276c89564 25-Aug-2015 Elliott Hughes <enh@google.com> am 6c04e9a9: am 42640e52: Merge "Add missing #include <memory> for std::unique_ptr on Windows."

* commit '6c04e9a9eca2903c2496ec735c359ed57467d52f':
Add missing #include <memory> for std::unique_ptr on Windows.
42640e5224a861690de006952470451d18337256 24-Aug-2015 Elliott Hughes <enh@google.com> Merge "Add missing #include <memory> for std::unique_ptr on Windows."
a925dba0e087042f7a7ecbcde46576acef15aa7d 24-Aug-2015 Elliott Hughes <enh@google.com> Add missing #include <memory> for std::unique_ptr on Windows.

Change-Id: Ic02f53003a20a646cbbf2aa08e0e10be9bd8b97f
ile_sync_client.cpp
201eaa683a5edd79000110e5246353235bb42ab1 24-Aug-2015 Elliott Hughes <enh@google.com> am 5c027334: am 93b9e865: Merge "There are no big endian hosts, grandpa."

* commit '5c027334cce4f0106d5d271d7924eafc752bd584':
There are no big endian hosts, grandpa.
f4465203b618fa57b6669c4d5627f32fb025b73e 24-Aug-2015 Elliott Hughes <enh@google.com> There are no big endian hosts, grandpa.

Change-Id: I6f64f702f919fe4af10d82c5f395a051571815ed
ile_sync_client.cpp
ile_sync_service.cpp
ile_sync_service.h
6b5f77c9bb0923e0072651a52a500c8c10b4d32b 24-Aug-2015 Elliott Hughes <enh@google.com> am c583c511: am 186f1dee: Merge "adb sync cleanup."

* commit 'c583c5112bb6634114cd9759c1cfbad61a13b397':
adb sync cleanup.
186f1dee2afc15c8941a1f78e1aa97e2ec9970ee 24-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb sync cleanup."
aa2454919098ee14cd232669f1e7dbb33ed07ccf 03-Aug-2015 Elliott Hughes <enh@google.com> adb sync cleanup.

We can double the speed of "adb sync" (on N9) if we increase SYNC_DATA_MAX
from 64KiB to 256KiB. This change doesn't do that, because I still haven't
managed to plumb through the information about whether we're a new adb/adbd
to file_sync_client.cpp and file_sync_service.cpp. But this is already a big
change with a lot of cleanup, so let's do the cleanup and worry about the
intended change another day...

This change does improve performance somewhat by halving the number of
lstat(2) calls made on the client side, and ensuring that most packets are
sent with a single write. This has the pleasing result of making the null
sync on an AOSP N9 go from just over 300ms to around 100ms, which means it
now seems instantaneous (https://en.wikipedia.org/wiki/Mental_chronometry).

Change-Id: If9f6d4c1f93ec752b95f71211bbbb1c513045166
ERVICES.TXT
YNC.TXT
db_client.cpp
db_io.cpp
db_io.h
db_utils.cpp
db_utils.h
ommandline.cpp
devent.cpp
ile_sync_client.cpp
ile_sync_service.cpp
ile_sync_service.h
ervices.cpp
ransport.cpp
47c3ce56edec14592d08f6f157a7aa354e74a4e0 02-Jun-2015 Jack Pham <jackp@codeaurora.org> adbd: enable USB SuperSpeed (again)

The descriptors to enable USB 3.0 SuperSpeed support had previously
been added in commit d6ee9f26a5163af4121f4380264fcbd4e6851a17
but were removed when the v1/v2 descriptor handling was refactored
in commits ab3446dd3400652ecf50682d0e5c4184628e9930 and again in
c49f51c451516bf06afc6d71947eb11cc4627273. Now that the dust has
settled, add back the SS descriptors to re-enable USB 3.0.

Bug: 23385314
Change-Id: I8de7c7e50d9216a7492ce7863e3aaf92ff805eff
(cherry picked from commit a190c800bf562c2fd2fb113782ff83c1d475ea61)
sb_linux_client.cpp
ff490354f495624578dc8feeab2c241f741f8a4b 24-Aug-2015 Badhri Jagan Sridharan <badhri@google.com> am 46f24955: am e3c02883: Merge "adbd: enable USB SuperSpeed (again)"

* commit '46f24955c8c30992c8b885fe2c4531777223315d':
adbd: enable USB SuperSpeed (again)
e3c028836f892e74c737c8b16ff96321cee82d25 24-Aug-2015 Badhri Jagan Sridharan <badhri@google.com> Merge "adbd: enable USB SuperSpeed (again)"
ef39b2613c0f2b9a9c98c1f01c8f4bcc30c8d1ae 24-Aug-2015 Siva Velusamy <vsiva@google.com> am 5b476736: am 9498fc68: Merge "Use glog for logging in the OSX USB layer"

* commit '5b476736da368ea679a9da8eb861c74451e4c689':
Use glog for logging in the OSX USB layer
9498fc68ec4a6ddf29cf471225eb87dbcb908e3d 24-Aug-2015 Siva Velusamy <vsiva@google.com> Merge "Use glog for logging in the OSX USB layer"
743883b570b200ff4d73d60798d63136f3e3d82e 19-Aug-2015 Siva Velusamy <vsiva@google.com> Use glog for logging in the OSX USB layer

Change-Id: I8a3a4dfc768fdd335f03dc582c85b410c808aeb7
lient/main.cpp
sb_osx.cpp
60eb73ed6a537c79f57bf03f1c3c7ebd04f409ea 21-Aug-2015 Tom Cherry <tomcherry@google.com> am 54b22ca2: am ff5be396: Merge changes from topic \'init-rc-breakup\'

* commit '54b22ca2488e4901265c99a42b5c5e0725a99199':
init: Queue Triggers instead of Actions
bundle init.rc contents with its service
20391b1de5aaa49657d625fe18a36d4484c6ac31 14-Aug-2015 Tom Cherry <tomcherry@google.com> bundle init.rc contents with its service

Bug: 23186545
Change-Id: I52616b8ab1165fdef716f9b8f958665f2308c12e
ndroid.mk
dbd.rc
22b510adc53787e580c591f27613ce0a7f7e7c29 19-Aug-2015 Elliott Hughes <enh@google.com> am 2b0deb91: am a169f3b4: Merge "adb: win32: fix unittest exit code parsing"

* commit '2b0deb91c3dca2b7b2a5ef0445fed73db63a922d':
adb: win32: fix unittest exit code parsing
b7e79af048b35f528cadf2929950b402e0a2a46e 17-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix unittest exit code parsing

adb on Windows uses \r\n line-endings, so take that into account when
parsing output for the exit code.

Change-Id: I6a3d7c5ca455b0f0f7dae174866857e0aeee9926
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
evice.py
f3f5bce204d264970dcc91b8f0a4149174b4add6 14-Aug-2015 David Pursell <dpursell@google.com> am 6a701bd9: am b53b521e: Merge "Add `adb features`."

* commit '6a701bd94b067c2ab873964f63c3d954bc59610f':
Add `adb features`.
f53c7af1563dae58d19f1c59fe4a57ab3171e5af 14-Aug-2015 David Pursell <dpursell@google.com> am be1f5732: am f4bda753: Merge "Add feature list to connection banner."

* commit 'be1f57325f6fe1702b0d18fcdb21efe4731a191d':
Add feature list to connection banner.
90d4b739ab94fded63086de1261e70a3d39ceb1d 21-May-2015 Dan Albert <danalbert@google.com> Add `adb features`.

Shows the features supported by the active adb server.

Change-Id: I4a58a2ca082823c43f7a49e2c62ff80df6426756
db.cpp
ommandline.cpp
1792c23cb892ab58590b2cdfce0d0ece30c21787 18-May-2015 Dan Albert <danalbert@google.com> Add feature list to connection banner.

This allows us to test for features explicitly rather than relying on
the protocol version number, allowing us to fall back gracefully if a
feature is not supported.

This will be needed for the upcoming shell upgrades for stdout/stderr
separation and exit code reporting.

Change-Id: Ibb1d8ad2611f7209901ee76d51346b453e9c5873
db.cpp
db.h
ransport.cpp
ransport.h
ransport_test.cpp
2733c142320acc4eca724f6c4526f096ae34b929 14-Aug-2015 Elliott Hughes <enh@google.com> am 2416b832: am 15c6de75: Merge "Start iterating USB pipe endpoints from 1."

* commit '2416b8320cdce59ae267d60d89b0ef96de6a9d95':
Start iterating USB pipe endpoints from 1.
2d4f852da4881b543c11f82de4af44db88bdf306 14-Aug-2015 Elliott Hughes <enh@google.com> Start iterating USB pipe endpoints from 1.

Bug: http://b/22829602
Change-Id: I5051880730ba8fadae5d78f1d19b5d527610d4a5
sb_osx.cpp
b3d3e245854ca498eadf8a6d7a3bc0b5f6cceeea 14-Aug-2015 Siva Velusamy <vsiva@google.com> am ba7284ae: am 4d40c03b: Merge "adb: On Mac, clear both host and device endpoints at startup"

* commit 'ba7284aee2df23d80eda3a78e73d98eaed8e16a7':
adb: On Mac, clear both host and device endpoints at startup
d8b48a62810d1d8f6482aba1b710d8ac89c3e40a 13-Aug-2015 Siva Velusamy <vsiva@google.com> adb: On Mac, clear both host and device endpoints at startup

This CL clears both the host and device endpoints right at the
beginning when the bulk endpoints are identified. This is in general
a "good idea", but more specifically for us, it fixes the issue
that sometimes when adb quits, it clears the endpoint on the host,
but not on the device which resulted in a subsequent invocation of
adb was seeing a stall.

Bug: https://code.google.com/p/android/issues/detail?id=182151

Change-Id: I331fa6805c40d1f50c153c010ceecd2f6a4045eb
sb_osx.cpp
f36aa8ec5de6a254d2b2e3849d2d4d203a09ee9f 13-Aug-2015 Elliott Hughes <enh@google.com> am 5563b77a: am 57532b2a: Merge "adb: improve network error info"

* commit '5563b77a138faa622d1ba164599bf6be88997f84':
adb: improve network error info
57532b2a067082fa5968094c2c615f1832fa1971 13-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb: improve network error info"
5e60d25d66caf6b4a7dbbfb3c33c61eecb6a93bf 13-Aug-2015 Elliott Hughes <enh@google.com> am 1685b099: am 8836031b: Merge "adb: win32: fix shutdown deadlock"

* commit '1685b09921ae2057acbd9655778660a2e81ec6b3':
adb: win32: fix shutdown deadlock
8836031b27f7c62a801501f1da7d09dc3db9686d 13-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: fix shutdown deadlock"
56d11898aa6937df3d1342b7d99dca8813d162a4 13-Aug-2015 Elliott Hughes <enh@google.com> am 80e83972: am 9537ca80: Merge "adb: start-server and kill-server error output"

* commit '80e83972d0bce74d218f72b76339e6761ad6b03b':
adb: start-server and kill-server error output
f18fc0879be9cd506be6b1e051feb543b0746bdb 12-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: start-server and kill-server error output

- handle_host_request
- When the host:kill command comes in, shutdown the socket before
calling exit(). If we don't do this, the client will output error info
even though everything is working ok.

- adb_connect()
- If we can't parse the version string, explain this in error output
and don't goto error which would try to close an fd we already closed.
- If host:kill doesn't work, output error info. Don't try to close
already closed fd.

- adb_main()
- If writing the ACK somehow has an error, output error info (I doubt
this will ever get hit).

- adb_commandline()
- Fix typo about max port number.
- Make 'adb kill-server' and 'adb start-server' output any detailed
error info.

Change-Id: Id1a309cc1bf516f7f49bd332b34d30f148b406da
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
db_client.cpp
lient/main.cpp
ommandline.cpp
87e97ee305627f01ad2b17220fd9a7aa2c3bef30 13-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix shutdown deadlock

adb can hang at shutdown due to a deadlock relating to WSACleanup().
This works around the issue by not calling WSACleanup() which shouldn't
be done anyway since threads aren't done using Winsock at shutdown.

A quick way to reproduce the original problem is to run many instances
of adb, many of which will call exit() soon:

for /l %i in (1,1,20) do @start adb nodaemon server

You may have to boost the 20 to 200, or set ADB_TRACE=1 or use Windows
10 instead of Windows 7, to affect the timing, but eventually there
should be hung adb processes with that repro.

A more complete fix to prevent problems like this from occuring in the
future, would be to additionally do the following:

- Investigate all static destructors that are called when exit() is
called.

- If they don't do anything important, switch all calls to exit() to
instead call _exit() and then ban exit() from being called.

Change-Id: Id1be3bf0053809a45f2eca4461e4c35b5ef9388d
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ysdeps_win32.cpp
6eef56fb7acf78728840210ac104da9cc0d06fc9 13-Aug-2015 David Pursell <dpursell@google.com> am 697869c4: am 6fefa36c: Merge "adb: Fix PTY logic for non-interactive shells."

* commit '697869c4fde93a23cda3a0d789c1f101f82eb157':
adb: Fix PTY logic for non-interactive shells.
d4093f191b3f23de30479c93be8c684b47505e44 10-Aug-2015 David Pursell <dpursell@google.com> adb: Fix PTY logic for non-interactive shells.

Change `adb shell` so that interactive sessions use a PTY but
non-interactive do not. This matches `ssh` functionality better
and also enables future work to split stdout/stderr for
non-interactive sessions.

A test to verify this behavior is added to test_device.py with
supporting modifications in device.py.

Bug: http://b/21215503
Change-Id: Ib4ba40df85f82ddef4e0dd557952271c859d1c7b
evice.py
ervices.cpp
est_device.py
63a29199f3192a66a1bf7a3127ba879fa7d51d9f 12-Aug-2015 Yabin Cui <yabinc@google.com> am 87f73de9: am 317acfb8: Merge "Remove confusing variable HOST."

* commit '87f73de9e9b0a74e4b963e8b49d90bbe81a38bb0':
Remove confusing variable HOST.
317acfb88065f68bc3030a5624a63ba4cfaab414 12-Aug-2015 Yabin Cui <yabinc@google.com> Merge "Remove confusing variable HOST."
efc8077246a3e816957a774f3d272b909c1c1b12 12-Aug-2015 Elliott Hughes <enh@google.com> am c01231b3: am 2fb00423: Merge "Always include the adb version in the log."

* commit 'c01231b399c38f00afe0872b3a51837518b713dc':
Always include the adb version in the log.
42ae2604f43ef88be748f125e8733f2c08b83fae 12-Aug-2015 Elliott Hughes <enh@google.com> Always include the adb version in the log.

"Are you running the right version?" seems to be a common cause of debugging
confusion.

Change-Id: I4a4ba95e876dafc05e515058ca059ea370273f78
db.cpp
db.h
ommandline.cpp
f000f7b25074f75995477ac72ea2b0a749b87b05 12-Aug-2015 Elliott Hughes <enh@google.com> am 70af6e0b: am 9508dcb9: Merge "adb: make stdin/stdout/stderr redirection errors fatal"

* commit '70af6e0bad17c5d90084738950e72243f0ce3806':
adb: make stdin/stdout/stderr redirection errors fatal
155159c545ee1a6d8e3cbea866ea66096f4db5f3 12-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: make stdin/stdout/stderr redirection errors fatal

Make these fatal errors:

- Win32 GetTempPathW() failures.

- Errors opening /dev/null (and don't use LOG(FATAL) for this error
since that will do a crash-dump on Windows which isn't appropriate for a
transient runtime error).

- Errors with dup2.

- Errors opening adb.log.

Change-Id: Ided76a5436d8c6f059d8f6799c49ba04c87181ae
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
lient/main.cpp
9cb4af39af344998be06e91ac97b7cbf24c03904 12-Aug-2015 Elliott Hughes <enh@google.com> am 8bb6b3e1: am b62f6c2a: Merge "adb: call android::base::InitLogging even when adb tracing is disabled"

* commit '8bb6b3e1ffc44336f89eb30cc39a1e96498c7c23':
adb: call android::base::InitLogging even when adb tracing is disabled
b62f6c2a1cc9f7697abb6fc5c74565da6631e0dd 12-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb: call android::base::InitLogging even when adb tracing is disabled"
97a8cd957f57f8a1f4a469d6df97959397963641 12-Aug-2015 Dan Albert <danalbert@google.com> am e78292f2: am cef3508b: Merge "Add missing includes."

* commit 'e78292f2c5a1cffd9fdcb76e5be29f6d14445b93':
Add missing includes.
cef3508bb69ec644f35de9d165dc91b127820d77 12-Aug-2015 Dan Albert <danalbert@google.com> Merge "Add missing includes."
bf7c605d87f87c03066c384cecb0f0c91aa31403 12-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: improve network error info

- handle_forward_request
- Because we have detailed info about which syscall failed (at least
on Win32), use a more generic prefix of "cannot bind listener" followed
by the detailed info.

- install_listener
- Return string errors for a few errors even though I don't think any
callers actually output the string for those errors.

- Remove the printf since the callers print the message themselves.

- adb_main
- LOG(FATAL) calls abort() which on Windows calls the Windows Error
Reporting service which pops up a dialog asking if you want a
crashdump to be uploaded to Microsoft. So really, abort() is
designed for app bugs. Windows isn't the only one doing this, Chromium
also makes LOG(FATAL) crashdump-ready. Since an error here is not
necessarily an app-bug, use a 'normal' error output API like fatal()
which prints an error and just uses exit().

- sysdeps_win32.cpp
- When Winsock APIs fail, make the string clarify which API failed.
Use terse unix-style descriptions (like what you'd get from
cp/mv/dd/etc.).

- Don't trace WSAEWOULDBLOCK from recv() which is a normal occurrence.

- Add a comment about WSAEWOULDBLOCK => EAGAIN.

Change-Id: I58e47f49fa2f6c1b4b92a36d0c4bfe369b456f2a
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
db_listeners.cpp
lient/main.cpp
ysdeps_win32.cpp
af9ba4dc6ca98e136e887b0baa59b72fb8302dd3 12-Aug-2015 Dan Albert <danalbert@google.com> Add missing includes.

Leaky header cleanup in libc++ means we don't get unistd.h
transitively any more.

Change-Id: I596c24eff418302b19afab6ad3caa55f52241e7c
est_track_devices.cpp
7430916098fd264d569d398614d1d725adfca165 12-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: call android::base::InitLogging even when adb tracing is disabled

This is a follow-up to https://android-review.googlesource.com/153623
which prevented android::base::InitLogging() from being called when
tracing was disabled.

It is ok to call InitLogging() on a device or host because calling it
does not imply that a logging file is used, which was the reason for
not calling it on a device.

So this change should preserve the device behavior of not using a
logging file when tracing is disabled, plus it will call InitLogging()
all the time in case logging APIs are called.

Change-Id: I3fd6ba2c567f67a2f111a85f174893fbf866ec57
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
e6b72a4ef65569daa5ecfc36309edd5a5da16e0a 11-Aug-2015 Elliott Hughes <enh@google.com> am 06a9f560: am 7989a7c8: Merge "adb: win32: fix USB device hang when resuming from sleep/hibernation"

* commit '06a9f560d2f19026c398b2ce66cd1ab76b2a4ae7':
adb: win32: fix USB device hang when resuming from sleep/hibernation
7989a7c8d32e90dc2cba952dc59da6b88cf55c8e 11-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: fix USB device hang when resuming from sleep/hibernation"
661327e8e40f95076e0e8abe86193da16b061bd8 11-Aug-2015 Yabin Cui <yabinc@google.com> Remove confusing variable HOST.

First, HOST is always 0 in adbd, which matches ADB_HOST=0.
Second, HOST is always 1 when adb_main is called, which matches ADB_HOST=1.
For adb client that doesn't call adb_main, it never touches local_init(),
init_transport_registration() and fdevent_loop(). So the changes in adb.cpp,
services.cpp and transport_local.cpp do nothing with it.
As a conclusion, I think we can remove HOST and use ADB_HOST instead.

Change-Id: Ide0e0eca7468b6c3c130f6b50974406280678b2e
db.cpp
db.h
lient/main.cpp
ervices.cpp
ransport_local.cpp
ransport_usb.cpp
6396f64fd795e0ff493e3d59b07ce27076c1170d 11-Aug-2015 Elliott Hughes <enh@google.com> am 61ff977b: am 1f36ae49: Merge "adb: win32: write ACK to separate pipe instead of stdout"

* commit '61ff977ba49f43d87fed86eb5b2e2bfc279f902b':
adb: win32: write ACK to separate pipe instead of stdout
5c398d2ce96150e94e596e959bfe2246b94de660 09-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: write ACK to separate pipe instead of stdout

The win32 version of 9f2d1a9cfc04e1d5970823da1878097288a9a9cd. The big
technique is to fit a Win32 HANDLE value in an int because it only uses
32-bits. This allows most of the other adb code to stay the same.

Also, fix a regression in the 'adb server nodaemon' command that was
erroneously returning an error when --reply-fd was not used, which
should not be necessary for this particular command.

Change-Id: I37e9c609014b813af93bf0d6c12f665b59c93c41
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
lient/main.cpp
ommandline.cpp
ysdeps.h
184585c417a4411b18ba41d938501ab3f5b25267 07-Aug-2015 Elliott Hughes <enh@google.com> am af60acef: am 98714882: Merge "adb start-server: Use a separate fd for sending initial OK"

* commit 'af60acef8231f03f7c736ed8ce86bd59979f9f6c':
adb start-server: Use a separate fd for sending initial OK
a4a902432e45933e86f40f25eb4ab96743f61ebd 07-Aug-2015 Elliott Hughes <enh@google.com> am c1b6378d: am e1101677: Merge "adb: fix killing of old version of adb process"

* commit 'c1b6378d96dda18f1a6b9d9cf33f9ed4eb6f6603':
adb: fix killing of old version of adb process
08fe47e3bdc3c119c37539da9b013bd6510b0fa7 07-Aug-2015 Elliott Hughes <enh@google.com> am c6195530: am db3492cf: Merge "win32: adb_test/libbase_test fixes"

* commit 'c61955305e4e6b222801e694af9d578b39485ac5':
win32: adb_test/libbase_test fixes
9f2d1a9cfc04e1d5970823da1878097288a9a9cd 07-Aug-2015 Siva Velusamy <vsiva@google.com> adb start-server: Use a separate fd for sending initial OK

When "adb start-server" is issued, and a server needs to be launched,
adb client forks itself and the child process runs the server routine.
Once the server initializes its various components, it sends an "OK\n"
back to the client via its stderror (or stdout on Windows).

This sequence breaks down if before sending the "OK\n", the server
happens to log something on its stderr. In order to avoid this, the
client now expects the ack to come on a different fd rather than one
of the standard streams.

Bug: https://code.google.com/p/android/issues/detail?id=182150

Change-Id: I9d58a08068d71eb3b77e8a7377e934631c016466
db.cpp
db.h
lient/main.cpp
ommandline.cpp
e1101677eabaaddc2a60c6456cce1fd5e38f5b4e 07-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb: fix killing of old version of adb process"
db3492cf1703e15a1e92218fe00291932780656f 07-Aug-2015 Elliott Hughes <enh@google.com> Merge "win32: adb_test/libbase_test fixes"
cbf26b76c7715969610b75048719f8cec676b656 04-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> win32: adb_test/libbase_test fixes

- My recent change with -DUNICODE=1 required changing
GetProfilesDirectory() to GetProfilesDirectoryA() for the ANSI version
of the API.

- enh's edit to my previous change deleted a test that used
/proc/version, but I think another test was missed. Merge that test into
another.

Change-Id: Ic748549848e7be922bcbf218d5b0c3fca2a90704
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db_utils_test.cpp
0e3b339bbb43a058b4c8397655b31d774b9e1d3a 06-Aug-2015 Elliott Hughes <enh@google.com> am 2fbae482: am c672cb07: Merge "Include the error code if GetPipeProperties fails."

* commit '2fbae4829b07c97e82c24e6bf54e58f7de477fe6':
Include the error code if GetPipeProperties fails.
c672cb07431c66e80a4e1b8845f25a7abb0bac9b 06-Aug-2015 Elliott Hughes <enh@google.com> Merge "Include the error code if GetPipeProperties fails."
6e02c24cfcba575c1e97a83fe59bea456eebf1ce 04-Aug-2015 Elliott Hughes <enh@google.com> Include the error code if GetPipeProperties fails.

Bug: http://b/22829602
Change-Id: I90a89e70518053a4581e1862a7dbd5d09e06dadc
sb_osx.cpp
a25e258d657e61f63ed1d278224f49ed244d59d2 06-Aug-2015 Yasuhiro Matsuda <mazda@google.com> am b84e1f54: am 50de8224: Merge "Enable perfboot.py to install APKs before measurement."

* commit 'b84e1f540379c6af9ccfc22e779b67f67b8c210a':
Enable perfboot.py to install APKs before measurement.
71635bb966727cf01d1796be7012ba914cd3ebbe 06-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: fix killing of old version of adb process

The original code was:

if (strcmp(__adb_error, "unknown host service") != 0)

But that was changed by 078f0fcf4c63b8d8e8c10a18855eae04ca321e06 to:

if (*error == "unknown host service") {

I think the comparison should be != so that "unknown host service"
falls-through and kills the server, and so if it is some other error,
that the other error is returned immediately.

Change-Id: Ia490a4a870d1d123a3c5ab258dd5fa0930e8032d
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db_client.cpp
c0822e83ad11e42e02f2304e9cf925ea944b8f53 05-Aug-2015 Yasuhiro Matsuda <mazda@google.com> Enable perfboot.py to install APKs before measurement.

This CL adds --apk-dir option, which specifies the directory
that contains APK files to be installed before measuring
boot time.

BUG: 22207911
Change-Id: Ifeacf34c779248686443a9ef02485272c140a456
evice.py
b5c4bc38336aed56ab6a4ac6e71afebc411890f3 04-Aug-2015 Elliott Hughes <enh@google.com> am f7af90c9: am 3cf2a8e0: Merge "Fix a comment typo."

* commit 'f7af90c9df6e863c15b39da811f194435aa5da94':
Fix a comment typo.
7ace565f6ba8e6b78b1b5a4e96365de923757841 04-Aug-2015 Elliott Hughes <enh@google.com> am 1da90f0c: am feacf20d: Merge "adb: win32: file descriptor reliability improvements"

* commit '1da90f0c14d315b10d8cc8cd2cfaacd794758ec3':
adb: win32: file descriptor reliability improvements
3cf2a8e0ee7dbf504763cc446d5cf1ee451158fc 04-Aug-2015 Elliott Hughes <enh@google.com> Merge "Fix a comment typo."
feacf20d1eb797c0edfc3c7a487fd93c63e8fd4a 04-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: file descriptor reliability improvements"
bfa7c7d9e2fc4e634958f19d7a973d44c4da25e2 04-Aug-2015 Elliott Hughes <enh@google.com> Fix a comment typo.

Change-Id: Ifacb19b9c31ac81fbf02c8382eb0324ea79075b9
ysdeps_win32.cpp
fb1dbac1439eb0ed2a95fa64a74c5257b20992e3 03-Aug-2015 Elliott Hughes <enh@google.com> am eee501ec: am 6b940e13: Merge "adb: win32: define UNICODE/_UNICODE, Unicode error messages, misc"

* commit 'eee501ece6d3d0add9f67ce2c71cef6620cf6bf5':
adb: win32: define UNICODE/_UNICODE, Unicode error messages, misc
b7c0bfbc5e48b333fdc6544578ec58281fab7c3d 03-Aug-2015 Elliott Hughes <enh@google.com> am 14c08745: am 6355f2c1: Merge "adb: win32: call SystemErrorCodeToString() from more places"

* commit '14c08745ac3ff46330b545354664ffd3c8f60844':
adb: win32: call SystemErrorCodeToString() from more places
e043761c7abe5f40c272d945ea1a7f1b845225ee 03-Aug-2015 Elliott Hughes <enh@google.com> am c783e1a3: am 0fac7fd1: Merge "Leave the evidence lying around if an adb test fails."

* commit 'c783e1a3f35675169b5ca85d3dc0f6a8c22ce901':
Leave the evidence lying around if an adb test fails.
6b940e1349da720bdba4c5eeb9741e5fffe30913 03-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: define UNICODE/_UNICODE, Unicode error messages, misc"
6355f2c1400b531fb71a46351a0c26e666af2e88 03-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: call SystemErrorCodeToString() from more places"
3841a9f7cb6f7f27667a02cde885f385ef848a5e 03-Aug-2015 Elliott Hughes <enh@google.com> Leave the evidence lying around if an adb test fails.

Not seeing the full output from the failed adb command is probably
the biggest issue when debugging a test failure, but this doesn't
help either.

Change-Id: Ic42cbced8be252185a799b27c210a744188a4201
est_device.py
8f13dc422607b8c82e80e96d85ac8e0a5f9eb36e 03-Aug-2015 Elliott Hughes <enh@google.com> am 6eb9aa62: am 6bf93400: Merge "adb: fix mkdirs / adb pull with relative paths, fix win32 issues"

* commit '6eb9aa62d3b112f004d39906d6994f37eabd95a3':
adb: fix mkdirs / adb pull with relative paths, fix win32 issues
22191c30a63da7ca951281fffcb1fd59ae40dd54 02-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: fix mkdirs / adb pull with relative paths, fix win32 issues

Relative paths were being prefixed with OS_PATH_SEPARATOR on unix and
win32 causing adb to incorrectly try to make directories at the root.
Plus, absolute paths didn't work on win32 (C: got prefixed into \C:).

This fix is to use dirname (available on win32 via mingw's crt) to do
the messy parsing.

I added a test for the relative path case.

Change-Id: Ibb0a4a8ec7756351d252a4d267122ab18e182858
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db_utils.cpp
db_utils.h
db_utils_test.cpp
utex_list.h
bc3c21b93f8d0529ba992fa18bd99c4d9b5cd625 03-Aug-2015 Elliott Hughes <enh@google.com> am c3766916: am 8c61e029: Merge "adb_test/libbase_test: win32: get some tests working"

* commit 'c376691617623c26fe7eb14184f874214e2d2173':
adb_test/libbase_test: win32: get some tests working
cf168a82e99e97e3ad95e37b7065f6b8e7f7390b 25-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb_test/libbase_test: win32: get some tests working

adb_test:

* Fix adb_utils directory_exists test for Windows. The test actually
fails because directory_exists() is not aware of junctions or symlinks,
but I'm not really sure if that is a bad thing (since these are rare on
Windows to begin with).

* Fix crash during transport tests due to mutex not being initialized.

* io tests fail for various reasons (see adb_io_test.cpp for more info).

libbase_test:

* Get it building on Win32 by implementing mkstemp() and mkdtemp().

* Run StringPrintf %z test on Windows because it passes because we build
with __USE_MINGW_ANSI_STDIO which implements %z.

* I didn't fixup the logging tests: some logging tests fail because when
abort() is called on Windows, by default it pops up UI asking whether a
crash dump should be sent to Microsoft. To some degree this makes sense,
as I think LOG(FATAL) does crash dumping in Chromium. This should be
revisited in the future.

Change-Id: Iaa2433e5294ff162e0b2aa9fe6e4ec09a6893f7a
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ndroid.mk
db_io_test.cpp
db_utils_test.cpp
ransport_test.cpp
3f0a0142818a3e540306d70f43e5c87b4e232465 03-Aug-2015 Elliott Hughes <enh@google.com> am d2984900: am 11ca81fc: Merge "Remove adb\'s unused get_my_path for Windows."

* commit 'd29849007a37daf45e20e6d0f9f3232c2ad4fc30':
Remove adb's unused get_my_path for Windows.
8df90321769c670b546a7ff0e7a14f2d7a79cc25 03-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: call SystemErrorCodeToString() from more places

Improve some error messages, or trace output.

Change-Id: Ib09fac33a296f090d37f125cad7556fc5b5e928e
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
db_auth_host.cpp
ysdeps_win32.cpp
e347c1dd475ab83b2ec483f43879b105be145ea2 03-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: define UNICODE/_UNICODE, Unicode error messages, misc

Define the UNICODE and _UNICODE preprocessor symbols to make passing
char* to Ansi/Unicode-agnostic Windows and C Runtime APIs break the
build. The solution is to call wide Windows and C Runtime APIs and use
widen(utf8).c_str(). Most code was already calling wide APIs. Defining
these symbols makes a call to CreateEvent() (which previously mapped to
CreateEventA()) turn into a call to CreateEventW().

Make SystemErrorCodeToString() use Unicode.

Add various comments.

Change-Id: I9b212412348a29826718e897a486489e1f142d16
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ndroid.mk
ysdeps_win32.cpp
a5b06b0ff8d7c99ce2678f61536cbf1430783dba 23-Jul-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix USB device hang when resuming from sleep/hibernation

After resuming Windows from sleep or hibernation, USB connections are not
automatically disconnected. Writing to the USB connections does not return any
errors, but read never returns. My theory is that the device saw the host
sleep/hibernation as a disconnect, so the device is waiting for re-auth from the
host as if the host was just connected.

To solve this, detect resume from sleep/hibernation, disconnect all USB
connections and let the device poll thread re-detect the USB devices in 1 sec.

This is done by using a hidden window that receives power notifications. The
hidden window code is based on Chromium's similar code (platform-tools already
includes the Chromium Authors license).

This depends on a change to AdbWinUsbApi.dll that makes AdbCloseHandle(endpoint)
abort any pending IOs and wait for those IOs to be aborted.

I expect that this should solve many adb and Android Studio related bugs
regarding hangs or errors.

Also in this change:

- Add D() logging for any errors from AdbWinApi.dll API calls.

- Stop setting errno to Win32 error values which the caller can't really do
anything with. Stop calling SetLastError() because the callers don't check
GetLastError() anyway.

- Check the return value from writing zero length packets.

- If the full amount of data isn't written, return an error.

- Upon any usb_read/usb_write error, kick the connection instead of only
kicking when ERROR_INVALID_HANDLE is encountered.

- Restructure some code from nested-if-trees to goto-fail to make it easier
to follow.

- Delete usb_name() since it isn't thread-safe and it isn't used.

Change-Id: Iffcf5315ad8593d0c7e93012afaabe6fae354ac1
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
sb_windows.cpp
2df4804ace526029b622c34e3200e6d71f2f265a 01-Aug-2015 Yabin Cui <yabinc@google.com> am 20e8b384: am c70ac57d: Merge "adb: poll for emulator connection."

* commit '20e8b384c6ad8718764e138cc9013623cad8f400':
adb: poll for emulator connection.
16d79c7318d28b5081f3c0291e7b6ae22e81d4a0 01-Aug-2015 Elliott Hughes <enh@google.com> Remove adb's unused get_my_path for Windows.

Change-Id: I3cfb4677acaf6acaf512b3cdce6c11bdb2bd0578
ndroid.mk
et_my_path_windows.cpp
c70ac57db0df9736f50a6b1fe29b151292b09e6b 01-Aug-2015 Yabin Cui <yabinc@google.com> Merge "adb: poll for emulator connection."
66429b34d056b5b638936744a71d49ceb863de94 01-Aug-2015 Elliott Hughes <enh@google.com> am b8b71186: am 367fb503: Merge "adb: win32: Unicode path names, env vars, some console support"

* commit 'b8b7118614e8d6bd9a683ecd624915519f8933a9':
adb: win32: Unicode path names, env vars, some console support
367fb50333a449f14636f5dc7cd4bc1c81323f59 01-Aug-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: Unicode path names, env vars, some console support"
5e6d1dcfac43422a135b1540c4bb245bfe89b294 01-Aug-2015 Elliott Hughes <enh@google.com> am 3d561748: am ec035950: Merge "Clean up -p handling slightly."

* commit '3d5617487c07f1fcbdf23755e0ca01559e3c5f3b':
Clean up -p handling slightly.
c3211557b3a7f1021878399a1e2574e697e92c24 25-Jul-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: file descriptor reliability improvements

When repeatedly opening and closing a file descriptor, the sequence of
fds returned was: 100...227,100,100,100,100,100... Basically, the first
wave was constantly increasing fds, but after the entire fd table was
traversed once, the alloc algorithm would switch to returning the first
free fd. This is sub-optimal for reliability because use-after-free bugs
would be more likely to be hit because right after a close, the same fd
would be given out next.

This change makes the alloc algorithm use a persistent clock hand that
walks forward through the fd table (wrapping around if necessary),
searching for a free fd.

This change adds locking for fd closing:

- This prevents multiple concurrent closes of the same fd.

- There was a race between alloc and close that wasn't guaranteed to be
correct: close would set f->clazz to NULL last, but without any
preceding memory barrier/fence, then the alloc thread would check for
NULL. It probably worked out ok in practice, but it is probably best
to fix this up with a lock (as in this change) or a memory barrier/fence
(but this code isn't about performance, so why go with a complicated
barrier/fence?)

Also in this change:

- Use errno = EMFILE for the out of fds case.

- Clear FH->name

Change-Id: Ic11d2a1a9d53996edfc1ca13566a2f46de4a4316
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ysdeps_win32.cpp
0e2c19465964d27f6da0e5d23c329b7892d41204 31-Jul-2015 Yabin Cui <yabinc@google.com> adb: poll for emulator connection.

Bug: 19974213
Change-Id: I336f3ad6f428277c54479e5b8c45d5343c64f472
aemon/main.cpp
ransport_local.cpp
cf4ff64f2d3cdc4ffa2f06e594d18a965f591a82 11-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: Unicode path names, env vars, some console support

Initial support for Unicode file/dir names. Unicode paths can be passed
on the command line, directory enumeration can enumerate Unicode paths,
Unicode paths are used for file access, and Unicode paths can be output
on the console correctly.

Also Unicode environment variable access.

Initial support for Unicode output from adb shell (which uses
adb_fwrite()). This is partial because the corner case of an
adb_fwrite() call with an incomplete UTF-8 multi-byte sequence does not
output correctly, but this should be uncommon, is better than what we
had before (*always* incorrect UTF-8 multi-byte sequences) and can be
fixed in the future.

Calls to Windows APIs with char strings were changed to pass wchar_t
strings to the FooW() variants.

For more details, see the giant comment in sysdeps_win32.cpp.

https://code.google.com/p/android/issues/detail?id=8185

Change-Id: I7ebf6713bb635638b986ccee97b354428837c9c5
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ndroid.mk
db.cpp
db_auth_host.cpp
lient/main.cpp
et_my_path_windows.cpp
ysdeps.h
ysdeps_win32.cpp
048b27c0665faecf72372de2884790ef60dfe1fd 31-Jul-2015 Elliott Hughes <enh@google.com> Clean up -p handling slightly.

Change-Id: I8a5cd4a7adb0dde9d09e0cbb620874b1bca35e43
ommandline.cpp
c0d738f3314952d7677d74bf97e833aeaa16e553 31-Jul-2015 Elliott Hughes <enh@google.com> am 6dca1987: am cf4dba5a: Merge "adb: win32: initial IPv6 support and improved Winsock error reporting"

* commit '6dca19875325a2ed25f9b55d736a9f6d17afeaad':
adb: win32: initial IPv6 support and improved Winsock error reporting
cf4dba5ab315493531fff5a4867698a3659b0526 31-Jul-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: initial IPv6 support and improved Winsock error reporting"
739349cd13735f9d04bf2064a693d34ebd656713 31-Jul-2015 Yabin Cui <yabinc@google.com> am a6fda917: am dc1fb361: Merge "Make clear of the data length sent by write_packet."

* commit 'a6fda917252ab9e47d89e181adbc22bccba1ca6c':
Make clear of the data length sent by write_packet.
5200c6670f041550c23821fec8e8e49b30ef6d29 31-Jul-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: initial IPv6 support and improved Winsock error reporting

Call getaddrinfo() for connecting to IPv6 destinations.

Winsock APIs do not set errno. WSAGetLastError() returns Winsock errors
that are more numerous than BSD sockets, so it really doesn't make sense
to map those to BSD socket errors. Plus, even if we did that, the
Windows C Runtime (that mingw binaries use) has a strerror() that does
not recognize BSD socket error codes.

The solution is to wrap the various libcutils socket_* APIs with
sysdeps.h network_* APIs. For POSIX, the network_* APIs just call
strerror(). For Windows, they call SystemErrorCodeToString() (adapted
from Chromium).

Also in this change:

- Various other code was modified to return errors in a std::string*
argument, to be able to surface the error string to the end-user.

- Improved error checking and use of D() to log Winsock errors for
improved debuggability.

- For sysdeps_win32.cpp, added unique_fh class that works like
std::unique_ptr, for calling _fh_close().

- Fix win32 adb_socketpair() setting of errno in error case.

- Improve _socket_set_errno() D() logging to reduce confusion. Map
a few extra error codes.

- Move adb_shutdown() lower in sysdeps_win32.cpp so it can call
_socket_set_errno().

- Move network_connect() from adb_utils.cpp to sysdeps.h.

- Merge socket_loopback_server() and socket_inaddr_any_server() into
_network_server() since most of the code was identical.

Change-Id: I945f36870f320578b3a11ba093852ba6f7b93400
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
db_client.cpp
db_listeners.cpp
db_listeners.h
db_utils.cpp
db_utils.h
lient/main.cpp
onsole.cpp
aemon/main.cpp
ervices.cpp
ysdeps.h
ysdeps_win32.cpp
ransport_local.cpp
e0b43a17852081c2fe1c0d2207006e421ffcc74b 31-Jul-2015 Elliott Hughes <enh@google.com> resolved conflicts for merge of 4e90b0ae to mnc-dev-plus-aosp

Change-Id: Iff0f469f09a0ad442db5b593345eaf52c3ca8104
6264129434e511da38faedeb5739c3e4bd4a710e 31-Jul-2015 Yabin Cui <yabinc@google.com> Make clear of the data length sent by write_packet.

Change-Id: If51b4feaa19a710874999ad7e6131ff2e56a9f8a
ransport.cpp
5c74270f95107952a893584d02b33f9a79f6b3c4 31-Jul-2015 Elliott Hughes <enh@google.com> More adb cleanup.

This removes adb_dirstart and adb_dirstop. It also fixes a couple of memory
leaks by switching to std::string. This also fixes the bug in the previous
change --- mkdirs is given input like "/system/bin/sh" and only expected to
create "/system/bin". In a later change, we should remove mkdirs and only
expose the intended "unlink && mkdirs && create" functionality.

Change-Id: I30289dc1b3dff575cc1b158d993652178f587552
db_utils.cpp
db_utils.h
db_utils_test.cpp
ommandline.cpp
ile_sync_client.cpp
ile_sync_service.cpp
ile_sync_service.h
ysdeps.h
d2117974e4c22ff6b8967c3b5cd2d497a6ffc856 31-Jul-2015 Elliott Hughes <enh@google.com> resolved conflicts for merge of 486645ee to mnc-dev-plus-aosp

Change-Id: I027a4de6e4ebae3bee6b7d2e56bd39c284b8a062
47d67c96ec991ef1690b4c07188335cbc4bfa2aa 06-May-2015 Alex Vallée <avallee@chromium.org> Write mkdirs in more idiomatic C++ style.

~ Rewrote mkdirs to be in C++ style.
~ Replaced adb_dir{start,stop} with std::string params and (r)find.
+ Added test for mkdirs.

Also make base/test_utils.h public and support temporary directories
as well as files.

Change-Id: I6fcbdc5e0099f3359d3aac6b00c436f250ca1329
db_io_test.cpp
db_utils.cpp
db_utils.h
db_utils_test.cpp
ommandline.cpp
ile_sync_client.cpp
ile_sync_service.cpp
ysdeps.h
e12db0b2011fc0a678f093653342c0d5ecf4272a 30-Jul-2015 Dan Albert <danalbert@google.com> am bec459a2: am 480bea33: Merge "Add top level sanitize options for ADB."

* commit 'bec459a277a0e391f5d36280bbf37eb6d84562fe':
Add top level sanitize options for ADB.
480bea3372e6b112c0ec80fdf82b16296d388d63 30-Jul-2015 Dan Albert <danalbert@google.com> Merge "Add top level sanitize options for ADB."
9113b47eacb955ec83fe8ecce67f7905b2c395be 30-Jul-2015 Dan Albert <danalbert@google.com> Add top level sanitize options for ADB.

Host and target are split here because the target can really only use
ubsan (most sanitizers don't support static executables).

Change-Id: I8a5a5adeeef5c27aaaa3d8145b1570760b764ce3
ndroid.mk
6036a4ff9ae28c095297b70720f39db2e3714b57 30-Jul-2015 Dan Albert <danalbert@google.com> am cc552ea3: am 3b5b1328: Merge "adb/test_device.py fixes for win32 and no use of ANDROID_SERIAL"

* commit 'cc552ea335497ecd95db3eae136d10ab3026d171':
adb/test_device.py fixes for win32 and no use of ANDROID_SERIAL
3b5b1328173b4914ccc3c50bdd5eaa046dbd6cd7 30-Jul-2015 Dan Albert <danalbert@google.com> Merge "adb/test_device.py fixes for win32 and no use of ANDROID_SERIAL"
c6dbc85845e58464541bb0644ebd570c44841a4c 30-Jul-2015 Elliott Hughes <enh@google.com> am 42dbc4b1: am 44443bea: Merge "Use _WIN32 rather than HAVE_WINSOCK."

* commit '42dbc4b1859fe4de16b19e9b74324b345c5fcb9d':
Use _WIN32 rather than HAVE_WINSOCK.
44443bead6cf3c6e71029e7181f64ba82c6a8c8e 30-Jul-2015 Elliott Hughes <enh@google.com> Merge "Use _WIN32 rather than HAVE_WINSOCK."
3e7feda3c52864055b6f6cc640e746bbc5282932 30-Jul-2015 Spencer Low <CompareAndSwap@gmail.com> adb/test_device.py fixes for win32 and no use of ANDROID_SERIAL

If ANDROID_SERIAL was not set, test_device.py was failing.

Use posixpath.join instead of os.path.join for make_random_device_files.

Change-Id: I24bfa43ba2a89a9a768f505fc0bba9d873082b2f
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
est_device.py
eeea3fc1be1c482dd04e7736dcf86ed04136be06 30-Jul-2015 Yasuhiro Matsuda <mazda@google.com> am 1a1f9beb: am dcf89091: Merge "Add a script to record Android boot time."

* commit '1a1f9beb1dbd0da0f305ff44816661cc404ba877':
Add a script to record Android boot time.
dcf890914c7571d3068046b9df1f672e9f45b4d2 30-Jul-2015 Yasuhiro Matsuda <mazda@google.com> Merge "Add a script to record Android boot time."
ab3798399dfe970a12a25f79c4392602b6d7515b 02-Jul-2015 Yasuhiro Matsuda <mazda@google.com> Add a script to record Android boot time.

perfboot.py repeats the record of each event log during Android
boot specified times. By default, interval between measurements
is adjusted in such a way that CPUs are cooled down sufficiently
to avoid boot time slowdown caused by CPU thermal throttling.
This script also works around the issue of dropbox slowing down
boot time on userdebug build (http://b/20890386) by limiting
the number of files to be created by dropbox.
The result is output in a tab-separated value format.

BUG: 22207911
Change-Id: I0ddbac5d1c941efda87bc6db6388d8194d4bb3dd
evice.py
2b72d68eb8e01de304103785f02b1f3859f055cc 30-Jul-2015 Elliott Hughes <enh@google.com> am e0541c7d: am a6597598: Merge "fix adb {forward,reverse} --no-rebind"

* commit 'e0541c7d7e329f83b23bfde4f515cefd39d65a66':
fix adb {forward,reverse} --no-rebind
adbf442a515c51cb2acb34e20c1d2ea0e843c660 30-Jul-2015 Elliott Hughes <enh@google.com> Use _WIN32 rather than HAVE_WINSOCK.

Change-Id: I9855b6fe72e2f2f3a8360c0993a67cb988024ee4
devent.cpp
ervices.cpp
a6b340af123b82e3aaa33cb2a0d45f637eeb4759 30-Jul-2015 Spencer Low <CompareAndSwap@gmail.com> fix adb {forward,reverse} --no-rebind

adb forward --no-rebind (and the matching reverse command) seem to have
been broken by 424af02f363a305a349ff99e1cc253ac5bc642c9. I fixed-up the
string parsing and also fixed the error message not to include
strerror(errno) since that does not apply because it is an
application-level error that doesn't have anything to do with the
OS/libc.

Change-Id: Iba7286283bfcf1782076355edcd9c355c0a0edfd
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
dee79f85b6c1a359bba1470864dd32a636e5c13b 29-Jul-2015 Dan Albert <danalbert@google.com> am fa3622b2: am c0e8d0fc: Merge "Fix AndroidDevice.get_prop, add tests."

* commit 'fa3622b22481787202808101a772ac2270cf96cd':
Fix AndroidDevice.get_prop, add tests.
c0e8d0fc50dc635c6723497900cf3b0d2eb572dc 29-Jul-2015 Dan Albert <danalbert@google.com> Merge "Fix AndroidDevice.get_prop, add tests."
e2b4a5fee020f4332390a47e68646b7558fe4185 28-Jul-2015 Dan Albert <danalbert@google.com> Fix AndroidDevice.get_prop, add tests.

Had messed this up while refactoring before I submitted and neglected
to add a test. Thanks to mazda@ for catching this.

Also disabled the root/unroot tests for user builds.

Change-Id: Icb819a820a2afa227d548d678ae471d5195f0b96
evice.py
est_device.py
24419f3c2e5b821e8f3efcfef32c9d530f0bd0d9 28-Jul-2015 Elliott Hughes <enh@google.com> am ce2047a9: am 1a706865: Merge "Fix const-ness of strrchr callers."

* commit 'ce2047a947eaf3c02e39c22a7b461e8a0acd87f2':
Fix const-ness of strrchr callers.
3e7048c027ffa081d2fea84b661a6da895a9f1fb 28-Jul-2015 Elliott Hughes <enh@google.com> Fix const-ness of strrchr callers.

This causes build failures in google3 where they use GCC. glibc only
provides const-correct overloads for string functions for GCC >= 4.4,
but clang -- which is what we use -- pretends to be GCC 4.2.

Change-Id: I2a054823ea6201ebcea46d5e77b80a975eefc622
db_utils.cpp
db_utils.h
ommandline.cpp
ile_sync_service.cpp
ysdeps.h
sb_linux.cpp
0566ab6fed582affad0f6e303f16b3e1ca18e66b 28-Jul-2015 Dan Albert <danalbert@google.com> am 05432f07: am 20cf8702: Merge "Create adb Python package."

* commit '05432f07eb34ff4f3956fc3fdc9fc713bf6ced9b':
Create adb Python package.
8e1fdd7806363af51d7bfa7134fcef66523bcc56 25-Jul-2015 Dan Albert <danalbert@google.com> Create adb Python package.

This is mostly just the AdbWrapper that we used in our tests, but I've
cleaned up the API to be a little more Pythonic (mostly in the sense
that commands are passed as lists rather than strings that are
shlex.split() by the shell command), and implemented the workaround
error checking for adb shell.

Move the tests up a directory. Having them buried a level down has
only been annoying.

There are now two files containing Python tests. test_device.py
contains tests specifically checking the AndroidDevice API, and
test_adb.py checks the ADB client program. To run both, use

python -m unittest discover [-v]

Change-Id: Ibd158c528d31126a5b048bd00bc93039dbc468bc
_init__.py
evice.py
est_adb.py
est_device.py
ests/test_adb.py
5bd3c3bb5435e2b7cfe521875776a11ddfe3cabd 25-Jul-2015 Elliott Hughes <enh@google.com> am b8fa711f: am 3fe6de1c: Merge "Add a simple test for using non-ASCII paths with adb."

* commit 'b8fa711fa92791f67592d9b9730354b1dd9e78e5':
Add a simple test for using non-ASCII paths with adb.
3fe6de1c39f532d4f462da8acbb3d2e84ee1a053 25-Jul-2015 Elliott Hughes <enh@google.com> Merge "Add a simple test for using non-ASCII paths with adb."
614e0a47d3a78cb671965555c3471090317cbf85 25-Jul-2015 Elliott Hughes <enh@google.com> Add a simple test for using non-ASCII paths with adb.

Bug: https://code.google.com/p/android/issues/detail?id=8185
Change-Id: If28a0ff345f44b60d6651bb36afb0bf72fe55e16
ests/test_adb.py
187afaf54f76f4a4a2598de7c66f8ecf32c0ee2a 25-Jul-2015 Elliott Hughes <enh@google.com> am 7d86f5e5: am 239f6ac8: Merge "Fix Win32 adb build (for the second time today)."

* commit '7d86f5e527c01d3fda84575af98888ee117159ee':
Fix Win32 adb build (for the second time today).
4f1d7b55d73e24c453720277e8dc5dca54f65eb8 24-Jul-2015 Elliott Hughes <enh@google.com> Fix Win32 adb build (for the second time today).

Change-Id: I83cb407660cd8b5ed65a80574875fe261e8a8926
ndroid.mk
994e9ea787dbfa584f83b77a0c49277351c7113b 24-Jul-2015 Elliott Hughes <enh@google.com> am f077e45c: am 9dad4ec4: Merge "Clean up the locking in usb_linux.cpp."

* commit 'f077e45cc47d1bf16779f3a689bd0cd857cb7f03':
Clean up the locking in usb_linux.cpp.
4bc35f3e4ce5ec94f70bed6ac78cbc8ea186448f 24-Jul-2015 Elliott Hughes <enh@google.com> am 51d08e8e: am 2e942a47: Merge "Fix Win32 adb build."

* commit '51d08e8e7abe50051650b1ea5936006c6d6da3e9':
Fix Win32 adb build.
5937a860f3ad87138956116b9cb0ffbac703c547 24-Jul-2015 Elliott Hughes <enh@google.com> am 1f76c1ab: am 9727a6a0: Merge "Report getaddrinfo failures correctly."

* commit '1f76c1abea3196a61f85164a078d44505d3a6b5e':
Report getaddrinfo failures correctly.
9dad4ec4408bf412c265ac9bb27c84bb5098e67c 24-Jul-2015 Elliott Hughes <enh@google.com> Merge "Clean up the locking in usb_linux.cpp."
812f030477bcd2ba064fef51d58e0c74fa361da7 24-Jul-2015 Elliott Hughes <enh@google.com> Clean up the locking in usb_linux.cpp.

tsan complained that usb_bulk_write accesses usb_handle members outside
a lock. Fix that, but by moving everything over to C++11 locking.

Note that the old code was checking whether pthread_cond_timedwait returned
a negative value, which it will never do --- it will signal timeout (or
any other error) by returning a positive errno value. The rewrite does
what they appeared to intend to do (break out on timeout), rather than
what they actually did (keep trying forever).

Bug: http://b/22598587
Change-Id: Iab6869ffed4874143a7da97193d6b09e34cf2933
ndroid.mk
sb_linux.cpp
d48dbd89c8661607b338b696c14c9609050f3f29 24-Jul-2015 Elliott Hughes <enh@google.com> Fix Win32 adb build.

Change-Id: I0a07379c470b7fa7f9bdef68c17ccb7bd0bd2079
db_utils.cpp
ysdeps.h
ysdeps_win32.cpp
381cfa9a8bc262dcd823a8bb6adc189595a2fe7d 24-Jul-2015 Elliott Hughes <enh@google.com> Report getaddrinfo failures correctly.

Also move us off the "convenience" function because you can't get useful
error reporting from it.

Change-Id: I5fcc6a6d762f5f60906980a7835f01a35045be65
db.h
db_client.cpp
db_listeners.cpp
db_utils.cpp
db_utils.h
onsole.cpp
dwp_service.cpp
ervices.cpp
ysdeps.h
ysdeps_win32.cpp
ransport_local.cpp
b877d72a86b949078eb8dbdb3442d2e2eda5c4f8 23-Jul-2015 Elliott Hughes <enh@google.com> am f5defe75: am 89cc750e: Merge "Don\'t limit Windows USB reads."

* commit 'f5defe752334c557a6be2d7242c944a81f11be76':
Don't limit Windows USB reads.
d704ede39253c1b28900c54b57f7dc57cb0367e8 23-Jul-2015 Elliott Hughes <enh@google.com> am 2fc8a91e: am 6b40d0aa: Merge "adb: win32: fix exec-in and exec-out to use binary mode"

* commit '2fc8a91eb35556b6f2bb4018b0fe2c08de55fe1c':
adb: win32: fix exec-in and exec-out to use binary mode
ae18667f9423dcd92c0d2f00e8496b4d2d370167 23-Jul-2015 Elliott Hughes <enh@google.com> am d804c6cd: am 571c8d71: Merge "Increase size of the the adb packets sent over the wire"

* commit 'd804c6cdc5f0dd4bccfe802f3e4db12e9110e0ef':
Increase size of the the adb packets sent over the wire
bd83f19f687f8000537ff884280a504cd643d049 23-Jul-2015 Elliott Hughes <enh@google.com> am 32b4d786: am a5d0ca4f: Merge "Show "(reverse)" in "adb reverse --list"."

* commit '32b4d786e14dd14cee39c12f56231ccf56c6710a':
Show "(reverse)" in "adb reverse --list".
fee06481213be7c2c5ba772bc45e56baa7802a95 23-Jul-2015 Elliott Hughes <enh@google.com> am d66e949b: am 2e7c39ec: Merge ""adb tcpip" should require a numeric argument."

* commit 'd66e949b14305b367d3de4ba00901bff1122bb0e':
"adb tcpip" should require a numeric argument.
c83614a8a5e3864ad423415fa76a3a503a92f337 23-Jul-2015 Elliott Hughes <enh@google.com> am 59ae3947: am 3bcdaa28: Merge "Recognize IPv6 addresses for "adb connect"."

* commit '59ae39473d1d9a53ecfbeb802f2b91c8e00a33e6':
Recognize IPv6 addresses for "adb connect".
61ee830ec93059f022903d48677c1c6211cd1757 23-Jul-2015 Elliott Hughes <enh@google.com> Don't limit Windows USB reads.

In 3d2904cdf2371e26c0465184436bd063979a5d97 we removed the code that broke
Linux USB reads into 4KiB chunks. This patch does the same for Windows. This
improves Windows "adb pull" speeds 6x in my VM. (There was no equivalent
problem with writes, so this change only affects pull speeds.)

Change-Id: If19013e5f51975f4824bf9147b7b76cebd305b96
sb_windows.cpp
6b40d0aaa1e8142dbe14a1fb1bfd7ff04de54e53 23-Jul-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: fix exec-in and exec-out to use binary mode"
3d2904cdf2371e26c0465184436bd063979a5d97 13-Jul-2015 Tamas Berghammer <tberghammer@google.com> Increase size of the the adb packets sent over the wire

The reason behing this change is to increase the adb push/pull speed
with reduceing the number of packets sent between the host and the
device because the communication is heavily bound by packet latency.

The change maintains two way compatibility in the communication
protocol with negotiating a packet size between the target and the
host with the CONNECT packets.

After this change the push/pull speeds improved significantly
(measured from Linux-x86_64 with 100MB of data):

| Old push | Old pull || New push | New pull |
-----------------------------------------------------------
Hammerhead | 4.6 MB/s | 3.9 MB/s || 13.1 MB/s | 16.5 MB/s |
-----------------------------------------------------------
Volantis | 6.0 MB/s | 6.2 MS/s || 25.9 MB/s | 29.0 MB/s |
-----------------------------------------------------------
Fugu | 6.0 MB/s | 5.1 MB/s || 27.9 MB/s | 33.2 MB/s |
-----------------------------------------------------------

Change-Id: Id9625de31266e43394289e325c7e7e473379c5d8
db.cpp
db.h
db_auth.cpp
db_auth_client.cpp
db_auth_host.cpp
dwp_service.cpp
rotocol.txt
ockets.cpp
ransport.cpp
ransport.h
ransport_local.cpp
ransport_usb.cpp
sb_linux.cpp
sb_linux_client.cpp
a5d0ca4f16a7e51726affb226975b57e495391e4 22-Jul-2015 Elliott Hughes <enh@google.com> Merge "Show "(reverse)" in "adb reverse --list"."
34c20bbdfffe0475555d3028e6a441198c85cc62 22-Jul-2015 Elliott Hughes <enh@google.com> Show "(reverse)" in "adb reverse --list".

Bug: http://b/17788586
Change-Id: I250a1459295ed38e8d962da8bea2a8d2f83c7ef0
db_listeners.cpp
19d80b878c3a91bec31bece096ca6ab012de77e7 22-Jul-2015 Elliott Hughes <enh@google.com> "adb tcpip" should require a numeric argument.

Defaulting to port 0 just breaks stuff.

Bug: http://b/22636927
Change-Id: I6239900e0828e71b31171d0184c24824957c99c8
ommandline.cpp
ervices.cpp
ests/test_adb.py
3bcdaa287760c8b1821c581493bfe851169ec65f 22-Jul-2015 Elliott Hughes <enh@google.com> Merge "Recognize IPv6 addresses for "adb connect"."
3d5f60dbba3bc0feabc05457d181547b295bb3b2 18-Jul-2015 Elliott Hughes <enh@google.com> Recognize IPv6 addresses for "adb connect".

Bug: http://b/22559299
Change-Id: I32891d706b5010c38db84a056e76dd279b780f75
db.cpp
db_client.cpp
db_utils.cpp
db_utils.h
db_utils_test.cpp
ervices.cpp
cc07811ebb4f42109ae9ef1414e1a24d8cf54a9d 21-Jul-2015 Elliott Hughes <enh@google.com> am 3cd33a72: am 5208d551: Merge "adb: logging: newlines, thread ids, error code overwriting"

* commit '3cd33a722543a6da22c6dd70b700d27e7890e2b7':
adb: logging: newlines, thread ids, error code overwriting
8d8126a705dd3c5734a0894f88c2c758784bd469 21-Jul-2015 Spencer Low <CompareAndSwap@gmail.com> adb: logging: newlines, thread ids, error code overwriting

Add missing \n to uses of legacy D() macro. This should make the legacy
logging easier to read (and harder to miss important stuff).

On POSIX, use gettid() from libcutils instead of pthread_self() so that
the output shows a more reasonable number instead of a pointer value.
This should be ok since libbase's logging already uses gettid().

Win32:

Don't let the Win32 last error get overwritten by API calls after the
original error'ing API. When encountering an unknown error, log the
specific error code.

Change-Id: Ib8f72754efa7ba895d2f1cd914251fec2a1d894c
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
db_auth_client.cpp
db_auth_host.cpp
db_client.cpp
devent.cpp
dwp_service.cpp
ervices.cpp
ysdeps.h
ysdeps_win32.cpp
ransport.cpp
sb_linux_client.cpp
ac6a325e5c2e2c852d4a5375743f17a29a372df9 21-Jul-2015 Elliott Hughes <enh@google.com> am b02de7ed: am 05418442: Merge "Remove subproc events when ADB_HOST."

* commit 'b02de7eda1d84179bc6d0f898a4b6e3d0565834b':
Remove subproc events when ADB_HOST.
05418442ff15e854a1041e26f56bd2f9e702d7f4 21-Jul-2015 Elliott Hughes <enh@google.com> Merge "Remove subproc events when ADB_HOST."
0f9b94e21d6db64abaf026e84b544d32364f99bf 20-Jul-2015 Elliott Hughes <enh@google.com> am 9287d2d8: am 953b44c3: Merge "Fix adbd/adb server confusion in an error message."

* commit '9287d2d83a420d750e3c1490d52930c11f662a19':
Fix adbd/adb server confusion in an error message.
64d303a0e750e5604564d6a91c11aea663f6874a 18-Jul-2015 Elliott Hughes <enh@google.com> Fix adbd/adb server confusion in an error message.

Change-Id: Iacb8bcfb1e8e1d46198ee4ba8cf0ec0d1b98c75a
ransport.cpp
947cb3e8eeb5583654ceac95e97762f20ff62035 17-Jul-2015 Alex Vallée <avallee@chromium.org> Remove subproc events when ADB_HOST.

The code which triggers these events (via the SHELL_EXIT_NOTIFY_FD) are
only called from code which is already guarded by #if !ADB_HOST.

Change-Id: I184414f5e090c1f08ee117e4c8c434cd4a8b5221
db.h
devent.cpp
e45a665040bfd317d9ed36ecac64a33d951e1fd7 16-Jul-2015 Elliott Hughes <enh@google.com> am c06c3001: am a1c344b9: Merge "Move mkdirs to adb_utils."

* commit 'c06c3001156cbbdf8d6b3e187e0f92c51c5a80b3':
Move mkdirs to adb_utils.
14216148210fef447aaed46d5f764844a605d3ae 06-May-2015 Alex Vallée <avallee@chromium.org> Move mkdirs to adb_utils.

There were duplicate implementations in commandline.cpp and
file_sync_client.cpp.

Change-Id: Ib448f76c0d7ffdcd577336b1c610a881425bc2db
db_utils.cpp
db_utils.h
ommandline.cpp
ile_sync_client.cpp
a0fbb908855d2476f5dd86c8172177f1c08d1428 10-Jul-2015 Thierry Strudel <tstrudel@google.com> am 8703bea1: Merge "fs_config: replace getenv(\'OUT\') by new fs_config parameter" into mnc-dev

* commit '8703bea1807326fef9835bc474e7a7288c725925':
fs_config: replace getenv('OUT') by new fs_config parameter
fs_mgr: Use ro.boot.veritymode
df33ffadd29ed02d87e87515626b673eac67f735 09-Jul-2015 Thierry Strudel <tstrudel@google.com> fs_config: replace getenv('OUT') by new fs_config parameter

Using a getenv('OUT') in such a deep down function is a wrong design
choice. Replacing with explicit parameter that may be NULL in case
device specific files can be accessed from /.
Since TARGET_COPY_OUT_SYSTEM may be defined to something different than
system we also ensure that we use a path relative to TARGET_OUT to
compute path to fs_config_* files.

Bug: 21989305
Bug: 22048934
Change-Id: Id91bc183b29beac7379d1117ad83bd3346e6897b
Signed-off-by: Thierry Strudel <tstrudel@google.com>
ile_sync_service.cpp
fcbc32de34ceea570824b98f243d40a228df1989 09-Jul-2015 Dan Albert <danalbert@google.com> am 00599eca: am e84205bf: Merge "Revert "Turn on -Wformat-nonliteral.""

* commit '00599eca7446f28762da3854566cff0b2ba46799':
Revert "Turn on -Wformat-nonliteral."
286bb6ddbd52584af0c6c76fbe0498f3dea4b944 09-Jul-2015 Dan Albert <danalbert@google.com> Revert "Turn on -Wformat-nonliteral."

One of my build aliases doesn't play nice with USE_MINGW=1, so my build lied to me. Will revert until I fix it up.

This reverts commit 459df8f3a14d4c614f0211049800cf7cad6d30ad.

Change-Id: I7905c5ae5ee85fb2d228ce63d81c79f140998c18
ndroid.mk
db.h
db_auth_host.cpp
db_io.h
db_utils.cpp
db_utils.h
ommandline.cpp
devent.cpp
emu_tracing.h
f9b81ccd7560deeade1f8bfc3fedbd5a1b460986 09-Jul-2015 Dan Albert <danalbert@google.com> am fcdc3141: am a35affb5: Merge "Turn on -Wformat-nonliteral."

* commit 'fcdc3141d3209afb8a8a62764fa66911a7104e74':
Turn on -Wformat-nonliteral.
d15baf01806834699285e6b788a2963c1062084e 09-Jul-2015 Elliott Hughes <enh@google.com> am 9d748c8b: am a6241a02: Merge "Replace HAVE_WIN32_IPC with _WIN32."

* commit '9d748c8bf4b3b4810c6ad9dcc75322c8059c3876':
Replace HAVE_WIN32_IPC with _WIN32.
459df8f3a14d4c614f0211049800cf7cad6d30ad 08-Jul-2015 Dan Albert <danalbert@google.com> Turn on -Wformat-nonliteral.

Apparently there are two classes of this warning in clang.
-Wformat-security is only emitted for cases of
`func(nonliteral_fmt_string)` (no args), and -Wformat-nonliteral is
emitted for cases *with* arguments. For whatever reason, the latter
isn't included in -Wextra and must be manually enabled.

To make this more easily portable to Windows, move the existing
gnu_printf/__printf__ decision into base/macros.h as ATTRIBUTE_FORMAT.

Change-Id: I3b0990e1d1f0a2e9c13b32f5cd60478946cb5fc6
ndroid.mk
db.h
db_auth_host.cpp
db_io.h
db_utils.cpp
db_utils.h
ommandline.cpp
devent.cpp
emu_tracing.h
a6241a0298de5e773ef113626ca4686f9c038868 09-Jul-2015 Elliott Hughes <enh@google.com> Merge "Replace HAVE_WIN32_IPC with _WIN32."
095307ec4950f06539f460ad621e0e1d3b246e19 09-Jul-2015 Elliott Hughes <enh@google.com> Replace HAVE_WIN32_IPC with _WIN32.

Change-Id: Ie9dc064fb23a4e4bd4856c9668784dec0be9d2d6
db_listeners.cpp
a5b671d0e38d171105b4c76f5671c2c62549d831 08-Jul-2015 Daniel Rosenberg <drosen@google.com> am 32933ff5: am dc4fa7f6: Merge "Fix "adb remount" for when the root directory is in system.img"

* commit '32933ff511a4b63f60543c97e2fc3b47ea465d1a':
Fix "adb remount" for when the root directory is in system.img
d6eba89f83a4028a4b25e44dc0f8bc59dd6ad70a 30-Jun-2015 Daniel Rosenberg <drosen@google.com> Fix "adb remount" for when the root directory is in system.img

When the root directory has been built into system.img, it is
mounted at /.

Change-Id: If01d12efeaa53b4ae59e801a6e9b802a9ae5882d
emount_service.cpp
0c3cb52dfc358cd6d6e01062e7cff50fb98e93d0 06-Jul-2015 Elliott Hughes <enh@google.com> am f4bb11d2: am 913ef1ca: Merge "Fixed a documentation error in protocol.txt"

* commit 'f4bb11d29888bae67d09a8004c3925f7dea9b1fc':
Fixed a documentation error in protocol.txt
36da715f2f18adc02c7cd1b1d1a858d9f42103ae 06-Jul-2015 Derrick Bonafilia <dbonafilia@google.com> Fixed a documentation error in protocol.txt

Prior to the documentation told users to pass 0 in as
the first argument to write messages, when they should
be outting in their local-id. It is now corrected.

Change-Id: Ia2c6c84f95383baa5ca471493a29a39e5173b604
Signed-off-by: Derrick Bonafilia <dbonafilia@google.com>
rotocol.txt
1bb6a4b89ed9fbba6d73ee8e716c3e9847feaefa 30-Jun-2015 Elliott Hughes <enh@google.com> am eb73219c: am b80ed906: Merge "adb server: don\'t close stale fd when TCP transport is closed"

* commit 'eb73219cbe186c4d879df081a83a97afa3ff7fc9':
adb server: don't close stale fd when TCP transport is closed
b80ed9069623efa3d48ac318c2c7585882d9b5d1 30-Jun-2015 Elliott Hughes <enh@google.com> Merge "adb server: don't close stale fd when TCP transport is closed"
529bb75f9ff4a36788babb6666e0bb17ab8f99c1 24-Jun-2015 Elliott Hughes <enh@google.com> am 04016450: am 9137d65e: Merge "Improve the "device \'(null)\' not found" error."

* commit '0401645033b0418f9cd6e07768ae3b062aa256ca':
Improve the "device '(null)' not found" error.
e2d3677cc2239a8530d33e3c5e24e65fff096801 23-Jun-2015 Elliott Hughes <enh@google.com> Improve the "device '(null)' not found" error.

Now we'll say "no devices found" if you haven't set ANDROID_SERIAL and
there's no device connected to default to.

Also clean up the relevant code a little.

Change-Id: Id254929629ce0888628d5ba8e67cd996ffbf9c8a
db.cpp
ervices.cpp
ransport.cpp
2f031481862e61eaa7d692cb525210997d7b3705 19-Jun-2015 Elliott Hughes <enh@google.com> am 11e6f219: am 21ba889a: Merge "Ignore ro.adb.secure in user builds."

* commit '11e6f219e7c5b755c70979fb573fcdc607d0f118':
Ignore ro.adb.secure in user builds.
1cddc2092f544c5eac339e59746436facfdd5dc7 18-Jun-2015 Elliott Hughes <enh@google.com> Ignore ro.adb.secure in user builds.

Require authorization by default, and remove the ability to override
that in user builds. (userdebug and eng are still free to do whatever
they want.)

Bug: http://b/21862859
Change-Id: Ibf8af375be5bf1141c1ad481eee7a59fb10a7adb
(cherry picked from commit 5cba504215ea91187cc36ec7aec5dce1b0f4b0fe)
ndroid.mk
db.cpp
db_auth.cpp
db_auth.h
db_main.cpp
5cba504215ea91187cc36ec7aec5dce1b0f4b0fe 18-Jun-2015 Elliott Hughes <enh@google.com> Ignore ro.adb.secure in user builds.

Require authorization by default, and remove the ability to override
that in user builds. (userdebug and eng are still free to do whatever
they want.)

Bug: http://b/21862859
Change-Id: Ibf8af375be5bf1141c1ad481eee7a59fb10a7adb
ndroid.mk
db.cpp
db_auth.cpp
db_auth.h
aemon/main.cpp
746d5cd66ae3c5c6ee422d45be08dcd4403b6d24 13-Jun-2015 Nick Kralevich <nnk@google.com> am a27dca0f: am 60c5a460: Merge "Remove calls to is_selinux_enabled()"

* commit 'a27dca0f7a5d6c1f79aaf213a6b26428e4ad855e':
Remove calls to is_selinux_enabled()
4d87095ebfefdb9e641492462f0a0e21d5b96ecf 13-Jun-2015 Nick Kralevich <nnk@google.com> Remove calls to is_selinux_enabled()

d34e407aeb5898f19d4f042b7558420bbb3a1817 removed support for
running with SELinux completely disabled. SELinux must either be
in permissive or enforcing mode now.

Remove unnecessary calls to is_selinux_enabled(). It always returns
true now.

Change-Id: Ife3156b74b13b2e590afe4accf716fc7776567e5
aemon/main.cpp
5ca8b9b0e639aec6e5492b9c2df9945f48a7bed2 13-Jun-2015 Elliott Hughes <enh@google.com> am dc5993b3: am 4931ae54: Merge "Minor "adb help" fixes."

* commit 'dc5993b3bac7797fb4163e3ea78cdc80f2f0d024':
Minor "adb help" fixes.
7e067cff7a635f3089568192a197140225d20495 12-Jun-2015 Elliott Hughes <enh@google.com> Minor "adb help" fixes.

One day we should slim this down. (Maybe implement the "help" versus
"help all" distinction that doesn't currently exist but was documented
before this change.)

Bug: https://code.google.com/p/android/issues/detail?id=158394
Change-Id: Ie24b588ffea00d262ce7ab0e5c328120ba8af240
ommandline.cpp
d62bce804005ef55bba90b9513a17db63c186ab3 08-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix key files reading/writing

The issue is that adb uses fopen() with "e" (presumably to open the file
with O_CLOEXEC), but that flag causes MSVCRT.DLL to return an error. So
when adb_auth_host.cpp goes to read or write the adbkey files, it fails.

The quick fix is to not use the "e" option on adb host code since it
isn't necessary there, compared to adbd.

An alternative fix would be to have a fopen() wrapper on Windows that
filters out the "e" option.

Bug: http://b/21806456
Bug: https://code.google.com/p/android/issues/detail?id=175077
Change-Id: I7d8ba2847dab0ed558ffe156e79093251eb253c9
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
(cherry picked from commit 9b9603148b0a42ee9b4fc2df76bfde31ba29c311)
db_auth_host.cpp
3abd31d8f4b4a86297ecc619ce746e660cb59028 09-Jun-2015 Spencer Low <CompareAndSwap@gmail.com> adb server: don't close stale fd when TCP transport is closed

I think this fixes a scary bug that could be on all host platforms.

When running 'adb unroot' with an emulator, the connection to the
emulator is dropped (as expected). I noticed that the adb.log showed:

_fh_from_int: 1168: 5280 | _fh_from_int: invalid fd 106 passed to adb_close

Background: Every transport has a socketpair (two bidirectional sockets
connected to each other to form one 'pipe') that are used as follows:

* When adb wants to write to a transport, it writes to
t->transport_socket (half of the socketpair). An input thread reads from
t->fd (the other half of the socketpair) and writes the data to the
underlying transport (TCP, USB).

* An output thread reads from the underlying transport (TCP, USB) and
writes the data to t->fd. The main thread runs fdevent_loop() which
reads from t->transport_socket and processes the packets (that really
came from the underlying transport).

So t->fd and t->transport_socket are just an intermediate pipe between
transport agnostic code in adb and the underlying transport (TCP, USB).

Here's what I think is going on:

1. When the TCP transport is closed (such as when running adb unroot),
adb server's output thread notices this (adb_read() returns zero), and
it writes a special packet to t->fd.

2. The main thread processes the special packet by writing the special
packet to the input thread.

3. input_thread() sees the special packet, so it breaks out of a read
loop and calls transport_unref() which calls transport_unref_locked().

4. transport_unref_locked() calls t->close() which is a function pointer
that points to transport_local.cpp: remote_close() which calls
adb_close(t->fd). <----- ****THIS IS THE BUG****

I think this is a (very old) typo and it should instead be
adb_close(t->sfd) (the transport’s actual TCP socket) because it does
not make sense for the particular transport mechanism (TCP, USB) to be
messing with a socket of the socketpair of the transport agnostic code
(t->fd).

5. transport_unref_locked() calls remove_transport() which writes an
action to another special socketpair.

6. The action is read and eventually transport_registration_func() is
called and it calls adb_close(t->fd). But t->fd was already
(erroneously) closed in #4 above!! Anyway, this causes the adb.log
output.

The fix is to fix the typo changing t->fd to t->sfd and adding some
resiliency around whether the socket has already been closed (probably
by remote_kick()).

I tested this by putting a new adbd on an emulator, a new adb on Linux
and Windows and running the adb unroot scenario and checking adb.log. I
also ran test_adb.py (which doesn't totally work without problems with
an emulator, but I'll leave that to another day.)

Change-Id: I188b6c74917a3d721c150fd17ed0f2b63a2178c3
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ransport_local.cpp
b7dfb79b53c516e54a8964ba66e207a3bb4db9ee 23-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix exec-in and exec-out to use binary mode

adb exec-in and exec-out are designed to read/write binary data
according to the commit description at:
https://android.googlesource.com/platform/system/core/+/5d9d434%5E!/

On Windows, when adb_read and adb_write are used, they are always in
binary mode (because sysdeps_win32.cpp calls Windows APIs direct). But
unix_read, unix_write, fread, fwrite, read, write use the text
translation mode of the C Runtime file descriptor, which is by default
textmode.

adb exec-in and exec-out use copy_to_file() which uses unix_read() and
fwrite() when reading/writing stdin and stdout, thus, copy_to_file()
should switch to binary mode for those cases (it already uses binary
mode for file descriptors other than stdin and stdout).

copy_to_file() is also called by adb backup, adb restore, and adb
install-multiple, but those do not use stdin or stdout, so those
codepaths should not be affected by this change.

Change-Id: I3446d9b363d20a2c2f6be2b96e55b653d99df2f9
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ommandline.cpp
f8ee7c7442608fb5bf856c83c3ca183e2fe170e6 09-Jun-2015 Elliott Hughes <enh@google.com> am 35096f4c: am fa76ffcc: Merge "adb: win32: fix logging to adb.log"

* commit '35096f4cf8d2d81f28cec07781fd080f855c0e99':
adb: win32: fix logging to adb.log
fa76ffccaa723538ad09255353538911ae390322 09-Jun-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: fix logging to adb.log"
a190c800bf562c2fd2fb113782ff83c1d475ea61 02-Jun-2015 Jack Pham <jackp@codeaurora.org> adbd: enable USB SuperSpeed (again)

The descriptors to enable USB 3.0 SuperSpeed support had previously
been added in commit d6ee9f26a5163af4121f4380264fcbd4e6851a17
but were removed when the v1/v2 descriptor handling was refactored
in commits ab3446dd3400652ecf50682d0e5c4184628e9930 and again in
c49f51c451516bf06afc6d71947eb11cc4627273. Now that the dust has
settled, add back the SS descriptors to re-enable USB 3.0.

Change-Id: I8de7c7e50d9216a7492ce7863e3aaf92ff805eff
sb_linux_client.cpp
71ae73c01dd8ef12b69e25b5925cd85bc1bfd91d 06-Jun-2015 Elliott Hughes <enh@google.com> am b4d0722d: am a9456438: Merge "Fix test_adb.py against production builds."

* commit 'b4d0722d7dedece03e560dc13eb6b56bf18eeae6':
Fix test_adb.py against production builds.
0ec4b9363a0298b2da532d3591f4ae99b04d88db 06-Jun-2015 Paul Lawrence <paullawrence@google.com> am 439cdfd0: am af0baad7: Merge "adb shouldn\'t trace unless told to"

* commit '439cdfd0bfa8ee2cf0996f517e61ab9f7d90bdc6':
adb shouldn't trace unless told to
a945643831db4ec58988a0773a89f3858d282b07 06-Jun-2015 Elliott Hughes <enh@google.com> Merge "Fix test_adb.py against production builds."
6f009d9496fc060ba76f97348aa0702a62fcf927 06-Jun-2015 Paul Lawrence <paullawrence@google.com> adb shouldn't trace unless told to

Prevents clean unmount of /data in crypto bounce

Bug: 21516860
Change-Id: I1f761dfdf216dcb35b4609cd46cc4d0644cc4a81
db.cpp
35953285644fe231b7d9ae4d1e48110613f4a4f6 05-Jun-2015 Elliott Hughes <enh@google.com> Fix test_adb.py against production builds.

Also use assertEqual for better errors. (I accidentally tested against
a non-AOSP build that doesn't have the \r fix.)

Change-Id: Ib032c01efa4e1efb14467ca776a14160fff4ad39
ests/test_adb.py
3fa276aab5455b2ece4dd9d25208097e3aa9820e 05-Jun-2015 Elliott Hughes <enh@google.com> am 473629d5: am f9ae390f: Merge "adb: win32: get test_adb.py running and passing 100%"

* commit '473629d564fbb90e5c08bc7006685fe47b8cadd0':
adb: win32: get test_adb.py running and passing 100%
f9ae390f63aa7bfc4e93ba1e18240aa1e05d122b 05-Jun-2015 Elliott Hughes <enh@google.com> Merge "adb: win32: get test_adb.py running and passing 100%"
d41dee7fc84c81f61ddc4d2ba3dc648559bc68e9 05-Jun-2015 Elliott Hughes <enh@google.com> am 641fd2e4: am ebce1470: Merge "adb: fix adb_close() vs. unix_close() usage"

* commit '641fd2e443607aadd2cb98177308241cb633dcbd':
adb: fix adb_close() vs. unix_close() usage
ebce1470779ad424bc220ada590ee274dbdfaaa4 05-Jun-2015 Elliott Hughes <enh@google.com> Merge "adb: fix adb_close() vs. unix_close() usage"
d0f66c361641dc30162877ee3e4b4690d6833442 21-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix logging to adb.log

In the adb client, redirect stdin and stderr of the adb server to `nul',
so that when the adb server starts up, it avoids issues in the C Runtime
where it closes stderr, making it hard to properly reopen. There are
probably other ways to avoid this issue, but I think this is the
cleanest that will keep working over the years and will exercise the
most commonly used code-paths in the C Runtime.

Fix some adb_close() calls to be unix_close() (only really matters on
Windows).

Make stderr non-buffered on Windows, to match the (sensible) Linux
behavior.

Change-Id: I1b15c64240e50dbeb56788b0d0d901f4536ad788
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
lient/main.cpp
cb0322f53604c2b292e23317389add3c54613438 02-Jun-2015 Svetoslav <svetoslavganov@google.com> am 23d84074: Improve adb install help.

* commit '23d84074652b77385431fc0d1505b7d43b7dba9e':
Improve adb install help.
23d84074652b77385431fc0d1505b7d43b7dba9e 02-Jun-2015 Svetoslav <svetoslavganov@google.com> Improve adb install help.

Bug: 21365060
Change-Id: I0a4ea5cf3a2f37a82161b30f7eec5781d175aa8f
ommandline.cpp
06e914eb8e7273a44a407d4679665ce09f865388 30-May-2015 Elliott Hughes <enh@google.com> am 5dd45034: am ce817c38: Merge "Fix error handling/reporting for "adb forward" and "adb reverse"."

* commit '5dd45034c3785792c59b3ef663ac2b669637d607':
Fix error handling/reporting for "adb forward" and "adb reverse".
424af02f363a305a349ff99e1cc253ac5bc642c9 30-May-2015 Elliott Hughes <enh@google.com> Fix error handling/reporting for "adb forward" and "adb reverse".

We really need better infrastructure for parsing adb subcommands, but
in the meantime...

At least this cleans up a little more of the implementation too.

Bug: http://b/20736014
Change-Id: I76209847da3724906c71924017bcb69fa31e0b49
db.cpp
db_client.cpp
db_client.h
db_listeners.cpp
db_listeners.h
ommandline.cpp
420979613649e6abcf4823ff7c73beb2cab9f477 28-May-2015 Lorenzo Colitti <lorenzo@google.com> am 0983a6d5: Merge "Document the -g option to adb install." into mnc-dev

* commit '0983a6d54c202fde75523f1340bd9c9a168ab98c':
Document the -g option to adb install.
0b3baac51217b14be9eacb8865f31be8f6b4bbc3 27-May-2015 Lorenzo Colitti <lorenzo@google.com> Document the -g option to adb install.

Change-Id: I012165df343c24953f1c1cfcdce379bf1b67c624
ommandline.cpp
62b6b4a1eabc477e66a5b5cdaa443667a76d4a94 25-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: get test_adb.py running and passing 100%

* Use posixpath instead of os.path, because os.path uses '\' instead of
'/' when running on Windows.

* tempfile.NamedTemporaryFile() does not work right on Windows because
it holds the file open, preventing other processes from accessing the
same file (https://bugs.python.org/issue14243). To work-around this, use
the mechanical transformation described at
http://stackoverflow.com/questions/15169101/how-to-create-a-temporary-file-that-can-be-read-by-a-subprocess

* Use pipes.quote() to quote path arguments, to prevent C:\foo\bar from
turning into C:foobar.

* Open files in binary mode with "b".

* Fix line-ending test to allow for \r\n on Windows, but to still test
for adbd incorrectly sending \r\n (which is then translated to \r\r\n).

Change-Id: Ib6ba94b919b747a878ba3ab54a4dea0801f76947
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ests/test_adb.py
6ac5d7dc56a016718d2a26803435505e983e5d80 23-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb: fix adb_close() vs. unix_close() usage

Document the differences between adb_*() and unix_*() in the function
prototypes in sysdeps.h. See the file for the details (CR/LF
translation, well-known file descriptors, etc.).

Fix adb_read(), adb_write(), and adb_close() calls that should really be
unix_read(), unix_write(), and unix_close(). Note that this should have
no impact on unix because on unix, unix_read/unix_write/unix_close are
macros that map to adb_read/adb_write/adb_close.

Improve sysdeps_win32.cpp file descriptor diagnostic logging to output
the name of the function that was passed a bad file descriptor.

Change-Id: I0a1d9c28772656c80bcc303ef8b61fccf4cd637c
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db.cpp
db_auth_host.cpp
aemon/main.cpp
emount_service.cpp
ervices.cpp
ysdeps.h
ysdeps_win32.cpp
sb_linux.cpp
sb_linux_client.cpp
9313c0df20d7cc8ea6a074a3d53022c4b3b5ea05 21-May-2015 Dan Albert <danalbert@google.com> Improve logging.

Any output from the LOG family will now go to stderr and logcat on the
device. stderr is usually redirected to a log file, but that is now
inhibited for adbd if being run from a tty (useful when debugging with
the serial console).

This also fixes sending logs to the file on device for the trace mask
of "all". The "all" tag was specifically handled to return early from
the function, preventing the file initialization from happening.

Change-Id: Id253577bfd1500fbce92dbfba0f9be23dbfd5ee4
db.cpp
db_trace.h
lient/main.cpp
aemon/main.cpp
36473768ef6996f2ddf767385a56964e3c88575d 22-May-2015 Dan Albert <danalbert@google.com> Merge "Clean up adb_trace_init."
db037bcd221c6116434f6ae555e65e6e1db77ff7 22-May-2015 Dan Albert <danalbert@google.com> Merge "Make atransport be a real class."
c7915a3470292349017f94ca066ed515babfcc23 19-May-2015 Dan Albert <danalbert@google.com> Make atransport be a real class.

Using non-POD types in atransport means we'll need to start treating
it as a real class (specifically with regards to new/delete rather
than malloc/free).

I've also cleaned up the home grown linked lists for transport_list
and pending_list to just be std::lists. We might want to refactor that
again to be an std::unordered_map keyed on serial, since that seems to
be a common way to search it.

Change-Id: I7f5e23cdc47944a9278099723ca029585fe52105
ndroid.mk
db.h
ransport.cpp
ransport_test.cpp
23fee8fcf59880545e5fbc2cf12df77f2be3280c 21-May-2015 Dan Albert <danalbert@google.com> Turn on -Wextra.

Change-Id: I3cddd6d949fdfa79312246670c37475276734f41
ndroid.mk
e246219d0c9897b1c08204d6c535d5d341c4e7ee 19-Mar-2015 Dan Albert <danalbert@google.com> Clean up adb_trace_init.

Old code was a mess for splitting a string and then searching a list
when they really wanted a map.

To more closely match ANDROID_LOG_TAG, only use a space separated list
rather than space/colon/semi-colon/comma.

Change-Id: I915ff4968e42d5f8dec1b43b6eacc0c8d7b44d7b
ndroid.mk
db.cpp
ac3f7d9a78f9024563cc47f62206c6e3475778dd 20-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb / libbase: clean up NOGDI and evil ERROR macro

Instead of defining and undefining NOGDI:

1. Always #include "base/logging.h" after #include <windows.h>.
Unfortunately, I could not find an easy way to give the user a
warning/error if they include in the wrong order.

2. base/logging.h does #undef ERROR to undefine the evil ERROR macro
that is from another era and probably a bad idea to begin with.

Change-Id: I995d89620611e849af9d7ec47eb55fc0512377f2
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ndroid.mk
db_auth_host.cpp
ysdeps_win32.cpp
d92fd41f693e1ea7dfbb0e8b3df8fd3a85910d71 19-May-2015 Dan Albert <danalbert@google.com> Merge "Make connection states a proper type."
dcd78a15d0be143d48fc93af6a9fa5748dbf9790 19-May-2015 Dan Albert <danalbert@google.com> Make connection states a proper type.

Change-Id: I809f9b327c832b88dd63151bf7dcb012d88e81c4
db.cpp
db.h
ervices.cpp
ockets.cpp
ransport.cpp
ransport.h
ransport_local.cpp
ransport_usb.cpp
075e8608a7d060d9c8251ef06b45c75dc714cc5c 19-May-2015 Dan Albert <danalbert@google.com> Ignore whitespace/indent issues from cpplint.

Unfortunately this lint check also fires when public/private are not
indented by a single space. The indentation format in adb does not
match google style, so that's not going to happen.

Change-Id: I35e5654a2359222bb274ac5fb2961aee6a3a280f
PPLINT.cfg
747a6f22cda0c74b66777e75aff384f0c09474ba 16-May-2015 Dan Albert <danalbert@google.com> Merge "adb: win32: fix key files reading/writing"
569a1301968925f03ab2362495dd20cd23b63dba 15-May-2015 Dan Albert <danalbert@google.com> Make pty raw in adb shell when non-interactive.

The main goal here is fixing the line ending translation from \n to
\r\n, but we probably don't want any translation to happen.

Bug: http://b/19735063
Change-Id: I1d6d6c6b57cc741b046c2432cd864b344ce1f28a
ervices.cpp
ests/test_adb.py
4e0008123d0828e8b8ab31c81ebdbc5dc3656e88 16-May-2015 Dan Albert <danalbert@google.com> Merge "adb: win32: fix StringPrintf format string checking of %zd and PRIu64"
2181c722ceac50dde3c4a399950b37e7fd6a5893 15-May-2015 Elliott Hughes <enh@google.com> Fix ' escaping in adb.

You can't just use \' inside a single-quoted string.

Bug: http://b/20323053
Bug: http://b/3090932
Change-Id: I73754b097671d02dc11c35052f0534b6dd789e4f
(cherry picked from commit 84b0bf22644b35d6b3d3f7dc96311a484c3519b3)
db_utils.cpp
db_utils_test.cpp
ests/test_adb.py
0df06907b42d5deea3d55411d98e273e204390ab 15-May-2015 Dan Albert <danalbert@google.com> Merge "adb: win32: fix daemon acknowledgement"
84b0bf22644b35d6b3d3f7dc96311a484c3519b3 15-May-2015 Elliott Hughes <enh@google.com> Fix ' escaping in adb.

You can't just use \' inside a single-quoted string.

Bug: http://b/20323053
Bug: http://b/3090932
Change-Id: I73754b097671d02dc11c35052f0534b6dd789e4f
db_utils.cpp
db_utils_test.cpp
ests/test_adb.py
6001c87cbcafba68975fd9b3aa69f4952396f83c 13-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix StringPrintf format string checking of %zd and PRIu64

At runtime, vsnprintf (and android::base::StringPrintf which calls it)
call a mingw version of vsnprintf, not the vsnprintf from MSVCRT.DLL.
The mingw version properly understands %zd and PRIu64 (the latter,
provided that you #include <inttypes.h>).

The problem was that android::base::StringPrintf was causing
compile-time errors saying that %zd and PRIu64 were not recognized. It
seems that this was because the attribute on the function prototypes
specified `printf' instead of `gnu_printf'. Once that was fixed to match
vsnprintf's attribute, the warnings went away.

This uses similar preprocessor techniques as <android/log.h>.

Also restore a %zd usage to avoid a static_cast<>, and make
print_transfer_progress()'s format string compile-time checkable (and
tweak some types and %llu => PRIu64).

Change-Id: I80b31b9994858a28cb7c6847143b86108b8ab842
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db_client.cpp
ommandline.cpp
ile_sync_client.cpp
4af3c40c4a5343ea30c8f600cc61804b8fb39bb6 16-Oct-2014 Alan Jeon <skyisle@gmail.com> adb: Do not share memory between multiple thread

When multiple client try to connect to other hosts, it failed because
memory corruption. Allocate memory for each thread like other command did.

Change-Id: I79959ce3dbfd11c7553736cd3f5a899815873584
Signed-off-by: Alan Jeon <skyisle@gmail.com>
ervices.cpp
d396dc93a7b2e2f55eb6a34f04fe796769e9ecea 12-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix daemon acknowledgement

The daemon failed to startup because main.cpp was changed from calling
WriteFile() to android::base::WriteStringToFd(), the later which calls
write() in the C Runtime which by default has stdout in textmode which
does \n to \r\n translation.

The quick fix is to change stdout's mode from text to binary since right
after it is reopened to redirect to the daemon log file anyway.

Change-Id: I322fc9eae5d6abbf63f3d5917b0beb2171b5a15c
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
lient/main.cpp
a51d8b9a1c06a17b8d5d5fd9547a3bf813ea4157 11-May-2015 Elliott Hughes <enh@google.com> Failure to find an oem partition should not be a remount failure.

Many devices don't have an /oem partition, so find_mount should be
expected to fail, but shouldn't cause the overall remount to fail.

Also clean up all the error handling and reporting, and remove the
dead int* globals.

Bug: http://b/21024141
Change-Id: Ie31021b03c9cab8e972269d7d1ffe383cd30ee9e
(cherry picked from commit 9aa4fda4e64c1882faf019cc2a483ee4917e0c85)
emount_service.cpp
emount_service.h
et_verity_enable_state_service.cpp
9aa4fda4e64c1882faf019cc2a483ee4917e0c85 11-May-2015 Elliott Hughes <enh@google.com> Failure to find an oem partition should not be a remount failure.

Many devices don't have an /oem partition, so find_mount should be
expected to fail, but shouldn't cause the overall remount to fail.

Also clean up all the error handling and reporting, and remove the
dead int* globals.

Bug: http://b/21024141
Change-Id: Ie31021b03c9cab8e972269d7d1ffe383cd30ee9e
emount_service.cpp
emount_service.h
et_verity_enable_state_service.cpp
c89e0ccd40624e8b2ce30d425e8bed0264fae548 09-May-2015 Dan Albert <danalbert@google.com> Revert "Revert "Split adb_main.cpp into client and daemon.""

This reverts commit 218dbccefa3d874d988e4784bda5e45b7643cb5a.

Change-Id: I74088db34983dc99e316a07c6ddc294340e0eb71
ndroid.mk
db.cpp
db.h
db_main.cpp
lient/main.cpp
aemon/main.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
sb_windows.cpp
218dbccefa3d874d988e4784bda5e45b7643cb5a 09-May-2015 Dan Albert <danalbert@google.com> Revert "Split adb_main.cpp into client and daemon."

This reverts commit cf07494ac2a101c3afbe23a7d85121553f586cf7.
ndroid.mk
db.cpp
db.h
db_main.cpp
lient/main.cpp
aemon/main.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
sb_windows.cpp
3e1cb6d98d54d38820de70bba07732ea87e84ffb 09-May-2015 Dan Albert <danalbert@google.com> Revert "Probably fix the Mac build."

This reverts commit 49513cbcc7534a6d31fb40f4b1172eee0673c407.
lient/main.cpp
49513cbcc7534a6d31fb40f4b1172eee0673c407 08-May-2015 Dan Albert <danalbert@google.com> Probably fix the Mac build.

This was throwing an unused variable warning for kWorkaroundBug6558362
on Darwin.

Change-Id: I1cbf381708e9884180a37f3246af36795d07dfc2
lient/main.cpp
207ddb20ac2f25de19d74fe88f2a526e0ee5cfa6 08-May-2015 Elliott Hughes <enh@google.com> Fix "adb remount" for devices without an oem partition.

On a device without an oem partition, we now have an /oem directory
anyway. This causes find_mount to fail, and that was returning nullptr
from a std::string-returning function. Boom!

Also clean up the bits of code I had to trace through between "adb remount"
on the host to the crash on the device as I debugged this.

The only other meaningful change is the error checking in
adb_connect_command --- adb_connect can also return -2.

Bug: http://b/20916855
Change-Id: I4c3b7858e13f3a3a8bbc7d30b3c0ee470bead587
(cherry picked from commit 5677c23e8d0c085be8d8429a5d125147d11e9bb2)
ommandline.cpp
emount_service.cpp
ee5ce0d14f099e7295a0aed54accd9d952e6a6a1 08-May-2015 Elliott Hughes <enh@google.com> Merge "Fix "adb remount" for devices without an oem partition."
c33e62bdc63ddaf7a17c5f317e73349bf3df2b83 08-May-2015 Benson Leung <bleung@google.com> Merge "Be tolerant of devices that don't report serials." into mnc-dev
cf07494ac2a101c3afbe23a7d85121553f586cf7 06-May-2015 Dan Albert <danalbert@google.com> Split adb_main.cpp into client and daemon.

The name "client" is somewhat misleading as it also contains the host
side adb server, but it's a part of the client binary.

Change-Id: I128b7bab213e330eb21b5010cd1fec5f7a62c8af
ndroid.mk
db.cpp
db.h
db_main.cpp
lient/main.cpp
aemon/main.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
sb_windows.cpp
02418b3e093b025ee9b9ae2e51a37810cc5322d6 08-May-2015 Elliott Hughes <enh@google.com> Try to include the SHA in a ddmslib-compatible way.

Bug: http://b/20918202
Change-Id: I0c1a48459372b0d28aaf9d09d82540e44b438c9c
(cherry picked from commit f3bbfa6a216669c4cd91d5f936662e89e0ae07ca)
ommandline.cpp
f85f111620afba9bad222661c1c34aee731d415b 08-May-2015 Elliott Hughes <enh@google.com> Merge "Try to include the SHA in a ddmslib-compatible way."
5677c23e8d0c085be8d8429a5d125147d11e9bb2 08-May-2015 Elliott Hughes <enh@google.com> Fix "adb remount" for devices without an oem partition.

On a device without an oem partition, we now have an /oem directory
anyway. This causes find_mount to fail, and that was returning nullptr
from a std::string-returning function. Boom!

Also clean up the bits of code I had to trace through between "adb remount"
on the host to the crash on the device as I debugged this.

The only other meaningful change is the error checking in
adb_connect_command --- adb_connect can also return -2.

Bug: http://b/20916855
Change-Id: I4c3b7858e13f3a3a8bbc7d30b3c0ee470bead587
ommandline.cpp
emount_service.cpp
f3bbfa6a216669c4cd91d5f936662e89e0ae07ca 08-May-2015 Elliott Hughes <enh@google.com> Try to include the SHA in a ddmslib-compatible way.

Bug: http://b/20918202
Change-Id: I0c1a48459372b0d28aaf9d09d82540e44b438c9c
ommandline.cpp
aee80fb67bcc3fc5209050c40bd8efc1bbcc0610 08-May-2015 Elliott Hughes <enh@google.com> Add some missing 'const's.

Change-Id: I5bd26d4366e10fc8c6bc255b7ddb174a7a8b82a5
db.cpp
db.h
9b9603148b0a42ee9b4fc2df76bfde31ba29c311 08-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix key files reading/writing

The issue is that adb uses fopen() with "e" (presumably to open the file
with O_CLOEXEC), but that flag causes MSVCRT.DLL to return an error. So
when adb_auth_host.cpp goes to read or write the adbkey files, it fails.

The quick fix is to not use the "e" option on adb host code since it
isn't necessary there, compared to adbd.

An alternative fix would be to have a fopen() wrapper on Windows that
filters out the "e" option.

Change-Id: I7d8ba2847dab0ed558ffe156e79093251eb253c9
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
db_auth_host.cpp
6043e15311df5278614157a1ef3000a6b143cb60 07-May-2015 Dan Albert <danalbert@google.com> Be tolerant of devices that don't report serials.

The USB spec explicitly says this is optional, so we shouldn't be
relying on it.

Bug: http://b/20883914
Change-Id: Icf38405b00275199bcf51a70c47d428ae7264f2b
ransport.cpp
sb_linux.cpp
142ec75cf882bf023853f0321cd559377daccc60 07-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: fix adb emu command

The adb emu command was never working because the socket connection to
the emulator was closed without reading all of the data that the
emulator sent. On Windows, this caused the emulator's recv() call to
error-out, so it never got the command that was sent.

Before settling on this fix, I also experimented changing the arguments
to the socket shutdown() call and that didn't seem to help. I also tried
removing the call to shutdown() and that didn't help. So that should
rule out shutdown() as the problem. One experiment that helped was
delaying before calling adb_close(), but that is of course fragile and
doesn't address the real issue, which is not closing the socket until
the commands have been read.

https://code.google.com/p/android/issues/detail?id=21021

Change-Id: I8fa4d740a2faa2c9922ec50792e16564a94f6eed
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ndroid.mk
db_auth_host.cpp
db_client.cpp
db_client.h
ommandline.cpp
onsole.cpp
ysdeps_win32.cpp
d99d902abdbcb86fd0f1db5d6204c02126d1e818 07-May-2015 Dan Albert <danalbert@google.com> Be tolerant of devices that don't report serials.

The USB spec explicitly says this is optional, so we shouldn't be
relying on it.

Bug: http://b/20883914
Change-Id: Icf38405b00275199bcf51a70c47d428ae7264f2b
ransport.cpp
sb_linux.cpp
c1cfbd304ad1f4f5f136a175ed687de41701235a 06-May-2015 Dan Albert <danalbert@google.com> Include the git sha in the adb version.

Also add --version to adbd to display the same thing.

Change-Id: I47dfbad16c892c42ea938aedd085ba77492791ba
(cherry picked from commit 1ba1d7c1ee644967ff4743b0d257290cbeca7a83)
ndroid.mk
db_main.cpp
ommandline.cpp
3edd54b3a873a18d9c2f66ce955036471f4c3c0a 06-May-2015 Elliott Hughes <enh@google.com> Add some missing 'static's.

Change-Id: Id76bb1e954e8fa36a11a38b5445c87f4a64af799
ile_sync_client.cpp
sb_linux_client.cpp
1ba1d7c1ee644967ff4743b0d257290cbeca7a83 06-May-2015 Dan Albert <danalbert@google.com> Include the git sha in the adb version.

Also add --version to adbd to display the same thing.

Change-Id: I47dfbad16c892c42ea938aedd085ba77492791ba
ndroid.mk
db_main.cpp
ommandline.cpp
3f05fb5d97d27f55adfb09febbc1957e893f0f8e 06-May-2015 Dan Albert <danalbert@google.com> Merge "Disable adb tests for Windows."
a7a67c307984849b501e678a18146ccec4eb1b2b 05-May-2015 Dan Albert <danalbert@google.com> Disable adb tests for Windows.

The tests will need some massaging before they're ready to go for
Windows, so just disable them to unblock people trying to mm in adb.

Change-Id: I67f2cd3af1a2444dea9cbb61c0553989442ba44b
ndroid.mk
2e4a2eeaf3eb679c5f3fd1f4280418db6d5dc3a1 05-May-2015 Elliott Hughes <enh@google.com> _beginthread returns uintptr_t.

64-bit Windows is a thing, and we'll have to support it some day...

Change-Id: Ib9e2da1a5625e95a0ffadfee8501825dfd4f9594
ysdeps.h
9b0f354fa25e3d5add516000c761e07c81c3bbc1 05-May-2015 Elliott Hughes <enh@google.com> Simplify adb_thread_create.

Change-Id: I36d6021ef8fbc23e8bcd4ddbe1dac0eba467cc70
ommandline.cpp
ervices.cpp
ysdeps.h
ransport.cpp
ransport_local.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
sb_windows.cpp
3bd73c12c07dcefc965abeef535ac53c4754d682 05-May-2015 Elliott Hughes <enh@google.com> Give enum types CamelCase names for clarity.

Change-Id: I1c89f1cc155ee839f372fb14d972a288183b8bcd
db.cpp
db.h
db_client.cpp
db_client.h
db_listeners.cpp
db_listeners.h
ommandline.cpp
ervices.cpp
ockets.cpp
ransport.cpp
ransport.h
32687beaf258d216115de51dbca89d1e9cbc376d 05-May-2015 Elliott Hughes <enh@google.com> Remove non-functional "adb persist".

It isn't documented, it doesn't work, and it was only hacked into
"adb shell" anyway. (It's not a bad idea, though, but if we do it
we should do it properly.)

Change-Id: I930a5c6dd1d2850bfdf131f2e989ae04100f7db9
ommandline.cpp
aceb9c08df80da9c929af2998c54870455b79a03 05-May-2015 Elliott Hughes <enh@google.com> Implement the ssh(1) escaping rules.

The first rule of ssh(1) escaping is that there is no escaping.

This doesn't undo any of my recent security fixes because they're all
calling escape_arg themselves.

This fixes "adb shell rm /data/dalvik-cache/arm/*".

Also remove do_cmd which caused concern during code review.

Bug: http://b/20564385
Change-Id: I4588fd949d51e2a50cff47ea171ed2d75f402d0d
(cherry picked from commit 2b10111d25adcfe3627103b73edad22f188c97ba)
ommandline.cpp
ests/test_adb.py
f25752dcfa11a5e949fedf279c9534a4d4a3e9a3 05-May-2015 Elliott Hughes <enh@google.com> Merge "Implement the ssh(1) escaping rules."
2b10111d25adcfe3627103b73edad22f188c97ba 05-May-2015 Elliott Hughes <enh@google.com> Implement the ssh(1) escaping rules.

The first rule of ssh(1) escaping is that there is no escaping.

This doesn't undo any of my recent security fixes because they're all
calling escape_arg themselves.

This fixes "adb shell rm /data/dalvik-cache/arm/*".

Also remove do_cmd which caused concern during code review.

Bug: http://b/20564385
Change-Id: I4588fd949d51e2a50cff47ea171ed2d75f402d0d
ommandline.cpp
ests/test_adb.py
2e57163f5384b55e84194db3989d8afee93f815c 05-May-2015 Elliott Hughes <enh@google.com> Make test_track_devices.cpp output easier to read.

Change-Id: I2d85cdbe591a6ee9763e742805f281cb26d7b122
est_track_devices.cpp
e1a55004e9fa46055c59f86e952e9e457c36c3f2 02-May-2015 Elliott Hughes <enh@google.com> Add WriteFdFmt and clean up more code.

Also say *which* device wasn't found.

Bug: http://b/20666660
Change-Id: I50e234ad89e39ae0a8995083c0b642c61275c5a3
(cherry picked from commit ab52c181fa4c1c9891644635dc5653cda5b90e2b)
db.cpp
db_client.cpp
db_io.cpp
db_io.h
db_io_test.cpp
db_listeners.cpp
db_listeners.h
db_main.cpp
ommandline.cpp
emount_service.cpp
ervices.cpp
et_verity_enable_state_service.cpp
ransport.cpp
ransport_local.cpp
ab52c181fa4c1c9891644635dc5653cda5b90e2b 02-May-2015 Elliott Hughes <enh@google.com> Add WriteFdFmt and clean up more code.

Also say *which* device wasn't found.

Bug: http://b/20666660
Change-Id: I50e234ad89e39ae0a8995083c0b642c61275c5a3
db.cpp
db_client.cpp
db_io.cpp
db_io.h
db_io_test.cpp
db_listeners.cpp
db_listeners.h
db_main.cpp
ommandline.cpp
emount_service.cpp
ervices.cpp
et_verity_enable_state_service.cpp
ransport.cpp
ransport_local.cpp
92af733ee202caa3b5475fe27fcc81582f11e7c8 01-May-2015 Elliott Hughes <enh@google.com> More adb buffer fixes.

This patch factors out a lot of the basic protocol code: sending OKAY,
sending FAIL, and sending a length-prefixed string.

ADB_TRACE has been non-optional for a long time, so let's just remove
the #ifs.

Also actually build the device tracker test tool (and remove its duplicate).

Bug: http://b/20666660
Change-Id: I6c7d59f18707bdc62ca69dea45547617f9f31fc6
(cherry picked from commit e67f1f87d9b1188ec8617035db7006c37ee7b21e)
ndroid.mk
db.cpp
db.h
db_client.cpp
db_io.cpp
db_io.h
db_io_test.cpp
db_listeners.cpp
db_listeners.h
db_trace.h
db_utils.cpp
db_utils.h
ommandline.cpp
emount_service.cpp
ervices.cpp
et_verity_enable_state_service.cpp
ockets.cpp
ysdeps_win32.cpp
est_track_devices.cpp
est_track_jdwp.cpp
ransport.cpp
ransport.h
e67f1f87d9b1188ec8617035db7006c37ee7b21e 01-May-2015 Elliott Hughes <enh@google.com> More adb buffer fixes.

This patch factors out a lot of the basic protocol code: sending OKAY,
sending FAIL, and sending a length-prefixed string.

ADB_TRACE has been non-optional for a long time, so let's just remove
the #ifs.

Also actually build the device tracker test tool (and remove its duplicate).

Bug: http://b/20666660
Change-Id: I6c7d59f18707bdc62ca69dea45547617f9f31fc6
ndroid.mk
db.cpp
db.h
db_client.cpp
db_io.cpp
db_io.h
db_io_test.cpp
db_listeners.cpp
db_listeners.h
db_trace.h
db_utils.cpp
db_utils.h
ommandline.cpp
emount_service.cpp
ervices.cpp
et_verity_enable_state_service.cpp
ockets.cpp
ysdeps_win32.cpp
est_track_devices.cpp
est_track_jdwp.cpp
ransport.cpp
ransport.h
f1a58f8f33509201cabe71c6a9d01aa6b8f99966 29-Apr-2015 Elliott Hughes <enh@google.com> More fixed-length buffer removal.

Bug: http://b/20666660
Change-Id: I0c738e9fed2defed48a9cf2d0a4f7b99c08dcf3d
(cherry picked from commit 6452a89aa8934231e12ab77e0d90f12c3e892ad1)
db.h
db_client.cpp
db_client.h
ommandline.cpp
ransport.cpp
ransport_local.cpp
6452a89aa8934231e12ab77e0d90f12c3e892ad1 29-Apr-2015 Elliott Hughes <enh@google.com> More fixed-length buffer removal.

Bug: http://b/20666660
Change-Id: I0c738e9fed2defed48a9cf2d0a4f7b99c08dcf3d
db.h
db_client.cpp
db_client.h
ommandline.cpp
ransport.cpp
ransport_local.cpp
0156589846117bccb2fbec6b3141cc21bc86c638 30-Apr-2015 Elliott Hughes <enh@google.com> Add missing 'else' to fix all devices showing up as "host".

Bug: http://b/20705355
Change-Id: I4f7830278f0c2bc87d95d148d85455b8da894645
(cherry picked from commit 3ce9575af76fa6dc110506080434303b9459abf4)
db.cpp
3ce9575af76fa6dc110506080434303b9459abf4 30-Apr-2015 Elliott Hughes <enh@google.com> Add missing 'else' to fix all devices showing up as "host".

Bug: http://b/20705355
Change-Id: I4f7830278f0c2bc87d95d148d85455b8da894645
db.cpp
2e06d3057e2d4f630b5785008fd586d6256d1827 29-Apr-2015 Elliott Hughes <enh@google.com> Fix Win32 build.

(cherry-pick of 1b600a902cc0b3a6065c962293292a5ac689fafe.)

Change-Id: Icf2c8df99b4b88bbf85a4097731733c5795fba44
db_client.cpp
1b600a902cc0b3a6065c962293292a5ac689fafe 29-Apr-2015 Elliott Hughes <enh@google.com> Fix Win32 build.

Change-Id: Icf2c8df99b4b88bbf85a4097731733c5795fba44
db_client.cpp
71aeb798154a515d5f4a91ecb9adb0896ab9a9e6 29-Apr-2015 Elliott Hughes <enh@google.com> Move __adb_error to std::string, and improve various errors.

Also remove an sprintf. Also fix various bits of code that were
reporting stale adb_error values when they meant strerror.

(cherry-pick of 078f0fcf4c63b8d8e8c10a18855eae04ca321e06.)

Bug: http://b/20666660
Change-Id: Ibeb48b7bc21bb0ec30ba47889d1d671ee480e1b7
db_client.cpp
db_client.h
ommandline.cpp
ile_sync_client.cpp
078f0fcf4c63b8d8e8c10a18855eae04ca321e06 29-Apr-2015 Elliott Hughes <enh@google.com> Move __adb_error to std::string, and improve various errors.

Also remove an sprintf. Also fix various bits of code that were
reporting stale adb_error values when they meant strerror.

Bug: http://b/20666660
Change-Id: Ibeb48b7bc21bb0ec30ba47889d1d671ee480e1b7
db_client.cpp
db_client.h
ommandline.cpp
ile_sync_client.cpp
d81f75ae41b2eed4ae7b0911f250778f3e6ec9c2 25-Apr-2015 Elliott Hughes <enh@google.com> Remove strtok from adb.

Also fix android::base::Split to behave like Java, Python, and google3.

(cherry picked from commit 8d5fa6da44d56511b3e173bc463cbc65ff221b4a)

Change-Id: I9388ae37ee8dd4a4a6c2a9a19f068b70d9a78353
db.cpp
db_auth_host.cpp
ysdeps.h
ysdeps_win32.cpp
8d5fa6da44d56511b3e173bc463cbc65ff221b4a 25-Apr-2015 Elliott Hughes <enh@google.com> Remove strtok from adb.

Also fix android::base::Split to behave like Java, Python, and google3.

Change-Id: Ifbffd4e92950a79e7aea5d153c95fe0980648417
db.cpp
db_auth_host.cpp
ysdeps.h
ysdeps_win32.cpp
03a90d663363c904d5b874f2de204a055c763b3c 27-Apr-2015 Elliott Hughes <enh@google.com> Support the full length of USB serial numbers.

Two bugs: we couldn't report the serial number correctly if it was long
enough, and it wasn't possible to connect to a device whose serial number
was long enough to overflow a different fixed-length buffer.

Bug: http://b/20317730

(cherry picked from commit 9309ecbcec428edfcb487ef697862bce59a1aed5)

Change-Id: I04c160a215418a57bd4fb27b7f63060c8be6f12e
ndroid.mk
db_client.cpp
sb_linux.cpp
9309ecbcec428edfcb487ef697862bce59a1aed5 27-Apr-2015 Elliott Hughes <enh@google.com> Support the full length of USB serial numbers.

Two bugs: we couldn't report the serial number correctly if it was long
enough, and it wasn't possible to connect to a device whose serial number
was long enough to overflow a different fixed-length buffer.

Bug: http://b/20317730
Change-Id: Ic9cf3c847066449ac78069bd1718184935098ac7
ndroid.mk
db_client.cpp
sb_linux.cpp
ce6363bbbcd05ff16111040eecacd174f9327745 25-Apr-2015 Elliott Hughes <enh@google.com> Improve logging of USBDEVFS_CLAIMINTERFACE failures.

Bug: https://code.google.com/p/android/issues/detail?id=170054
Change-Id: I9b11eb019093e3322da0a8e70d6e17de4c25ab75
sb_linux.cpp
876881b22ad5d735cdb3ae2ac1afa6c336378808 22-Apr-2015 Elliott Hughes <enh@google.com> Merge "Add missing null checks after allocations."
dc3b459ff9f0ff71d404ba7198083e532a0dd894 22-Apr-2015 Elliott Hughes <enh@google.com> Add missing null checks after allocations.

Bug: http://b/20317729
Change-Id: I62bb761d48ee59a1f4ddd0cdd0632432305ca2ca
ommandline.cpp
ervices.cpp
ransport.cpp
sb_linux.cpp
sb_linux_client.cpp
sb_osx.cpp
1555147bc47349dd786098e9d660bbed205d25fc 22-Apr-2015 Elliott Hughes <enh@google.com> Plumb more of the error reporting through.

This doesn't fix the bug, but it does flatten the bug to the well-known
and long-standing "adb shell" doesn't return exit statuses, so when we
fix that, this one will fix itself.

Bug: http://b/20423886
Change-Id: I48351e46f05dd3f2f6e57f0df1d851333458d0ef
ommandline.cpp
8e6edc0d89f370fbc1760139849cf36d3ac4d589 22-Apr-2015 Elliott Hughes <enh@google.com> Add a couple more adb shell regression tests.

Bug: http://b/15479704
Change-Id: Id3e7f0df101ad61db509df313c13210a8bd8b124
ests/test_adb.py
82b0f7ba9258c74e4019b2b6478d2e1623a287d9 21-Apr-2015 Badhri Jagan Sridharan <Badhri@google.com> Merge "adb: set sys.usb.ffs.ready to signal usb pullup"
5f97370babbe465e82c2aefe9864848af6796113 21-Apr-2015 Badhri Jagan Sridharan <Badhri@google.com> adb: set sys.usb.ffs.ready to signal usb pullup

This change sets sys.usb.ffs.ready to 1 to
trigger configfs based enumeration.

Change-Id: I222495fc667cce59675579069d164b0b484f3653
sb_linux_client.cpp
0053bb3f1a4647e6b2deea3d7cf0a1965a3d9bad 21-Apr-2015 Elliott Hughes <enh@google.com> Add a test for shell escaping.

Until I fixed this, we would fail this example:

$ adb shell sh -c 'echo hello; echo world'
hello
/system/bin/sh: echo world: not found

Bug: http://b/19734868
Change-Id: I11a437cd0c0362303028f23fbaa103611b75707e
ests/test_adb.py
d236d071b960a387f536712f0314b99696167178 21-Apr-2015 Elliott Hughes <enh@google.com> Fix "adb sync" for devices without vendor and oem.

Bug: http://b/20440110
Change-Id: I2481992198890f5ca50412c2b7ca361101961413
ommandline.cpp
ile_sync_client.cpp
ile_sync_service.h
e434ad1dd799551830019a7bd2871dec226bdcd2 21-Apr-2015 Elliott Hughes <enh@google.com> Merge "Always explain why bind(2) failed."
14b65736c5ed487ebba93d3ccc3e261ece71f833 21-Apr-2015 Elliott Hughes <enh@google.com> Merge "Use ' quoting to escape arguments."
dc1e482b205ac6f04a4c1344bd0038e593a25ce3 20-Apr-2015 Colin Cross <ccross@android.com> Fix windows adb build

libc++ is not available on windows yet, but it already defaults to
static libstdc++.

Change-Id: I85a766ead84f71fe1f2f59be6ac739b0b833b6db
ndroid.mk
b2b06de5fc9605919a06d7757c8ef4a7a48f3e87 20-Apr-2015 Colin Cross <ccross@android.com> Merge "statically link adb and fastboot against libc++"
7b506090e1ac51f4990f17621c6e33847b0632a2 20-Apr-2015 Elliott Hughes <enh@google.com> Always explain why bind(2) failed.

This has confused several people lately.

Bug: http://b/20219978
Change-Id: I2537ceb83bff0b3166c230c728d4389a983db858
ndroid.mk
db.cpp
db_listeners.cpp
db_listeners.h
ransport_local.cpp
53daee6a2b415caa0ff3e425c7fa613c834bca61 19-Apr-2015 Elliott Hughes <enh@google.com> Fix the Windows adb build.

It looks like we can't use clang on Windows yet because libc++ isn't ready.
So move back to GCC for the Windows host clang. Work around the mingw
printf format string problems that made us want to switch to clang in the
first place, and #include "sysdeps.h" in adb_utils.cpp to work around the
absence of lstat(2) on Windows.

Change-Id: Icd0797a8c0c2d1d326bdd704ba6bcafcbaeb742f
ndroid.mk
db_utils.cpp
ommandline.cpp
5498adefb00cd979137361b98fcbf8d51f72ebeb 18-Apr-2015 Elliott Hughes <enh@google.com> Use ' quoting to escape arguments.

The specific motivating case is "text;ls;1.apk", but rather than continue
adding individual characters to the list of characters to be escaped, let's
just switch to quote all arguments with ', which only leaves ' itself to be
escaped.

Bug: 20323053
Bug: 19734868
Change-Id: I8bd71db9373bc2d1169fc11e46c889da6638550a
db_utils.cpp
db_utils_test.cpp
6c34bbaa6845a1c3ccb116d45b1a873ba6256fc8 18-Apr-2015 Elliott Hughes <enh@google.com> Use escape_arg in "adb backup".

This doesn't fix the injection vulnerability, but it makes "adb backup"
no worse than the other commands, and lets me fix them all at once.

Bug: 20323053
Change-Id: I39843c065d9d738b6b7943b2ffd660e4a031cc36
ommandline.cpp
ervices.cpp
a7090b94c181f3efe5b53d2c8367b78d99074dfe 18-Apr-2015 Elliott Hughes <enh@google.com> Remove yet more fixed-length buffers (and their overruns).

Bug: 20317724
Change-Id: If137fc96f5f23576ccecd388ac87afefa47337c6
db_main.cpp
db_utils.cpp
db_utils.h
ommandline.cpp
ervices.cpp
sb_linux_client.cpp
2083fa6b012ee9106a8a72b9ba94da714af846ab 18-Apr-2015 Elliott Hughes <enh@google.com> Switch adb over to clang.

Change-Id: Ib5511dcba56e80ffce6bc293d99251ccfd61c330
ndroid.mk
61a004c05f100741048d284fa527ac28c242d0bc 18-Apr-2015 Elliott Hughes <enh@google.com> Merge "Fix more buffer overruns."
5830577bd82fdb7c39555da20a4cf585b8bb376a 17-Apr-2015 Elliott Hughes <enh@google.com> Fix more buffer overruns.

Also add some tests.

Bug: 20323050
Change-Id: I9eaf3dc04efd85206663c4cca4f8c1208620a89a
ndroid.mk
db_utils.cpp
db_utils.h
db_utils_test.cpp
ommandline.cpp
emount_service.cpp
2940ccff8605e929cc56353254f29f37823fdda7 17-Apr-2015 Elliott Hughes <enh@google.com> Use PRI* macros to fix the Windows build.

Change-Id: Icd400be05c2bc726265832875b5a05dba7966847
ommandline.cpp
2baae3a876ada7e22986e92188f7933cae34ce3b 17-Apr-2015 Elliott Hughes <enh@google.com> Remove various fixed-length buffers (and their overflows).

Bug: 20323052
Bug: 20323051
Bug: 20317728
Bug: 20317727
Bug: 20317726
Bug: 20317725
Change-Id: I57a5e30a5b7867715f55cee7429aa36d7ce21484
ndroid.mk
ommandline.cpp
0b8ecb32908f0ccde550dd510f4a562239085806 17-Apr-2015 Elliott Hughes <enh@google.com> Merge "Remove extern "C" barriers to using C++."
2d4121c0dcc93382bcd7ea6476f433d8254919dd 17-Apr-2015 Elliott Hughes <enh@google.com> Remove extern "C" barriers to using C++.

Change-Id: Ic046d6aa540738cb46b54531bc59ba3b47b0136d
db.h
db_auth.h
db_client.h
db_io.h
db_listeners.h
db_trace.h
devent.h
ile_sync_client.cpp
ile_sync_service.h
dwp_service.cpp
emu_tracing.h
ervices.cpp
ockets.cpp
ysdeps.h
ransport.cpp
7be29c819b4fb8bf9b1d4b69a4333f8765de0281 17-Apr-2015 Elliott Hughes <enh@google.com> Show $ADB_VENDOR_KEYS if authentication fails.

Incorrectly set $ADB_VENDOR_KEYS is the most likely cause of failed
adb connections. Make it easier to debug such problems by including
the value in use in the error message.

Bug: 20165551
Change-Id: I64c1d98ae6d3fb40eea9e1f0ddcfcf4f2d9d7318
db.cpp
ervices.cpp
ockets.cpp
ransport.cpp
ransport.h
a4802ca08bfcbf0124f5e9b959ed4e3a198d5f46 17-Apr-2015 Dan Albert <danalbert@google.com> Merge "Move usb_osx to C++."
c4f8fa7b36a8ba397f1c0ad3c7fb5a5c09520272 17-Apr-2015 Dan Albert <danalbert@google.com> Merge "Link libraries needed for Darwin adb tests."
7447dd05bdc12b87687c49ee7ecf0fe50d8ab17a 17-Apr-2015 Dan Albert <danalbert@google.com> Move usb_osx to C++.

Change-Id: I21673211a702cc4f31d4311c36e2a4b22e55fac8
ndroid.mk
sb_osx.c
sb_osx.cpp
f8d6b9b1ef9c19769dd4a450390f9bdec17f11b3 17-Apr-2015 Dan Albert <danalbert@google.com> Link libraries needed for Darwin adb tests.

Change-Id: I1c3c3a7bbd3824f5f3a37ee80c24d1c2a9b98748
ndroid.mk
55bf5f0017a76df0a97ec35f092054ef6f33c713 17-Apr-2015 Colin Cross <ccross@android.com> statically link adb and fastboot against libc++

libc++.so is not widely available on the host, so we compile against
one built as part of the platform. This causes problems for adb and
fastboot, which are distributed through a number of channels - the
sdk, distro packages, downloaded from the build server, or manually
copied. Instead of forcing all users to handle libc++.so too,
statically link against libc++.

Change-Id: I51b75258653a23558c8b598802005f6c1166a439
ndroid.mk
a2f2e56796fef024c7374d033bd7d34af71fdf5a 17-Apr-2015 Elliott Hughes <enh@google.com> Move sysdeps_win32 to C++.

Change-Id: I27ca41b64d62bb3611b3a39a5c3bb4377d0773bc
ndroid.mk
ommandline.cpp
ysdeps_win32.c
ysdeps_win32.cpp
2acec9153e40a558671ec0544bdd89d5a7fabf08 16-Apr-2015 Elliott Hughes <enh@google.com> Switch usb_linux_client to C++.

Change-Id: I8172e81e6c4665aa16e9e8e0c33b048dbb9ad848
ndroid.mk
sb_linux_client.c
sb_linux_client.cpp
1a4d85a5e81bb98503966312a509c5a1e23f14d4 16-Apr-2015 Elliott Hughes <enh@google.com> Move get_my_path_darwin to C++.

As long as we have C in here, we can't use C++ in our headers.

Change-Id: Ibccaa77a5af506dc504aa9c39c8dca5dcdbeccab
ndroid.mk
et_my_path_darwin.c
et_my_path_darwin.cpp
284c5cb2a16d21e5d5123ae6a0d731dcc6beadca 07-Apr-2015 Sami Tolvanen <samitolvanen@google.com> Merge "Set verity mode as the verified property value"
dfa09fd635e341d5e47d67123a0e938710be5949 01-Mar-2013 Alistair Buxton <a.j.buxton@gmail.com> Disable CR/LF translation for adb interactive shell.

adb shell uses termios to disable canonical input processing in order to
get raw control codes but it does not disable CR/LF translation. The default
for Linux terminals is to convert CR to LF unless the running program
specifically asks for this to be disabled. Since adb does not, there is no
way to send a CR to any program run on adb shell. Many programs do in fact
differentiate and so are broken by this behaviour, notably nano. This patch
sets the termios flags to disable all line ending translation.

Change-Id: I8b950220f7cc52fefaed2ee37d97e0789b40a078
Signed-off-by: Alistair Buxton <a.j.buxton@gmail.com>
ommandline.cpp
09a45a1927415de1540ad9c94ed0052ef2eb2184 04-Apr-2015 Elliott Hughes <enh@google.com> Fix "adb devices -l".

Change 055f1aa4ff58ba71133d506b202ad46612758ded switched to using isalnum(3)
but didn't take into account that isalnum has the opposite sense to the
function it replaced, so the tests should have been inverted.

Bug: http://b/20056546
Change-Id: I90630c0bea69ddbb4a95dc09f79f49d23fd497de
ransport.cpp
bcc2b5f44a39c5843eea2449cad66b8dce8721ee 02-Apr-2015 Elliott Hughes <enh@google.com> Remove LOCAL_ADDITIONAL_DEPENDENCIES in cases where it's not needed.

Change-Id: I720b8ef1050da45a7833adef8219b6acb2cf3a38
ndroid.mk
454742392f72079dbdb0d23ea24e01b5703c1aa5 30-Mar-2015 Sami Tolvanen <samitolvanen@google.com> Set verity mode as the verified property value

Set the verity mode as the value for partition.%s.verified to make it
easier for userspace to determine in which mode dm-verity was started.

Change-Id: Icc635515f8a8ede941277aed196867351d8387cb
emount_service.cpp
175b7bbfb4d935e1867a1d6df14e6ef94f2db2f4 29-Mar-2015 Tao Bao <tbao@google.com> adb: Add option to reboot into sideload mode in recovery

Currently it requires manual key press to enter the sideload mode. This
CL adds 'adb reboot sideload' to reboot the device into sideload mode
directly with text display on. With 'adb reboot sideload-auto-reboot',
it will reboot after the sideload regardless of the installation result,
unless interrupted by user.

Since it needs to write to /cache/recovery/command file, 'adb root' is
required before calling 'adb reboot sideload' and the one with
'-auto-reboot'.

Also it requires the matching CL in bootable/recovery.

Change-Id: Ib7bd4e216a1efc01e64460659c97c6005bbaec1b
ndroid.mk
ommandline.cpp
ervices.cpp
868402e5bfcc14305f216f34751d6c2e150aa849 28-Mar-2015 Dan Albert <danalbert@google.com> Revert "Remove the emulator special case from the "adb root" code."

adb root doesn't work on the emulator, so this prevents root access
to a userdebug emulator.

Since the emulator has always been root even on userdebug builds, it
may be that adb root has never worked on the emulator.

Bug: 19974213

This reverts commit abd6773b41effd1e1005ad7ce8cb5e370a367302.
db_main.cpp
50184062b87a121458fff7d8bda6656c59c71c77 02-Mar-2015 Spencer Low <CompareAndSwap@gmail.com> adb shell: Win32: fix Ctrl-C, tab completion, line editing, server echo

The 'adb shell' command on Windows has had problems:

* Ctrl-C killed the local Windows adb.exe process instead of sending the
Ctrl-C to the Android device.

* Local echo was enabled, causing everything typed to be displayed twice.

* Line input was enabled, so the Android device only received input
after hitting enter. This meant that tab completion did not work because
the tab wasn't seen by the shell until pressing enter.

* The usual input line editing keys did not work (Ctrl-A to go to the
beginning of the line, etc.).

This commit fixes these issues by reconfiguring the Win32 console and
then translating input into what Gnome Terminal would send, in effect
somewhat emulating a Unix terminal.

This does not fix all Win32 console issues, but is designed to be better
than what we had before, and to make the common day-to-day usage much
more comfortable and usable.

Change-Id: Idb10e0b634e27002804fa99c09a64e7176cf7c09
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ommandline.cpp
ysdeps.h
ysdeps_win32.c
8743ef98414b336f222327253f2cde6bf6aee386 20-Mar-2015 Dan Albert <danalbert@google.com> Additional cleanup of start_device_log.

Addresses nnk's post commit review comments on
https://android-review.googlesource.com/#/c/139381/

Remove unneeded code for creating /data/adb.

Add an O_CLOEXEC.

Move the closing of stdin out to main().

Append the pid of the current process to the log file to avoid
clobbering the log if the process crashes and restarts within the same
second.

Change-Id: Ide0be86b4b33256486634c29ba02efaf10cf913d
db.cpp
db_main.cpp
ea2175ab6bae74409620374a96fc9a0097a1845c 09-Mar-2015 Dan Albert <danalbert@google.com> Use text based trace masks for adbd.

Previously the adbd trace mask had to be set as raw hex rather than
with the colon separated list. We all have better things to do than
memorize bitmasks, so make adbd use the same trace mask setting code
as adb.

Change-Id: I0bf0ab61c070d06d1cc2acf1ed90b2b77ccd261b
db.cpp
db_main.cpp
a16b0f4c3a7b6546690cbdbd3d63b5cdd2da4149 20-Mar-2015 Dan Albert <danalbert@google.com> Merge "The generic failure case disappeared..."
28f07697eb6f4039daae6c9c5efee67a4d85cc92 20-Mar-2015 Dan Albert <danalbert@google.com> Merge "File header cleanup."
08f66bc771ac798d89451a9b68a1c6722352d683 20-Mar-2015 Dan Albert <danalbert@google.com> The generic failure case disappeared...

Was manifesting as a write to a full disk hanging indefinitely.

Bug: 19846181
Change-Id: Ia581e0bbbb331c221bdb68882c238d0cb9f8a0b3
db_io.cpp
db_io_test.cpp
3313426fad9eaaf53017cdbde889ebcec91358ec 19-Mar-2015 Dan Albert <danalbert@google.com> File header cleanup.

* sysdeps.h should always be included first.
* TRACE_TAG needs to be defined before anything is included.
* Some files were missing copyright headers.
* Save precious bytes on my SSD by removing useless whitespace.

Change-Id: I88980e6e00b5be1093806cf286740d9e4a033b94
db.cpp
db_auth.cpp
db_auth.h
db_auth_client.cpp
db_auth_host.cpp
db_client.cpp
db_io.cpp
db_main.cpp
ommandline.cpp
devent.cpp
ile_sync_service.cpp
dwp_service.cpp
emount_service.cpp
ervices.cpp
et_verity_enable_state_service.cpp
ockets.cpp
ysdeps_win32.c
ransport.cpp
ransport_local.cpp
ransport_usb.cpp
sb_linux.cpp
sb_linux_client.c
sb_osx.c
sb_windows.cpp
683238c3c45628666a9eb0880a067a61358a4dfe 19-Mar-2015 Dan Albert <danalbert@google.com> Fix clang-format file for correct indent settings.

Change-Id: I8786baf33c0b84e3614e9d40c404eeef94b91236
/system/core/.clang-format-4
b4ebc475e678e1dce5e4c78436a0b2fc4813159d 19-Mar-2015 Dan Albert <danalbert@google.com> Merge "Fix memory leak on jdwp_process_free()"
64d9adcea807aa1d31574b5b3bb5aad4b9025134 17-Mar-2015 Pavel Labath <labath@google.com> Fix file descriptor leakage in adbd

adb_auth_init in adb_auth_client.cpp sets FD_CLOEXEC on the control
socket, which prevents the leakage. However if ro.adb.secure
property is unset (as it is on the emulator), adb_auth_init is not
invoked, which results in the control socket fd leaking into any
process started by the deamon (specifically, any command executed
through adb shell).

Split the fd cleanup into a separate function that is called
unconditionally.

Change-Id: I73ea84977542ddfc4ac20599593ecf3745ae9108
db_auth.h
db_auth_client.cpp
db_main.cpp
ec7a66713144a16361724fe88332b28bbf3f4b3c 16-Mar-2015 Elliott Hughes <enh@google.com> Revert "Revert "adb: support /oem partition""

This reverts commit 6084a0124f868c7ec43f6c415a27a168f27ff694.

The original build breakage is fixed by (a) building the verity
code for eng builds as well as userdebug builds and (b) moving
the exported remount service functions into a new header file.

Change-Id: Ice0c4f97d4db38ab7eb333c7a6e56bbd11123f5b
ndroid.mk
db.h
ommandline.cpp
ile_sync_service.cpp
emount_service.cpp
emount_service.h
ervices.cpp
et_verity_enable_state_service.cpp
6084a0124f868c7ec43f6c415a27a168f27ff694 16-Mar-2015 Dan Albert <danalbert@google.com> Revert "adb: support /oem partition"

This is broken on userdebug builds, and it isn't completely clear why. The declaration for make_block-device_writable in adb.h wasn't updated to match the definition (which uses a std::string instead of a char*). adb.h is currently extern "C", and it isn't clear why this is only broken for userdebug, so I'd like to revert while we investigate.

This reverts commit 81416fdb186070fe4db3ca5fed2e713a4eecaac1.

Change-Id: I47f321574f9f21052e2c7332e8b0f6ef9ab98277
ommandline.cpp
ile_sync_service.cpp
emount_service.cpp
81416fdb186070fe4db3ca5fed2e713a4eecaac1 03-Nov-2014 MÃ¥rten Kongstad <marten.kongstad@sonymobile.com> adb: support /oem partition

Add support for /oem partition in commands 'adb remount' and 'adb sync'.

Change-Id: I5defc74ccaa37feaef74b9268e22b4075f98a59f
ommandline.cpp
ile_sync_service.cpp
emount_service.cpp
98ff77204cef9bb8f0f27420833233622060a09e 14-Mar-2015 Dan Albert <danalbert@google.com> Create libbase.

Move StringPrintf and the string based file I/O from libutils to
libbase.

Change-Id: I0297a6063874b9d92100e0dd5123fddfbda932fe
ndroid.mk
db_io_test.cpp
46270d233a76b63497b5bcf456e00f6defd429bd 13-Mar-2015 Elliott Hughes <enh@google.com> adb doesn't actually use libzipfile.

Change-Id: Ia7d22214bc8422c88edaaf9bb716d7e12e0bb381
ndroid.mk
db_client.cpp
ile_sync_client.cpp
83ca56ac98c089dfa5d61f282353e9ae2024797e 10-Mar-2015 Dan Albert <danalbert@google.com> Fix build from -Werror=maybe-uninitialized.

This won't actually ever be uninitialized because the code will take a
failure path if the code that initializes it fails. The goto seems to
thwart this check though.

Not sure why this is only firing on userdebug builds yet. I'll look in
to it tomorrow.

Change-Id: Ie9d837d6baea255d2a4d169355b53dfd775eacce
et_verity_enable_state_service.cpp
bac3474a8256cb32a29e8d46f78cad95a5502692 26-Feb-2015 Dan Albert <danalbert@google.com> Move adb to C++.

I keep trying to clean things up and needing std::strings. Might as
well just do this now.

usb_linux_client.c is going to stay as C because GCC isn't smart
enough to deal with the designated initializers it uses (though for
some reason it is in C mode).

The Darwin files are staying as C because I don't have a way to test
that they build.

The Windows files are staying as C because while I can actually build
for them, it's slow and painful.

Change-Id: I75367d29205a9049d34460032b3bb36384f43941
ndroid.mk
db.c
db.cpp
db.h
db_auth.c
db_auth.cpp
db_auth.h
db_auth_client.c
db_auth_client.cpp
db_auth_host.c
db_auth_host.cpp
db_client.c
db_client.cpp
db_client.h
db_io.cpp
db_listeners.c
db_listeners.cpp
db_main.c
db_main.cpp
ommandline.c
ommandline.cpp
onsole.c
onsole.cpp
ile_sync_client.c
ile_sync_client.cpp
ile_sync_service.c
ile_sync_service.cpp
ramebuffer_service.c
ramebuffer_service.cpp
et_my_path_darwin.c
et_my_path_linux.c
et_my_path_linux.cpp
et_my_path_windows.c
et_my_path_windows.cpp
dwp_service.c
dwp_service.cpp
emu_tracing.c
emu_tracing.cpp
emount_service.c
emount_service.cpp
ervices.c
ervices.cpp
et_verity_enable_state_service.c
et_verity_enable_state_service.cpp
ockets.c
ockets.cpp
est_track_devices.c
est_track_devices.cpp
est_track_jdwp.c
est_track_jdwp.cpp
ransport.c
ransport.cpp
ransport.h
ransport_local.c
ransport_local.cpp
ransport_usb.c
ransport_usb.cpp
sb_linux.c
sb_linux.cpp
sb_windows.c
sb_windows.cpp
9b1fd969a7b7f1c6f1ed19719f21d57001d3c461 09-Mar-2015 Dan Albert <danalbert@google.com> Merge "Fix a writex transcription error."
f3519a8747c8ea4dd56c7df51c67a714e89fa32c 09-Mar-2015 Dan Albert <danalbert@google.com> Fix a writex transcription error.

Change-Id: I71b11127d41ebac6caf68926089c5a3b99d8c21e
ile_sync_service.c
857d7db69d2aac03ea624a0401e7231a3cef4597 03-Mar-2015 Dan Albert <danalbert@google.com> Make the root/unroot test more robust.

* Check the current adb user to choose the order of root/unroot.
* Re-root the device when finished.

Change-Id: I47a14b89e2c405bd63722e4d2043fcc629fb5e58
ests/test_adb.py
abb80e0f95f43b3ca066d9f80f4fe060a87e3f80 03-Mar-2015 SungHyun Kwon <sh.kwon@lge.com> Fix memory leak on jdwp_process_free()

if many jdwp connection are created(), the memory will be leaked.

When it deletes heap memory on jdwp_process_free(),
the proc->fde just set to null.

so it need to free() in fdevent_destory().
devent.cpp
268eb4f3846d551c73eb4fc5a505f9a70d47b638 26-Feb-2015 Nick Kralevich <nnk@google.com> check if uid=0 before attempting remount

If "adb remount" is done without having done "adb root" first,
scary looking SELinux denials are emitted before the operation
eventually fails. Avoid the scary looking messages by refusing
remount attempts if we're not running with privileges.

Change-Id: I298621251a10e38345ef77875003a97c8b5a0270
emount_service.c
cc731cc76786b6bdc58764aad9924c0d0c8d645f 25-Feb-2015 Dan Albert <danalbert@google.com> Test readx/writex (now renamed).

Renamed readx/writex to ReadFdExactly/WriteFdExactly respectively.
These read/write a full fixed-size buffer. If the whole buffer cannot
be read/written, these functions return an error.

Rename write_string to WriteStringFully.

Move the TEMP_FAILURE_RETRY definition in sysdeps.h out of the
!Windows section. It seems Windows won't actually interrupt a call,
but it's easier to just define it than to #ifdef each call.

Change-Id: Ia8ddffa2a52764a2f9a281c96c937660e002b9b9
ndroid.mk
db.c
db_client.c
db_io.cpp
db_io.h
db_io_test.cpp
db_trace.h
ommandline.c
devent.cpp
ile_sync_client.c
ile_sync_service.c
ramebuffer_service.c
emount_service.c
ervices.c
ockets.c
ysdeps.h
ransport.c
ransport.h
ransport_local.c
7fd821e907c4ee25ea4bdf7643c38bd679efdaca 25-Feb-2015 Dan Albert <danalbert@google.com> Remove _(GNU|XOPEN)_SOURCE makefile cruft.

None of the functions that require these are used.

Change-Id: I10cffab127795b94340131f8737f7924b9138f9e
ndroid.mk
055f1aa4ff58ba71133d506b202ad46612758ded 21-Feb-2015 Dan Albert <danalbert@google.com> Add some basic tests to adb.

Change-Id: I946b5b1e5650540db3b4f75892214c4218b3baf3
ndroid.mk
ransport.c
ransport_test.cpp
dc0f8ecb24f3a392fa51c85eee5f7fbe14da3a1e 25-Feb-2015 Dan Albert <danalbert@google.com> Fix the mac build.

Change-Id: Ieb6f2650ce5f39f1d8c938d0ca8cbec459d8e2fd
sb_osx.c
72bf2a710089b5fff42059d5946fe7bdd6b12480 25-Feb-2015 Dan Albert <danalbert@google.com> Merge "Move transport declarations into transport.h."
7664901a355b959f312e9acff5a0fd31b7139623 25-Feb-2015 Dan Albert <danalbert@google.com> Move transport declarations into transport.h.

There are a few cloexec issues in here as an added bonus.

Change-Id: I1699d719d733f47878bdba0454230cf5ab6a60b6
db.c
db.h
db_auth.c
db_auth_client.c
db_client.c
db_listeners.c
db_main.c
ommandline.c
ile_sync_client.c
ile_sync_service.c
ramebuffer_service.c
emount_service.c
ervices.c
ockets.c
ransport.c
ransport.h
ransport_local.c
ransport_usb.c
sb_linux.c
sb_linux_client.c
sb_windows.c
103c1be03f8ce8e4b12c1f194a7881d3381ea897 25-Feb-2015 Dan Albert <danalbert@google.com> Add .clang-format file.

Not going to format the whole world just yet, but this helps for `git
clang-format`.

Change-Id: I482819419647e4c752d3b044bde8d637e1fae1e5
/system/core/.clang-format-4
5329d3fd54fa875bb7de78a8c40134cc63921c64 25-Feb-2015 Dan Albert <danalbert@google.com> Merge "Add a project wide clang switch."
9697ce520d47500a72c95bb7f688ff2f273c9070 21-Feb-2015 Dan Albert <danalbert@google.com> Add a project wide clang switch.

I'll probably make this the default soon, but I'm not brave enough to
do that without checking the recovery image first.

Change-Id: I9cde687b08a588e3797645a308f381e4ec553447
ndroid.mk
70385f3017366ecf06af7a073a2fb955e93d01ba 25-Feb-2015 Elliott Hughes <enh@google.com> Merge "Remove the emulator special case from the "adb root" code."
b2e57b738f4d24e59235738e74dc2f9a8f53f64e 21-Feb-2015 Dan Albert <danalbert@google.com> Make Python tests only check the current device.

In practice testing all connected devices is a pain, since it's
probably each device is running a different build. It would probably
make sense to just move this functionality up into a higher level test
runner (which could just live in main).

Also rename test_devices to test_shell, since it doesn't really test
`adb devices`.

Change-Id: Ie96d3e83b30acfac4e3bcbd9821690c0ad4d2f7e
ests/test_adb.py
fdf8722491cf5fd21b5d897578c24fec4bb62682 24-Feb-2015 Dan Albert <danalbert@google.com> Fix Mac build.

Prior to https://android-review.googlesource.com/#/c/134253/ the
makefile had assumed !Windows was the same as Linux, so the Mac was
actually getting all the Linux sources as well. I mistakenly didn't
add fdevent.cpp to the Darwin sources in that change.

Change-Id: I4e12a394e9a2baf7c1e3c711a01a6b5fccbf79d9
ndroid.mk
abd6773b41effd1e1005ad7ce8cb5e370a367302 24-Feb-2015 Elliott Hughes <enh@google.com> Remove the emulator special case from the "adb root" code.

The emulator is essential an "eng" build, so the regular properties
should suffice.

Change-Id: Id63b3918f9b0b04b0d887ed886535b9976a9cc85
db_main.c
88cf1c8c4ac986b89d90eed798f51fa007787db0 24-Feb-2015 Dan Albert <danalbert@google.com> Fix Windows SDK build.

Change-Id: I9c0f9c92c28867ff17f1ec83aac935d18348c335
ndroid.mk
3b967f52f2d859c736028b8c5983fd759c5e62b6 24-Feb-2015 Elliott Hughes <enh@google.com> Add missing <stdlib.h> to adb_listeners.c.

Change-Id: If9505880a33131b27bfaa19f3efd45c83a6810ed
db_listeners.c
a75b4935a4b667f0d37372db7559ecc6f8ee0b0d 24-Feb-2015 Dan Albert <danalbert@google.com> Merge "Move more into libadb and libadbd."
9f3540d017f881768ec3a317d3149edd6a50fab9 24-Feb-2015 Dan Albert <danalbert@google.com> Merge "Oops. Fix make variable name. Thanks again, make."
8ef39424e8ef58ea09addb4a1f3e7d1c45b30cb3 24-Feb-2015 Dan Albert <danalbert@google.com> Merge "Ignore another stupid lint warning."
b627a0e2ed63377c828b1f324dd0120fee4e4cd3 18-Feb-2015 Nanik Tolaram <nanikjava@gmail.com> Add more logging message and dead code

* Add more logging message to aid in easier debugging

* Remove unnecessary dead/commented code

Change-Id: I9c7fe8f6b674cab41601001458010ab176b89776
Signed-off-by: Nanik Tolaram <nanikjava@gmail.com>
ile_sync_client.c
ockets.c
sb_linux.c
3c43858986ff9b6804fb52029b9d12461f49fcae 21-Feb-2015 Dan Albert <danalbert@google.com> Move more into libadb and libadbd.

None of this needs to be shared with minadbd, but these sources are
still needed for anything linking libadb (such as tests).

Change-Id: I3024f714da42364bf27a991986f00676e2bbbf2c
ndroid.mk
bf10647b61704a8dbe01b7381ebed5aefaa074e0 21-Feb-2015 Dan Albert <danalbert@google.com> Oops. Fix make variable name. Thanks again, make.

Change-Id: Iecbb41acc835bb8eb20b668c89a3ff065470fcb7
ndroid.mk
db_listeners.c
f1591691ee12c9156f2ec9397cc6818542e39263 21-Feb-2015 Dan Albert <danalbert@google.com> Ignore another stupid lint warning.

Change-Id: I8e586e472a139cc3039f1371f8a99935d20aa0f0
PPLINT.cfg
7e84308b74e2757d19610aaf8653aa1e244b8149 20-Feb-2015 Dan Albert <danalbert@google.com> Merge "Lose adb.c and sockets.c to libadb."
e1ca623faa278a264981b088fb608b2a62727ab1 19-Feb-2015 Dan Albert <danalbert@google.com> Lose adb.c and sockets.c to libadb.

Also kill the device side libadb. This was added for the now dead
device side adb, and is no longer used.

Bug: 17626262
Change-Id: I3b28915641fd5b4f16fc86cf1f4f4e9711093001
ndroid.mk
18daa159ec5f8455f83dd87dad1a1ed1d2501b3e 19-Feb-2015 Dan Albert <danalbert@google.com> Merge "Document the behavior of props affecting adb root."
13f9c406d7ae58bb3f5c3ac0b0e50f8760c5cf46 19-Feb-2015 Dan Albert <danalbert@google.com> Document the behavior of props affecting adb root.

Change-Id: Icfdc3ba696556d6db64835e61dde6f40b491d1a7
db_main.c
6795cd8db5ffab674f2a477d8b7b8cc0e3ab406e 19-Feb-2015 Dan Albert <danalbert@google.com> Fix Windows adb build.

Change-Id: I560bedfcf77556b36acadc19f5dac71b3628ea2b
db.c
db_listeners.c
db_main.c
bd0b750897bebaa10e16507fdd08dbc746cd228d 19-Feb-2015 Dan Albert <danalbert@google.com> Move adb_main to its own file.

Change-Id: If6e98c089b39f73bd8f4a878a82669bfeee367f3
ndroid.mk
db.c
db.h
db_auth.c
db_auth.h
db_main.c
e9fca14c9e555a9d02e1d94ba6d3b290673ea26b 19-Feb-2015 Dan Albert <danalbert@google.com> Move the listener code into its own file.

Change-Id: I7332455ed1a213daedeaa4a81260edf08b2fd131
ndroid.mk
db.c
db_listeners.c
db_listeners.h
ransport.h
ba3a251749c88210949008ae26f8bc04812084c1 19-Feb-2015 Dan Albert <danalbert@google.com> Move the adb auth code into its own file.

Change-Id: I84cf0bd7777f0147119e7c6afc4096c2e93156a2
ndroid.mk
db.c
db.h
db_auth.c
db_auth.h
1403aa36b2d9d0c295402a935bb07ea661536fcb 19-Feb-2015 Dan Albert <danalbert@google.com> Merge "Move emulator tracing into its own file."
21c3eaf4cc46aa835531b0cf1e0ca177046a14ed 19-Feb-2015 Dan Albert <danalbert@google.com> Move emulator tracing into its own file.

adb.c is far too monolithic.

Change-Id: I4a9ee97927e4a96a38ea5859d84efac86bfdfc35
ndroid.mk
db.c
emu_tracing.c
emu_tracing.h
4c9d24a3edaa86df458b3c5937e77d07cd51e3a7 19-Feb-2015 Elliott Hughes <enh@google.com> Fix build.

Change-Id: I31fc562068ebbba5e9872ee91694feb611fc957f
db.c
8e16a7e2a3506b6f526a503bd03e3919235dde71 19-Feb-2015 Elliott Hughes <enh@google.com> Merge "adb: add "adb unroot" to restart adb in non-root mode"
9885881d0689e7999f2d7e7558e894dc73a0a0b0 06-Oct-2014 Dan Pasanen <dan.pasanen@gmail.com> adb: add "adb unroot" to restart adb in non-root mode

Change-Id: Ice6b94a71a62648ac073d129914a07372411fb25
db.c
ommandline.c
ervices.c
ockets.c
ests/test_adb.py
9449376328daa7c726ec693637fcdf1d3985640a 25-Nov-2014 Dan Albert <danalbert@google.com> Move USB transport code to libadb.

Also note that we need both a libadb and a libadbd (for now) to
differentiate between code using ADB_HOST=1 and ADB_HOST=0.

Bug: 17626262
Change-Id: I873a8fb442a8a69258fe39af17781714a8fae4f6
ndroid.mk
1ac334ec660292298917668a40fc5239b1fdaa56 18-Feb-2015 Dan Albert <danalbert@google.com> Merge "Add extern "C" to all the adb headers."
818fb4b448a44ef9f1db85f66415fde4b7a96aa6 18-Feb-2015 Dan Albert <danalbert@google.com> Add extern "C" to all the adb headers.

Change-Id: Iaefa3e18d6ee2e065eb97271a796613b2a8e7d6e
db.h
db_auth.h
db_client.h
db_trace.h
ile_sync_service.h
ysdeps.h
54ac73aa343f25391e7b3c2e56eacacfa868a8ea 18-Feb-2015 Dan Albert <danalbert@google.com> Ignore useless cpplint messages in adb.

Change-Id: I6411eb3963d215b228e50cd967a2174e5036ed73
PPLINT.cfg
a859219fec34ea0207c97a225c9f3fe451fc1209 03-Feb-2015 eric.yan <severecold@gmail.com> fix bug that passing invalid fd to fstats on win32 builds

lfd returned by adb_open is not the actual file desc.
on win32 builds. calling through fstat with invalid fd
will lead to crash, using stat instead.

Change-Id: I7fdc8b825162eaa42efe8755265842c300b00e39
Signed-off-by: eric.yan <eric.yan@yulong.com>
Signed-off-by: severecold <severecold@gmail.com>
ile_sync_client.c
187eade1279e592de7d3ac87f4924593f02c7ef6 03-Feb-2015 Elliott Hughes <enh@google.com> Remove netcfg's unused options.

Only "netcfg" for a list of interfaces and "netcfg <interface> dhcp" still
seem to be used.

Change-Id: I9f0b580474258fa648deb5287f98d8ec5533ca6f
db.c
c463025a19aff3f9f92cffa3de6462316e8407a7 03-Feb-2015 Elliott Hughes <enh@google.com> Revert "Remove netcfg's unused options."

This reverts commit f8e83054cb8a8b13ee84a4aeeaa0a2fd8debca81.

Change-Id: Iede772f96ff9008277df433dcbb5f6603de65283
db.c
f8e83054cb8a8b13ee84a4aeeaa0a2fd8debca81 02-Feb-2015 Elliott Hughes <enh@google.com> Remove netcfg's unused options.

Only "netcfg" for a list of interfaces and "netcfg <interface> dhcp" still
seem to be used.

Change-Id: Iaf499c06b09ffe5e0925339b9cd6e502f3234a86
db.c
506aea43618ec101917bb670b7487fa226e88233 31-Jan-2015 Elliott Hughes <enh@google.com> The bsddroid project has been dead since 2010.

And even if it wasn't, they should probably keep this stuff in their own
repository.

Change-Id: If9fa2e47ee2700098d8a99f6986f7e89fc6dfdf3
ndroid.mk
et_my_path_freebsd.c
sb_libusb.c
9c4c5a6ed934490ba0fcce661594975a6f4c2c89 28-Jan-2015 Sami Tolvanen <samitolvanen@google.com> Merge "Verify token length before adb signs it"
a034362be4dc69d3432d7587089d371dc871e811 28-Jan-2015 Elliott Hughes <enh@google.com> Merge "Make server port option work on windows"
0de77ffec6b4096f334bd45f48a6210915c6d1af 26-Jan-2015 Spencer Low <CompareAndSwap@gmail.com> adb: tracing: don't make strings if runtime tracing is disabled

If tracing was not enabled (the ADB_TRACE environment variable was not
set specially), writex() and readx() would still call dump_hex() which
would construct hex tracing strings, which would be immediately
discarded and not printed (because tracing is not enabled).

The fix is to only call dump_hex() if ADB_TRACING evalutes to true, the
same way that dump_packet() is only called if ADB_TRACING evaluates to
true.

Change-Id: I1651680da344389475ebdeea77ba1982960d5764
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ransport.c
7b9c20d3b2aad8b2f67de9478d3d44cc6deff52c 27-Jan-2015 Sami Tolvanen <samitolvanen@google.com> Verify token length before adb signs it

Currently, a host running adb will sign a token of any length passed
to it by a device, effectively acting as a signing oracle. If the
ADB_VENDOR_KEYS environment variable is used to specify an additional
key to use, this behavior is not only unexpected, but probably also
unwanted. Further discussion can be found from this thread:

http://www.metzdowd.com/pipermail/cryptography/2015-January/024423.html

This change adds a check to ensure token length matches TOKEN_SIZE
before it's signed, which prevents an attacker from signing longer
messages.

Change-Id: I7b2cc1f051941bf9b66e1c02980850bede501793
db_auth_host.c
f055c193b85b5bc077a4e278f84f33a266edccf7 25-Jan-2015 Spencer Low <CompareAndSwap@gmail.com> adb: Win32: set socket buffer sizes properly

On Windows, adb_socket_setbufsize() was taking a file descriptor value
from the compatibility layer in sysdeps_win32.c (namely, an index into
the _win32_fhs array) and passing it to the Winsock setsockopt() call,
which wants a Winsock SOCKET handle. Basically, adb_socket_setbufsize()
was passing `fd` instead of `_fh_from_int(fd)->fh_socket`, resulting in
adb effectively setting a socket buffer size on a random socket in the
process.

The fix is to introduce adb_setsockopt() which just calls setsockopt()
on non-Win32, and which uses the Winsock SOCKET handle on Win32. The
change also moves Win32 disable_tcp_nagle() to a header and adds an
extra sanity check to adb_shutdown().

Change-Id: I4354e818d27538f7ff5b0e70b28bdb6300e1b98b
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ommandline.c
ysdeps.h
ysdeps_win32.c
1f09bdaf598636095da97e4e0eb3df7b1630e16f 27-Jan-2015 Dan Albert <danalbert@google.com> Protect from eng vs userdebug build breaks.

Using a const bool rather than an ifdef means the compiler can still
protect us from breaking code paths that aren't included in every
build variant.

Change-Id: Ic45c8fb52cd66c3ce090d760cdb92104e31265f5
et_verity_enable_state_service.c
fe68578716290d93fd42005622adade8d345de3c 27-Jan-2015 Dan Albert <danalbert@google.com> Merge "Fix userdebug build."
030b76fc1d2884b8bafb2bdcd4d9947b351d627d 27-Jan-2015 Dan Albert <danalbert@google.com> Fix userdebug build.

Apparently this code I thought was unused is just unused for eng
builds...

Bug: 17626262
Change-Id: I2e5f411a2ead7f23d9f5822935de66c992750a03
ndroid.mk
et_verity_enable_state_service.c
4626b7105763f0f5d25343dc81523ff2e9bda180 27-Jan-2015 Dan Albert <danalbert@google.com> Fix win_sdk build.

Hadn't caught this in the previous submission because I tested the
build with another change on top of it that also fixes this.

Bug: 17626262
Change-Id: Ia40127618a5466e382081760d614ff7fc09d50a3
ndroid.mk
630b9afeb0d7f0e5e053db0f900cfb65d914cb1a 25-Nov-2014 Dan Albert <danalbert@google.com> Begin moving code from adb to libadb.

Much of adb is duplicated in bootable/recovery/minadb and fastboot.
Changes made to adb rarely get ported to the other two, so the trees
have diverged a bit. We'd like to stop this because it is a
maintenance nightmare, but the divergence makes this difficult to do
all at once. For now, we will start small by moving common files into
a static library. Hopefully some day we can get enough of adb in here
that we no longer need minadb.

Bug: 17626262
Change-Id: Ic8d5653bfcc0fec4e1acbece124402355084b864
ndroid.mk
db.h
devent.c
devent.cpp
devent.h
et_verity_enable_state_service.c
ysdeps.h
ransport.h
fb538fb13d930a7398695d1044ceaaf854949018 26-Jan-2015 Christopher Ferris <cferris@google.com> Merge "Fix the v2 descriptor handling."
c49f51c451516bf06afc6d71947eb11cc4627273 24-Jan-2015 Christopher Ferris <cferris@google.com> Fix the v2 descriptor handling.

There was a misinterpretation of how the v2 header works. The flags
in the header indicate what is in the rest of the structure.

Bug: 19127803

Change-Id: I5fa0dae6da51522c9afc4c94838eb6f462208683
sb_linux_client.c
943ef23b3de60c92a219e65aee35ae6242a461dc 26-Jan-2015 Spencer Low <CompareAndSwap@gmail.com> adbd: tcpip command uses port number from uninitialized memory

If you run `adb tcpip`, adbd tries to process a string of 'tcpip:' using
this code:

} else if(!strncmp(name, "tcpip:", 6)) {
int port;
if (sscanf(name + 6, "%d", &port) == 0) {
port = 0;
}
ret = create_service_thread(restart_tcp_service, (void *) (uintptr_t) port);

If a zero-length string is passed to sscanf(), it returns EOF (-1) which
causes the if statement to skip the block, leaving the port variable
uninitialized.

I found this by running `adb tcpip` and sometimes getting 'invalid port'
and sometimes a device would start listening on a random port number.

The fix is to check the sscanf() return value for the success case (the
number of items successfully parsed), as is already done in other parts
of the adb code. I also fixed-up another instance of the same
code-pattern in services.c.

Change-Id: I8c9c33485ad076828da0ac74f048fdad561669d3
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
ervices.c
1bc38a4cdc74f477b99185125089f20411baf431 23-Jan-2015 David 'Digit' Turner <digit@google.com> Merge "adb: Fix 'adb forward --no-rebind'."
f0e0c2e458580129a02b383f1eccc0984fcc0966 22-Jan-2015 David 'Digit' Turner <digit@google.com> adb: Fix 'adb forward --no-rebind'.

Due to a typo, the --no-rebind option never worked (it always failed).
The root of the problem was that the client was sending on the wire
a command like:

host:forward:norebind::tcp:<port>;tcp:<port>
^^
Instead of:

host:forward:norebind:tcp:<port>;tcp:<port>
^

Note the erroneous double-column.

The fix is local to the adb client and thus doesn't require a new
version of the server or guest adbd on the device-side.

This also fixes 'adb reverse --no-rebind'.

See https://code.google.com/p/chromium/issues/detail?id=451109

Change-Id: I680fd432b5470072f6a9968ca32a7f90c600ac68
ommandline.c
d83a9c55f46017627821787b6405b75682f1d391 09-Dec-2014 Riley Andrews <riandrews@google.com> Python unit test for adb.

Change-Id: I1b2b8004f47b708e6a1d6a4ad20816e7beb21a0f
ests/test_adb.py
0a049b1d8dbb1877fd9cd3ca7c3f39e72b3b6c04 12-Jan-2015 Elliott Hughes <enh@google.com> Clean up adb Win32 symlink #ifdefs.

Change-Id: I83ef30e82d820f91960c29f6b737e6e900caaca6
ile_sync_client.c
ile_sync_service.c
fdb3da5953b70dc87a05d28c31cb0dc06b8181aa 06-Jan-2015 Yabin Cui <yabinc@google.com> Merge "Use getmntent when accessing /proc/mounts."
d6bd9bf45968cb97ed88a4e06c40a127625897b1 02-Jan-2015 Yabin Cui <yabinc@google.com> Use getmntent when accessing /proc/mounts.

Bug: 18887435
Change-Id: I6d7f95bbdb976428d4722bd640745e73c9839160
emount_service.c
13449cd71464c3a644109c469a77bd7fd56c8af8 02-Jan-2015 Sami Tolvanen <samitolvanen@google.com> Fix disable-verity when the underlying block device is RO

If verity is enabled and the underlying block device is marked
read-only, disable-verity fails. We cannot use the existing code
for enable-verity to make the device writable as the device in
/proc/mounts will be the verity device instead of the underlying
device we want to change. This change makes the correct device
writable when altering verity state.

Change-Id: I423ee50fb34d78cff2fe843318b9081c03c5142d
db.h
emount_service.c
et_verity_enable_state_service.c
2bd412425981c590f6de6e16848b7c59c173c18d 12-Dec-2014 Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org> Fix build with clang

Remove 2 unused functions and 1 unused label in the
!ALLOW_ADBD_DISABLE_VERITY case

Change-Id: Id6b29f57bcb95e54f5a4014021d47d8ca6e4556e
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
et_verity_enable_state_service.c
4d04d24b9e668fa532782e7c9e53bb9f66ecd1ab 12-Dec-2014 Riley Andrews <riandrews@google.com> fix memory leak in copy_remote_dir_local

Bug https://code.google.com/p/android/issues/detail?id=82436


Change-Id: I4bfa865638742e1b7cedd17f5b33dcc10c7f711c
ile_sync_client.c
058932c4ff89b7d42734cba0a7aa7805c2859a11 10-Dec-2014 Chih-Hung Hsieh <chh@google.com> Remove unused local variable.

Clang compiler gives it a warning and error.

Change-Id: Id35b740e265b393b5e31e05bd83544f391d8ff08
emount_service.c
98f58e83c0f2a282c70706f9cc3c25edc7a2e756 06-Dec-2014 Riley Andrews <riandrews@google.com> Fix some style issues in adb_commandline().

Change-Id: I8ed7899e7e137405594b3f3cbb0a87eae411dfc9
ommandline.c
c8514c886e2103d1c4f3f74d5a94472396615b3b 06-Dec-2014 Riley Andrews <riandrews@google.com> Refactor the host adb argument parsing loop to remove a goto

Change-Id: I3412ac473abc4efa51a6275658e65f7191b5439d
ommandline.c
1d931bca26331c82777a1a75579a2d7405d5c49b 04-Dec-2014 Paul Lawrence <paullawrence@google.com> Fix build

(cherry-pick of 731136ca36bb7af1490856373d463e3a6c4df1c8.)

Change-Id: I9b493fd5fc5c5f62f02bc5234ccca2a5118380b4
et_verity_enable_state_service.c
982089d83879c768eac3fd36f19665463a550b53 04-Dec-2014 Paul Lawrence <paullawrence@google.com> Add adb enable-verity

Note that it is *easy* to break your phone with this feature. It is
not a bug that reenabling verity after changing one byte of the system
partition stops the device booting.

(cherry-pick of 7c442e1700e6312727283db402dec6f666f1b55a.)

Bug: 18529433
Change-Id: I632e91281884471a362960f1ba30312d2669b8ff
ndroid.mk
db.h
ommandline.c
isable_verity_service.c
emount_service.c
ervices.c
et_verity_enable_state_service.c
ec900bba20630934dc51a1b3a57d6d7a30fed325 09-Oct-2014 Paul Lawrence <paullawrence@google.com> Revert "Revert "Enable verity on userdebug, and add disable-verity to adb""

This reverts commit 152d2d4234ba89e0c20c4af13e291b6049a7bc33.

Fixed build error, and also fixed memory leak spotted from warning.

(cherry-pick of bbb36319119edde9377fb80015235893c30d2bc9.)

Bug: 17691572
Change-Id: I23b5ba537f7b557432041d4338b38b9be434e981
ndroid.mk
db.h
ommandline.c
isable_verity_service.c
ervices.c
34637555c25a6663658b1ff45e98272b10b449f4 27-Oct-2014 Paul Lawrence <paullawrence@google.com> adb warns on remount when verity is enabled

(cherry-pick of f643beced1d154726dca7115014d2d1fdfcca993.)

Bug: 18119147
Change-Id: I75e5edf83fa01dbf2495e24df4597dce41f13654
emount_service.c
ab3446dd3400652ecf50682d0e5c4184628e9930 28-Oct-2014 Badhri Jagan Sridharan <badhri@google.com> adbd & fastbootd: Support for new f_fs descriptor format

The patch "[RFC] usb: gadget: f_fs: Add flags
to descriptors block" marks the current
usb_functionfs_descs_head format deprecated
and introduces support for sending SuperSpeed
descriptors.

This CL makes adbd to send Descriptors in the
new format. Adbd would fall back to the old
format, if kernel is not able to recognize
the new format. This is done to prevent
adbd from breaking in the older versions
of the kernel.

(cherry-pick of fad60336daa5a7adf82d8140cbddd1c735770e71.)

Bug: 17394972
Change-Id: I05095ccdcc74bf6953cbef847d7583eab137e12e
Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
sb_linux_client.c
298b6c70a084e87e688d19d1b3d609410121cf1d 23-Aug-2014 leozwang <leozwang@google.com> Fix build on mac.

On mac require a case.
Also, this code is not portable, will fix it in long run.

(cherry-pick of 0f1fda9ee80ba086e4c8960a7d153798e3cf3285.)

Change-Id: I76194b62cea29bd3d21c7ba6c3da4d549bea4738
ysdeps.h
cbf0267f5b508f6933631e661a5be86f0bd89ed1 15-Aug-2014 leozwang <leozwang@google.com> Add more debug information.

Re-commit https://googleplex-android-review.googlesource.com/#/c/519430/
Add fix for win_sdk build.

Add socketpair debug log.
Also output thread information in log on host side.

(cherry-pick of adb09fa01a16d8c5c92c2f8d325e1678c531223f.)

Change-Id: I21021bc111a3f7362a91b70593e3738125878118
db.h
db_client.c
db_trace.h
devent.c
dwp_service.c
ervices.c
ysdeps.h
ransport.c
67a7a4ae274ebd873a78e791b96da35a210db0cc 06-Nov-2014 Christopher Ferris <cferris@google.com> Fix adb/fastboot windows compilations.

Many of the windows files where not including stdlib.h even though they
are using malloc/free calls.

(cherry-pick of ae7bf0959bd3f79afbf365e41f015ed1c304afdc.)

Change-Id: If6959df9909d9d9928e9f4a2a96018166361cf3c
db_auth_host.c
ysdeps_win32.c
sb_windows.c
02ef15f1d7cc6f47b041eb34e7d9d2ef37ff866d 10-Dec-2014 Elliott Hughes <enh@google.com> Merge "Introduce "adb keygen""
dbb7c46d686e55aabd52a8e4c5494768c8955a2f 08-Dec-2014 Elliott Hughes <enh@google.com> Merge "ADB on linux: Handle USB SuperSpeed extra Descriptors"
bea3f9c345073069151c9000cd506b9e46b26250 14-Nov-2014 Nick Kralevich <nnk@google.com> Introduce "adb keygen"

Introduce the "adb keygen" command.

Usage: adb keygen <filename>

This command creates an adb public/private key pair in a user
specified file. This can be used to create new adb keys, or rotate
existing keys.

Modify adb's key generation routines to use the HOSTNAME/LOGNAME
environment variables if available. This allows someone to override
the username/hostname embedded within the adb public key file if
desired. Fallback to the old mechanisms if those environment
variables aren't available.

Bug: 18342715
Change-Id: Ibccee6088d4609aa05ad6687d3a1d8a8689d3e8a

(cherry picked from commit af782b9f2ac4fb817ded80d4317a45345bb3f992)

Change-Id: Ic76ffc9412171dddc879af0bbf6e20fbe1a8f057
db_auth.h
db_auth_host.c
ommandline.c
a5e9b065efcd2ee91a7a9bee4a44d85c5d30cf13 08-Dec-2014 Elliott Hughes <enh@google.com> Merge "adb: enable superspeed support"
d6ee9f26a5163af4121f4380264fcbd4e6851a17 02-Sep-2014 Zhuang Jin Can <jin.can.zhuang@intel.com> adb: enable superspeed support

Change-Id: I5a350bfa5641365d7a0939d89c6f477c335e948a
Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com>
Signed-off-by: Robert Chiras <robert.chiras@intel.com>
sb_linux_client.c
b79a2d55f7c514357da3486a1d72b3fe31661207 07-Dec-2014 Trevor Drake <trevordrake.gerrit@gmail.com> Clean up adb/Android.mk

Removed redundant LOCAL_C_INCLUDES.
Switch from using libunz to libz

Change-Id: Ic90c582fa56453bbac09561158e73f240dd47503
ndroid.mk
023bc0a426d0500904d5a9d2ddf4b7dfecf9ce6a 03-Dec-2014 Elliott Hughes <enh@google.com> Merge "Fix deadlocks."
97ac0e1bb42ddd17c75691ecbe1df8a6520d4c81 22-Nov-2014 Elliott Hughes <enh@google.com> Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN.

Change-Id: I9e25ac9d27e95b04fb8bf7a66c619af0139d8b8f
db.h
ile_sync_service.h
ransport_local.c
ransport_usb.c
8432ddc822ac98f64ae87a2b1352bf76ffc6c90e 21-Nov-2014 Ajay Dudani <adudani@codeaurora.org> system/core: Remove AID_GRAPHICS from adb groups

Remove AID_GRAPHICS from adb access groups to limit framebuffer
access.

Change-Id: I7fc6dca8b02a45d67d1ecc4a4daf6c38741ffb94
db.c
c66aed8a14ac6227378c90085d8e42625ceabf9e 21-Nov-2014 Elliott Hughes <enh@google.com> Remove the adb usb vendor id whitelist.

If there are bad vendors, we should blacklist them. Whitelisting the entire
world is crazy.

Change-Id: I1f4c27fd34fc420e2a3b4b2c8749198030db69f1
ndroid.mk
db.c
sb_vendors.c
sb_vendors.h
97e1e1704245d4c2edd8a9e155669aaae7341b7d 21-Nov-2014 Elliott Hughes <enh@google.com> Merge "Disable vendor id filtering for OS X."
0750f78659758352490e599d057a39dc44e93340 21-Nov-2014 Elliott Hughes <enh@google.com> Merge "Remove explict use of ASCII encoding"
01d49e854fa09a776c9673b229efcfa2d53adfea 21-Nov-2014 Elliott Hughes <enh@google.com> Merge "adb: Add USB vendor ID for Ubiquiti Networks, Inc."
2a4b5f9e804f019c0d565c86579f07963989ed1b 21-Nov-2014 Al Sutton <al@funkyandroid.com> Remove explict use of ASCII encoding

Replace the use of CFStringGetCString with kCFStringEncodingASCII specified
with CFStringGetFileSystemRepresentation which will ensure the correct
character encoding is used to conver the CFString into a NULL terminated
char array suitable for use with POSIX APIs.

Change-Id: Ibab1dc05c4f4db8604d329a493b4241992b8e69d
et_my_path_darwin.c
8e01cc6e0be65b395e226301f2f45a9cc6f10cf9 21-Nov-2014 Al Sutton <al@funkyandroid.com> Disable vendor id filtering for OS X.

Companion patch for change I2bf583a27f9a3f98ef006ea62b906a4f89960507.

Due to the use of USB class 0xff it's not possible to register a listener
which uses the OS methods for filtering notifications, so this patch
also introduces a check in the notification listener which checks the
class, subclass, and protocol for the interface each notification relates
to.

Change-Id: I380cc80f96addc5057660efb2179b35f9378886a
sb_osx.c
aa3e17e1b685218cddeb7a05e68ff1721a322147 20-Nov-2014 Elliott Hughes <enh@google.com> Merge "Return path including executable instead of without"
26b53bb75e6bdf9aa7820a3343845dae145625cc 20-Nov-2014 Al Sutton <al@funkyandroid.com> Return path including executable instead of without

The previous implementation returned the path the executable was in instead
of returning the path including the executable (i.e. it returned ...bin
instead of ...bin/executable). This is not what the original methods did
and caused the process forking of adb to fail.

This patch corrects the implementation.

Change-Id: Ib58497cab35706041f170c1bc97c31fd5d965f90
et_my_path_darwin.c
55664906a89058ae8d7521e20b24273508f6bf9b 20-Nov-2014 Elliott Hughes <enh@google.com> Disable vendor id filtering for Linux.

It's time we switched to blacklisting any problematic devices rather than
slowly whitelisting the entire world. This seems to work for me, but let's
see how other people get on before coming back to actually remove the list.

We'll also need to find a Mac to test the equivalent Mac change.

Change-Id: I2bf583a27f9a3f98ef006ea62b906a4f89960507
ransport_usb.c
sb_vendors.c
f456d47c506d87265ce0ff6080cba5374dced011 19-Nov-2014 Al Sutton <al@funkyandroid.com> Fix building on modern versions of Xcode and OS X.

Recent versions of XCode fail to compile the adb and fastboot binaries due to
two functions being deprecated in 10.9 (GetCurrentProcess and
ProcessInformationCopyDictionary), and the use of -Werrror.

This patch replaces the method implementations which use calls to methods
deprecated in the 10.9 SDK with versions which only call non-deprecated methods.

Change-Id: I855bf26aff45093ca9022924f3ecd1b80f2305a8
et_my_path_darwin.c
868cf42557fc9ce96ffa90886f014a8f2e60e1ff 03-Oct-2014 Jeremy Chang <jeremy@ubnt.com> adb: Add USB vendor ID for Ubiquiti Networks, Inc.

Change-Id: Iedb86b9ff8dc55aea5d0df201a98c96418002207
Signed-off-by: Jeremy Chang <jeremy@ubnt.com>
sb_vendors.c
0655d38b0c998f294ad52f1f8e84233a48046e97 18-Nov-2014 Elliott Hughes <enh@google.com> Merge "Revert "adb: Add USB vendor ID for Honeywell""
3e01bb85d622ae87956c8be78e8ccb82f20b5fd8 18-Nov-2014 Elliott Hughes <enh@google.com> Revert "adb: Add USB vendor ID for Honeywell"

This reverts commit 8c4c8e8988411449ecb2f50c25d3e4188e81e7c0.

Change-Id: Ia1cad862f42e5bea3174ed2cc0eea5232fc0a858
sb_vendors.c
d325e866c438ac63305bf0f48bbaa95d1b6bd8ec 17-Nov-2014 Yabin Cui <yabinc@google.com> kill HAVE_TERMIO_H

Bug: 18398307
Change-Id: Idbb89a074cdf16869cae3f667e89472781f37a5f
ommandline.c
e77b6a08623bba383ce55cd6653bec76cdf57792 11-Nov-2014 Yabin Cui <yabinc@google.com> kill HAVE_FORKEXEC

Bug: 18317407
Change-Id: I4eecb3c9d745e3dabfc46fa595aac7f94f6d93e3
db.c
ommandline.c
ervices.c
2655256570b7c1c5af6d886735835eecb99f45f2 05-Nov-2014 Elliott Hughes <enh@google.com> am 452f08a0: Merge "Add razer usb vid for future use with adb"

* commit '452f08a0b78e65cbd7e4cddac133e59f94d5db4c':
Add razer usb vid for future use with adb
3410d33dc497ec61c2a106d4e5802671ed6ecb06 03-Nov-2014 Stuart Wells <stuart.wells@razerzone.com> Add razer usb vid for future use with adb

Change-Id: I6b76c297de900da050473b764517cfd15c64b838
Signed-off-by: Stuart Wells <stuart.wells@razerzone.com>
sb_vendors.c
cb3739b5453ffaa64daa47bd7db824f58481f9d5 20-Oct-2014 JP Abgrall <jpa@google.com> am 7e38ab47: am 951c48c5: Merge "adb: Add USB vendor ID for TrekStor GmbH"

* commit '7e38ab476f808f84f0755ccbceb4cd7d8a1982a3':
adb: Add USB vendor ID for TrekStor GmbH
4fa99e542f00be3e1dab52e803facd840486c074 20-Oct-2014 Thorsten Koroscha <t.koroscha@trekstor.de> adb: Add USB vendor ID for TrekStor GmbH

Change-Id: I1d7fc14e691b4ab504c5205b21c93939499cdff9
Signed-off-by: Thorsten Koroscha <t.koroscha@trekstor.de>
sb_vendors.c
f17c42f68a3b176aef40f0977f5212fed80577f4 02-Oct-2014 Stephen Hines <srhines@google.com> am 2f431a8d: Fix windows-specific error without messing up Makefile flags.

* commit '2f431a8d5a1c2029af470a7336751a555131ee51':
Fix windows-specific error without messing up Makefile flags.
2f431a8d5a1c2029af470a7336751a555131ee51 02-Oct-2014 Stephen Hines <srhines@google.com> Fix windows-specific error without messing up Makefile flags.

Bug: 14416410

The proper fix for the error/warning we encountered is to move winsock2.h
in front of windows.h.

Change-Id: I29504ba3a184a85c6636d06c2ad900828fdb5436
ndroid.mk
ysdeps.h
ysdeps_win32.c
sb_windows.c
d2ee70758627cd67c9e393f6ae7f453093a1c957 02-Oct-2014 Stephen Hines <srhines@google.com> am 3ea87c33: Fix build breakage for missing -Wcpp option on old GCC versions.

* commit '3ea87c33a1c6e940322f5436cf0dd70a0bdadd75':
Fix build breakage for missing -Wcpp option on old GCC versions.
3ea87c33a1c6e940322f5436cf0dd70a0bdadd75 02-Oct-2014 Stephen Hines <srhines@google.com> Fix build breakage for missing -Wcpp option on old GCC versions.

Bug: 14416410
Change-Id: Ib30c3739d50d6122b3b4643051c72f2fa4985686
ndroid.mk
1e95e0b19cd265088286940def38d27305f847af 02-Oct-2014 Stephen Hines <srhines@google.com> am 64f44b84: Merge "Remove obsolete reference to ddk; Fixes for -Werror" into lmp-dev

* commit '64f44b8444dabd69cf391d42e10d44e8e926a79d':
Remove obsolete reference to ddk; Fixes for -Werror
64f44b8444dabd69cf391d42e10d44e8e926a79d 02-Oct-2014 Stephen Hines <srhines@google.com> Merge "Remove obsolete reference to ddk; Fixes for -Werror" into lmp-dev
43aecc543619de2d72529ab75fd5fb645cfd55fa 30-Sep-2014 Vince Harron <vharron@google.com> am c75dac39: Merge "fix for adbd pinning CPU" into lmp-dev

* commit 'c75dac394e3fcd9760841a820d8a0c93dd0c276e':
fix for adbd pinning CPU
b75d6f1429edf41cd15772a8d9d3a96f84a21862 07-May-2014 Andrew Hsieh <andrewhsieh@google.com> Remove obsolete reference to ddk; Fixes for -Werror

Bug: 14416410

1. The new mingw-w64 toolchain x86_64-w64-mingw32-4.8 has ddk
in x86_64-w64-mingw32/include/ddk
2. Add -Wno-error=cpp to suppress a warning that turns into error
thanks to -Werror:

Please include winsock2.h before windows.h
3. Cast GetLastError() return type DWORD to "int"
4. Include direct.h for _mkdir
5. Include stdint.h for uint8_t on Windows

Change-Id: I4bec0587f6573692f08c760da6c98ae551b8b5eb
ndroid.mk
ommandline.c
ysdeps.h
ysdeps_win32.c
1f88f8ef32d6468cf8096a41a36420117f56cc36 26-Sep-2014 Alex Klyubin <klyubin@google.com> am 9005ec37: am e3d3016d: Merge "Switch from using base64 BIOs to encoding funcs."

* commit '9005ec378ecd281f52945b5baca87245543bbfbf':
Switch from using base64 BIOs to encoding funcs.
e3d3016d46f53a75d4ae94fcbcb95a5593eb00a0 26-Sep-2014 Alex Klyubin <klyubin@google.com> Merge "Switch from using base64 BIOs to encoding funcs."
af436b1e10bed3b89880b3bd4f3031ea14057def 26-Sep-2014 Vince Harron <vharron@google.com> fix for adbd pinning CPU

adbd was spinning between select & read (0 bytes) for an adb_auth
socket. The read documentation states: "On success, the number of
bytes read is returned (zero indicates end of file)" so the code has
been modified to close the connection (like the read error case).

BUG=17419868

Change-Id: I1d8fb70c8e1876225ba8d47ea0a2b6265a7d182b
db_auth_client.c
736fd4a870781b9cf8a59c95fac8a518a462c49a 26-Sep-2014 Dan Albert <danalbert@google.com> am 8e1e5415: am 5b4a1767: Merge "Revert "Switch adb to epoll(2).""

* commit '8e1e54154bc7a5e9dee206735474186c2276b111':
Revert "Switch adb to epoll(2)."
45741ae2ea7883dcfb5062d34707f4699e0716ca 26-Sep-2014 Dan Albert <danalbert@google.com> Revert "Switch adb to epoll(2)."

This reverts commit 67de1557b0aa53b07a96d24734f165238f7415b3.
devent.c
0ab784d4707e88405fd85d6467487bf2ee9d84a0 23-Sep-2014 Elliott Hughes <enh@google.com> am 790e7c0a: am 3772545c: Merge "Switch adb to epoll(2)."

* commit '790e7c0ac46bca5ad511ba8764bbb0e9646c6f2a':
Switch adb to epoll(2).
67de1557b0aa53b07a96d24734f165238f7415b3 22-Sep-2014 Elliott Hughes <enh@google.com> Switch adb to epoll(2).

Bug: 17588403
Change-Id: I2590f5e7dd4e178ff4f743609c5ef0155b1015a1
devent.c
edda73d0c8aa52500199ed17781b9a9e83b1dfa7 08-Jul-2014 Doug Zongker <dougz@google.com> fix windows build

(cherry-picked from commit 4b39c6aca973470812caf4f7911b494c891e0c3a)

Change-Id: Ia7b236f1a915630fe85d488072efb9784ba10dad
ommandline.c
d372c5c36510b99254b031d3fd5958e246a85544 16-Sep-2014 Kenny Root <kroot@android.com> Merge changes I11e84a7b,I5adaedd8

* changes:
adb: fix 64-bit build
add sideload-host mode to adb
52e0b619990cce8becc20d16530ddd91334eff84 07-Jul-2014 Colin Cross <ccross@android.com> adb: fix 64-bit build

strlen returns a size_t, but the * modifier in printf expects an int.
On arm64 size_t != int.

(cherry-picked from commit 6d6a898b0c4e0283569209ba74bd7dbf49da73a2)

Change-Id: I11e84a7b62c935162abc0aba910d14e63d11efd3
ommandline.c
8e49ae4bb8c7a58d03b9907e0b14a7305a4af526 27-Jun-2014 Doug Zongker <dougz@google.com> add sideload-host mode to adb

The sideload-host mode turns the host into a server capable of sending
the device various pieces of the file on request, rather than
downloading it all in one transfer. It's used to support sideloading
OTA packages to devices without the need for them to hold the whole
package in RAM.

If the connected device doesn't support sideload-host mode, we fall
back to the older sideload connection.

(cherry-picked from commit 71fe584a1a7256c057267ae46a35f7c74d1d549e)

Change-Id: I5adaedd8243dc3b76414bba0149879ca2bbf35fa
db.h
db_client.c
ommandline.c
a5ab96eb50f27989240ab8917e8ebf3a028bcdfb 11-Sep-2014 Esteban de la Canal <estebandlc@google.com> 74602: Fixes adb not seeing connected devices on Mac.

Every alternate time an adb server was started already connected devices were
not being seen. This was caused by opened usb connections being "stalled".
See this thread for more information: http://lists.apple.com/archives/usb/2011/Jun/msg00050.html

Change-Id: Ic35b7a66c3f14a837b960066557f44e105609dcb
Fixes: https://code.google.com/p/android/issues/detail?id=74602
sb_osx.c
da5b2d67faeb2a85f042cf5b23d9875ad3413183 12-Sep-2014 Esteban de la Canal <estebandlc@google.com> am 99bb69c1: am f41ee3d5: Merge "74602: Fixes adb not seeing connected devices on Mac."

* commit '99bb69c1cee678382bf5e48962aa444469b3310e':
74602: Fixes adb not seeing connected devices on Mac.
f41ee3d5a1f236b0770d1ebd7068606aea7288bd 12-Sep-2014 Esteban de la Canal <estebandlc@google.com> Merge "74602: Fixes adb not seeing connected devices on Mac."
9dd83dc96e2f4d86093bc64d934d6c60c18d1edb 11-Sep-2014 Esteban de la Canal <estebandlc@google.com> 74602: Fixes adb not seeing connected devices on Mac.

Every alternate time an adb server was started already connected devices were
not being seen. This was caused by opened usb connections being "stalled".
See this thread for more information: http://lists.apple.com/archives/usb/2011/Jun/msg00050.html

Change-Id: Ic35b7a66c3f14a837b960066557f44e105609dcb
Fixes: https://code.google.com/p/android/issues/detail?id=74602
sb_osx.c
8fa75e44f182afb9eddeb11dbb67e78397165bab 10-Sep-2014 Elliott Hughes <enh@google.com> am 6608a46c: am c4ff0389: Merge "adb: Add USB vendor ID for Alco Digital Devices Limited"

* commit '6608a46c59abd72bd42a5104937fb276b6b0ccbd':
adb: Add USB vendor ID for Alco Digital Devices Limited
553630e4233251f905ffc90e44cdc6f4f16f39e7 10-Sep-2014 DanielMo <DanielMo@fih-foxconn.com> adb: Add USB vendor ID for Alco Digital Devices Limited

Change-Id: I50d343d583e688e9f8a72d1c61618b384e310fe1
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
sb_vendors.c
84e533d7b06de2dfd2a40b577ef22877e0e499af 09-Sep-2014 Jeff Sharkey <jsharkey@android.com> am 228f8261: Merge "delete_file() should force removal." into lmp-dev

* commit '228f8261fd778e1c03184b5f79f979d1a25abf50':
delete_file() should force removal.
41b3cfa29602d5f5065e7eafc25692cd75dc1871 09-Sep-2014 Jeff Sharkey <jsharkey@android.com> delete_file() should force removal.

It's a shell command with a pty, but it's not really interactive,
so force the removal to avoid giving users dead-end prompts.

Bug: 17339227
Change-Id: Iaf5d95c49f032066aa741a711a2c45557d93c598
ommandline.c
fb849bd46e28bd47a0545cf56d6683d138f5f09d 06-Sep-2014 Christopher Ferris <cferris@google.com> am fc8e16bf: am 2c805883: Merge "Add -Wno-deprecated-declarations to makefiles."

* commit 'fc8e16bfc59fcebaf554e266aae808eed5f2d078':
Add -Wno-deprecated-declarations to makefiles.
2c805883408339823d3f3ca23aceb08a1783ebbd 06-Sep-2014 Christopher Ferris <cferris@google.com> Merge "Add -Wno-deprecated-declarations to makefiles."
6d94763b2fd88a66197927d3233eff91e2b8044a 06-Sep-2014 Chih-Hung Hsieh <chh@google.com> am 379ca94d: am 299a32c8: Merge "Include ADB_HOST only code in #if ADB_HOST."

* commit '379ca94d00cab91a77ad8991cc92e2b4d4236d56':
Include ADB_HOST only code in #if ADB_HOST.
299a32c8038d4152b302948e5b961f2fcc04f6b2 06-Sep-2014 Chih-Hung Hsieh <chh@google.com> Merge "Include ADB_HOST only code in #if ADB_HOST."
f787b381b6a304415030ed54bdba6ca482763e4c 06-Sep-2014 Chih-Hung Hsieh <chh@google.com> Include ADB_HOST only code in #if ADB_HOST.

BUG: 17409892
Change-Id: Ic1199dd745191aba718fdb18343e87c0ccbe530b
db.c
709569febf97ab2f3c94a28c42cce06ebf56114c 06-Sep-2014 Elliott Hughes <enh@google.com> am 0dcc3f65: am 9c814648: Merge "Add USB Vendor ID for Micromax Informatics Ltd."

* commit '0dcc3f65b1ff5fa771618436ee4bfdd44cd2f672':
Add USB Vendor ID for Micromax Informatics Ltd.
4d10523be8a6a1aec8228c82ca57477d575f964d 28-Aug-2014 Abhishek Karmakar <abhishek.karmakar@micromaxinfo.com> Add USB Vendor ID for Micromax Informatics Ltd.

Signed-off-by: Abhishek Karmakar <abhishek.karmakar@micromaxinfo.com>
Change-Id: I63462eb15575cc953ac0246ee5d4c883d3678c08
sb_vendors.c
179d9d6587ff4c46746ea8df5c8a6ffe3f1cda3f 03-Sep-2014 Adam Langley <agl@google.com> Switch from using base64 BIOs to encoding funcs.

The OpenSSL base64 BIO is going away in BoringSSL. This change switches
to using the explicit base64 functions which are availible in both
OpenSSL and BoringSSL. The BoringSSL helper functions (i.e. for
calculating the size of the base64 encoding) are wrapped in #ifdefs so
that this change isn't coupled with the switch to BoringSSL. Once that
switch is complete, the #ifdefs can be removed.

Bug: 17409664
Change-Id: I42bac3bc93a1fb39feed39a8917d8e38d97629d3
Signed-off-by: Adam Langley <agl@google.com>
db_auth_host.c
51448eb39ef28b6c0314668ce22aa1f4aa116e8d 04-Sep-2014 Christopher Ferris <cferris@google.com> Add -Wno-deprecated-declarations to makefiles.

This is in preparation for an update to the uapi v3.16.1
kernel headers that marks the structure usb_functionfs_descs_head
as deprecated.

Change-Id: I25d2f32ce8e95e038e6df201ce2f8126f5a8b6fa
ndroid.mk
0c3d98b02b74fc64c78e57c07ae6b81eff3a8888 15-Aug-2014 Ying Wang <wangying@google.com> am 87ad7cdc: am e1ba39aa: Merge "Fix 64-bit host build."

* commit '87ad7cdc590aa4033f0b7ae23d83e2fbc119d07a':
Fix 64-bit host build.
42a809ba0626d089441fcef398297aa44013d53c 15-Aug-2014 Ying Wang <wangying@google.com> Fix 64-bit host build.

Bug: 13751317
Change-Id: Ibf62935b7d12a55ffc57242a26a2581b52796847
sb_osx.c
e772705a598a8d2a13fb9d8386d06441b67f804f 06-Aug-2014 Elliott Hughes <enh@google.com> am 771f6f29: am 29c5a78f: Merge "Fix build of adb with gcc-4.9."

* commit '771f6f299f16704b251d6adb8fb185c8fb517d07':
Fix build of adb with gcc-4.9.
678bd2e8225ccebe678430d4095b7fc78253bcf8 06-Aug-2014 Alexander Ivchenko <alexander.ivchenko@intel.com> Fix build of adb with gcc-4.9.

Without this patch we get:

system/core/adb/commandline.c:1629:16: error: array subscript is above
array bounds [-Werror=array-bounds]

Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>

(cherry picked from commit 53723338858772a0189aa3f92f4d4bbdaa9b6772)

Change-Id: I920c1de933ce5ba0a0d57eb8a9b557325a767a2a
ommandline.c
8a01917da13ba9ed66a8dd2adec33aaf38845c00 06-Aug-2014 Brian Carlstrom <bdc@google.com> am 46a8ffe8: Fix Windows adb build by avoiding "bool"

* commit '46a8ffe87f3cba070fb18a90e3c5c1f73468f99c':
Fix Windows adb build by avoiding "bool"
46a8ffe87f3cba070fb18a90e3c5c1f73468f99c 06-Aug-2014 Brian Carlstrom <bdc@google.com> Fix Windows adb build by avoiding "bool"

Change-Id: I9ca59e400c199d497a1a18d5e64c2cafe628097b
ommandline.c
8c9b155ea17c8281021d835fc1f5fedc49199c4b 06-Aug-2014 Jeff Sharkey <jsharkey@android.com> am 43d65b69: Merge "Escape single quotes in arguments." into lmp-dev

* commit '43d65b6903249a409031b081bb6175b9ad3e5c2a':
Escape single quotes in arguments.
440df7b61f81ee616405579fdeb19f66a011f4fc 06-Aug-2014 Elliott Hughes <enh@google.com> am 830a8641: am a8d0c4a2: Merge "Move host \'get-state\' service up so that it works."

* commit '830a8641bb960d208ad2a5b3bc3d9fb91bc31c2b':
Move host 'get-state' service up so that it works.
29c5a78fdc163f7d5e5e3a00729b8c37a89562f6 06-Aug-2014 Elliott Hughes <enh@google.com> Merge "Fix build of adb with gcc-4.9."
53723338858772a0189aa3f92f4d4bbdaa9b6772 06-Aug-2014 Alexander Ivchenko <alexander.ivchenko@intel.com> Fix build of adb with gcc-4.9.

Without this patch we get:

system/core/adb/commandline.c:1629:16: error: array subscript is above
array bounds [-Werror=array-bounds]

Change-Id: I494eb8b4d0e8082f8ff57bdd33d8d46c8c481c6f
Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
ommandline.c
a8d0c4a2b8f99dd3dba9d726bdecde98d350da50 06-Aug-2014 Elliott Hughes <enh@google.com> Merge "Move host 'get-state' service up so that it works."
0cc642c82d94affd5804b7c28c2f2578b8fadafb 11-Jun-2014 Jeff Sharkey <jsharkey@android.com> Partially revert argument escaping.

Commands chained with && need to be passed through literally instead
of always being quoted.

(cherry-pick of 7c460351f53cb683097fe4071b9ec1e4cd7cdf82.)

Bug: 15479704
Change-Id: I2998e40a92a3bfd092098cd526403b469c86c9a6
ommandline.c
dcd2f0ef2f87a3fcade74aec7e178be14d0ea335 10-Jun-2014 Jeff Sharkey <jsharkey@android.com> Uniformly escape shell arguments.

Arguments with embedded spaces need to be wrapped in quotes, which
changes the overall escaping strategy. Instead of mixing the two
strategies, just always wrap arguments in quotes.

(cherry-pick of fd546e8c35341b518873eb4f883afbed92e947af.)

Bug: 15479704
Change-Id: I03eacfa1bd6c220d4ec6617b825ebb0c43c7221e
ommandline.c
43d65b6903249a409031b081bb6175b9ad3e5c2a 06-Aug-2014 Jeff Sharkey <jsharkey@android.com> Merge "Escape single quotes in arguments." into lmp-dev
d9c4b14b44e93006efdffb059b769d46af509e2d 15-Jul-2014 Simon Ye <sye@google.com> Move host 'get-state' service up so that it works.

Due to previous bad merge, the get-state service was moved out of the
ADB_HOST #ifdef block.

(cherry picked from commit dc22c3c7a82ad1919c52dc4d00c601ad7210c61b)

Change-Id: I08465e7c666104a4c2d15eadef8a4d4be7f91456
db.c
d0eee747f6389a5800b485f36b265b3f5521852f 06-Aug-2014 Jeff Sharkey <jsharkey@android.com> Escape single quotes in arguments.

Verified that these use-cases continue working:

$ adb shell arg a a 'b b'
$ adb shell arg a a "b b"
|arg|a|a|b b|

$ adb shell arg "a a 'b b'"
|arg|a a 'b b'|

$ adb shell arg 'a a "b b"'
|arg|a a "b b"|

$ adb shell arg a\"b\'c
|arg|a"b'c|

$ adb shell "arg a && arg b"
|arg|a|
|arg|b|

$ adb shell "arg 'a' \"b\" c"
|arg|a|b|c|

Bug: 16139781
Change-Id: I3b010b6cdf57281695c11fda318c9bea0a7221cc
ommandline.c
05004026d9ee89d7fc7873aba0d53e71395ccf34 30-Jul-2014 leozwang <leozwang@google.com> am a361503e: Merge "Consolidate adb trace macro defines into its own header file." into lmp-dev

* commit 'a361503e3e68d1b26ce737547c4e1d53a03ec2d9':
Consolidate adb trace macro defines into its own header file.
43eb2ea5f83c79032e6b9b566d0f4e3626683631 29-Jul-2014 Elliott Hughes <enh@google.com> am ec531e5c: am 47a12389: Merge "Fix adb "ptsname is not thread-safe; use ptsname_r instead" build break."

* commit 'ec531e5cdde5e0b120bd88aeb2c3d36d18cedfb4':
Fix adb "ptsname is not thread-safe; use ptsname_r instead" build break.
dc22c3c7a82ad1919c52dc4d00c601ad7210c61b 15-Jul-2014 Simon Ye <sye@google.com> Move host 'get-state' service up so that it works.

Due to previous bad merge, the get-state service was moved out of the
ADB_HOST #ifdef block.

Change-Id: Id4b72a051ff04104659925e63a02eb340db2f807
db.c
d235288553f8c0535f51dfb8f05f81e1bc01e4ed 29-Jul-2014 Elliott Hughes <enh@google.com> Fix adb "ptsname is not thread-safe; use ptsname_r instead" build break.

Change-Id: I633dc4d6d421862473e7267cc0d2c1b0933392e0
ervices.c
a361503e3e68d1b26ce737547c4e1d53a03ec2d9 30-Jul-2014 leozwang <leozwang@google.com> Merge "Consolidate adb trace macro defines into its own header file." into lmp-dev
d3fc15f4841a8cbfd15fa9f051f2712266b5cd78 29-Jul-2014 leozwang <leozwang@google.com> Consolidate adb trace macro defines into its own header file.

Most code is copied and pasted from adb.h.
Any file can just include it to enable tracing.
Removed some duplications.

Change-Id: Ie1ed9e9edbf92158aac84669fbcbf7dc85fe2cf0
db.h
db_trace.h
devent.c
a6ff5c95a3fa798d661e09aa628cd0c5e5c8608f 29-Jul-2014 Elliott Hughes <enh@google.com> Fix adb "ptsname is not thread-safe; use ptsname_r instead" build break.

(cherry picked from commit d235288553f8c0535f51dfb8f05f81e1bc01e4ed)

Change-Id: I05f8160bc8c356cb8a57e2bc5677517750700456
ervices.c
555a904f7c304ee2ad1a7a5cffa80e6f1a121a5a 25-Jul-2014 Jeff Sharkey <jsharkey@android.com> am 74ff4fcf: Merge "Follow refactoring of install-abandon command." into lmp-dev

* commit '74ff4fcfc46e853ecd9fe34b5cedb47fc379f1af':
Follow refactoring of install-abandon command.
75619aabb3ae9ec4d1fd43d5fe1e9ad9cbce917d 25-Jul-2014 leozwang <leozwang@google.com> am 5a255238: Merge "Redirect debug output to logcat." into lmp-dev

* commit '5a2552388e698fec4efda270d2d88bb18ed3f299':
Redirect debug output to logcat.
6cc961c7cb1c45a73dffd0e14683bda1a176263d 25-Jul-2014 Colin Cross <ccross@android.com> am edf41f98: am 8d9d362b: Merge "adb: Add USB vendor ID for SONIM TECHNOLOGIES, INC."

* commit 'edf41f981c47d857bd130e8ecc95cd7cf0a0fe0a':
adb: Add USB vendor ID for SONIM TECHNOLOGIES, INC.
2cc4fd73d100749f4154065e4884fc912db584a9 25-Jul-2014 Tim Murray <timmurray@google.com> am 6ebaf311: am 721f189a: Merge "fix adb build on Darwin"

* commit '6ebaf311a7af8d20979deba279f9d5096ed8f193':
fix adb build on Darwin
43222b3f0ac661a3c8d4dfeff6e1c2f71731aadf 25-Jul-2014 DanielMo <DanielMo@fih-foxconn.com> adb: Add USB vendor ID for SONIM TECHNOLOGIES, INC.

Change-Id: Id66997709fec55b1efd389abf2efa644b9a8ccf4
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
sb_vendors.c
5a2552388e698fec4efda270d2d88bb18ed3f299 25-Jul-2014 leozwang <leozwang@google.com> Merge "Redirect debug output to logcat." into lmp-dev
1efcdeffe5ca9981112be5c7ec7c56e7ac0d6e49 25-Jul-2014 Tim Murray <timmurray@google.com> fix adb build on Darwin

bug 16172793

Change-Id: Ia34b7148afc4c909f29037df91c04d6fd29a731e
ndroid.mk
ac77e1f4e40479ee7018f10dd070d5a6d5f4cfec 25-Jul-2014 Jeff Sharkey <jsharkey@android.com> Follow refactoring of install-abandon command.

Bug: 16543552
Change-Id: I1f54254813fd7d7f4341b8815f816535a39de079
ommandline.c
48a904240bf32fcba701ad8634651569a586d0aa 24-Jul-2014 leozwang <leozwang@google.com> Redirect debug output to logcat.

If ADB_TRACE is enabled, debug output will be redirected to logcat.

Change-Id: I9c36ada7690a2b946ecd6a926d04e36a8313c36a
ndroid.mk
db.h
9866a66d6d1b9898c6c29ff390358fe8dc2c7d77 19-Jul-2014 Nick Kralevich <nnk@google.com> adb: set O_CLOEXEC on lots of file descriptors

Too many leaking FDs.

Fixes bug: https://code.google.com/p/android/issues/detail?id=65857
(and more)

(cherrypicked from commit fe8d7f4f2e775d46d61f7c2d29a4e852434984da)

Change-Id: I67d8683244e54288a8105f6f65ee40abe2378d7e
db_auth_client.c
ile_sync_service.c
emount_service.c
ervices.c
sb_linux.c
70467735953ea9cceae9870ee0c426a0d21912ee 06-May-2014 Greg Hackmann <ghackmann@google.com> adb: replace utimes() with utime()

Fix the win_sdk host build by replacing utimes() with utime(). utime()
is functionally equivalent to utimes() when dealing with non-fractional
second timestamps, and is supported by the Windows CRT.

(The Windows CRT uses the nonstandard name _utime(), but mingw creates
aliases to the POSIX names.)

Change-Id: I513c6c5de05376c34cbb0894a94259acba8ae6f1
ile_sync_client.c
ef16a17afb8894776ce0be88b8a9ea705f9d64e5 22-Jul-2014 Nick Kralevich <nnk@google.com> Merge "adb: set O_CLOEXEC on lots of file descriptors" into lmp-dev
1b3f2ff0286da1f06e095e8d96ce8aefe874b6aa 21-Jun-2014 Rom Lemarchand <romlem@google.com> adb: use oom_score_adj instead of oom_adj

(cherry picked from commit 07ce7cab72d9b3e5c701491daf8fd457d035eec8)

Change-Id: I1730d1df34039a5502200002ac813ce96a3eaa1a
ervices.c
eb97987332e2e5f7c5eb90d82d853f698a040b14 27-May-2014 Jeff Sharkey <jsharkey@android.com> Add "exec" service: shell commands with no pty.

To facilitate device scripts that want to read/write binary data from
the host side, this change introduces a new "exec" service that
behaves like "shell" but without creating a pty, which would otherwise
mangle binary data.

After forking, it hooks up stdin/stdout of the child process to
the socket connected through to the host. The adb transport doesn't
support shutdown(), so the host can't half-close the socket and wait
for device termination. Instead, the host side now has two explicit
commands "exec-in" and "exec-out" for either sending or receiving
data.

Teach host side copy_to_file() to deal with stdin/stdout special
cases. Switch device side backup/restore services to use the new
create_subproc_raw under the hood.

(cherry picked from commit 5d9d434efadf1c535c7fea634d5306e18c68ef1f)

Change-Id: I42c18cb5bb907449b458c94450ef6c584d84ecdb
ndroid.mk
db.h
ackup_service.c
ommandline.c
ervices.c
4b35c01e3e1fdf80b85ef417f3c3bcedeccbe442 19-Apr-2013 Lajos Molnar <lajos@google.com> adb: added support for adb pull -a to preserve time stamps and mode

Added -a flag to adb pull that preserves time and mode. Mode is
subjected to umask for security. We only receive modification
time from adb server, so creation time will be set to the modification
time as well.

Signed-off-by: Lajos Molnar <lajos@google.com>

(cherry picked from commit de8ff4adcaa487259f9ddcd0eab4d1117d1cca71)

Change-Id: I03bb5cc14ce542299cf3b221a8be318a28ee8a8d
ommandline.c
ile_sync_client.c
ile_sync_service.h
fe8d7f4f2e775d46d61f7c2d29a4e852434984da 19-Jul-2014 Nick Kralevich <nnk@google.com> adb: set O_CLOEXEC on lots of file descriptors

Too many leaking FDs.

Fixes bug: https://code.google.com/p/android/issues/detail?id=65857
(and more)

Change-Id: I67d8683244e54288a8105f6f65ee40abe2378d7e
db_auth_client.c
ile_sync_service.c
emount_service.c
ervices.c
sb_linux.c
cbbb83b0eb8b09b729c9287238d709bec7b833b5 19-Jul-2014 Elliott Hughes <enh@google.com> Fix implicit declaration of function 'prctl' in adb.

(cherry picked from commit b4dd6ef223c4744f8583add1b4999c9ce0b5a0fe)

Change-Id: Ia64bec746ae8d2c45663f61afb46702838b1e5bf
db.c
b4dd6ef223c4744f8583add1b4999c9ce0b5a0fe 19-Jul-2014 Elliott Hughes <enh@google.com> Fix implicit declaration of function 'prctl' in adb.

Change-Id: I9f14cabbb36d658510c11833b3314565a2445e10
db.c
71bbc6789fb6750d8fddda0a3ff9a87f09a32c74 15-Jul-2014 Christopher Tate <ctate@google.com> Fix the build in clang

"fprintf(stderr, buf)" is a warning in some compilers, and we're
building with all warnings promoted to error.

Change-Id: Ie3c6ddcd74cf4dda40cf7b742df955dde1d1a5ff
ommandline.c
c03064ea71dba91a8fd94e37fabd401a66b8cc7f 14-Jul-2014 Jeff Sharkey <jsharkey@android.com> Fix 64-bit builds.

Change-Id: I1ff5c9c3dc8d870aef2885f8a1989c6c913ccb3d
ommandline.c
960df97c2356f5a804d3ef87fe49f788d7ecdfaf 10-Jun-2014 Jeff Sharkey <jsharkey@android.com> Add install-multiple to adb.

The new install-multiple command automates creating an install
session, streaming multiple files into place, and then committing
or destroying the session. This uses the recent "exec" feature to
stream APK contents over stdin directly into their final resting
place, requiring no extra copies.

Blindly pass through command line arguments to "pm" to make adding
new flags easier in future.

Remove support for verifying APK before sending across wire, since it
was reading the entire APK into memory (!) before sending. Also
remove encrypted APKs, since they are no longer supported. Drop
support for undocumented verification files.

Bug: 14975160
Change-Id: I0c538471873061798160e2e47cec4c0424c27361
ommandline.c
ile_sync_client.c
ile_sync_service.h
ervices.c
77a2c22dcbab56b260eb9d39c84fe8f98258cebb 10-Jul-2014 Badhri Jagan Sridharan <badhri@google.com> Merge "adbd: adb root should terminate adbd only if it's debuggable"
bf9ef5196995119a9801b55d2df2e683eeba2168 10-Jul-2014 Badhri Jagan Sridharan <badhri@google.com> am cb7be1e8: am 87c7a0d7: am 77a2c22d: Merge "adbd: adb root should terminate adbd only if it\'s debuggable"

* commit 'cb7be1e8cd4e4388d014a5c48df455a5715f2180':
adbd: adb root should terminate adbd only if it's debuggable
cb7be1e8cd4e4388d014a5c48df455a5715f2180 10-Jul-2014 Badhri Jagan Sridharan <badhri@google.com> am 87c7a0d7: am 77a2c22d: Merge "adbd: adb root should terminate adbd only if it\'s debuggable"

* commit '87c7a0d74b9dadaedfe6805c57d221d9c445aaf6':
adbd: adb root should terminate adbd only if it's debuggable
4b39c6aca973470812caf4f7911b494c891e0c3a 08-Jul-2014 Doug Zongker <dougz@google.com> fix windows build

Change-Id: Ia7b236f1a915630fe85d488072efb9784ba10dad
ommandline.c
6d6a898b0c4e0283569209ba74bd7dbf49da73a2 07-Jul-2014 Colin Cross <ccross@android.com> adb: fix 64-bit build

strlen returns a size_t, but the * modifier in printf expects an int.
On arm64 size_t != int.

Change-Id: I11e84a7b62c935162abc0aba910d14e63d11efd3
ommandline.c
7df14ef339fcdd9103f2ef4e0eb66bf9c4ad3f5b 07-Jul-2014 Doug Zongker <dougz@google.com> Merge "add sideload-host mode to adb"
71fe584a1a7256c057267ae46a35f7c74d1d549e 27-Jun-2014 Doug Zongker <dougz@google.com> add sideload-host mode to adb

The sideload-host mode turns the host into a server capable of sending
the device various pieces of the file on request, rather than
downloading it all in one transfer. It's used to support sideloading
OTA packages to devices without the need for them to hold the whole
package in RAM.

If the connected device doesn't support sideload-host mode, we fall
back to the older sideload connection.

Change-Id: I5adaedd8243dc3b76414bba0149879ca2bbf35fa
db.h
db_client.c
ommandline.c
686bce6390db802bfd2cb4e78f9270596b6decb2 01-Jul-2014 Daniel Rosenberg <drosen@google.com> Added support for vendor partition to adb

Remount will now remount the vendor partition as well, if it exists.
Sync will also allow you to sync vendor, and will include it by
default if it exists.

Change-Id: Iea1e8212f445e96233438a8d8a9d3266bf3d6557
Signed-off-by: Daniel Rosenberg <drosen@google.com>
ommandline.c
ile_sync_client.c
ile_sync_service.c
emount_service.c
ce10b191c56057e494f6b46de06b0054d77b4726 24-Jun-2014 Elliott Hughes <enh@google.com> am f6d86d75: am d08b80cc: am 20bda70f: Merge "Add Smartisan usb config"

* commit 'f6d86d75461ae3a246522932759e045dcc7a4952':
Add Smartisan usb config
f6d86d75461ae3a246522932759e045dcc7a4952 24-Jun-2014 Elliott Hughes <enh@google.com> am d08b80cc: am 20bda70f: Merge "Add Smartisan usb config"

* commit 'd08b80ccc6f7d106a8bfc410f89e466b798e2ebe':
Add Smartisan usb config
20bda70f9a8dff764bcbad3e711a91700fc6346b 24-Jun-2014 Elliott Hughes <enh@google.com> Merge "Add Smartisan usb config"
07ce7cab72d9b3e5c701491daf8fd457d035eec8 21-Jun-2014 Rom Lemarchand <romlem@google.com> adb: use oom_score_adj instead of oom_adj

Change-Id: I76c6ce83d7d400c8b84bfece5d30189640cb2505
ervices.c
b10fb88e1ea02bce8c052d51662fe2c6fd00f275 19-Jun-2014 Colin Cross <ccross@android.com> am d7d9b6fc: am f02fd9f0: am 5e504a4e: Merge "adb: Add USB vendor ID for Honeywell"

* commit 'd7d9b6fcaa415ea6251e45d84b95a95740ea807e':
adb: Add USB vendor ID for Honeywell
d7d9b6fcaa415ea6251e45d84b95a95740ea807e 19-Jun-2014 Colin Cross <ccross@android.com> am f02fd9f0: am 5e504a4e: Merge "adb: Add USB vendor ID for Honeywell"

* commit 'f02fd9f0b061d29bb872664479ed4a5949d23ac9':
adb: Add USB vendor ID for Honeywell
8c4c8e8988411449ecb2f50c25d3e4188e81e7c0 19-Jun-2014 DanielMo <DanielMo@fih-foxconn.com> adb: Add USB vendor ID for Honeywell

Change-Id: Ib92eca23a6c75ec9323bb1b0e7d7f8cd5f9ca207
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
sb_vendors.c
4224edf51dcddf9e014b198bb23fc40ef61a5834 18-Jun-2014 Nick Kralevich <nnk@google.com> am 89e4fad0: am 4e6aa6a2: Merge "adbd: unconditionally call setgroups"

* commit '89e4fad09e1ae765ab0be1580a468bc0837ef7e4':
adbd: unconditionally call setgroups
000a62f64424f0dafa83c9f0fffb07e8ab49f540 18-Jun-2014 Nick Kralevich <nnk@google.com> am 4224edf5: am 89e4fad0: am 4e6aa6a2: Merge "adbd: unconditionally call setgroups"

* commit '4224edf51dcddf9e014b198bb23fc40ef61a5834':
adbd: unconditionally call setgroups
e5cbf4e0441a280985cb4768d5ce65d70fc9c725 18-Jun-2014 Nick Kralevich <nnk@google.com> adbd: unconditionally call setgroups

We should ensure that the appropriate supplementary groups are
set, regardless of whether we're running UID=0 or UID=shell.

Change-Id: I3a1624a574102be08176a41f9c7eb5f82af2b3e5
db.c
def14fc4ed5e38ea942cc6cb8d7d8a68568cf729 16-Jun-2014 Elliott Hughes <enh@google.com> am cd0d5935: am 6c65cd5d: am 60218f19: Merge "Add gionee USB vendor id."

* commit 'cd0d593569d7f2b8f8ec81ab3ef6dd942230e973':
Add gionee USB vendor id.
cd0d593569d7f2b8f8ec81ab3ef6dd942230e973 16-Jun-2014 Elliott Hughes <enh@google.com> am 6c65cd5d: am 60218f19: Merge "Add gionee USB vendor id."

* commit '6c65cd5db84361c66983903638ddb251762f9151':
Add gionee USB vendor id.
4f8d3be3b2a78813a0769ec787a29789c27cf21e 16-Jun-2014 xuefeng cai <caixuefeng130@gmail.com> Add gionee USB vendor id.

Change-Id: I3745f0e8462d0bffcd2eb4d926a9d2f9af8578f9
sb_vendors.c
7c460351f53cb683097fe4071b9ec1e4cd7cdf82 11-Jun-2014 Jeff Sharkey <jsharkey@android.com> Partially revert argument escaping.

Commands chained with && need to be passed through literally instead
of always being quoted.

Bug: 15479704
Change-Id: I2998e40a92a3bfd092098cd526403b469c86c9a6
ommandline.c
fd546e8c35341b518873eb4f883afbed92e947af 10-Jun-2014 Jeff Sharkey <jsharkey@android.com> Uniformly escape shell arguments.

Arguments with embedded spaces need to be wrapped in quotes, which
changes the overall escaping strategy. Instead of mixing the two
strategies, just always wrap arguments in quotes.

Bug: 15479704
Change-Id: I03eacfa1bd6c220d4ec6617b825ebb0c43c7221e
ommandline.c
5c70f7e3106bb9457cd5ea2f638cd430ba67eb9c 07-Jun-2014 Nick Kralevich <nnk@google.com> am f3af14e6: am ef47eb19: am 30136150: Merge "adb: avoid leaking file descriptors"

* commit 'f3af14e6df266f466e0bf7868d002cfe8104c128':
adb: avoid leaking file descriptors
f3af14e6df266f466e0bf7868d002cfe8104c128 07-Jun-2014 Nick Kralevich <nnk@google.com> am ef47eb19: am 30136150: Merge "adb: avoid leaking file descriptors"

* commit 'ef47eb1948ba394866f53c41c459561fc372a3b5':
adb: avoid leaking file descriptors
8fcb631389123ab7f5d795ae3a36a67842b3028c 06-Jun-2014 Nick Kralevich <nnk@google.com> adb: avoid leaking file descriptors

If an adb shell connection comes in while taking a screenshot,
an open pipe file descriptor will be leaked to the shell process.
This causes SELinux denials of the form:

avc: denied { read } for path="pipe:[21838]" dev="pipefs" ino=21838 scontext=u:r:shell:s0 tcontext=u:r:adbd:s0 tclass=fifo_file permissive=0
avc: denied { write } for path="pipe:[21838]" dev="pipefs" ino=21838 scontext=u:r:shell:s0 tcontext=u:r:adbd:s0 tclass=fifo_file permissive=0

Set O_CLOEXEC on the pipe connections, to avoid leaking them
across an exec boundary.

Bug: 15437785
Change-Id: Id2304b316bd7082d8baac246dce1f0e0e26e9197
ramebuffer_service.c
8f4ac8e1d3349170f319526e8cfcb036db954ee4 03-Jun-2014 Narayan Kamath <narayan@google.com> am 7cf8e1cb: am 4e26c95a: Merge "Skip the "--abi" flag on "adb install" if present."

* commit '7cf8e1cb88c44963ccb2128113d8a804d85645b9':
Skip the "--abi" flag on "adb install" if present.
7cf8e1cb88c44963ccb2128113d8a804d85645b9 03-Jun-2014 Narayan Kamath <narayan@google.com> am 4e26c95a: Merge "Skip the "--abi" flag on "adb install" if present."

* commit '4e26c95a6363da4885bb9178c9d42c273b357043':
Skip the "--abi" flag on "adb install" if present.
4e26c95a6363da4885bb9178c9d42c273b357043 03-Jun-2014 Narayan Kamath <narayan@google.com> Merge "Skip the "--abi" flag on "adb install" if present."
b81708146f51afb434739374095161ab7ff32787 02-Jun-2014 Jeff Sharkey <jsharkey@android.com> Merge "Add "exec" service: shell commands with no pty."
5d9d434efadf1c535c7fea634d5306e18c68ef1f 27-May-2014 Jeff Sharkey <jsharkey@android.com> Add "exec" service: shell commands with no pty.

To facilitate device scripts that want to read/write binary data from
the host side, this change introduces a new "exec" service that
behaves like "shell" but without creating a pty, which would otherwise
mangle binary data.

After forking, it hooks up stdin/stdout of the child process to
the socket connected through to the host. The adb transport doesn't
support shutdown(), so the host can't half-close the socket and wait
for device termination. Instead, the host side now has two explicit
commands "exec-in" and "exec-out" for either sending or receiving
data.

Teach host side copy_to_file() to deal with stdin/stdout special
cases. Switch device side backup/restore services to use the new
create_subproc_raw under the hood.

Change-Id: I5993049803519d3959761f2363037b02c50920ee
ndroid.mk
db.h
ackup_service.c
ommandline.c
ervices.c
a284f8b214a8b92775534922ac24f13498d3af0a 29-May-2014 Narayan Kamath <narayan@google.com> Skip the "--abi" flag on "adb install" if present.

This flag needs to be passed through to the package manager.
Without this change, the argument to this flag is interpreted
as a filename.

NOTE: If we don't want to add special treatment for this flag,
we'll have to assume that all flags with a -- prefix have an
argument, and that isn't necessarily true.

Change-Id: I78c3fa842bc24148d83d7278e6dee395686240a0
ommandline.c
bccac026e9198e283fd2e276bfe5a7020db1bf88 27-May-2014 Elliott Hughes <enh@google.com> am 8ed26bd6: am 769db021: am b24085d5: Merge "adb: Add USB vendor ID for Unowhy"

* commit '8ed26bd6531a8d52dcaff6c14b6fc59749791679':
adb: Add USB vendor ID for Unowhy
8ed26bd6531a8d52dcaff6c14b6fc59749791679 27-May-2014 Elliott Hughes <enh@google.com> am 769db021: am b24085d5: Merge "adb: Add USB vendor ID for Unowhy"

* commit '769db021e6b61d10c13a7b17a72750f18ebdee16':
adb: Add USB vendor ID for Unowhy
769db021e6b61d10c13a7b17a72750f18ebdee16 27-May-2014 Elliott Hughes <enh@google.com> am b24085d5: Merge "adb: Add USB vendor ID for Unowhy"

* commit 'b24085d55b082d802eba699243dba26fbc6ac712':
adb: Add USB vendor ID for Unowhy
56266c75e2089500c30fcbc97f0d46df47f87f00 26-May-2014 Wing Tseng <Wing_Tseng@pegatroncorp.com> adb: Add USB vendor ID for Unowhy

Change-Id: I8bab07734d5b6acb4d8ceaf45b0bab0723f5fe03
Signed-off-by: Wing Tseng <Wing_Tseng@pegatroncorp.com>
sb_vendors.c
7291ac60822c8b84e423de4f4abec6663d0e8f50 27-May-2014 David 'Digit' Turner <digit@android.com> am 97267755: am c3358875: am 6e7343b8: Merge "adb: implement "adb reverse <local> <remote>""

* commit '972677557bd2c3a0678a945765783e85c7ec7b9c':
adb: implement "adb reverse <local> <remote>"
972677557bd2c3a0678a945765783e85c7ec7b9c 27-May-2014 David 'Digit' Turner <digit@android.com> am c3358875: am 6e7343b8: Merge "adb: implement "adb reverse <local> <remote>""

* commit 'c3358875169b920847a72428f4e8b8f09f7bdf05':
adb: implement "adb reverse <local> <remote>"
c3358875169b920847a72428f4e8b8f09f7bdf05 27-May-2014 David 'Digit' Turner <digit@android.com> am 6e7343b8: Merge "adb: implement "adb reverse <local> <remote>""

* commit '6e7343b8993fecb2f0600a9e5cff91dd4480a877':
adb: implement "adb reverse <local> <remote>"
252586941934d23073a8d167ec240b221062505f 21-Mar-2013 David 'Digit' Turner <digit@android.com> adb: implement "adb reverse <local> <remote>"

This implements the logical opposite of 'adb forward', i.e.
the ability to reverse network connections from the device
to the host.

This feature is very useful for testing various programs
running on an Android device without root or poking at the
host's routing table.

Options and parameters are exactly the same as those for
'adb forward', except that the direction is reversed.

Examples:

adb reverse tcp:5000 tcp:6000
connections to localhost:5000 on the device will be
forwarded to localhost:6000 on the host.

adb reverse --no-rebind tcp:5000 tcp:6000
same as above, but fails if the socket is already
bound through a previous 'adb reverse tcp:5000 ...'
command.

adb reverse --list
list all active reversed connections for the target
device. Note: there is no command to list all
reversed connections for all devices at once.

adb reverse --remove tcp:5000
remove any reversed connection on the device from
localhost:5000

adb reverse --remove-all
remove all reversed connections form the current
device.

Reversed connections are tied to a transport, in other
words, they disappear as soon as a device is disconnected.

Simple testing protocol:

adb forward tcp:5000 tcp:6000
adb reverse tcp:6000 tcp:7000
nc -l localhost 7000

in another terminal:
echo "Hello" | nc localhost 5000

Will print "Hello" on the first terminal.

Change-Id: I761af790cdb06829b68430afa4145a919fa0e6d5
ERVICES.TXT
db.c
db.h
ommandline.c
ervices.c
6fb1557fda1b18b4696c9213df7b4f542cd30d3f 21-May-2014 Colin Cross <ccross@android.com> am b696bec3: am 28c30518: am 1742b7d2: Merge "Modify VID for Compal"

* commit 'b696bec3541dc3091fb7c8764750f8ba21f64636':
Modify VID for Compal
b696bec3541dc3091fb7c8764750f8ba21f64636 21-May-2014 Colin Cross <ccross@android.com> am 28c30518: am 1742b7d2: Merge "Modify VID for Compal"

* commit '28c305183a6596eb3241771422d22351fbeaa9fb':
Modify VID for Compal
28c305183a6596eb3241771422d22351fbeaa9fb 21-May-2014 Colin Cross <ccross@android.com> am 1742b7d2: Merge "Modify VID for Compal"

* commit '1742b7d218706c596e6b40c89a6660f30bdba022':
Modify VID for Compal
1742b7d218706c596e6b40c89a6660f30bdba022 21-May-2014 Colin Cross <ccross@android.com> Merge "Modify VID for Compal"
b65208d1a98c4cc6b4fbae302f7718f056e2fadd 20-May-2014 Elliott Hughes <enh@google.com> am f7a7e3c3: am 6dfb039b: am 4a343436: Merge "Fix win32 undefined reference to `_socket_network_client_timeout\'."

* commit 'f7a7e3c301fdf7d98d8bcabf6fefb0fcf5bbf90d':
Fix win32 undefined reference to `_socket_network_client_timeout'.
f7a7e3c301fdf7d98d8bcabf6fefb0fcf5bbf90d 20-May-2014 Elliott Hughes <enh@google.com> am 6dfb039b: am 4a343436: Merge "Fix win32 undefined reference to `_socket_network_client_timeout\'."

* commit '6dfb039b0ba56576b4ed043e02ae43fb6afd42aa':
Fix win32 undefined reference to `_socket_network_client_timeout'.
6dfb039b0ba56576b4ed043e02ae43fb6afd42aa 20-May-2014 Elliott Hughes <enh@google.com> am 4a343436: Merge "Fix win32 undefined reference to `_socket_network_client_timeout\'."

* commit '4a343436e01b07c21c043f8a903689f70000ca73':
Fix win32 undefined reference to `_socket_network_client_timeout'.
0bff5bd95268184a34ae69c062584a8d1f4d87fb 20-May-2014 Elliott Hughes <enh@google.com> Fix win32 undefined reference to `_socket_network_client_timeout'.

Change-Id: I063213957b8452f4690da0f64872075f7c27b4cd
ysdeps_win32.c
fa59e0a48786505d5d8e65e0714f65b85d260dfc 20-May-2014 Elliott Hughes <enh@google.com> am 9bcc5512: am 796b2015: am 51e27f95: Merge "Fix win32 implicit declaration of function socket_network_client_timeout."

* commit '9bcc55123ec814074417994db99730929a31fec8':
Fix win32 implicit declaration of function socket_network_client_timeout.
9bcc55123ec814074417994db99730929a31fec8 20-May-2014 Elliott Hughes <enh@google.com> am 796b2015: am 51e27f95: Merge "Fix win32 implicit declaration of function socket_network_client_timeout."

* commit '796b20157f75e46ad91b7d894796e0ba55a7766e':
Fix win32 implicit declaration of function socket_network_client_timeout.
796b20157f75e46ad91b7d894796e0ba55a7766e 20-May-2014 Elliott Hughes <enh@google.com> am 51e27f95: Merge "Fix win32 implicit declaration of function socket_network_client_timeout."

* commit '51e27f955b79846e36097532a725f4b7a3eefef8':
Fix win32 implicit declaration of function socket_network_client_timeout.
b911cf0af43718a6dedb06561e787ba3bdbdfe8b 20-May-2014 Elliott Hughes <enh@google.com> Fix win32 implicit declaration of function socket_network_client_timeout.

Change-Id: Ic6070855a21920384c555c9c82b9a2e4a776cbae
ysdeps.h
3edc25271fd6696cede2d0e6ecdcaf3d6cc273a5 20-May-2014 Elliott Hughes <enh@google.com> am b42f1413: am 0e71e3ab: am 9cae50b3: Merge "Bound the ADB connect time with a non-blocking connect"

* commit 'b42f141315ae0929325335645d397db04a500c88':
Bound the ADB connect time with a non-blocking connect
b42f141315ae0929325335645d397db04a500c88 20-May-2014 Elliott Hughes <enh@google.com> am 0e71e3ab: am 9cae50b3: Merge "Bound the ADB connect time with a non-blocking connect"

* commit '0e71e3ab9cf66f41645ea286c7e62ed2b657ca38':
Bound the ADB connect time with a non-blocking connect
0e71e3ab9cf66f41645ea286c7e62ed2b657ca38 20-May-2014 Elliott Hughes <enh@google.com> am 9cae50b3: Merge "Bound the ADB connect time with a non-blocking connect"

* commit '9cae50b38d6a58efe0799ef3697f594cb4b100f9':
Bound the ADB connect time with a non-blocking connect
aecc6a6657746afc9b95a960eedad10484bf14ac 20-Jun-2013 Ken Lierman <ken.lierman@windriver.com> Bound the ADB connect time with a non-blocking connect

After a disconnect, the initial blocking connect takes
a long time to return, while subsequent calls return
quicks. Switch to a non-blocking connect to make the
re-connect time more consistent and faster overall.

Change-Id: I21d02b22a8eb9a457c2f1fa95eb17894d5612ccd
Signed-off-by: Ken Lierman <ken.lierman@windriver.com>
Reviewed-by: Gumbel, Matthew K <matthew.k.gumbel@intel.com>
Reviewed-by: Jovanovic, Radivoje <radivoje.jovanovic@intel.com>
Reviewed-by: Boie, Andrew P <andrew.p.boie@intel.com>
ervices.c
58b01e01875e2f6ae593ded197430bc23713dd0a 16-May-2014 Ingo Rohloff <lundril@gmx.de> ADB on linux: Handle USB SuperSpeed extra Descriptors

Under Linux, ADB manually parses USB Descriptors to check for
possible ADB USB Interfaces. USB Devices connected with SuperSpeed
will exhibit extra USB SuperSpeed Endpoint Companion Descriptors.
This patch handles these USB SuperSpeed specific USB Descriptors.

Change-Id: Icd1e5fdde0b324c7df4f933583499f2c52a922f3
Signed-off-by: Ingo Rohloff <lundril@gmx.de>
sb_linux.c
cdb1b1b84daa528d078379a7f343177b94e5976e 14-May-2014 Bao Haojun <baohaojun@gmail.com> Fix deadlocks.

1. Close pipe fds[1] as soon as possible. Otherwise it may block when
reading from fds[0] even though the child process has exited early
and closed its copy of fds[1].

2. Waitpid after pipe is closed. Otherwise the screencap child process
may block while writing fds[1], because the fds[0] is not closed
yet. If we close fds[0] first, then the screencap child process will
die because of SIGPIPE, and waitpid will return correctly.

Change-Id: I433c95a5ba2eb3045727fc39a49fd9557fb1a1d1
Signed-off-by: Bao Haojun <baohaojun@gmail.com>
ramebuffer_service.c
910bca6850aea80bb4431aaccb2561730fe9741d 13-May-2014 Kenny Root <kroot@google.com> am 57e53ed4: am c563c38d: am 905874ab: Merge "adb: avoid compilation errors for unused results"

* commit '57e53ed4189cc49844e6afcea2a5861fd8ca93f1':
adb: avoid compilation errors for unused results
57e53ed4189cc49844e6afcea2a5861fd8ca93f1 13-May-2014 Kenny Root <kroot@google.com> am c563c38d: am 905874ab: Merge "adb: avoid compilation errors for unused results"

* commit 'c563c38d06e3af61ab8cf1c26536106985fec073':
adb: avoid compilation errors for unused results
c563c38d06e3af61ab8cf1c26536106985fec073 13-May-2014 Kenny Root <kroot@google.com> am 905874ab: Merge "adb: avoid compilation errors for unused results"

* commit '905874abe45279d7c668e590d404880dd91b1869':
adb: avoid compilation errors for unused results
1bd41b13998b2d56359f64247695db355c48f4c6 13-May-2014 Kenny Root <kroot@google.com> adb: avoid compilation errors for unused results

The BIO_CTRL_FLUSH function for files doesn't return anything useful
from the underlying fflush call, so it is safe to ignore this.

Change-Id: If33a7efbbaaf158e3da1cd72d0a56da1d3b82fd9
db_auth_host.c
d2baee2f47dc5d96c913ac0d6550134bdcab9753 08-May-2014 Mark Salyzyn <salyzyn@google.com> am e7597115: am 328746da: am 129e9dad: Merge changes Idfd1a114,If725a1cb,I61211165,If9a05ccb

* commit 'e75971157c46a0fc57194a75d4dde0920f60f427':
adb: turn on -Werror
netcfg: turn on -Werror
mkbootimg: turn on -Werror
gpttool: turn on -Werror
da6a0aa0df91d7e9429c522e403a129077502df9 08-May-2014 Ying Wang <wangying@google.com> am b18da571: am 1e6cd741: am 803fb62b: Merge "Remove unused LOCAL_LDLIBS."

* commit 'b18da571f90eebedd99fe5607a6b0d7ae4e91893':
Remove unused LOCAL_LDLIBS.
e75971157c46a0fc57194a75d4dde0920f60f427 08-May-2014 Mark Salyzyn <salyzyn@google.com> am 328746da: am 129e9dad: Merge changes Idfd1a114,If725a1cb,I61211165,If9a05ccb

* commit '328746da8090a549e432da2358585b101e30d753':
adb: turn on -Werror
netcfg: turn on -Werror
mkbootimg: turn on -Werror
gpttool: turn on -Werror
328746da8090a549e432da2358585b101e30d753 08-May-2014 Mark Salyzyn <salyzyn@google.com> am 129e9dad: Merge changes Idfd1a114,If725a1cb,I61211165,If9a05ccb

* commit '129e9dada707d66eb3242b666b6187a031dc410a':
adb: turn on -Werror
netcfg: turn on -Werror
mkbootimg: turn on -Werror
gpttool: turn on -Werror
129e9dada707d66eb3242b666b6187a031dc410a 08-May-2014 Mark Salyzyn <salyzyn@google.com> Merge changes Idfd1a114,If725a1cb,I61211165,If9a05ccb

* changes:
adb: turn on -Werror
netcfg: turn on -Werror
mkbootimg: turn on -Werror
gpttool: turn on -Werror
b18da571f90eebedd99fe5607a6b0d7ae4e91893 08-May-2014 Ying Wang <wangying@google.com> am 1e6cd741: am 803fb62b: Merge "Remove unused LOCAL_LDLIBS."

* commit '1e6cd741fd130e5916337eb75c9ceef2152035d2':
Remove unused LOCAL_LDLIBS.
1e6cd741fd130e5916337eb75c9ceef2152035d2 08-May-2014 Ying Wang <wangying@google.com> am 803fb62b: Merge "Remove unused LOCAL_LDLIBS."

* commit '803fb62bb49b551afff546b4748d2d3e9ec54af1':
Remove unused LOCAL_LDLIBS.
9f437d71812dd9907571d0cabd061153190ebbb9 08-May-2014 Ying Wang <wangying@google.com> Remove unused LOCAL_LDLIBS.

Change-Id: I42aeb7668183e7a06207ee063f6eee4d37d66c6e
ndroid.mk
7a5e2bd0621ee0b1c66d8f4c21497ffb62feff42 06-May-2014 Greg Hackmann <ghackmann@google.com> adb: replace utimes() with utime()

Fix the win_sdk host build by replacing utimes() with utime(). utime()
is functionally equivalent to utimes() when dealing with non-fractional
second timestamps, and is supported by the Windows CRT.

(The Windows CRT uses the nonstandard name _utime(), but mingw creates
aliases to the POSIX names.)

Change-Id: I513c6c5de05376c34cbb0894a94259acba8ae6f1
ile_sync_client.c
60299dfd6a5dca059a079bc8e11d45a1fecf02d0 30-Apr-2014 Mark Salyzyn <salyzyn@google.com> adb: turn on -Werror

- Deal with some -Wunused issues

Change-Id: Idfd1a114e68ae637978b52fde5144d0dca0ec79f
ndroid.mk
ackup_service.c
ommandline.c
ile_sync_client.c
emount_service.c
ysdeps_win32.c
sb_windows.c
1297d22bc99c26b2ad414faedd5bea73a16ecb90 24-May-2013 jzhuan5 <jin.can.zhuang@intel.com> adbd: adb root should terminate adbd only if it's debuggable

adb root command will terminate adbd when closing the socket if current
user id is not root. This works for userdebug build, as adb root causes
re-enumeration.

But for user build, adb root command won't cause re-enumeration, and if
adbd is terminated and restarted, it will be in offline state, thus it
won't send any thing to host.

Change-Id: I81216a3b3da888cd9b236060cf745175f6d93c60
Author: jzhuan5 <jin.can.zhuang@intel.com>
Signed-off-by: Bo Huang <bo.b.huang@intel.com>
ockets.c
fd18127eb7f1b900beb72be35bbe9163bf95995a 04-May-2014 herman_lin <herman_lin@compal.com> Modify VID for Compal

The original definition of VENDOR_ID_COMPAL is for Compal Communications, Inc.
But Compal Communications, Inc(CCI) had been merged into Compal Electronics, Inc(CEI) at April of 2014
So VENDOR_ID_COMPAL should be changed from 0x1219(CCI's VID) to 0x04B7(CEI's VID).
And add one new definition(VENDOR_ID_COMPALCOMM) for CCI to maintain old devices that use CCI's VID.
modified: adb/usb_vendors.c

Change-Id: I9e9a96f6cc81273ff2c9353a13e7ce3b0583396b
sb_vendors.c
de8ff4adcaa487259f9ddcd0eab4d1117d1cca71 19-Apr-2013 Lajos Molnar <lajos@google.com> adb: added support for adb pull -a to preserve time stamps and mode

Added -a flag to adb pull that preserves time and mode. Mode is
subjected to umask for security. We only receive modification
time from adb server, so creation time will be set to the modification
time as well.

Change-Id: I37c0b94741ed464f19025d25dea3ff2f6ac43e7f
Signed-off-by: Lajos Molnar <lajos@google.com>
ommandline.c
ile_sync_client.c
ile_sync_service.h
1333e012ee65fef59f5f43f33744230574dfc2a2 30-Apr-2014 Bill Yi <byi@google.com> Merge commit '4102af05a86aae36d2560fd8b3f740a52399342c' into HEAD
48858b21b2609831bfc105fb937ea322daedb9e9 18-Apr-2014 Colin Cross <ccross@android.com> am c33702dd: am 4785ea60: Merge "adb: Add USB vendor ID for Prestigio"

* commit 'c33702dd92da5f41d17ee9a64a8a0ff67f6e9d1b':
adb: Add USB vendor ID for Prestigio
76b526a2cad8f42717c48ad5d451dfc09d5a6d6f 15-Apr-2014 DanielMo <DanielMo@fih-foxconn.com> adb: Add USB vendor ID for Prestigio

Change-Id: Ib9e79043961b9b1fa27d87f5bc815000e7965706
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
sb_vendors.c
83ec00108676fa66cec470e886b87384bdf1e6a2 15-Apr-2014 Jeff Brown <jeffbrown@google.com> am a77bef47: Document the adb install -d option.

* commit 'a77bef47decf2c0818397aced983999e235aa82f':
Document the adb install -d option.
a77bef47decf2c0818397aced983999e235aa82f 15-Apr-2014 Jeff Brown <jeffbrown@google.com> Document the adb install -d option.

Change-Id: Ife0da42c22e4408dc5c07ac0f20e0ecbbde20832
ommandline.c
ae1f0094309b9bad62ff7de32820c78f66f2c07a 31-Mar-2014 Bao Haojun <baohaojun@gmail.com> Add Smartisan usb config

Change-Id: Ifd921f1dc0d2163230337805c3cf726f371300b0
Signed-off-by: Bao Haojun <baohaojun@gmail.com>
sb_vendors.c
d3113afc4775495ce1b89b031f0b26ac7d0e7cbc 26-Mar-2014 Colin Cross <ccross@android.com> am 707f5b40: am 6940bc08: Merge "adb: Add USB vendor ID for Intermec Technologies Corp."

* commit '707f5b401ec354851c0e1b22c8ddb6aba45fba66':
adb: Add USB vendor ID for Intermec Technologies Corp.
2b6612ff96eaf4ad5debda7af5d2a9bdb04c417d 26-Mar-2014 DanielMo <DanielMo@fih-foxconn.com> adb: Add USB vendor ID for Intermec Technologies Corp.

Change-Id: I6429bca087523829a13f905ae9dfa5f43b7abf8b
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
sb_vendors.c
5a5ab405cd796eeb08ae94b201eb297d68f09bd8 20-Mar-2014 JP Abgrall <jpa@google.com> am 4db6ce8e: Merge "Adding documentation on the sync part of the adb protocol previously missing."

* commit '4db6ce8e353458de751394102084bb3a304a7ff6':
Adding documentation on the sync part of the adb protocol previously missing.
ff66a06851828e3e5afaf14dc29526e09ca534e4 20-Mar-2014 JP Abgrall <jpa@google.com> am 4db6ce8e: Merge "Adding documentation on the sync part of the adb protocol previously missing."

* commit '4db6ce8e353458de751394102084bb3a304a7ff6':
Adding documentation on the sync part of the adb protocol previously missing.
4db6ce8e353458de751394102084bb3a304a7ff6 20-Mar-2014 JP Abgrall <jpa@google.com> Merge "Adding documentation on the sync part of the adb protocol previously missing."
912d5dddf81da3c5485d17480fb6b773334bf7eb 20-Mar-2014 Samuel Carlsson <samuel.carlsson@gmail.com> Adding documentation on the sync part of the adb protocol previously missing.

In the SERVICES.TXT a missing documentation file is mentioned - SYNC.TXT. This file is supposed to contain all the godie bits of the adb protocol for pushing and pulling files. I've read the source code and documented this in the file SYNC.TXT. I've used my own documentation to create a java implementation to verify the documentation here: https://github.com/vidstige/jadb

Added line breaks at 78 characters. Added comments about remote files might be deleted.

Change-Id: I48c87c2a9fb5b59b85c72679124dfbbfa9a701bc
Signed-off-by: Samuel Carlsson <samuel.carlsson@gmail.com>
YNC.TXT
111c882b3ca61a3a3c069d0ad69b64053f991e15 14-Mar-2014 David 'Digit' Turner <digit@google.com> am ee223d50: Merge "adb: Increase the max number of emulator instances to 64"

* commit 'ee223d50a009af39be577c30cc35257c751f05a1':
adb: Increase the max number of emulator instances to 64
7cb1504e8a234fa8aaa110912c75fb221307ad17 14-Mar-2014 David 'Digit' Turner <digit@google.com> am ee223d50: Merge "adb: Increase the max number of emulator instances to 64"

* commit 'ee223d50a009af39be577c30cc35257c751f05a1':
adb: Increase the max number of emulator instances to 64
648f4113bcd82e00f4ef1ba80d1928ee0d8d7685 13-Mar-2014 JP Abgrall <jpa@google.com> am 5fb1a34a: Merge "Added transfer progress reporting for push and pull commands."

* commit '5fb1a34af4128bfe7332b02e31b146a82bc2872d':
Added transfer progress reporting for push and pull commands.
094fd86b1423fbb4f4c421447ddf6d10a5027c7b 13-Mar-2014 David 'Digit' Turner <digit@google.com> adb: Increase the max number of emulator instances to 64

When the ADB server starts, it probes the localhost ports to find
existing emulator instances, starting from 5555 with increments of
2, and stopping after ADB_LOCAL_TRANSPORT_MAX tries, which was
set to 16.

This means that the ADB server could not detect on startup more
than 16 existing emulator instances.

This increases the limit to 64, to match a corresponding change
on the emulator side.

See https://android-review.googlesource.com/#/c/83553/

Change-Id: I35c69f8017298c3e5797bd396b8d788d44eaa00f
ransport_local.c
73690b24c64bdd96db5316eead079d03b7dcd8ea 12-Mar-2014 JP Abgrall <jpa@google.com> am 5fb1a34a: Merge "Added transfer progress reporting for push and pull commands."

* commit '5fb1a34af4128bfe7332b02e31b146a82bc2872d':
Added transfer progress reporting for push and pull commands.
76f2a93b18e0d321d527cb64c2b2c4281e1cf70f 12-Mar-2014 Mark Lindner <mlindner@google.com> Added transfer progress reporting for push and pull commands.

Added a new '-p' switch to the 'push' and 'pull' commands that outputs
the file transfer progress (bytes transmitted, total bytes, and % done).
This provides useful feedback when transferring large files, and also
makes it possible for other tools to easily monitor the progress of a
forked push/pull command.

Change-Id: Iee6f42f5bd41292e5bc80fba779f526f0072e356
ommandline.c
ile_sync_client.c
ile_sync_service.h
66146c40f7bb9ae3fba4db905634d41684b81279 11-Mar-2014 JP Abgrall <jpa@google.com> am 44390474: Merge "adb: Don\'t unlink special files on sync failure."

* commit '443904746301e4d519e51075487ea4c8b9a860e3':
adb: Don't unlink special files on sync failure.
8a00ce939aca70aaba4138391441e6b4047ff12d 11-Mar-2014 JP Abgrall <jpa@google.com> am b2c34ece: Merge "adb: Don\'t clobber block devices during push"

* commit 'b2c34ece647c212baa30c474394c498a2d6dd61f':
adb: Don't clobber block devices during push
40b735f9b952fd00d890a3c0689b0f694fc9211b 11-Mar-2014 JP Abgrall <jpa@google.com> am 1367854a: Merge "adb: fix windows build after "forward --list" fix."

* commit '1367854a891090d1be1edfb12515691b20b350cf':
adb: fix windows build after "forward --list" fix.
a4a9e64668ce1980e7c39e476aee89b106f6517a 11-Mar-2014 JP Abgrall <jpa@google.com> am 66e95d76: Merge "Fix adb forward --list when forwarding a lot"

* commit '66e95d76c47a3a099931bbebe7f4a0af4d3f7fbb':
Fix adb forward --list when forwarding a lot
b4f1b3ca6502041bd5350b211f894928790d214d 08-Mar-2014 JP Abgrall <jpa@google.com> am 44390474: Merge "adb: Don\'t unlink special files on sync failure."

* commit '443904746301e4d519e51075487ea4c8b9a860e3':
adb: Don't unlink special files on sync failure.
270ebefc6c0c7937e8bef112a257b25509a1c2b7 08-Mar-2014 JP Abgrall <jpa@google.com> am b2c34ece: Merge "adb: Don\'t clobber block devices during push"

* commit 'b2c34ece647c212baa30c474394c498a2d6dd61f':
adb: Don't clobber block devices during push
55b6c843a6166fbbf57aa4afba8b2c2b3e87cfea 08-Mar-2014 JP Abgrall <jpa@google.com> adb: Don't unlink special files on sync failure.

adb push some_disk_image /dev/block/mmcblk0p9
should not unlink the dev just because adb was ctrl-c'd.

Change-Id: I1b6669e8dba1f80fc1438b8deb618180b7e9a1b2
Signed-off-by: JP Abgrall <jpa@google.com>
ile_sync_service.c
4ce2f838e78592d0b93776b73ca4de855a423dde 03-Dec-2013 JP Abgrall <jpa@google.com> adb: Don't clobber block devices during push

In the past, an adb push would ALWAYS unlink the target path.
Now, we only links and regular files (and links).
This allows the following to work:

adb shell ls -l /dev/block/mmcblk0p8
# brw------- root root 179, 8 2013-11-28 07:43 mmcblk0p8
adb push n7.jpa.mda.post_jb_encryption.raw /dev/block/mmcblk0p8

Bug: 11984121
Change-Id: I982c7a1cd87986621f2bebdcb41c4e281f67f772
ile_sync_service.c
ecac99b54ce704f282ff6706f8cfada48f41b35c 07-Mar-2014 JP Abgrall <jpa@google.com> am 1367854a: Merge "adb: fix windows build after "forward --list" fix."

* commit '1367854a891090d1be1edfb12515691b20b350cf':
adb: fix windows build after "forward --list" fix.
5b0bb4898c61e5b5b7dc95c185b2e46b65f60d00 07-Mar-2014 JP Abgrall <jpa@google.com> adb: fix windows build after "forward --list" fix.

EWOULDBLOCK is not there on windows.
It gets translated by the adb_write() wrapper into EGAIN.
But the Linux one does not translate EWOULDBLOCK into EGAIN.
Without EWOULDBLOCK, it works just fine.

Change-Id: Ic293be392aa4364637428ea94ef87890ffa09b9b
Signed-off-by: JP Abgrall <jpa@google.com>
ransport.c
9f573bb362c3716c54df77d85a0285897daa242a 07-Mar-2014 JP Abgrall <jpa@google.com> am 66e95d76: Merge "Fix adb forward --list when forwarding a lot"

* commit '66e95d76c47a3a099931bbebe7f4a0af4d3f7fbb':
Fix adb forward --list when forwarding a lot
6e94c5764b1775a0e4f122cf3925c46815029ccb 07-Mar-2014 Nick Kralevich <nnk@google.com> am 2e7347d6: Merge "Convert all selinux_android_restorecon and _setfilecon calls to new API."

* commit '2e7347d617b02b13d227bb4cecf6bd69b7b20fa9':
Convert all selinux_android_restorecon and _setfilecon calls to new API.
3530b9cd4675a5e0c5c02dd765450b84ace67401 04-Mar-2014 Nick Kralevich <nnk@google.com> am 02916aa2: Remove obsolete vdc call.

* commit '02916aa20e3ffbe4b738bb12dc1607a7ec6a8c37':
Remove obsolete vdc call.
02916aa20e3ffbe4b738bb12dc1607a7ec6a8c37 15-Jan-2014 Nick Kralevich <nnk@google.com> Remove obsolete vdc call.

Since ca8e66a8b0f843812014a28d49208f9f6f64ecbc, init has
been handling reboots and filesystem unmounts. Remove obsolete
call to vdc.

Bug: 12504045
Change-Id: If8704ca042cb3a68857743b9973e48c52e7eb881
(cherry picked from commit 225459a5da21e9397ca49b0d9af7d5fe3462706b)
db.c
ervices.c
2264e7cfef6b1236a90a13b1d99abb4aadcb0b93 30-Jan-2014 Snild Dolkow <snild.dolkow@sonymobile.com> Fix adb forward --list when forwarding a lot

The list action had some problems with large numbers of forwards:
* adb_query() limited replies to 1024 B (and the print was useless)
* the reply header's length could overflow (also in other commands)
* ...and the client had no way of detecting it
* writex() didn't retry on EAGAIN ("Resource temporarily unavailable")

This patch makes all "OKAY%04x" replies use a common function which
checks the length and limits it to 0xffff. This means that the client
can easily check for truncated replies.

Before: forward --list starts failing at 15-30 forwards (depending on
device serial and forward spec lengths).

After: no problems with forward --list.

Change-Id: Ie1e82c4d622f5c56e51abb26533ba17d40459914
db.c
db_client.c
ransport.c
488b5eafe368781077b367a9afd68db303bc8891 13-Feb-2014 Nick Kralevich <nnk@google.com> am 2e7347d6: Merge "Convert all selinux_android_restorecon and _setfilecon calls to new API."

* commit '2e7347d617b02b13d227bb4cecf6bd69b7b20fa9':
Convert all selinux_android_restorecon and _setfilecon calls to new API.
27a93650c0df02e4cd3c48bbec8acee8b817a012 07-Feb-2014 Stephen Smalley <sds@tycho.nsa.gov> Convert all selinux_android_restorecon and _setfilecon calls to new API.

libselinux selinux_android_restorecon API is changing to the more
general interface with flags and dropping the older variants.

Also get rid of the old, no longer used selinux_android_setfilecon API
and rename selinux_android_setfilecon2 to it as it is the only API in use.

Change-Id: I1e71ec398ccdc24cac4ec76f1b858d0f680f4925
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
ile_sync_service.c
3a5f3050626c01c45ff487274a2399876d63a4eb 28-Jan-2014 Mark Salyzyn <salyzyn@google.com> am 7b9bb36a: am 0256e1f6: am d2acdd82: Merge changes I70ab37d5,I716f89c0,I34c96adf,I77650923,I35b0d1ee, ...

* commit '7b9bb36ade6c8fa2e77416143847b019ddda9e95': (29 commits)
libsysutils: SocketListener export release
libsysutils: Add iovec/runOnEachSocket
liblog: support struct logger_event_v2 format
liblog: update timestamp on NOTICE file
libcutils: resolve warning in iosched_policy.c
liblog: Add const pedantics
logcat: Add -T flag (-t w/o assumption of -d)
logcat: Add logcat test suite
liblog: Add cpu utilization test
liblog: Add liblog test suite
debuggerd: Support newline split in log messages
liblog: deprecate export LOGGER ioctl definitions
liblog: deprecate export of LOGGER_LOG_* defines
liblog: Add README
liblog: resolve build warning messages
liblog: high CPU usage from logcat
liblog: fix build again
liblog: drop use of sys/cdefs.h
liblog: git_master@964770 build problem
logcat: Incorporate liblog reading API
...
d2acdd82e613b3e1d79a00943ac3bf5fbc14a766 28-Jan-2014 Mark Salyzyn <salyzyn@google.com> Merge changes I70ab37d5,I716f89c0,I34c96adf,I77650923,I35b0d1ee, ...

* changes:
libsysutils: SocketListener export release
libsysutils: Add iovec/runOnEachSocket
liblog: support struct logger_event_v2 format
liblog: update timestamp on NOTICE file
libcutils: resolve warning in iosched_policy.c
liblog: Add const pedantics
logcat: Add -T flag (-t w/o assumption of -d)
logcat: Add logcat test suite
liblog: Add cpu utilization test
liblog: Add liblog test suite
debuggerd: Support newline split in log messages
liblog: deprecate export LOGGER ioctl definitions
liblog: deprecate export of LOGGER_LOG_* defines
liblog: Add README
liblog: resolve build warning messages
liblog: high CPU usage from logcat
liblog: fix build again
liblog: drop use of sys/cdefs.h
liblog: git_master@964770 build problem
logcat: Incorporate liblog reading API
debuggerd: Incorporate liblog reading API
liblog: Interface to support abstracting log read
adb: deprecate legacy log service interface
adb: regression from Move list.c to inlines
liblog: whitespace cleanup
libcutils: bug str_parms.c:str_parms_get_float().
libcutils: UNUSED argument warnings
libsysutils: Get rid of warnings
libcutils: Move list.c to inlines on list.h
119dbff9c18453c9d91189424e44b3dcdf9bb82b 28-Jan-2014 Benoit Goby <benoitgoby@google.com> am bbc92ee7: am 68a74ec4: am 6ddabb7a: Merge "adbd: Don\'t close/reopen FFS ep0 on disconnect"

* commit 'bbc92ee7e4d05571e734022894afa2236ccbf9a4':
adbd: Don't close/reopen FFS ep0 on disconnect
6ddabb7a1cc3080ae773acb045f69b5e6afee87a 28-Jan-2014 Benoit Goby <benoitgoby@google.com> Merge "adbd: Don't close/reopen FFS ep0 on disconnect"
7aa39a7b199bb9803d3fd47246ee9530b4a96177 10-Dec-2013 Mark Salyzyn <salyzyn@google.com> adb: deprecate legacy log service interface

(cherry picked form commit c66a7537df987715acc77eed952111cc56b7e72b)

Change-Id: If96019cc13b3d7a4dcd7785c7137e0cbcc622981
ndroid.mk
ERVICES.TXT
db.h
og_service.c
ervices.c
c788278abce1830d4b5e9e78aaefd86d0eecafde 07-Dec-2013 Mark Salyzyn <salyzyn@google.com> adb: regression from Move list.c to inlines

(cherry picked from commit 5f64d528be2ca7229c0e9ce00837ac0fa4da2e54)

Change-Id: I057dbe3db80b1460f774e9f9ade11e0929529ec6
ndroid.mk
75e0645921cb6c3e9d33672733372f519bf57f38 10-Dec-2013 Nick Kralevich <nnk@google.com> Fix overflow in adb_client

Credit: Joshua Drake
Bug: 12060953

(cherry picked from commit e89e09dd2b9b42184973e3ade291186a2737bced)

Change-Id: I8a9b2592a5e4f7527c607abfe4ea6df6eb550aa8
db_client.c
c3af60aff5d097c717b19721f143499891d5ca3d 24-Jan-2014 Nick Kralevich <nnk@google.com> am c7e28899: am 16384312: am 0620e3dd: Merge "adbd: switch to su domain when running as root"

* commit 'c7e28899c3917ad6e72d5dc99401bcd133cbd475':
adbd: switch to su domain when running as root
16384312244b8dccd53478a7bdeeb9a492821807 24-Jan-2014 Nick Kralevich <nnk@google.com> am 0620e3dd: Merge "adbd: switch to su domain when running as root"

* commit '0620e3ddb85582f66612d046d1295dc20bf1a4f5':
adbd: switch to su domain when running as root
d49aa2537cf0b454dfaa4b0312a403ebff202d70 18-Jan-2014 Nick Kralevich <nnk@google.com> adbd: switch to su domain when running as root

When adbd runs as root, it should transition into the
su domain. This is needed to run the adbd and shell
domains in enforcing on userdebug / eng devices without
breaking developer workflows.

Introduce a new device_banner command line option.

Change-Id: Ib33c0dd2dd6172035230514ac84fcaed2ecf44d6
db.c
eb665350d13d36f8974da332674adf5df58859f3 18-Jan-2014 Nick Kralevich <nnk@google.com> am 55537633: am 78af6c4c: am 0a72d293: Merge "Fix "adb push /sdcard/filename""

* commit '555376331f436fb519c182677c22d8299ead5523':
Fix "adb push /sdcard/filename"
78af6c4c946fec01b232c92d40eb6fd202490e3e 18-Jan-2014 Nick Kralevich <nnk@google.com> am 0a72d293: Merge "Fix "adb push /sdcard/filename""

* commit '0a72d2930adcd3b3504448f71b25ebb88c2cc3cf':
Fix "adb push /sdcard/filename"
72917837e6a1163bd389cf535eb404501a118cf2 18-Jan-2014 Nick Kralevich <nnk@google.com> Fix "adb push /sdcard/filename"

Don't assume that calling chown(filename, getuid(), getgid())
will always succeed. In the case of /sdcard, a file you create
will be owned by root, so the chown call will fail.

Instead, use uid=gid=-1 so that the chown call is truly a no-op.

Ignore the results of calling chmod. Again, for /sdcard, the
chmod call will never succeed, because the file isn't owned by
the shell user.

Bug: 12441485
Change-Id: I11eaf1d6f6049c1158afc29754fbb7af2baf2c78
ile_sync_service.c
ec9e5891ac97c50cfb8d3d1c9c2d478637eff62b 16-Jan-2014 Elliott Hughes <enh@google.com> am 8940c0a0: am 97373bbc: am 7cd15614: Merge "system/core 64-bit cleanup."

* commit '8940c0a07f8d6682712e2d2ee387e78096602f99':
system/core 64-bit cleanup.
97373bbc713c52c43e0fa48d0f16466e0a450178 16-Jan-2014 Elliott Hughes <enh@google.com> am 7cd15614: Merge "system/core 64-bit cleanup."

* commit '7cd1561410473c71d40cec822fb53a282b5b3279':
system/core 64-bit cleanup.
ccecf1425412beb2bc3bb38d470293fdc244d6f1 16-Jan-2014 Elliott Hughes <enh@google.com> system/core 64-bit cleanup.

This cleans up most of the size-related problems in system/core.
There are still a few changes needed for a clean 64-bit build,
but they look like they might require changes to things like the
fastboot protocol.

Change-Id: I1560425a289fa158e13e2e3173cc3e71976f92c0
ervices.c
ockets.c
ransport.c
ransport_local.c
sb_linux.c
sb_linux_client.c
225459a5da21e9397ca49b0d9af7d5fe3462706b 15-Jan-2014 Nick Kralevich <nnk@google.com> Remove obsolete vdc call.

Since ca8e66a8b0f843812014a28d49208f9f6f64ecbc, init has
been handling reboots and filesystem unmounts. Remove obsolete
call to vdc.

Bug: 12504045
Change-Id: If8704ca042cb3a68857743b9973e48c52e7eb881
db.c
ervices.c
e0e7595f3c5e069e6b85973df6dbba39dcec0984 12-Jan-2014 Colin Cross <ccross@android.com> am e76343ef: Merge "Emerson USB ID"

* commit 'e76343ef72458aff8fdc25c57f4e84407c05a2f2':
Emerson USB ID
e76343ef72458aff8fdc25c57f4e84407c05a2f2 12-Jan-2014 Colin Cross <ccross@android.com> Merge "Emerson USB ID"
6e39bace17ef089beb143f6324807b9d33df366c 12-Jan-2014 Jon Sawyer <jon@cunninglogic.com> Emerson USB ID

Adds Emerson's USB id to the known USB Devices.

Change-Id: If6115c2551c1f30a5c190690f2aeaaf2adff7ee1
Signed-off-by: Jon Sawyer <jon@cunninglogic.com>
sb_vendors.c
c121c69b856bfa9baea105439fbdac648d154097 09-Jan-2014 Colin Cross <ccross@android.com> am b0751101: Merge "HP USB ID"

* commit 'b0751101b090a8732c62ad261fa44e5d6a69a2cc':
HP USB ID
5ff167ca1121a2d598aa7564449950076f42a5ca 08-Jan-2014 Jon Sawyer <jon@cunninglogic.com> HP USB ID

Adds HP's USB id to the know USB Devices

Change-Id: I975126f3ae5e53f25e18dea7cc43c29076bfc965
Signed-off-by: Jon Sawyer <jon@cunninglogic.com>
sb_vendors.c
4cbf1d882236462482b8e22893061604b224e308 24-Dec-2013 Jack Pham <jackp@codeaurora.org> adbd: Don't close/reopen FFS ep0 on disconnect

In case of bulk read/write failure or disconnect, transport_usb
calls usb_ffs_kick in order to force the daemon to re-open the
FunctionFS ep files as a way to soft restart the kernel driver.

However, there's no reason to always close the ep0 file, as it
would need to be reopened and the descriptors rewritten--this
is unnecessary, especially in the simple/frequent case of cable
disconnect, and causes the kernel driver to unbind and bind *all*
of the function drivers. This is causing USB Chapter 9 tests to fail.

Thus, try to reuse the same ep0 file handle across reconnects. In
case there is a failure, the ep1/ep2 opens would fail and all the
file handles get dropped. For the adb root case, the entire daemon
gets restarted anyway.

Change-Id: I0840085c52a0795dcb2d751c39aa4a436c039ee2
sb_linux_client.c
d8f74f1b3e40d64fafcd327066428235f0312c47 06-Jan-2014 Colin Cross <ccross@android.com> am 491ecd0b: Merge changes Id8bec8a3,Ied42e4d0,Iea3f7cc6,Ic7f7c984,Ic77d5f71, ...

* commit '491ecd0b7275a98b7fda9b1e807724f7f06b1469':
adb: Add USB vendor ID for YotaDevices
adb: Add USB vendor ID for TechFaith
adb: Add USB vendor ID for Rockchip
adb: Add USB vendor ID for EMERGING Technology (Holdings) Ltd.
adb: Add USB vendor ID for Allwinner
adb: Add USB vendor ID for Amlogic
added Gigaset's USB vendor ID
adb: alphabetically sort usb vendors lists
c1b6b153dc7c535294a63a215a018d0824813757 04-Sep-2013 DanielMo <DanielMo@fih-foxconn.com> adb: Add USB vendor ID for YotaDevices

Change-Id: Id8bec8a35edd0d21ae52e8469f7a65b5f4433bc2
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
sb_vendors.c
402c2b98889e02a9b558b02a0bc28bd85fb36b31 17-Dec-2013 DanielMo <DanielMo@fih-foxconn.com> adb: Add USB vendor ID for TechFaith

Change-Id: Ied42e4d011b736ee990ed75e7d81bc6a16db47f9
sb_vendors.c
d0057c006b5bdfec6e6322d2b80a985a6359d8f3 27-Aug-2013 DanielMo <DanielMo@fih-foxconn.com> adb: Add USB vendor ID for Rockchip

Change-Id: Iea3f7cc6ed463684fe30a73c39445b3ca36854d9
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
sb_vendors.c
fdd189c64ee5afe01f11072255a44fe57b965f57 08-Oct-2013 DanielMo <DanielMo@fih-foxconn.com> adb: Add USB vendor ID for EMERGING Technology (Holdings) Ltd.

Change-Id: Ic7f7c984db19050d2ce4da8ae87683ce42dc9094
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
sb_vendors.c
63f0f5117bb8ca781a8d9c9a66f5cba755e6005e 28-Aug-2013 DanielMo <DanielMo@fih-foxconn.com> adb: Add USB vendor ID for Allwinner

Change-Id: Ic77d5f71c9e329e33cd31fa0854e692ad794a609
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
sb_vendors.c
d5dab6d5f85e7c03f08614918088a33ce73abcf5 26-Aug-2013 DanielMo <DanielMo@fih-foxconn.com> adb: Add USB vendor ID for Amlogic

Change-Id: I35fad82214f2b5a82b0150821326aaea15784de1
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
sb_vendors.c
319d8c1d1f5e11e971125bb244e9afca25bce592 07-Oct-2013 Volker Moesker <volker.moesker@gigaset.com> added Gigaset's USB vendor ID

Change-Id: Iebb0f352eec4530ee1e972527fc76bbb9dad5cc3
Signed-off-by: Volker Moesker <volker.moesker@gigaset.com>
sb_vendors.c
293717c364f325c1b60a28fa5913cec0a99ba03d 06-Jan-2014 Colin Cross <ccross@android.com> adb: alphabetically sort usb vendors lists

Sort the lists of usb vendor ids alphabetically to reduce future
conflicts.

Change-Id: I682c18a1d97adf3a4aa9c00de9fed932c83e4646
sb_vendors.c
4600d80cef73af052cbba25c7af0d7abfda6e08b 03-Jan-2014 Colin Cross <ccross@android.com> am e1095e1d: Merge "Modify BYD\'s USB Vendor ID"

* commit 'e1095e1da12de9d6dc219f497f7c19d1c1f7a41b':
Modify BYD's USB Vendor ID
e1095e1da12de9d6dc219f497f7c19d1c1f7a41b 03-Jan-2014 Colin Cross <ccross@android.com> Merge "Modify BYD's USB Vendor ID"
8be1ccff87cad2a71a4db2f3f827b428e0d26d81 03-Jan-2014 Nick Kralevich <nnk@google.com> am fcf3d207: Merge "adb: configure /system file permission with fs_config"

* commit 'fcf3d207c51f1e734137a08ae2fdb1bb37a50b87':
adb: configure /system file permission with fs_config
20d33f4d99c26afdd0aebf23786958ef34e261e3 03-Jan-2014 Liang Cheng <licheng@nvidia.com> adb: configure /system file permission with fs_config

adbd changes the permissions of files uploaded by copying
owner's permission to group and other. This causes kernel
load failure if any changes are made to kernel modules
followed by ``adb push'' or ``adb sync'' because file mode
644 would become 666.

The change uses fs_config to get the target mode of files.

In addition, the SELinux file label is set incorrectly
on synced files. Set the label properly.

Change-Id: I354db848f39adfbf189d7e8d3b028e8d763c772f
Signed-off-by: Liang Cheng <licheng@nvidia.com>
Bug: 12264775
ndroid.mk
ile_sync_service.c
98fdcfa9817bf54a8695c57366f4ff047ceddb85 19-Dec-2013 Nick Kralevich <nnk@google.com> am 67cb61ee: Merge "adb: Check sender\'s socket id when receiving packets."

* commit '67cb61ee5a8b8f5c967361430fff250e76c3a1dc':
adb: Check sender's socket id when receiving packets.
818d641c420f5d4f35f4e8706937c17b974146d1 13-Dec-2013 David 'Digit' Turner <digit@android.com> adb: Check sender's socket id when receiving packets.

handle_packet() in adb.c didn't check that when an A_WRTE packet is
received, the sender's local-id matches the socket's peer id.

This meant that a compromised adbd server could sent packets to
the host adb server, spoofing the identity of another connected
device if it could "guess" the right host socket id.

This patch gets rid of the issue by enforcing even more checks
to ensure that all packets comply with the description in
protocol.txt.

+ Fix a bug where closing a local socket associated with a
remote one would always send an A_CLSE(0, remote-id, "")
message, though protocol.txt says that should only happen
for failed opens.

The issue was that local_socket_close() called
remote_socket_close() after clearing the remote socket's
'peer' field.

The fix introduces a new asocket optional callback,
named 'shutdown' that is called before that, and is
used to send the A_CLSE() message with the right ID
in remote_socket_shutdown().

Also add some code in handle_packet() to detect
invalid close commands.

Change-Id: I9098bc8c6e81f8809334b060e5dca4fc92e6fbc9
db.c
db.h
ockets.c
a91a47c30c7c6672137d5f43cffe87ed34dae04a 10-Dec-2013 Nick Kralevich <nnk@google.com> am b2dfa7ec: am 02d90b92: am 33e7f915: am 54a80bcf: am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client

* commit 'b2dfa7ece7fb69d2ce5ae517eb35492beb646385':
Fix overflow in adb_client
b2dfa7ece7fb69d2ce5ae517eb35492beb646385 10-Dec-2013 Nick Kralevich <nnk@google.com> am 02d90b92: am 33e7f915: am 54a80bcf: am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client

* commit '02d90b92ce65ad4e7f49565f0e97373e1d8b0fbf':
Fix overflow in adb_client
02d90b92ce65ad4e7f49565f0e97373e1d8b0fbf 10-Dec-2013 Nick Kralevich <nnk@google.com> am 33e7f915: am 54a80bcf: am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client

* commit '33e7f915d6a27880dd4c4c0709dcc921f549eea2':
Fix overflow in adb_client
33e7f915d6a27880dd4c4c0709dcc921f549eea2 10-Dec-2013 Nick Kralevich <nnk@google.com> am 54a80bcf: am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client

* commit '54a80bcf88060b21f527c631c7ec911171bdb13f':
Fix overflow in adb_client
54a80bcf88060b21f527c631c7ec911171bdb13f 10-Dec-2013 Nick Kralevich <nnk@google.com> am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client

* commit 'cd072e94cf7e546cd6d333cd65641edcd69402b7':
Fix overflow in adb_client
03d4eb29003a712c28733646588fafc8939fc1fe 10-Dec-2013 Nick Kralevich <nnk@google.com> am d63fb078: am e89e09dd: Fix overflow in adb_client

* commit 'd63fb078aea697c536b19c03d29d4dde4ac087fc':
Fix overflow in adb_client
d63fb078aea697c536b19c03d29d4dde4ac087fc 10-Dec-2013 Nick Kralevich <nnk@google.com> am e89e09dd: Fix overflow in adb_client

* commit 'e89e09dd2b9b42184973e3ade291186a2737bced':
Fix overflow in adb_client
e89e09dd2b9b42184973e3ade291186a2737bced 10-Dec-2013 Nick Kralevich <nnk@google.com> Fix overflow in adb_client

Change-Id: I7f8582bd8a69d61ce47d11a9ffd0e901fc371037
Credit: Joshua Drake
Bug: 12060953
db_client.c
a09558c2e205771e6830eeb6241c5c0e3b1cf4ce 13-Nov-2013 Wenhao Li <liwenhao.g@gmail.com> Make server port option work on windows

The server port command line option do not work
on windows, need pass -P option to child process.

Change-Id: Ibb3f0a926fae8e17c75fccbd4bb3a33318fffe9e
db.c
9259663cdb8f15226844e3ecfc6e3aa53614ad03 30-Oct-2013 Elliott Hughes <enh@google.com> am f17f5591: am 36d44740: Merge "Fix a bunch of small system/core bugs."

* commit 'f17f55914e18eb176ccc5bb8266b248ece8cb56b':
Fix a bunch of small system/core bugs.
14e28d39f7f094225c1ddae8fa43bd792c621a8f 29-Oct-2013 Elliott Hughes <enh@google.com> Fix a bunch of small system/core bugs.

Missing frees in:
adb/file_sync_client.c
fastboot/fastboot.c
libsparse/output_file.c

Missing closedirs in:
adb/file_sync_service.c
cpio/mkbootfs.c
libcutils/dir_hash.c

Potential buffer overrun in:
gpttool/gpttool.c

Incorrect NULL check in:
libsparse/backed_block.c

Bug: https://code.google.com/p/android/issues/detail?id=61564
Change-Id: If97838a9e73a77aef7f416c31c237ce1fca4ce21
ile_sync_client.c
ile_sync_service.c
406abdc8a2b68df77ab30836826f642c2ef37bda 28-Oct-2013 Brian Carlstrom <bdc@google.com> am 5dadac50: am 87af04a4: Merge "Improve some adb error logging"

* commit '5dadac50c4bbeaf8baf4d5e04c2d2706d9e74fc7':
Improve some adb error logging
93c91fad77dc9516954a606e6199e8a940d99388 18-Oct-2013 Brian Carlstrom <bdc@google.com> Improve some adb error logging

Bug: 11290643
Change-Id: Ibad4e9f0b69421cd6017b70a52237e7f27aab848
db_client.c
ommandline.c
0bf7924df19f72258df7b553515bfbc9574d0114 24-Oct-2013 Nick Kralevich <nnk@google.com> am 91704522: Don\'t return immediately from reboot commands.

* commit '917045222a69021eb36aea96708649c709685509':
Don't return immediately from reboot commands.
917045222a69021eb36aea96708649c709685509 24-Oct-2013 Nick Kralevich <nnk@google.com> Don't return immediately from reboot commands.

The reboot commands return too fast, interfering with testing.
Add a pause(), which will allow the device time to complete the
reboot.

Change-Id: Ie9cc6eea67b7ff662ec71ea2329cbb94f8d55404
Bug: 11369303
ervices.c
903e6865cae15d5967c4c810ece17c021945c2e4 02-Oct-2013 Colin Cross <ccross@android.com> am b024bbf6: am 6da66ef4: Merge "Handle screendumps for all framebuffer sizes"

* commit 'b024bbf6a1daf752a8d756bfda472fe6fb48dd9e':
Handle screendumps for all framebuffer sizes
6da66ef49b7c35cc5050a4a6b9771801640fb99b 02-Oct-2013 Colin Cross <ccross@android.com> Merge "Handle screendumps for all framebuffer sizes"
8e5b63d045e988f13d1ee9b7797db28fde15bbfc 10-Apr-2013 Doug Zongker <dougz@android.com> mincrypt: support SHA-256 hash algorithm

- adds a library to compute the SHA-256 hash

- updates the RSA verifier to take an argument specifying either SHA-1
or SHA-256

- updates DumpPublicKey to with new "key" version numbers for
specifying SHA-256

- adds new argument to adb auth code to maintain existing behavior

(cherry picked from commit 515e1639ef0ab5e3149fafeffce826cf654d616f)

Change-Id: Ib35643b3d864742e817ac6e725499b451e45afcf
db_auth_client.c
85373f42803f86e3295afd5031a0e42e0b3bef33 25-Sep-2013 Chris Dearman <chris.dearman@imgtec.com> Handle screendumps for all framebuffer sizes

readx() treats a partial read as an error but also consumes the data,
Now exactly the amount of data needed for the screendump is requested.

This bug showed up for framebuffers that were not a multiple of 640
bytes.

Also fix a compiler warning related to handing pipe() failure.

Change-Id: I8b1713923e156d4e3424784152e5dc5cbc7d478d
ramebuffer_service.c
b92649341718984bf91a09a3e9dddf04b844c567 28-Aug-2013 Elliott Hughes <enh@google.com> am 876f4366: am a7f6e015: Merge "correct msi usb vendor id."

* commit '876f436668036e8e9d3f86434eee1a44ff5364b8':
correct msi usb vendor id.
48c5d7b6cd805ea859960f9859b424b5a9a52666 28-Aug-2013 astonehuang <astonehuang@msi.com> correct msi usb vendor id.

Change-Id: I13128531b8dd7758abddce47ce1c119381773c26
sb_vendors.c
88ea2f669f914596f934ed50f67f7360aae71b68 17-Aug-2013 Elliott Hughes <enh@google.com> am 3042c265: am b3644d8f: Merge "Add USB Vendor ID for WACOM"

* commit '3042c265bf3123426e99fed856c9d3b7fa3b3ad6':
Add USB Vendor ID for WACOM
64a602942e159c73ceee5c584064f364137d1f47 13-Aug-2013 Wing Tseng <Wing_Tseng@pegatroncorp.com> Add USB Vendor ID for WACOM

Change-Id: I3deee6d5bdfb9c5bbc0fddcfa39814d27ee281c2
Signed-off-by: Wing Tseng <Wing_Tseng@pegatroncorp.com>
sb_vendors.c
49f2e1cedfcf1dac72efe6e3634a3cd2db299e30 12-Aug-2013 Elliott Hughes <enh@google.com> am cc39d421: am 936032b4: Merge "Add USB Vendor ID for MSI"

* commit 'cc39d421ea5f449d5e201dd1ada7b2a12acf5ad9':
Add USB Vendor ID for MSI
307d96a6e6377e4c250999305db540fdf4926516 01-Aug-2013 astonehuang <astonehuang@msi.com> Add USB Vendor ID for MSI

Change-Id: I4f4bfb6ef08058bf749917119a2b08952e7bc337
sb_vendors.c
44f5c157240bd9ba3077ca7f444fee4ea56ce5cf 25-Jul-2013 Colin Cross <ccross@android.com> Merge "Move liblog headers to system/core/include/log"
b815810f477aa39e28705dda1713152927e5adc6 25-Jul-2013 Elliott Hughes <enh@google.com> am 09f240e0: am 5d855432: Merge "Add USB Vendor ID for ECS"

* commit '09f240e0b06326531e64e9826859a774cd456ad7':
Add USB Vendor ID for ECS
5d8554323caddfa3ca02f31625ea72634312521f 25-Jul-2013 Elliott Hughes <enh@google.com> Merge "Add USB Vendor ID for ECS"
9227bd385504ace739d4451a6c5dc3d777b5bf21 24-Jul-2013 Colin Cross <ccross@android.com> Move liblog headers to system/core/include/log

Move the liblog headers to log/ instead of cutils/ to complete
the separation of libcutils and liblog. cutils/log.h still
exists and includes log/log.h in order to support the many existing
modules that use cutils/log.h.

Change-Id: I2758c9f4aedcb809ca7ba8383d0f55041dd44345
ndroid.mk
og_service.c
cae8b9df5c9368cabda380d82f9b6c4903e1e2e5 24-Jul-2013 ecsgms <ecs.gms@ecs.com.tw> Add USB Vendor ID for ECS

Change-Id: Ib2fa70204d37f53dc642091eb927d865ddc585b5
sb_vendors.c
228ee639be8b75ad13b945950b62529aa6615abd 18-Jun-2013 Elliott Hughes <enh@google.com> am 98c02528: am 19188955: am d92e35eb: Merge "Add Qisda usb config"

* commit '98c02528a2f8bdc0f31a78a8b0b086f4ae823310':
Add Qisda usb config
19188955b50ef6cb133780f66384e9fa055acfac 18-Jun-2013 Elliott Hughes <enh@google.com> am d92e35eb: Merge "Add Qisda usb config"

* commit 'd92e35eb7b97f349054390cfee1d40154dba6d66':
Add Qisda usb config
001fe87e0228b72bc0c048ecd92f31be023b72e5 13-Jun-2013 esther <esther530@gmail.com> Add Qisda usb config

add Qisda usb config
Signed-off-by: esther <esther530@gmail.com>

Change-Id: I5b8a0e5bd2218ecdf417de357c9a7d9307c91932

Conflicts:
adb/usb_vendors.c
sb_vendors.c
e39057b68798807f67179baac8bc61860fa1ab7a 17-Jun-2013 Elliott Hughes <enh@google.com> am 88411498: am 520f4f06: am 865bb05d: Merge "adb: fix reported transfer size for transfer over 4 GiB"

* commit '88411498b3341dbf8f2976991524b1e21dedc6f6':
adb: fix reported transfer size for transfer over 4 GiB
8df29c9b61be76c786100d36194b54a871d604f0 17-Jun-2013 Elliott Hughes <enh@google.com> am 1aeefcd6: am 0173ebd5: am 5f8d9c01: Merge "adb: add vendor ID\'s for Nook, Haier, Hisense, and MTK"

* commit '1aeefcd6900d85911028e6d3e344e338e0a05158':
adb: add vendor ID's for Nook, Haier, Hisense, and MTK
520f4f060325496741f600692f3582536fa43a8f 17-Jun-2013 Elliott Hughes <enh@google.com> am 865bb05d: Merge "adb: fix reported transfer size for transfer over 4 GiB"

* commit '865bb05dd0db1531f252de5e137605beec171ca2':
adb: fix reported transfer size for transfer over 4 GiB
0173ebd531b2b443b56d1c12d598f2f89c95fb0a 17-Jun-2013 Elliott Hughes <enh@google.com> am 5f8d9c01: Merge "adb: add vendor ID\'s for Nook, Haier, Hisense, and MTK"

* commit '5f8d9c012cf28fad57d0896b938b05e2c976073f':
adb: add vendor ID's for Nook, Haier, Hisense, and MTK
865bb05dd0db1531f252de5e137605beec171ca2 17-Jun-2013 Elliott Hughes <enh@google.com> Merge "adb: fix reported transfer size for transfer over 4 GiB"
71150ce4efdaba3d60cb39ed085b3476969ab95e 17-Jun-2013 Jeff Smith <whydoubt@gmail.com> adb: add vendor ID's for Nook, Haier, Hisense, and MTK

Change-Id: I156ff750ef9ae66113d1e0e3ceffea047abc03b9
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
sb_vendors.c
d9a1430ff2b2d2a52b586dfba1db5ac0128dd85b 15-Jun-2013 Jeff Smith <whydoubt@gmail.com> adb: fix reported transfer size for transfer over 4 GiB

When transferring files over 4 GiB with adb, the size of the transfer
is misreported.

Change-Id: Ia3d4cae1e9f82b4f7432341820b101ea9a44f85b
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
ile_sync_client.c
893a4a47e8c9290128b9254af0246e36f821c260 23-May-2013 Nick Kralevich <nnk@google.com> adb: Only use properties on device builds

When building for the host, don't make reference to
property_get / property_set. I'm in the process of removing
host side support for properties.

Change-Id: I691c5872b5fd538e78bc38a3fe72574cdc7f43c3
db.c
ervices.c
ysdeps.h
ransport_local.c
cabb75e42743e22975e8dda1035fc0aa51d8e92a 15-May-2013 kongfanqing <kong.fanqing@byd.com> Modify BYD's USB Vendor ID

Change-Id: I391487a12ba7ed86aac81457f8026acd3fd7576c
sb_vendors.c
928116ceef8dbd5ef38dfe0fd587b5d62c2c0c96 26-Sep-2012 Kenny Root <kroot@google.com> Host builds: add fastboot and adb

Add fastboot and adb host utilities to debug builds for debugging
and development purposes.

Change-Id: If77699a27497b8641998930f14d4ee418b856080
ndroid.mk
15e84ad0425a2a98c0f7db0f0b723fbbd6082cf4 26-Apr-2013 Benoit Goby <benoit@android.com> Merge "adb: Handle adb connect in a thread"
44a5fb57045709f7f3feead4c8444baa2bdfc658 25-Apr-2013 Nick Kralevich <nnk@google.com> Merge "fs_mgr: make block devices read-only"
1c45ee92e2372f3c552744823143fb093fdbda9d 30-Mar-2013 Benoit Goby <benoit@android.com> adb: Handle adb connect in a thread

adb connect calls connect() in the event loop. If you pass a wrong ip
address or the server is slow to respond, this will block the event loop
and you can't even kill the adb server with adb kill-server. Handle connect
requests in a service thread instead.

Change-Id: I2ee732869a3dc22a6d3b87cf8ac80acaa7790037
db.c
db.h
ervices.c
ransport.c
9470c2f1ab555311633d52e5ed8303a813061cdf 21-Feb-2013 Benoit Goby <benoit@android.com> adb: Cleanup dead code

dns_service is unused and recover_service has been replaced by adb
sideload

Change-Id: Ie90000d7f672e8299ee1622a9690c7371b214dc1
ndroid.mk
ERVICES.TXT
db.h
utex_list.h
ervices.c
ockets.c
tils.c
tils.h
e18c0d508a6d8b4376c6f0b8c22600e5aca37f69 17-Apr-2013 Nick Kralevich <nnk@google.com> fs_mgr: make block devices read-only

When a filesystem is mounted read-only, make the underlying
block device read-only too. This helps prevent an attacker
who is able to change permissions on the files in /dev
(for example, symlink attack) from modifying the block device.

In particular, this change would have stopped the LG Thrill / Optimus
3D rooting exploit
(http://vulnfactory.org/blog/2012/02/26/rooting-the-lg-thrill-optimus-3d/)
as that exploit modified the raw block device corresponding to /system.

This change also makes UID=0 less powerful. Block devices cannot
be made writable again without CAP_SYS_ADMIN, so an escalation
to UID=0 by itself doesn't give full root access.

adb/mount: Prior to mounting something read-write, remove the
read-only restrictions on the underlying block device. This avoids
messing up developer workflows.

Change-Id: I135098a8fe06f327336f045aab0d48ed9de33807
emount_service.c
ca8e66a8b0f843812014a28d49208f9f6f64ecbc 18-Apr-2013 Nick Kralevich <nnk@google.com> Make init handle reboots

Move the responsibility for rebooting the system from the
reboot command to init. Init is in a better position to take
actions to bring the system down cleanly, including making sure
filesystems are mounted read-only.

The only UIDs which can perform an init triggered reboot are
root, system, and shell.

Modify the reboot command so that it calls into init to perform
the reboot. The reboot command no longer requires CAP_SYS_BOOT.

Remove the -n reboot option and code which supports it. Anyone needing
to do an unclean shutdown can just do a 'echo c > /proc/sysrq-trigger'.

Modify adb so that it calls into init to perform a shutdown.

Bug: 8646621
Change-Id: I84c0513acb549720cb0e8c9fcbda0050f5c396f5
db.c
ervices.c
519236322615102b27c0d759ca75c349f6c5da6c 18-Apr-2013 Colin Cross <ccross@android.com> am b544da0b: am d7cab8bf: Merge "adb : add missing connection states"

* commit 'b544da0be42cdd1e28d6562a26215d57c51b2f2b':
adb : add missing connection states
b544da0be42cdd1e28d6562a26215d57c51b2f2b 18-Apr-2013 Colin Cross <ccross@android.com> am d7cab8bf: Merge "adb : add missing connection states"

* commit 'd7cab8bff1334ba48620a16d1b98f2ae623fee7d':
adb : add missing connection states
d7cab8bff1334ba48620a16d1b98f2ae623fee7d 17-Apr-2013 Colin Cross <ccross@android.com> Merge "adb : add missing connection states"
50970341bfaf0c218e7fff29e0b2fb652387e274 17-Apr-2013 Elliott Hughes <enh@google.com> am ac76c1f1: am ffc5a4a5: Merge "Add OUYA VID to known VID list"

* commit 'ac76c1f16f889140ec5c56faccd676c2ff15d7bc':
Add OUYA VID to known VID list
ac76c1f16f889140ec5c56faccd676c2ff15d7bc 17-Apr-2013 Elliott Hughes <enh@google.com> am ffc5a4a5: Merge "Add OUYA VID to known VID list"

* commit 'ffc5a4a529338c834954e58de2701572eb0752f0':
Add OUYA VID to known VID list
21ec0516cf0fb6b5a849ca8f47258554a99e386c 16-Apr-2013 Al Sutton <al@funkyandroid.com> Add OUYA VID to known VID list

Add the OUYA VID to the list of known USB VIDs to allow developers with OUYA
consoles to have their device automatically recognized.

Change-Id: I499114d8071747b972c24681fc0771f000ad9f9d
sb_vendors.c
a5ad539cff9dba92650425b8bec79c071ef5993b 17-Apr-2013 trevd <trevd1234@gmail.com> adb : add missing connection states

Both CS_RECOVERY and CS_SIDELOAD where not being checked by
connection_state_name which resulted in adb get-state returning
unknown when a device is in those modes.

Change-Id: I00716024d6a0bdb68d6e2380c8cd7b5d056bd15f
Signed-off-by: trevd <trevd1234@gmail.com>
db.c
515e1639ef0ab5e3149fafeffce826cf654d616f 10-Apr-2013 Doug Zongker <dougz@android.com> mincrypt: support SHA-256 hash algorithm

- adds a library to compute the SHA-256 hash

- updates the RSA verifier to take an argument specifying either SHA-1
or SHA-256

- updates DumpPublicKey to with new "key" version numbers for
specifying SHA-256

- adds new argument to adb auth code to maintain existing behavior

Change-Id: I5b1406cf57c2b8993f6032eda3e29139f7740839
db_auth_client.c
05d6a649a3e3106c762c4da8df1fb5ef0e3f9435 02-Apr-2013 Benoit Goby <benoit@android.com> am 9f25178a: am 7f8fb3ff: Merge "adb: Prevent registering usb_disconnect twice" into jb-mr2-dev

* commit '9f25178a9dd0aa8fab5e74f785c9997ae230a325':
adb: Prevent registering usb_disconnect twice
9f25178a9dd0aa8fab5e74f785c9997ae230a325 02-Apr-2013 Benoit Goby <benoit@android.com> am 7f8fb3ff: Merge "adb: Prevent registering usb_disconnect twice" into jb-mr2-dev

* commit '7f8fb3ffa2a234b704fc975fc9b1001f17df9cac':
adb: Prevent registering usb_disconnect twice
b66356cab6cd47ecbe26513f36614dda1052eb11 02-Apr-2013 Benoit Goby <benoit@android.com> adb: Prevent registering usb_disconnect twice

adbd can receive multiple AUTH_RSAPUBLICKEY packets. This happens for
example when booting with usb attached when we retry authenticating
after the framework is done booting. Make sure usb_disconnect is only
registered once, otherwise this creates a loop in the disconnects list.

Bug: 8504991
Change-Id: Ia1f9a37005dd17b7eefee1493d622e1679263eea
db_auth_client.c
b2ba42a5d3fc6d9d3d249fa1efb22a315b5a972e 30-Mar-2013 Colin Cross <ccross@android.com> am b1d20464: am f5562cb6: Merge "adb: Remove execute permission on usb_vendor.c"

* commit 'b1d204648eb8061aa59bed189ce41938fa40197a':
adb: Remove execute permission on usb_vendor.c
b1d204648eb8061aa59bed189ce41938fa40197a 30-Mar-2013 Colin Cross <ccross@android.com> am f5562cb6: Merge "adb: Remove execute permission on usb_vendor.c"

* commit 'f5562cb66c1c15d65bc372ede4c180430e1ce9d7':
adb: Remove execute permission on usb_vendor.c
243667a98ec8b1114ca0dcfe400aaab089623d78 30-Mar-2013 Benoit Goby <benoit@android.com> am 78420edc: resolved conflicts for merge of 35200422 to jb-mr2-dev-plus-aosp

* commit '78420edc0f3e99684c36f0d516744b4d9312a1c1':
Add BYD's USB Vendor ID
Add USB Vendor ID for Xiaomi
Add vendor IDs to adb
f8cfa8a1e46a8927065df0ce4ded78ced5bea46a 30-Mar-2013 Benoit Goby <benoit@android.com> adb: Remove execute permission on usb_vendor.c

Change-Id: Ia4f2e0171634764bde3593593b3c99184236528f
sb_vendors.c
78420edc0f3e99684c36f0d516744b4d9312a1c1 30-Mar-2013 Benoit Goby <benoit@android.com> resolved conflicts for merge of 35200422 to jb-mr2-dev-plus-aosp

Change-Id: I754b8b17a7e3a6e4ef3ccf0a02beca0fc72ba749
92eb5838336d52b415472a9a9df703a99328b194 15-Mar-2013 sunxiaoqi <sun.xiaoqi@byd.com> Add BYD's USB Vendor ID

Change-Id: I0694ed72d70638f0a4a252b1c802ae8f4e33385e
sb_vendors.c
d3b69404a1497cef235574a97e45867686f4c155 19-Mar-2013 Gary Hua <huachengping@xiaomi.com> Add USB Vendor ID for Xiaomi

Change-Id: I9f0622e05334a5074604bd88093172654b4c3e7d
Signed-off-by: Gary Hua <huachengping@xiaomi.com>
sb_vendors.c
df6d7666fd44e9903944202bcb4a8da6e8064a1d 12-Mar-2013 Sam Lin <samlin@google.com> Add vendor IDs to adb

Adding vendor IDs to adb for device partners:
AnyDATA, Harris & Oppo

Change-Id: Ib8c5196c53599bd6eb077871cd95ccac935c42e7
sb_vendors.c
c6d7e200eddd620d8ac55259ab3aa5f8bfa2aadb 23-Mar-2013 Benoit Goby <benoit@android.com> toolbox: Make reboot a separate command from toolbox

Set the CAP_SYS_BOOT filesystem capability on the new reboot
command and keep CAP_SYS_BOOT in adb bounding set so that the
shell user can run it.

Change-Id: I1dd6143445ee2a952254f0452ab6e544318431dd
db.c
644b6afdacec5ae0724ca799b643a808b6d290c7 12-Mar-2013 Sam Lin <samlin@google.com> Add vendor IDs to adb

Adding vendor IDs to adb for device partners:
AnyDATA, Harris & Oppo

Change-Id: Ib8c5196c53599bd6eb077871cd95ccac935c42e7
sb_vendors.c
dd0d0e78afb5b809983fe9cebac8cc5d54a284b6 09-Mar-2013 Elliott Hughes <enh@google.com> am 822ea9b3: am fd5c6b9f: Merge "Close adb_usb.ini after reading it"

* commit '822ea9b3d1cf240b16135e1b5c3bd926c02d17d6':
Close adb_usb.ini after reading it
fd5c6b9f137940ce2d762c85dfdb4d2f1104f2bd 09-Mar-2013 Elliott Hughes <enh@google.com> Merge "Close adb_usb.ini after reading it"
0c06eb5017e5888f0452da348d12fc92a767e45d 07-Mar-2013 Christopher Tate <ctate@google.com> DO NOT MERGE - Document new -obb flag for adb backup

Now that adb backup handles OBB file backup/restore.

(Cherrypicked)

Change-Id: Ie92b546e3898b62d74f552ab577b7756ad176ee6
ommandline.c
95b087fa90c89b21d18268c84167d1407f9e7905 05-Mar-2013 Colin Cross <ccross@android.com> am 79d4381a: am 69f3ec84: Merge "Fix issues where the filename is referred to as \'sideload\'"

* commit '79d4381a8e838d7ddbeda5b7dc90e0c5bca5a8c6':
Fix issues where the filename is referred to as 'sideload'
86ae6d587b740c70d46e0633a92457454dee79fb 05-Mar-2013 Magnus Eriksson <eriksson.mag@gmail.com> Fix issues where the filename is referred to as 'sideload'

The adb sideload utility referes to the filename as 'sideload' in some
places. This patch changes the printouts to display the filename instead.

Change-Id: I38ada01a08bed53a8d9697c03f55ce8cee2abe12
Signed-off-by: Magnus Eriksson <eriksson.mag@gmail.com>
ommandline.c
277626e59dc0ccbf0337ec6615622f46e6f958fd 01-Mar-2013 Nick Kralevich <nnk@google.com> am 844306bd: am cc4499b6: Merge "adb: use correct header file."

* commit '844306bd9cb3c8b3e514e5d91e9514556e8f95f4':
adb: use correct header file.
e2864bf727d6a404bd871f063c03e36cc8eedeec 28-Feb-2013 Nick Kralevich <nnk@google.com> adb: use correct header file.

Change-Id: I7a66ced762dc077247fd7c2714ae8850ffdcaeb9
db.c
4c609e9683959193dafd7a32bb8393410cbddc74 27-Feb-2013 Nick Kralevich <nnk@google.com> Remove CAP_NET_RAW from adb

ping no longer needs CAP_NET_RAW. See:

* http://lwn.net/Articles/443051/
* https://android-review.googlesource.com/52090
* https://android-review.googlesource.com/52072

Eliminate the CAP_NET_RAW special case in adb

Change-Id: If9d32c5254291b123b06bededc94b64113f6b8f2
db.c
1531c966c11a8e3fe5099d8018715560923ffc9f 22-Feb-2013 Benoit Goby <benoit@android.com> Merge "adb: Fix secure adb when booting with usb attached"
080427e4e2b1b72718b660e16b6cf38b3a3c4e3f 15-Feb-2013 Nick Kralevich <nnk@google.com> adb: drop capability bounding set on user builds

run-as: don't require CAP_DAC_OVERRIDE.

Prevent an adb spawned application from acquiring capabilities
other than

* CAP_NET_RAW
* CAP_SETUID
* CAP_SETGID

The only privileged programs accessible on user builds are
* /system/bin/ping
* /system/bin/run-as

and the capabilities above are sufficient to cover those
two programs.

If the kernel doesn't support file capabilities, we ignore
a prctl(PR_CAPBSET_DROP) failure. In a future CL, this could
become a fatal error.

Change-Id: I45a56712bfda35b5ad9378dde9e04ab062fe691a
db.c
b9c087031b4f387fd2d1c6cb9f3ca1d43435c8d4 15-Feb-2013 Nick Kralevich <nnk@google.com> am e149855a: am 523a2090: Merge "adb: Use 64 bit capabilities."

* commit 'e149855a816c98149a95725139ae66f193049ddd':
adb: Use 64 bit capabilities.
109f4e16cb22e2ae915a4c16d8c8a5e46a749d27 15-Feb-2013 Nick Kralevich <nnk@google.com> adb: Use 64 bit capabilities.

Fix the following kernel warning:

$ adb shell dmesg | grep adb
<6>[ 7.813003] warning: `adbd' uses 32-bit capabilities (legacy support in use)

Change-Id: I3912302c5c577f1cb03f0c591834ab7b3a72ddf5
db.c
045a4a9c3a317e60ab1078f5a689bf302ee2ab19 16-Jan-2013 Benoit Goby <benoit@android.com> adb: Fix secure adb when booting with usb attached

When booting with usb attached, the secure adb authentication happens
long before the framework is done booting, so adb can't notify the
framework to install the public key.

Change-Id: Id2af6cebece345022f56cb0c4b5af24e1d7a425c
db.c
db_auth.h
db_auth_client.c
49f0f776932ec6120d41d8e144247f9d36a01fb5 30-Jan-2013 Kenny Root <kroot@android.com> am 282caf3b: am 260f3471: am f8afaebe: Merge "Windows adb: include stdint.h for uint8_t on MinGW-w64"

# By Ray Donnelly
# Via Android Git Automerger (2) and others
* commit '282caf3bd0dfd81b92ac74e0b3ea970d195fee7b':
Windows adb: include stdint.h for uint8_t on MinGW-w64
53e5b242317a079a6a194e21e5e06a91ab6a23d8 30-Jan-2013 Kenny Root <kroot@android.com> am 6c3d3ccf: am d033739d: am d40fd86e: Merge "Windows adb: initialize on to 1 in disable_tcp_nagle"

# By Ray Donnelly
# Via Android Git Automerger (2) and others
* commit '6c3d3ccfa5d1d77b80e5c7619909a48b976c69ec':
Windows adb: initialize on to 1 in disable_tcp_nagle
f8afaebec3d10879f22406ac1bf06a246d448f93 30-Jan-2013 Kenny Root <kroot@android.com> Merge "Windows adb: include stdint.h for uint8_t on MinGW-w64"
d40fd86ec5bdf56e8cd5a702ffc5332b6de931e4 30-Jan-2013 Kenny Root <kroot@android.com> Merge "Windows adb: initialize on to 1 in disable_tcp_nagle"
8e85644aa139252acd5a13c99a1f6f7de22b23e7 29-Jan-2013 Benoit Goby <benoit@android.com> Merge "adb: Add "unauthorized" connection state"
83dee8e4e5346553f435626b46487d51b1e0ff2d 29-Jan-2013 Benoit Goby <benoit@android.com> Merge "adb: Read secure adb keys on every auth request"
5bf8a4200c5f1695b0210e59b6b6ef421cedee8f 21-Jan-2013 David Turner <digit@android.com> am 3dbcb6d6: am 98d07897: Merge "Windows adb: Make client stdout and stderr handles uninheritable"

* commit '3dbcb6d6c6befc406e4ce4e2b7aa9ad2635dfbb8':
Windows adb: Make client stdout and stderr handles uninheritable
98d0789772b94b9b0c2aecfab74dc1a9283a91b1 21-Jan-2013 David Turner <digit@android.com> Merge "Windows adb: Make client stdout and stderr handles uninheritable"
77e8e5851d3b951b5382663bd50f1f83cb531eb2 15-Jan-2013 Benoit Goby <benoit@android.com> adb: Add "unauthorized" connection state

Add a new connection state, so that devices, that require confirmation
to allow adb, appear as "unauthorized" in the adb devices lists.

Change-Id: Ib4264bc5736dedecf05bcf8e31896f4d7a91fad8
db.c
db.h
ransport.c
345cb066d2e0c774c877a85d3035f298df1daf16 15-Jan-2013 Benoit Goby <benoit@android.com> adb: Read secure adb keys on every auth request

The framework can now clear the user key list, so we need to reload the
key list on every auth request instead of loading it once when adbd
starts.
This also fixes issues with encrypted devices, where the user key file
is only readable after the user has unlocked the device.

Change-Id: I350c5aab986f8ca86b95f316398d03012553e581
db_auth.h
db_auth_client.c
bbe26c1f79bf860dde9cfbe8cd4ad826cd1a8a53 11-Jan-2013 Ray Donnelly <mingw.android@gmail.com> Windows adb: initialize on to 1 in disable_tcp_nagle
ysdeps_win32.c
2c43b55814c9038f25425dd0a9b202e4fb9b5229 11-Jan-2013 Ying Wang <wangying@google.com> resolved conflicts for merge of f62f1e3a to master

Change-Id: I35c66859e2c454c20c8acc6b2b1f0833032205bb
571c1367682c83cb23481cc9c1028c8588a1fed0 07-Dec-2012 JP Abgrall <jpa@google.com> adb: HACK: (linux only) allow temp mitigation for multithreaded issues

There are serious multithreading issues between the fdevent and transport
subsystems which both manipulate struct asocket and struct fde concurrently.
The prevalent symptom being around multiple socket closures which stomp
on each other, typically causing:
"glibc detected *** adb: double free or corruption ..."

This HACK allows forcing CPU affinity via an env var. E.g.:
export ADB_CPU_AFFINITY_BUG6558362=0
which will cause ONLY the adb server and all its threads to be pegged
to CPU 0.

The result is visible in valgrind's helgrind: no *socket_close() related
data races. But tons of other races are still there.

Bug: 6558362
Change-Id: I0f112390a6a921c64b2a783297be9e99ce27fd56
ndroid.mk
db.c
cbb9891049628a2a89d566cade88c80ba1ba4a7b 29-Nov-2012 Ray Donnelly <mingw.android@gmail.com> Windows adb: include stdint.h for uint8_t on MinGW-w64

Change-Id: I84b8284bc034feb0acd313b0aad9e2fa5868854f
db.c
267aa8b00eadf273321e492026af74b7baad890e 29-Nov-2012 Ray Donnelly <mingw.android@gmail.com> Windows adb: Make client stdout and stderr handles uninheritable

Change-Id: Ib0519a199c9504aad1d0ecc3757f4d162984bf22
db.c
ef2ea99bfe1e19c451882c3c8eb19368d0087ff6 08-Jan-2013 Ying Wang <wangying@android.com> Merge "Correct LOCAL_LDLIBS of adb"
d7c52a458e1c93b539ebd94f341f842d32d36937 04-Jan-2013 jp abgrall <jpa@google.com> am 03873ce4: am 77eccafe: Merge "Support adb client connect to remote server"

* commit '03873ce495e8c4bdb1289cdfa2b97cb47bb15108':
Support adb client connect to remote server
d7b33085117ccbb908a883f624cb1fe5495ee92a 14-Nov-2012 Matt Gumbel <matthew.k.gumbel@intel.com> Support adb client connect to remote server

ADB client: allow user to specify hostname and port number of remote
adb server.
ADB server: bind server to all network interfaces instead of just
localhost when user gives -a flag.

Primary use-case for this change is to support remote testing of USB
devices. HostA is running some test automation software which invokes adb
client. HostB has USB-only device attached and is running adb server. adb
client on HostA makes connection to adb server on HostB to talk to the
USB device.

Change-Id: I845cc8c00350b400317f8c18f813e6fd79bd5470
Signed-off-by: Dean Kwon <daex.i.kwon@intel.com>
Signed-off-by: Jim Bride <jim.bride@intel.com>
Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com>
db.c
db_client.c
db_client.h
ommandline.c
9c607552077321d9b6b2e29dab8a6e276bffb457 01-Jan-2013 Chih-Wei Huang <cwhuang@linux.org.tw> Correct LOCAL_LDLIBS of adb

adb doesn't really use ncurses-libs, remove it.

Add -ldl for the symbols dlclose, dlerror, dlopen...
introduced from dso_dlfcn.c of libcrypto_static.a.

Change-Id: If1cc23987a9b35ec535bbf8f4e7db141b9f10af7
ndroid.mk
9bc6f20c618c45183af579e118dcf27b145b4e8c 14-Dec-2012 David 'Digit' Turner <digit@android.com> am abf7cc97: am 13306d95: Merge "adb: Improve ADB\'s forward redirection management."

* commit 'abf7cc977e41540c45836d2fafd81606117f0399':
adb: Improve ADB's forward redirection management.
0d82fbf04d6db847cf598f370aa6986af794bd72 14-Nov-2012 David 'Digit' Turner <digit@android.com> adb: Improve ADB's forward redirection management.

This adds a few new options/modes to 'adb forward':

adb forward --list
adb forward --remove <local>
adb forward --remove-all
adb forward --no-rebind <local> <remote>

For more context, see http://code.google.com/p/android/issues/detail?id=39631

Note that this only affects the host adb client and server programs,
i.e. it's compatible with devices running older adbd versions.

Change-Id: I9cda3ba12b5a8560a2061620bc7f948e5c1e70f7
ERVICES.TXT
db.c
ommandline.c
60529e39bb5d5c1a797394fe78201c0454080ee4 15-Nov-2012 Chris Dearman <chris@mips.com> Close adb_usb.ini after reading it

Signed-off-by: Chris Dearman <chris@mips.com>
Change-Id: I7d3ee8cbd54af206dac89225c438e6c7322c571f
sb_vendors.c
846c686b6663b15833e1827ff8f0232f9a959576 08-Nov-2012 Xavier Ducrohet <xav@android.com> am 493d04d2: am f621d62a: am c4244565: am d1e39491: Add usb vendor id for Teleepoch.

* commit '493d04d2fec59b273a067f5ef9d908dd0b441a08':
Add usb vendor id for Teleepoch.
493d04d2fec59b273a067f5ef9d908dd0b441a08 08-Nov-2012 Xavier Ducrohet <xav@android.com> am f621d62a: am c4244565: am d1e39491: Add usb vendor id for Teleepoch.

* commit 'f621d62adcbcd81d6479223d9afe47c1d966710d':
Add usb vendor id for Teleepoch.
d1e39491f063626e026304ba8abe084cc43c94da 06-Nov-2012 Xavier Ducrohet <xav@android.com> Add usb vendor id for Teleepoch.

Change-Id: I82bbfed598fc3a886681c4139600cf487034c59c
sb_vendors.c
1dcaf9d054bf92a17d82160865bba5c6f7d15adb 13-Oct-2012 Kenny Root <kroot@google.com> am 51ccef27: Merge "Add TEMP_FAILURE_RETRY macro for darwin"

* commit '51ccef27cab58277775e62518a59666d2a059b62':
Add TEMP_FAILURE_RETRY macro for darwin
89c2812bd68ce81fb7a85bb1b946cc2f79f5dbfd 13-Oct-2012 Kenny Root <kroot@google.com> Add TEMP_FAILURE_RETRY macro for darwin

Darwin doesn't define the TEMP_FAILURE_RETRY macro in unistd.h so we
need to add it everywhere. Joy!

(cherry picked from commit ec90f1dc11488f0ab8a25a9159965b4ae3c4ca88)

Change-Id: Ida554fc65193672cc4616dec79e6282e06cc1b28
ysdeps.h
ec90f1dc11488f0ab8a25a9159965b4ae3c4ca88 13-Oct-2012 Kenny Root <kroot@google.com> Add TEMP_FAILURE_RETRY macro for darwin

Darwin doesn't define the TEMP_FAILURE_RETRY macro in unistd.h so we
need to add it everywhere. Joy!

Change-Id: Ida554fc65193672cc4616dec79e6282e06cc1b28
ysdeps.h
c5333e494d5a52261a9e0d595dc66e55e5dc6957 13-Oct-2012 Kenny Root <kroot@google.com> am 1dc92bac: am 207c17ff: Merge "Make adb robust against EINTR"

* commit '1dc92bacb8cbf052438e0b1af4030a57901d6e94':
Make adb robust against EINTR
1dc92bacb8cbf052438e0b1af4030a57901d6e94 13-Oct-2012 Kenny Root <kroot@google.com> am 207c17ff: Merge "Make adb robust against EINTR"

* commit '207c17ff1f48d0db3c69628bb036a14db40b5887':
Make adb robust against EINTR
73167412bc52ee370761e418366ddac504666567 13-Oct-2012 Kenny Root <kroot@google.com> Make adb robust against EINTR

Change-Id: I39a8d9007ce2d5662a33a50e4d7e2e7f8f9fad63
ervices.c
ysdeps.h
d5d6d97defa8999784a15003ed41449954bc7178 26-Sep-2012 Kenny Root <kroot@google.com> Host builds: add fastboot and adb

Add fastboot and adb host utilities to debug builds for debugging
and development purposes.

Change-Id: If77699a27497b8641998930f14d4ee418b856080
ndroid.mk
d8a8979bd932a73378286ecea6a03c7fa8e1b2a6 06-Sep-2012 Jeff Sharkey <jsharkey@android.com> Merge "Bring back ADB_EXTERNAL_STORAGE." into jb-mr1-dev
d6d4286a28b4a9aef902585625ea6656ab06cf52 06-Sep-2012 Jeff Sharkey <jsharkey@android.com> Bring back ADB_EXTERNAL_STORAGE.

Bug: 7119408
Change-Id: Ic9a23fb6adfb1db771e1e278179586bca69a5edd
db.c
96535ba62044c712f8b017fe569f598a7a2934c2 05-Sep-2012 Ying Wang <wangying@google.com> Dist fastboot and adb for the sdk build.

So they can be downloaded from the build page.
Bug: 7109694

Change-Id: Ibc60d0acbc5d2445c01010fd0bd4654a240b0a88
ndroid.mk
345ca131bbc17b1ae1073db04f37f6610ccb4c71 01-Sep-2012 Benoit Goby <benoit@android.com> adb: Link statically with libcrypto

Bug: 7063951
Change-Id: I328b76a751aceaae625d64156f22ce3de65678c8
ndroid.mk
64b3103017cb9038c5fb7e3601f51c6a458bed06 31-Aug-2012 Benoit Goby <benoit@android.com> adb: Create private key with 0600 mode

Changed key name to force generating new pairs.

Bug: 7092477
Change-Id: I680cb9dd1896ae52b2b29d63533f966e033d823f
db.h
db_auth_host.c
d5fcafaf41f8ec90986c813f75ec78402096af2d 12-Apr-2012 Benoit Goby <benoit@android.com> adb: Add public key authentification

Secure adb using a public key authentication, to allow USB debugging
only from authorized hosts.

When a device is connected to an unauthorized host, the adb daemon sends
the user public key to the device. A popup is shown to ask the user to
allow debugging once or permanantly from the host. The public key is
installed on the device in the later case. Other keys may be installed
at build time.

On the host, the user public/private key pair is automatically generated,
if it does not exist, when the adb daemon starts and is stored in
$HOME/.android/adb_key(.pub) or in $ANDROID_SDK_HOME on windows. If needed,
the ADB_KEYS_PATH env variable may be set to a :-separated (; under
Windows) list of private keys, e.g. company-wide or vendor keys.

On the device, vendors public keys are installed at build time in
/adb_keys. User-installed keys are stored in /data/misc/adb/adb_keys.

ADB Protocol change:
If the device needs to authenticate the host, it replies to CNXN
packets with an AUTH packet. The AUTH packet payload is a random token.
The host signs the token with one of its private keys and sends an AUTH(0)
packet. If the signature verification succeeds, the device replies with
a CNXN packet. Otherwise, it sends a new AUTH packet with a new token so
that the host can retry with another private key. Once the host has tried
all its keys, it can send an AUTH(1) packet with a public key as
payload. adbd then sends the public key to the framework (if it has been
started) for confirmation.

Change-Id: I4e84d7621da956f66ff657245901bdaefead8395
ndroid.mk
db.c
db.h
db_auth.h
db_auth_client.c
db_auth_host.c
rotocol.txt
ysdeps.h
bfcd810b792f7ffbb2ec1360c0c2662725fd0362 22-Aug-2012 Jeff Sharkey <jsharkey@android.com> Iteration on multi-user external storage.

Define /storage as top-level concept, so that we enforce permissions
uniformly. Moves external storage paths from headers to per-device
environment variables. Added missing mount flags, and we no longer
have adb-specific external storage.

Bug: 6925012
Change-Id: Ic7ca953be2f552d3f0ec9e69f89fef751daa1b29
db.c
3fc95a991805feba257a396c13548776fd36f34f 21-Aug-2012 Benoit Goby <benoit@android.com> Revert "adb: Add public key authentification"

This reverts commit f4ed516643ee8ed3a59ad1a8048f7ce5f47f93fb.
ndroid.mk
db.c
db.h
db_auth.h
db_auth_client.c
db_auth_host.c
rotocol.txt
300d6d65d022c4a4663d097e5271eac745be6278 21-Aug-2012 Benoit Goby <benoit@android.com> Merge "adb: Add public key authentification" into jb-mr1-dev
9dd0029a05511d5e15c7fdb453b93f50d5b37d04 21-Aug-2012 John Grossman <johngro@google.com> Merge "Replace a segfault with a warning." into jb-mr1-dev
9367f4f973e0d4dfb1fe898709f0246dce6f81aa 21-Aug-2012 John Grossman <johngro@google.com> Replace a segfault with a warning.

Just print a warning if ADB_EXTERNAL_STORAGE is not defined when ADB
runs instead of segfaulting. If we really don't want to continue to
run, we can make this a fatal error instead.

Change-Id: Icfc5fb9e594b0a310029f1dca7e9476f27ceb7bc
db.c
a8b832a89713dea6d1a82cfc8ecfa624c4fc5783 20-Aug-2012 Jean-Baptiste Queru <jbq@google.com> am 42900c30: am 0874aa0e: Merge "adb: Pick desired product value from command line it follows -p"

* commit '42900c30cf39ea4cdc41cc3671584b7f4f39b8bc':
adb: Pick desired product value from command line it follows -p
0874aa0ec4f413a77a610133c904c2590a2e3ccd 20-Aug-2012 Jean-Baptiste Queru <jbq@google.com> Merge "adb: Pick desired product value from command line it follows -p"
5dd0f86fbfed631b31c9055109889f1d9559a3ea 18-Aug-2012 Jeff Sharkey <jsharkey@android.com> Migrate sdcard0 to shell-accessible location.

Also remove mount() from adb, since it can come online long before
data partition is ready. Set EXTERNAL_STORAGE environment variable
to point to owner for backwards compatibility.

Bug: 7005701
Change-Id: I63444f6636624eb7ad89f053daa289663424639e
db.c
f4ed516643ee8ed3a59ad1a8048f7ce5f47f93fb 12-Apr-2012 Benoit Goby <benoit@android.com> adb: Add public key authentification

Secure adb using a public key authentication, to allow USB debugging
only from authorized hosts.

When a device is connected to an unauthorized host, the adb daemon sends
the user public key to the device. A popup is shown to ask the user to
allow debugging once or permanantly from the host. The public key is
installed on the device in the later case. Other keys may be installed
at build time.

On the host, the user public/private key pair is automatically generated,
if it does not exist, when the adb daemon starts and is stored in
$HOME/.android/adb_key(.pub) or in $ANDROID_SDK_HOME on windows. If needed,
the ADB_KEYS_PATH env variable may be set to a ;-separated list of private
keys, e.g. company-wide or vendor keys.

On the device, vendors public keys are installed at build time in
/adb_keys. User-installed keys are stored in /data/misc/adb/adb_keys.

ADB Protocol change:
If the device needs to authenticate the host, it replies to CNXN
packets with an AUTH packet. The AUTH packet payload is a random token.
The host signs the token with one of its private keys and sends an AUTH(0)
packet. If the signature verification succeeds, the device replies with
a CNXN packet. Otherwise, it sends a new AUTH packet with a new token so
that the host can retry with another private key. Once the host has tried
all its keys, it can send an AUTH(1) packet with a public key as
payload. adbd then sends the public key to the framework (if it has been
started) for confirmation.

Change-Id: Idce931a7bfe4ce878428eaa47838e5184ac6073f
ndroid.mk
db.c
db.h
db_auth.h
db_auth_client.c
db_auth_host.c
rotocol.txt
885342a0f2c834a6b680284047c47c9d04b32565 15-Aug-2012 Jeff Sharkey <jsharkey@android.com> Multi-user external storage support.

Remount rootfs as recursively shared, so that mount changes are
propagated into child namespaces. Mount external storage for access
from adb.

Clean multi-user dependencies for use in Dalvik. Also define
external storage paths.

Bug: 6925012
Change-Id: I375de581a63f4f36667894c56a34a9dd45361e8f
db.c
1dd55c53af264b24319d721281fe32c67c053120 21-Jul-2012 Mike J. Chen <mjchen@google.com> Allow adb to listen both on usb and tcp.

(cherry picked from commit ae868a40459a6bcb89d8a4426503fea0c8002b25 in master)

Change-Id: I980c7c5e8affbc8627d17b1d9303b002adcdb29a
Signed-off-by: Mike J. Chen <mjchen@google.com>

Conflicts:

adb/adb.c
db.c
5f73a6863f75c54feec73e0f8dad7160e219197e 09-Aug-2012 Stephen Hines <srhines@google.com> am 7accfc2f: am f889f0db: Merge "Trivial signed/unsigned warning fix for adbd"

* commit '7accfc2ffd3d0fb6e6e8985349e8773f1977df59':
Trivial signed/unsigned warning fix for adbd
8127323f145b2de7e1c30bbb7af0d20d783ac76b 05-Aug-2012 Vairavan Srinivasan <vairav@codeaurora.org> adb: Pick desired product value from command line it follows -p

Change-Id: Ic9fb74c99c88479addf3a2cc599b8492ced759d8
ommandline.c
ae06933cdeb61b1145a1245ea3f40a3d159d215b 26-Jul-2012 Edwin Vane <edwin.vane@intel.com> Trivial signed/unsigned warning fix for adbd

Change-Id: Icd674006bb2b526166960b4f90eb274030d80439
Author: Edwin Vane <edwin.vane@intel.com>
Reviewed-by: Ariel J Bernal <ariel.j.bernal@intel.com>
ransport_local.c
97d2aef6d231b57afb7e08ef871506e98cf1f171 26-Jul-2012 Edwin Vane <edwin.vane@intel.com> Fix signed/unsigned comparison warning

Trivial warning fix.

Change-Id: I93b905b34155214fc2d211a0d9319f06b67fa193
Author: Edwin Vane <edwin.vane@intel.com>
Reviewed-by: Ariel J Bernal <ariel.j.bernal@intel.com>
db.c
9630ca7dcefc9abfe456186758c1b91c43b1a3ff 24-Jul-2012 Colin Cross <ccross@android.com> am d4725517: am ec7d9dc7: Merge "Avoid zombies on androidscreencast"

* commit 'd47255175ede1af31aee9132914e5d14549ba577':
Avoid zombies on androidscreencast
5a536efa5b5f5d973232846d5fe6818df84ab5dc 17-Jul-2012 Yuriy Zabroda <yuriy.zabroda@ti.com> Avoid zombies on androidscreencast

When using a third party screen capture program called androidscreencast
(http://code.google.com/p/androidscreencast/) to get the framebuffer of
the device, there are tons of screencap zombie processes got left behind.
The issue is also mentioned here: http://code.google.com/p/android/issues/detail?id=22836.
The cause of the issue is that adbd spawns off screencap processes,
and these child processes were not waited to be finished.
This change fixes the issue.

Change-Id: Ife928d65ecf6a2ff39b8b72ddba930fda6733a00
Signed-off-by: Yuriy Zabroda <yuriy.zabroda@ti.com>
ramebuffer_service.c
f53aff69487f2c36f0fa28ed8ce46ee53db662a5 10-Jul-2012 Dan Zhang <danielzhang@google.com> Add Kobo's USB vendor ID to adb

Change-Id: I8b86a851e6478d5e8248df4f1e53f3da4dc4b5e0
sb_vendors.c
66086a586f80e394674eb171d683d0d9677e3abf 13-Jun-2012 Benoit Goby <benoit@android.com> am 504dccec: am aeceb517: adb: Fix adb tcpip command

* commit '504dccec97c12283f348838ba0bf88536322ee6b':
adb: Fix adb tcpip command
504dccec97c12283f348838ba0bf88536322ee6b 13-Jun-2012 Benoit Goby <benoit@android.com> am aeceb517: adb: Fix adb tcpip command

* commit 'aeceb5174502659cb4fff6de924b54ef7e6cdae7':
adb: Fix adb tcpip command
aeceb5174502659cb4fff6de924b54ef7e6cdae7 12-Jun-2012 Benoit Goby <benoit@android.com> adb: Fix adb tcpip command

When running "adb tcpip 5555", adb create a service socket named
"tcpip:5555". Only compare the 6 first chars "tcpip:" to decide if
we enable exit_on_close.

Bug: 6650130
Change-Id: I0835973de044f1cfde0e859ff0277c0ccc2630a3
ockets.c
c29569c5d3c1358983915596267e85e85c7f82e2 07-Jun-2012 Benoit Goby <benoitgoby@google.com> Merge "FunctionFS: initial implementation"
845f106a93d5f8ed710c80293d22d23e1b17ed3c 06-Jun-2012 Scott Anderson <saa@android.com> am 1b7a7e81: adb: Use bionic\'s strtok_r() for Windows

* commit '1b7a7e81195ff06a7482f81cb92b094bb3481cb1':
adb: Use bionic's strtok_r() for Windows
1b7a7e81195ff06a7482f81cb92b094bb3481cb1 06-Jun-2012 Scott Anderson <saa@android.com> adb: Use bionic's strtok_r() for Windows

A recent change use strtok_r which broke the Windows build.
Clear this potential landmine by adding adb_strtok_r to sysdeps.h
in the typical fashion. For Windows, the actual implementation
in sysdeps_win32.c was copied from bionic/libc/string/strtok.c.

Change-Id: Ibb71555bc429f7058c07c3d39e0b62859c79635c
Signed-off-by: Scott Anderson <saa@android.com>
db.c
ysdeps.h
ysdeps_win32.c
0e9e13eb46d8ffbb456f937db4a8fb0da02dd5d2 06-Jun-2012 Scott Anderson <saa@android.com> am 2ca3e6b3: adb: Generalizing -s to take qualifiers.

* commit '2ca3e6b35f79136418ebc32fef57580698dbd045':
adb: Generalizing -s to take qualifiers.
3fef581bc7a513defe48329973d14bec722f1293 06-Jun-2012 Scott Anderson <saa@android.com> am e82c2db0: adb: Transmit key properties in banner of connect message

* commit 'e82c2db05cae70a0490a1f84b7211ef42c329671':
adb: Transmit key properties in banner of connect message
2ca3e6b35f79136418ebc32fef57580698dbd045 31-May-2012 Scott Anderson <saa@android.com> adb: Generalizing -s to take qualifiers.

Prior to this change, -s could take either a serial number or a
device path (e.g. "-s 01498B1F02015015" or "-s usb:1-4.2"). This
change extends -s to also allow product, model or device names
(e.g. "-s product:mysid"). These new qualifiers will only be
available on devices that are running an adb daemon that provides
properties in the connect message per Change-Id:
I09200decde4facb8fc9b4056fdae910155f2bcb9

The product, model and device are derived from the
ro.product.name, ro.product.model and ro.product.device
properties respectively. They are prefixed with "product:",
"model:" or "device:" as appropriate. In addition, any
non-alphanumerics in the model are changed to underscores.

If the -s parameter matches multiple devices, the result will be
the same as when multiple devices are connected but no -d, -e or
-s option is specified. In general, this means the user will get
"error: more than one device". However for get-state,
get-devpath and get-serialno, they will get "unknown".

The format of "devices -l" was changed to list all of the
qualifiers that are available. The following example output
(with the last digits of the serial numbers replaced with X's) is
with a Galaxy Prime with an older adb daemon and another Galaxy
Prime and Galaxy S both with the enhanced adb daemons:

List of devices attached
016B75D60A0060XX device usb:2-5 product:mysid model:Galaxy_Nexus device:toro
3731B535FAC200XX device usb:1-4.2 product:soju model:Nexus_S device:crespo
01498B1F020150XX device usb:1-4.1

Note that the serial number and state are now column oriented
instead of tab delimited. After the serial number and state, all
qualifiers are listed with each preceded by a space. The output
of the original devices command (without -l) is unchanged.

Change-Id: Iceeb2789874effc25a630d514a375d6f1889dc56
Signed-off-by: Scott Anderson <saa@android.com>
db.c
db.h
ommandline.c
ockets.c
ransport.c
e82c2db05cae70a0490a1f84b7211ef42c329671 25-May-2012 Scott Anderson <saa@android.com> adb: Transmit key properties in banner of connect message

protocol.txt says that the connect message should have three
fields:

<systemtype>:<serialno>:<banner>

In reality, what is transmitted is simply:

<systemtype>::

The serialno is obtained via other means so doesn't really need
to be a part of the connect message. This change puts the
ro.product.name, ro.product.model and ro.product.device
properties in the <banner> for devices. Each property is
terminated by a semicolon (;) with the key and value separated by
an equals sign (=). Example message:

device::ro.product.name=<prd>;ro.product.model=<mdl>;ro.product.device=<dev>;

Making this change will enable the device list to provide more
information to the user and to give the potential for being able
to select which device to talk to with the -s option.

Change-Id: I09200decde4facb8fc9b4056fdae910155f2bcb9
Signed-off-by: Scott Anderson <saa@android.com>
db.c
db.h
rotocol.txt
ransport.c
e5867141c9364596fbcd47195aeff5b0f9844435 01-Jun-2012 Scott Anderson <saa@android.com> am 3608d832: adb: Fix two problems with device path implementation.

* commit '3608d832425ca3a6d00c4040f3bb979c5aa49899':
adb: Fix two problems with device path implementation.
a1020825fb8abdff9289a7473260e5312131e7c8 01-Jun-2012 Scott Anderson <saa@android.com> am c7993af6: adb: Fix compiler warning

* commit 'c7993af64baec271a238646bc20aaa846866c4a9':
adb: Fix compiler warning
fd96db17b7f07eb6615af01fd1908b74383bf04b 13-Jan-2012 Andrzej Pietrasiewicz <andrzej.p@samsung.com> FunctionFS: initial implementation

This is the second version of a patch which demonstrates the possibility
of using adbd (Android Debug Bridge daemon) with a generic FunctionFS gadget
instead of a custom adb usb gadget in the Linux kernel. It contains changes
introduced after Benoit's review - thank you Benoit.

The patch adds a new usb access layer to adbd using FunctionFS. The former
usb access method is still available. The method is chosen at runtime
depending if /dev/usb-ffs/adb/ep0 or /dev/android_adb is accessible.

How to use on the target device:

$ insmod g_ffs.ko idVendor=<vendor ID> iSerialNumber=<some string>
$ mount -t functionfs adb /dev/usb-ffs/adb -o uid=2000,gid=2000
$ ./adbd

This patch requires a patch to bionic which adds <linux/usb_functionfs.h>
which is an exact copy of the relevant file in the linux kernel.

Change-Id: I4b42eb267ffa50fca7a5fba46f388a2f083e8b2d
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
[benoit@android.com: detect at runtime if functionfs is mounted
or fallback using f_adb]
Signed-off-by: Benoit Goby <benoit@android.com>
db.c
db.h
sb_linux_client.c
3608d832425ca3a6d00c4040f3bb979c5aa49899 31-May-2012 Scott Anderson <saa@android.com> adb: Fix two problems with device path implementation.

The commands that use "host-serial:<serial-number>:<request>"
service did not handle "-s usb:<path>". The -s parameter is
passed as the serial number in the protocol and then matched
against either the serial number or device path. However,
skip_host_serial() in sockets.c did not know about the usb:
syntax, the serial number was parsed incorrectly. Before this
change:
$ adb -s usb:1-4.1 get-state
error: unknown host service
After:
$ adb -s usb:1-4.1 get-state
device

Code was added in find_transport() in transport.c to match device
paths, but find_transport() is only used for socket connections
so matching device paths is not needed.

Change-Id: I922cec963659dafadd0fbc8fa36dee3b55fe366c
Signed-off-by: Scott Anderson <saa@android.com>
ockets.c
ransport.c
c7993af64baec271a238646bc20aaa846866c4a9 25-May-2012 Scott Anderson <saa@android.com> adb: Fix compiler warning

system/core/adb/adb.c: In function 'connect_device':
system/core/adb/adb.c:1001: warning: comparison between signed and unsigned integer expressions

Change-Id: I206f85395e1d7ad8d6ef130a26c95dcf0f498696
Signed-off-by: Scott Anderson <saa@android.com>
db.c
678cc32980b092ec90e98f6d62bbeeafb3dd19cb 15-May-2012 Xavier Ducrohet <xav@android.com> am c7a67d0f: resolved conflicts for merge of 246808be to jb-dev-plus-aosp

* commit 'c7a67d0fc4121abb0bc5f11aeda4d848ea8e0690':
Add USB Vendor ID for Yulong Coolpad.
c7a67d0fc4121abb0bc5f11aeda4d848ea8e0690 15-May-2012 Xavier Ducrohet <xav@android.com> resolved conflicts for merge of 246808be to jb-dev-plus-aosp

Change-Id: I3415e2d7b4e8295b7415951c0e8a78c775574089
246808bedfb35ce8abd6cee434ff5b07a6618e8a 15-May-2012 Xavier Ducrohet <xav@android.com> Add USB Vendor ID for Yulong Coolpad.

Bug: 6217375

Change-Id: I8931c42e8d3088cc4df8c6e56b323a7392cad5ef
sb_vendors.c
51a958645ce9aeb4f8dc56d66a85d0005273a6ca 14-May-2012 Jean-Baptiste Queru <jbq@google.com> am 9dbcbe08: am 9bdedb59: am a36e1aa3: Merge "adb: usb_windows: fix adb connection lost issue"

* commit '9dbcbe08751bacbf1fcbf6037fed1e6c69a27fa3':
adb: usb_windows: fix adb connection lost issue
9dbcbe08751bacbf1fcbf6037fed1e6c69a27fa3 12-May-2012 Jean-Baptiste Queru <jbq@google.com> am 9bdedb59: am a36e1aa3: Merge "adb: usb_windows: fix adb connection lost issue"

* commit '9bdedb599874278abf206230ed31010eeb9b40dd':
adb: usb_windows: fix adb connection lost issue
1c4b760a5d41de3196572d50d1404e453174cf9a 12-Aug-2011 Jack Ren <jack.ren@intel.com> adb: usb_windows: fix adb connection lost issue

Windows adb connection could be lost if the target
side kernel enables the kmemleak.

The root cause is that kmemleak downgrades USB
performance, and lead to Windows adb host application
timeout because usb_write()/usb_read()'s timeout time is
very short. That issue is not reproducible in Linux
host because its usb_write() timeout is 5s and usb_read()
is blocked until return:
usb_write() usb_read()
Linux 5000ms blocked until return
Windows 500+len*8 ms 500+len*8 ms

To fix that issue, extend the Windows adb host usb_write
timeout time to 5 seconds and usb_read() as a blocked routine:
usb_write() usb_read()
Windows 5000ms blocked until return

Change-Id: If54e2b4c396a5a06318c0ee0b3326a00e7661fbc
Signed-off-by: Yu Wang <yu.y.wang@intel.com>
Signed-off-by: Jin Can Zhuang <jin.can.zhuang@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
sb_windows.c
69b2e7dd127d0fdc8dac6794c323856142792ab3 03-May-2012 Jean-Baptiste Queru <jbq@google.com> am 007b7002: am 2ae9878c: am c5d5a5e8: Merge "Kindle Fire USB ID"

* commit '007b70023b179f846c0ad1f0303da4ce03ac065e':
Kindle Fire USB ID
007b70023b179f846c0ad1f0303da4ce03ac065e 03-May-2012 Jean-Baptiste Queru <jbq@google.com> am 2ae9878c: am c5d5a5e8: Merge "Kindle Fire USB ID"

* commit '2ae9878cd5dc517cc7338aaca81f0eb3127b4a53':
Kindle Fire USB ID
76e47e0ec84eaf7faf6f77b853ba74345875a8e3 02-May-2012 Scott Anderson <saa@android.com> am 9526a788: Merge "adb: Add ability to specify device path" into ics-aah

* commit '9526a788a6bd528e14622404e8750bdcc147d15a':
adb: Add ability to specify device path
4474ac408105bb31f945ddab53a24ed148e34227 24-Apr-2012 Anonymous Coward <nobody@android.com> Add encryption parameters to adb install

Change-Id: I92e5f6ace1bc9e711c14cb83533aeb99ab9ab9f7
ommandline.c
e109d266c12c5f537d429ca4b892f2719e02c2da 20-Apr-2012 Scott Anderson <saa@android.com> adb: Add ability to specify device path

For manufacturing and testing, there is a need to talk to
whatever device is connected to a given port on the host. This
change modifies adb's "-s" option to take either a serial
number or a device path. The device paths of the connected
devices can be listed using "adb devices -l" whose output
will resemble:

List of devices attached
016B75D60A00600D usb:2-5 device
3031D0B2E71D00EC usb:1-4.3 device

The second column lists the device paths. If the -l option is
not given, the output from "adb devices" will be the same as
it used to be (i.e. the paths will not be printed).

The device path can also be obtained with the get-devpath
command:

$adb -s 3031D0B2E71D00EC get-devpath
usb:1-4.3

Note that the format of the device paths are platform dependent.
The example above is from Linux. On OS-X, the paths will be
"usb:" followed by hex digits. For other platforms, the device
paths will be printed as "????????????" and the -s option will
not be able to select a device until someone implements the
underlying functionality.

Change-Id: I057d5d9f8c5bb72eddf5b8088aae110763f809d7
Signed-off-by: Scott Anderson <saa@android.com>
ERVICES.TXT
db.c
db.h
ommandline.c
ransport.c
sb_libusb.c
sb_linux.c
sb_linux_client.c
sb_osx.c
sb_windows.c
775ab9c99eb513efecb6390b58bbcec80555eef8 15-Apr-2012 Jon Sawyer <jon@cunninglogic.com> Kindle Fire USB ID

Adds Lab126's USB id to the known USB Devices

Change-Id: I3cd5d90bba68123d5d3d2d67e1ab7d60137eb388
Signed-off-by: Jon Sawyer <jon@cunninglogic.com>
sb_vendors.c
eb68fa8153d97f5f8b6d9062fcf91fe393e3bff3 02-Apr-2012 Nick Kralevich <nnk@google.com> adb: set umask to 000

Init is going to be modified to set the umask to 077.
This will impact adb, as "adb install" and "adb sync"
assume that files will be world-readable / writable.

Keep adb's umask at 000 for now.

Bug: 3272072
Change-Id: I75978e8dd7bbdf4dbe7c9a691ef516235f207da2
db.c
f91259a8f0d75d721761d588a4b811427565c984 30-Mar-2012 JP Abgrall <jpa@google.com> adb: fix non-linux builds. tcpip:, root:, usb: are not for ADB_HOST

The handling of adb root:/tpcip:/usb: is normally only for non-ADB_HOST.
This avoids getuid() being invoked on windows builds.

Change-Id: I365b81d9f70de99b9347d3eac82e690a8ac5e747
ockets.c
d7f1feb5c8c76838b822d093983cc8a3f57a9b2d 30-Mar-2012 JP Abgrall <jpa@google.com> adb: fix exit of "adb root" when it is a no-op.

"adb root" creates a socket, then starts the service.
Socket creation should not set the exit_on_close when the service will be
a no-op.

Bug: 6259353
Change-Id: Ie526d2fad64f39a48051ed0ff6fb3405c2802ced
ockets.c
9a7611fefae6710ad9903ee61965434d6fb754cc 29-Mar-2012 Kenny Root <kroot@google.com> Merge "Revert "add IP checking for adb over TCP""
9a77f55aada6c5a8da3d330d858bd04c1c0b6c51 29-Mar-2012 Kenny Root <kroot@google.com> Revert "add IP checking for adb over TCP"

This reverts commit dca76e6187c4128a17c8df5bcaca0db6993d91a1
ransport_local.c
29dc792bcdd466efcdf068404760bcbbbd01017b 29-Mar-2012 Kenny Root <kroot@google.com> Merge "add IP checking for adb over TCP"
60733e9280ebd693293d6e7683af0bd94f8909aa 27-Mar-2012 Kenny Root <kroot@google.com> Make sure "adb install" work is cleaned after error

If an error occurs during the verification of an APK, it could be left
in the temporary installation directory.

Change-Id: I4afa5535fc0b978532b31d5b8fb63776963c39db
ommandline.c
4d668e013b232e080498868b190f2078b244e892 26-Mar-2012 Benoit Goby <benoit@android.com> Merge "adb: Don't synchronize with transport using sleep"
62e5cbaebc29d83148dd1ce30a620a37dcdbe7ed 26-Mar-2012 Benoit Goby <benoit@android.com> Merge "Revert "Reimplement the "adb root" command to more closely match its previous behavior""
8ee361cb01e20b3fb0980f428cf83d0e1181a4bd 23-Mar-2012 Andrew Hsieh <andrewhsieh@google.com> Remove duplicated VENDOR_ID_INTEL

VENDOR_ID_INTEL defined and appear in builtInVendorIds[] twice.
Remove the 2nd one.

Change-Id: I62f7bba392012aafb8ea9730959362db4bc6c669
sb_vendors.c
f366b3698b409405e1ee88476d1186f29fe14b06 16-Mar-2012 Benoit Goby <benoit@android.com> adb: Don't synchronize with transport using sleep

Services that cause adbd to reboot are currently implemented this way:
write(fd, response)
close(fd)
sleep(1)
exit(1)
sleep(1) is necessary to leave time for the transport to transmit
the response before the daemon exits. This is slow and unreliable.
Instead, add a flag to the asocket to make it exit the daemon only
after the socket is closed.

Change-Id: I9df45ea6221f0d9b828703b9b2316a5d4fe59352
db.h
ervices.c
ockets.c
7941cf87f624e7747b5bb868a27904c7a3be0ca4 16-Mar-2012 Benoit Goby <benoit@android.com> Revert "Reimplement the "adb root" command to more closely match its previous behavior"

This reverts commit 535164e9d9649a83d4d63829f3389f2bea339fe1.
ervices.c
9f1af8cde988e8a276753db6019e8c7d94f0e2b4 14-Mar-2012 Benoit Goby <benoit@android.com> adb: Remove unused flags

BUILD_ADBD is always true

ANDROID_GADGET is not used in the code anymore. adbd now checks at
runtime if /dev/android_adb is present

Change-Id: If6c3278606c79cc74d1ef5978e7b8e3a4513aef8
ndroid.mk
dca76e6187c4128a17c8df5bcaca0db6993d91a1 13-Mar-2012 Wei Zhong <wzhong@google.com> add IP checking for adb over TCP

whitelist connection for
1) emulator
2) "eng" or "tests" build, or
3) IP matches with "persist.service.adb.client_ip"

Change-Id: I8ac149149873f3bd206bd4d5abc063e5274fb468
Signed-off-by: Wei Zhong <wzhong@google.com>
ransport_local.c
50458cf76ea7b0b03598c785acb1481ed0ae5b1d 07-Mar-2012 Dianne Hackborn <hackbod@google.com> Add AID_SDCARD_R.

Change-Id: I47f650e415e06c0b69790ffefea7f208c910ebd7
db.c
28781b0a52dfb5ad19121afcc6aef56918992b30 27-Feb-2012 Vladimir Chtchetkine <vchtchetkine@google.com> Enables ADBD tracing in the emulator.

When running inside the emulator, guest's adbd can connect to 'adb-debug' qemud
service that can display adb trace messages on condition that emulator has been
started with '-debug adb' option.

This CL enables that functionality in ADB code.

Change-Id: I59b4a76d3c887ad28b8aa8e2a01dfa814e75faa1
db.c
db.h
fc656103dba298dbab1377ab07060068f50a5f83 14-Feb-2012 Anatol Pomazau <anatol@google.com> Fix 'extra tokens at end of #endif directive' warning

Change-Id: I464ede415e64cf7db845bb441754120974bcf855
ransport_local.c
46f86f11d446a650602057f8a07eba1f609d7fe9 24-Jan-2012 Xavier Ducrohet <xav@android.com> am 0c054095: am 746f3243: Add USB vendor IDs for Quanta, INQ and Sony.

* commit '0c05409510037fd7372c3fe7ab240ebf33b15831':
Add USB vendor IDs for Quanta, INQ and Sony.
05025357e6aef0d4cf036d350c96ac529f6306c2 24-Jan-2012 Xavier Ducrohet <xav@android.com> am 746f3243: Add USB vendor IDs for Quanta, INQ and Sony.

* commit '746f3243f6d30ab51a36dcfea76eac3ba29ac625':
Add USB vendor IDs for Quanta, INQ and Sony.
0c05409510037fd7372c3fe7ab240ebf33b15831 24-Jan-2012 Xavier Ducrohet <xav@android.com> am 746f3243: Add USB vendor IDs for Quanta, INQ and Sony.

* commit '746f3243f6d30ab51a36dcfea76eac3ba29ac625':
Add USB vendor IDs for Quanta, INQ and Sony.
746f3243f6d30ab51a36dcfea76eac3ba29ac625 14-Jan-2012 Xavier Ducrohet <xav@android.com> Add USB vendor IDs for Quanta, INQ and Sony.

Change-Id: I224e067d9a64e8e9e7afbad0760a4b07f965bf83
sb_vendors.c
38412163da933664791cf511056953b9e3bd1454 24-Jan-2012 Jean-Baptiste Queru <jbq@google.com> am 70580b20: am 149ae11f: Merge "adb,fastboot: add USB support for Intel Vendor ID"

* commit '70580b20bc8485002df0b3e89e42754c8c9796ff':
adb,fastboot: add USB support for Intel Vendor ID
70580b20bc8485002df0b3e89e42754c8c9796ff 24-Jan-2012 Jean-Baptiste Queru <jbq@google.com> am 149ae11f: Merge "adb,fastboot: add USB support for Intel Vendor ID"

* commit '149ae11fb63818b470156e1652abfad0e08d486d':
adb,fastboot: add USB support for Intel Vendor ID
a8748d3b2afcbe23eb428f7915a45884ad638438 21-Jan-2012 Andrew Hsieh <andrewhsieh@google.com> am daafb531: am 4779e934: Add Intel\'s vendor ID to adb

* commit 'daafb531484a35a63e229e14d8a81b412e506670':
Add Intel's vendor ID to adb
5890fe33141a9efd124c86c40a8c1ff6170ecf20 19-Jan-2012 Nick Kralevich <nnk@google.com> Don't allow adb to run as root in user builds.

Change-Id: I4fbd7beb7f76c68fead1a89b745f0dfb931b4597
ndroid.mk
db.c
bd9206bc7399b22d3917c737bb75f8534fa77e35 19-Jan-2012 Nick Kralevich <nnk@google.com> Move permission checking code to it's own function.

Change-Id: Ibe46ca3043791f3b3815080f9e23ac307b1f5900
db.c
80d50a4c99610334498d23f19932ee782756f4e7 19-Jan-2012 Andrew Hsieh <andrewhsieh@google.com> am 4779e934: Add Intel\'s vendor ID to adb

* commit '4779e9344bb62208e4772ff6486b6df564f434b8':
Add Intel's vendor ID to adb
4779e9344bb62208e4772ff6486b6df564f434b8 13-Jan-2012 Andrew Hsieh <andrewhsieh@google.com> Add Intel's vendor ID to adb

Change-Id: I81da3ea11bfd44395f6895fe51e477ff1e7fa25b
sb_vendors.c
f60e8638282d66c108f1e1dea030856312f65892 17-Jan-2012 Wu, Hao <hao.wu@intel.com> adb,fastboot: add USB support for Intel Vendor ID

This patch adds Intel USB Vendor ID into the support
list for adb and fastboot.

Signed-off-by: Wu, Hao <hao.wu@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
sb_vendors.c
a33c6ee92b25f6f89ca2044832344d0a6b2ccd11 11-Jan-2012 Xavier Ducrohet <xav@android.com> am e0b55791: am 07ad9f2a: Add USB Vendor ID for Fujitsu and Lumigon.

* commit 'e0b557915123b7ad022ff5d0a7a3d4dd2ee7c2fe':
Add USB Vendor ID for Fujitsu and Lumigon.
95ec1ca90361c6e3509637565b98ea8c8dca14de 11-Jan-2012 Xavier Ducrohet <xav@android.com> am 07ad9f2a: Add USB Vendor ID for Fujitsu and Lumigon.

* commit '07ad9f2a127b2836c7d45a503a5f3ef7517218f3':
Add USB Vendor ID for Fujitsu and Lumigon.
07ad9f2a127b2836c7d45a503a5f3ef7517218f3 11-Jan-2012 Xavier Ducrohet <xav@android.com> Add USB Vendor ID for Fujitsu and Lumigon.

Change-Id: Icd013b362366815527834cbf54aa4ecac2b7750d
sb_vendors.c
b125671921df885515c87de18aa9fe022bc7d094 11-Jan-2012 Vladimir Chtchetkine <vchtchetkine@google.com> am ae429828: Cherry-picked from c4f37eed7 in master. Do not merge.

* commit 'ae4298286896cbef22b2af285a3f651e8f498185':
Cherry-picked from c4f37eed7 in master. Do not merge.
9f5598834309c61dc7cc8fa964c7e1cc33049929 11-Jan-2012 Vladimir Chtchetkine <vchtchetkine@google.com> am 74159657: Cherry-picked from c13daef7b on master. Do not merge.

* commit '74159657687aadab4c82e4fd7e7a54d16c045d95':
Cherry-picked from c13daef7b on master. Do not merge.
ae4298286896cbef22b2af285a3f651e8f498185 13-Dec-2011 Vladimir Chtchetkine <vchtchetkine@google.com> Cherry-picked from c4f37eed7 in master. Do not merge.

Fix the build.

Conditionally compile code that is intended to run inside the emulator only.

Change-Id: Ie82e415b2ff52395616f85871dddb38e65b0ed55
ransport_local.c
74159657687aadab4c82e4fd7e7a54d16c045d95 10-Dec-2011 Vladimir Chtchetkine <vchtchetkine@google.com> Cherry-picked from c13daef7b on master. Do not merge.

Use QEMU pipe for ADB communication when running in emulator.

Change-Id: I7934b6272c2a9825d244ce76ff65dbce6e54ebff
ransport_local.c
447f061da19fe46bae35f1cdd93eeb16bc225463 09-Jan-2012 Doug Zongker <dougz@android.com> add "adb sideload" and sideload connection state

Recovery will soon support a minimal implementation of adbd which will
do nothing but accept downloads from the "adb sideload" command and
install them. This is the client side command (mostly resurrected out
of the old circa-2007 "adb recover" command) and the new connection
state.

Change-Id: I4f67b63f1b3b38d28c285d1278d46782679762a2
db.c
db.h
ommandline.c
ransport.c
bffa4ca9ad2702d51f5b391b7a05be0c7c691e4e 07-Jan-2012 Christopher Tate <ctate@google.com> Tell the user to unlock/confirm backup & restore operations

People are being confused about the silent failure of backup/restore
when they didn't know they had to unlock the device & confirm the
backup/restore operation, so now adb prints a brief reminder.

Change-Id: I1b32913f0ad0cf6e30bf235dc975b9e983b533fd
ommandline.c
c4f37eed734ecd3310bbe241df1b940329e91d74 13-Dec-2011 Vladimir Chtchetkine <vchtchetkine@google.com> Fix the build.

Conditionally compile code that is intended to run inside the emulator only.

Change-Id: Ie82e415b2ff52395616f85871dddb38e65b0ed55
ransport_local.c
c13daef7bdc09886ffbd573d7836a66b01c02084 10-Dec-2011 Vladimir Chtchetkine <vchtchetkine@google.com> Use QEMU pipe for ADB communication when running in emulator.

Change-Id: I7934b6272c2a9825d244ce76ff65dbce6e54ebff
ransport_local.c
1f4bada6674e052eb44e174c6abbb0a9948f498a 13-Dec-2011 Christopher Tate <ctate@google.com> am 650307df: am b1dfffe6: Fix \'adb backup\' on Windows

* commit '650307df33fc834c251df71c78b00cc0ae6529b7':
Fix 'adb backup' on Windows
1131c1644fe170bc1e1c614ed7cc19c10974b4d2 10-Dec-2011 Christopher Tate <ctate@google.com> am b1dfffe6: Fix \'adb backup\' on Windows

* commit 'b1dfffe6bb506313a3bc9146d2f6f8c533213193':
Fix 'adb backup' on Windows
b1dfffe6bb506313a3bc9146d2f6f8c533213193 09-Dec-2011 Christopher Tate <ctate@google.com> Fix 'adb backup' on Windows

Use the same call sequence that 'adb pull' uses for creating the
output file. adb_open_mode() apparently does not work on Windows
hosts.

Bug 5733007

Change-Id: I48d719c4657c93e19f6790cf1c6da610d49f5806
ommandline.c
ae868a40459a6bcb89d8a4426503fea0c8002b25 08-Dec-2011 Joe Onorato <joeo@google.com> Allow adb to listen both on usb and tcp.

Change-Id: I98db594241631fa17e39686727392afc8b3124bc
db.c
c6b07d94fa062886e0908540f3ce760256b37065 08-Dec-2011 Christopher Tate <ctate@google.com> Merge "Tweak logcat parameters"
db0a880c4682a90ddf078f03a0e709ddda07a2fd 30-Nov-2011 Christopher Tate <ctate@google.com> Tweak logcat parameters

Change-Id: If97ee1eb682d95fa05b5e2003a204a628bd6ae4d
ommandline.c
ce48083fc90cee807dd66608e2c3e496145af9ff 30-Nov-2011 Vladimir Chtchetkine <vchtchetkine@google.com> Fixes ADB crash on Windows due to large number of connections. do not merge.

The reason for the crash is that ADB on Windows uses WaitForMultipleObjects to
wait on connection events. When number of connections exceeds 64, ADB crashes,
because WaitForMultipleObjects API doesn't support more than 64 handles. This
CL contains a fixer routine that allows waiting on an arbitrary number of
handles.

(cherry picked from commit ac52833e48f46dfd9f7c8f86236ee8b437850c0a)

Change-Id: I8ad264765e5b38d01a31e42b445f97ea86e49948
ysdeps_win32.c
ac52833e48f46dfd9f7c8f86236ee8b437850c0a 30-Nov-2011 Vladimir Chtchetkine <vchtchetkine@google.com> Fixes ADB crash on Windows due to large number of connections.

The reason for the crash is that ADB on Windows uses WaitForMultipleObjects to
wait on connection events. When number of connections exceeds 64, ADB crashes,
because WaitForMultipleObjects API doesn't support more than 64 handles. This
CL contains a fixer routine that allows waiting on an arbitrary number of
handles.

Change-Id: I83f712e552018df308318154c27df184015a16ee
ysdeps_win32.c
61b90bd211021886049f72cb666a5b49b83b3c64 09-Nov-2011 JP Abgrall <jpa@google.com> adb: grant it AID_NET_BW_STATS for full /proc/net/xt_qtaguid/stats

Normally only bandwidth stats for the uid reading .../stats is returned.
With the extra group, adb shell will be able to read stats from
all UIDs.
This is to be used to offer data usage profiling to developers.

Change-Id: If3d2941ce5aa4dbb1a23947b97b893149ba224f7
db.c
56885094b63af1b0077dec16bc695aa09d8043fc 04-Oct-2011 Christopher Tate <ctate@google.com> Add command line help for the new 'adb backup -all -nosystem'

Documentation-only change that supports the new framework-side
feature to omit system packages when you're using adb backup -all.
Bug 5361503.

Change-Id: I86bca8883a7fb8c713ca352ad5980e92fd640d18
ommandline.c
a031a91b9518af9a38290713b0c2126d9b8f6cde 23-Sep-2011 Kenny Root <kroot@google.com> Skip argument when parsing adb install

A command line flag with an argument was checked in the Pm.java code,
but it wasn't being checked by "adb install" so attempts to use it
failed.

Change-Id: I0b84a4203a416f7323fa823c0f1f1750670d0c76
ommandline.c
dd52e8c57b5026f70a3ec390d2f9a7809ebd2d85 16-Sep-2011 Xavier Ducrohet <xav@android.com> Add Positivo's vendor ID to adb.

Change-Id: Ida6fc323d766249f4f12708bae1c50ae5d937b2c
sb_vendors.c
aa61854645ffed8595507463820e81aa0aa8f2fd 13-Sep-2011 Mike Lockwood <lockwood@android.com> adb: Add USB vendor IDs for K-Touch, Pegatron and Archos

Change-Id: Idbc212abfb7d4d0a53e6b8ecd55134b81f4e960d
Bug: 5182028
Bug: 5157478

Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_vendors.c
bb86bc5892374f3a41784135bebc7ada3270c8c1 23-Aug-2011 Christopher Tate <ctate@google.com> Fix 'adb backup' command line validation

The host side wasn't properly checking for argument-list sufficiency
*after* removing any [-f filename] sequence.

Fixes bug 5164135

Change-Id: I7bc49e37ef168182088e0e664b6897dd2a088ebf
ommandline.c
75ae4246295db86089a0d672873bb5121b051b79 16-Aug-2011 Kenny Root <kroot@google.com> Merge "Add install arg for verification"
22268c720b53224ed10fa209266418eec964ea7c 15-Aug-2011 Mike Lockwood <lockwood%android.com@gtempaccount.com> am 549bfcda: am 003771d1: am 80d508fd: Merge "correct VID of Lenovo(0x2006 is for LenovoMobile,0x17EF is for Lenovo)"

* commit '549bfcda6df30dd00db254b3717fc8df463ce710':
correct VID of Lenovo(0x2006 is for LenovoMobile,0x17EF is for Lenovo)
549bfcda6df30dd00db254b3717fc8df463ce710 15-Aug-2011 Mike Lockwood <lockwood%android.com@gtempaccount.com> am 003771d1: am 80d508fd: Merge "correct VID of Lenovo(0x2006 is for LenovoMobile,0x17EF is for Lenovo)"

* commit '003771d1c0ad6c3c6cd0c82f787636111c9e193c':
correct VID of Lenovo(0x2006 is for LenovoMobile,0x17EF is for Lenovo)
c11f99f40a200f5cdb4bdaedc18fddbc4324189c 15-Aug-2011 zhangclb <zhangclb@lenovo.com> correct VID of Lenovo(0x2006 is for LenovoMobile,0x17EF is for Lenovo)

Change-Id: I3466fdf7b03cf5da189efe4efb563d09f14b467a
sb_vendors.c
de034ec83e2d76db54d1936e706e80853146dcc7 10-Aug-2011 Christopher Tate <ctate@google.com> Change default backup filename and terminology

We now use "backup.ab" as the default backup archive filename, and no longer
refer to "tar" or "tarfiles" in the help text. The underlying format may
be tar, but we're certainly not interoperable even with ustar/pax thanks
to our compression & encryption layers and our custom header.

Change-Id: I3e74af96cfc102e94848c969eb36af54304bfd9b
ommandline.c
597ea5b63f764b4403fd0d34400ab37cf944b479 05-Aug-2011 Kenny Root <kroot@google.com> Add install arg for verification

Allow "adb install" to transfer the file for the verification argument
to the package manager "pm install" command.

Change-Id: I4834f45019eb1387a5d2b205b53a67e91d5fa67e
ommandline.c
9ff99f653632504b98c17fc76eac3383df5b5d1e 05-Aug-2011 Kenny Root <kroot@google.com> Merge "Default to secure mode"
ff9d3484e6c8f2f7e7e25581cb4dc86e0884d8a7 31-Jul-2011 Kenny Root <kroot@google.com> Default to secure mode

If ro.secure is not set for some reason, default to secure mode.

Change-Id: Id0ce3ea5507a3f9690332fb5a2daef7d3303481d
db.c
514b40bafada989c63f8a3d42a517c6c53e04b02 30-Jul-2011 Nick Kralevich <nnk@google.com> am 189de0c1: am adabe566: am 810cf41b: Merge "Fixed memory leak when using transport:serial."

* commit '189de0c1f4339abd7b938b4905775163d2a94bbe':
Fixed memory leak when using transport:serial.
189de0c1f4339abd7b938b4905775163d2a94bbe 30-Jul-2011 Nick Kralevich <nnk@google.com> am adabe566: am 810cf41b: Merge "Fixed memory leak when using transport:serial."

* commit 'adabe566906aa5e8ce791327559aeb10c139b365':
Fixed memory leak when using transport:serial.
810cf41b6d5b772846bbb16700f8c69f03710e60 30-Jul-2011 Nick Kralevich <nnk@google.com> Merge "Fixed memory leak when using transport:serial."
3175c8e9bfcb01f181d7300755da15a999e5461c 27-Jul-2011 Tom Marlin <tomm@bsquare.com> Fixed memory leak when using transport:serial.

Fixed memory leak when using transport:serial. Code was previously
using strdup() to make a copy of the serial number which was not
necessary. Instead, just set serial=service.

Change-Id: Ifa8fe7999c6fb88955d2c6bdfcd3cd724ec1f020
Signed-off-by: Tom Marlin <tomm@bsquare.com>
db.c
ea839db2894b88ff8e039e589ad251579fd14610 29-Jul-2011 Mike Lockwood <lockwood@android.com> am b1cfa672: am 7d39463e: am d1015de9: Merge "adb: Add USB vendor ID for Vizio"

* commit 'b1cfa672014d197d6d4d12fca0d40cd59de436bc':
adb: Add USB vendor ID for Vizio
b1cfa672014d197d6d4d12fca0d40cd59de436bc 29-Jul-2011 Mike Lockwood <lockwood@android.com> am 7d39463e: am d1015de9: Merge "adb: Add USB vendor ID for Vizio"

* commit '7d39463eff2a9002208f34f1d2ce4d62546f6c3a':
adb: Add USB vendor ID for Vizio
fb34e98bdd36717a1df5a2be4de288c5e08c9b78 29-Jul-2011 Mike Lockwood <lockwood@android.com> adb: Add USB vendor ID for Vizio

Change-Id: I280ff83d7f1fda1ed811bd42cb6fd65036525559
Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_vendors.c
b32904a9eaff02799713363d5f6817ce86eaca54 18-Jul-2011 Mike Lockwood <lockwood@android.com> am 01acea11: am 1f72fe99: am 7df080b2: am 3ddaa0ad: Merge "adb: Add USB vendor ID for Lenovo"

* commit '01acea112501f7d140f100591319781e59b90d0e':
adb: Add USB vendor ID for Lenovo
01acea112501f7d140f100591319781e59b90d0e 18-Jul-2011 Mike Lockwood <lockwood@android.com> am 1f72fe99: am 7df080b2: am 3ddaa0ad: Merge "adb: Add USB vendor ID for Lenovo"

* commit '1f72fe991dc2e48c13518015c523f9e3ea048af2':
adb: Add USB vendor ID for Lenovo
7076831c7d59d96e9b75bf9aa5664d1d1b312f32 14-Jul-2011 Jean-Baptiste Queru <jbq@google.com> am f75a2ed2: Merge from gingerbread-plus-aosp

* commit 'f75a2ed2138cd8b74597bd57e13d12e1f0b815c2':
adb: Add vendor IDs for iRiver, Compal and T & A Mobile Phones
Add Gigabyte's USB vendor ID to adb.
Add Funai's USB vendor ID to adb.
7c17d0932c676d75ac0ff42b1917a02127ee554e 14-Jul-2011 Mike Lockwood <lockwood@android.com> adb: Add USB vendor ID for Lenovo

Change-Id: I1c2423f567272493067fae04e64fdcb651b0af62
Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_vendors.c
f75a2ed2138cd8b74597bd57e13d12e1f0b815c2 12-Jul-2011 Jean-Baptiste Queru <jbq@google.com> Merge from gingerbread-plus-aosp

Change-Id: I55b84eda30edf0eade8b43712ab011cd3f65f0d9
29e1e7393d1742f9dd5663c63026f50981e5bd89 12-Jul-2011 Jeff Brown <jeffbrown@google.com> Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I2fcf31af681d92880e5d31a46d5f6777f7ca1977
ndroid.mk
292e86230ee0eabb9c9bed902bc3b3941437341d 11-Jul-2011 Mike Lockwood <lockwood@android.com> adb: Add vendor IDs for iRiver, Compal and T & A Mobile Phones

Change-Id: I4dafc43aa76049dd0075e1d70ba05d899e545c8d
Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_vendors.c
sb_vendors.h
7a5c1463ba386fd14e97c9fb4e058129763b60c1 19-May-2011 Joe Bass <jbass@google.com> Add Gigabyte's USB vendor ID to adb.

Bug #4452872

Change-Id: Ib97548d121d40e96ccc519323a335fc90f3b32b9
sb_vendors.c
cbe19cec6192837582906d885dafe1945d6a7f4c 19-May-2011 Xavier Ducrohet <xav@android.com> Add Funai's USB vendor ID to adb.

Change-Id: Idc2974d4437ab1c79cfea5aade98b599a877aad3
sb_vendors.c
535164e9d9649a83d4d63829f3389f2bea339fe1 22-Jun-2011 Mike Lockwood <lockwood@android.com> Reimplement the "adb root" command to more closely match its previous behavior

The adb gadget driver used to reset the USB bus when the adbd daemon exited,
and the host side adb relied on this behavior to force it to reconnect
with the new adbd instance after init relaunches it. The new gadget
drivers no longer automatically reset the USB bus when adbd is restarted
which caused adb to hang since it was no longer forced to reconnect with the
device. We attempted to work around this on the host side adb, but that
work around has not been reliable.

This change adds a property trigger on the service.adb.root system property
which will reset the USB bus and restart the adbd daemon when adbd sets
the property to 1. This should be much closer to the previous behavior
and will hopefully fix some problems with automated testing.

Change-Id: I177c37400009a3d83f21a5f9431f94fd1cc19b9b
Signed-off-by: Mike Lockwood <lockwood@android.com>
ervices.c
07edefe4cecbddaf6282e556e04a1e1ef21c404a 22-Jun-2011 Mike Lockwood <lockwood@android.com> Revert "adb: kick the transport after sending the "adb root" command"

This reverts commit d15e6ac95dc898fb78fb5917bb2e4498b40b716f.

Also increment adb version to 1.0.29

Change-Id: I890643f0c18a2fe90f170134df039c54116cecda
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.h
ockets.c
693e78b9b61da835b6d2f88348bb99ab0840b37e 22-Jun-2011 Mike Lockwood <lockwood@google.com> Merge "Fix hang after end of backup"
10f129ca8eb266f46393e981484e60521f9011df 22-Jun-2011 Christopher Tate <ctate@google.com> Fix hang after end of backup

The buggy behavior was that the 'adb backup ....' host command line
invocation would hang forever, even after the backup finished and
the forked device-side subprocess had been reaped. The reason for
this is that the device adbd end of the socketpair used to send
the data back from the forked subprocess was still stuck readable
even after the remote end of it had been closed.

With this patch, the thread whose job it is to waitpid() in order
to harvest the forked child process also closes the local (adbd)
end of the socketpair. This makes the fdevent logic notice that
the socket is dead, at which point it cleans up everything including
the communication back to the host.

Change-Id: I90e7e4e5db36c5a6f7363708b29a6d2c56d1250e
ackup_service.c
b0bd6024e344eb49702e24e78654f55254f42e8f 21-Jun-2011 Mike Lockwood <lockwood@android.com> adb: Update version to 1.0.28

Change-Id: Ib8a98d3840abf24cf062112aca7ce462a0f44bc5
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.h
5b811fa5dd00288954f15209a56aea03d5e4a004 10-Jun-2011 Christopher Tate <ctate@google.com> Tidy up the end-of-data handling in backup

* Increase transfer buffer size to 32K
* Add logging about error conditions and fd teardown
* Pass the fd number as a command line option to the 'bu' subprocess
* Properly harvest the 'bu' subprocess after it's done

Change-Id: Id44dde25778ecf43c5604fd9d01d726ba58861e5
ackup_service.c
ommandline.c
ockets.c
b0a8aae3eda5e245b93cb6d3af286202dc8c011c 16-Jun-2011 Kenny Root <kroot@google.com> Use adb_sleep_ms for Cygwin compat

Change-Id: Iabb2cddfb6740a35e4b6b1563a81b64972c29453
ockets.c
d15e6ac95dc898fb78fb5917bb2e4498b40b716f 12-Jun-2011 Mike Lockwood <lockwood@android.com> adb: kick the transport after sending the "adb root" command

This is needed because the USB driver on the device no longer resets the bus
when exits and restarts.
Since the host side adb no longer detects that adbd has restarted we need
to reset the connection on the host side now.

Change-Id: I1a8eabd292e8b45c34fa07a8a8b8c609cc15648d
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.h
ockets.c
37b9fc6e7c25e4d7f57e1df6954498c8bc3c5a1b 09-Jun-2011 Nick Kralevich <nnk@google.com> am 4ba5a8ac: am eafcbe10: am 072a0fac: Merge "Fixed adb crash due to accessing freed memory"

* commit '4ba5a8acba033127befd184f2f78cf0580995b07':
Fixed adb crash due to accessing freed memory
4ba5a8acba033127befd184f2f78cf0580995b07 08-Jun-2011 Nick Kralevich <nnk@google.com> am eafcbe10: am 072a0fac: Merge "Fixed adb crash due to accessing freed memory"

* commit 'eafcbe109f97e5a687cc944e65c383fa45d71c8f':
Fixed adb crash due to accessing freed memory
49f1857dd8b64cdd57f28e965a1ff5fa0c2b0547 13-May-2011 Tom Marlin <tomm@bsquare.com> Fixed adb crash due to accessing freed memory

Reset peers to NULL after closing them down. This prevents
other code from attempting to access that freed memory
(which prevents crashes). Previously, it left pointers to
freed memory and the "if (s->peer)" guards could not block
the attempt to access that memory later. Resolves many
crashes seen while taking repeated screenshots on WinXP.

Change-Id: I32553f4d19f6ddc9b05b6ab4dc1e9efe69e5be4f
ockets.c
c9cd3b976111d91ede6cd88bd06eb57b10b2f0e7 02-Jun-2011 Christopher Tate <ctate@google.com> Make 'adb backup' -f handling more bulletproof and more flexible

* "adb backup" as the entire command line no longer crashes

* The "-f filename" option can now appear anywhere in the command line.
A trailing "-f" at EOL prompts an error message and usage summary.

Change-Id: I040ed73c2ca3687e265e35600eb3ab2b3c879695
ommandline.c
2bc503e6a9000c1b218f5f059629990341d74c33 22-May-2011 Joe Bass <jbass@google.com> am 0efe2f2f: am b27c682e: am f5144d34: Add Gigabyte\'s USB vendor ID to adb.

* commit '0efe2f2f11d79060962f35a3fb4db525d3f12e9e':
Add Gigabyte's USB vendor ID to adb.
0efe2f2f11d79060962f35a3fb4db525d3f12e9e 21-May-2011 Joe Bass <jbass@google.com> am b27c682e: am f5144d34: Add Gigabyte\'s USB vendor ID to adb.

* commit 'b27c682e28a01b18f7506a9b35222453058107ad':
Add Gigabyte's USB vendor ID to adb.
5526ee0831358d0a79670806e6a7df8b0380e61e 21-May-2011 Christopher Tate <ctate@google.com> Merge "Add 'adb restore' to parallel 'adb backup'"
f5144d34fac074b134722b1fdb6149eb11eff420 19-May-2011 Joe Bass <jbass@google.com> Add Gigabyte's USB vendor ID to adb.

Bug #4452872

Change-Id: Ib97548d121d40e96ccc519323a335fc90f3b32b9
sb_vendors.c
aff5d7870e2f7db808b47d8ca2fd4a567433dba5 19-May-2011 Xavier Ducrohet <xav@android.com> am 44c336bf: am 830fc9af: am 30d916c3: Add Funai\'s USB vendor ID to adb.

* commit '44c336bfe9bbd400461b9b28a449a67145eaeeb8':
Add Funai's USB vendor ID to adb.
44c336bfe9bbd400461b9b28a449a67145eaeeb8 19-May-2011 Xavier Ducrohet <xav@android.com> am 830fc9af: am 30d916c3: Add Funai\'s USB vendor ID to adb.

* commit '830fc9afbe3e83b3b39278d67a9680bb2068098a':
Add Funai's USB vendor ID to adb.
30d916c360d4d49658b9b305b17568b37fcb1029 19-May-2011 Xavier Ducrohet <xav@android.com> Add Funai's USB vendor ID to adb.

Change-Id: Idc2974d4437ab1c79cfea5aade98b599a877aad3
sb_vendors.c
702967afb1bebc97c0b8a23c075d4932820ef7a3 18-May-2011 Christopher Tate <ctate@google.com> Add 'adb restore' to parallel 'adb backup'

It won't actually do anything until the 'bu' tool and framework are
updated to respond properly, but this is the adb side of the
necessary infrastructure: we copy the tarfile into the socket pointed
at the device, using the existing mechanisms.

Change-Id: Ic3b5779ade256bd1ad989a94b0685f7b1a7d59d2
ndroid.mk
db.h
ackup_service.c
ommandline.c
ervices.c
024447c3c3dcf63b54cc481f2c6ecbda10823269 17-May-2011 Christopher Tate <ctate@google.com> Use the new 'bu' syntax for backup vs restore operation

Change-Id: Ib007705ee562a41869f8add3408101b3a53aa2d7
ackup_service.c
35e6a003ca5d59cbaa504d8bb8458e8bdd995906 17-May-2011 Omari Stephens <xsdg@android.com> Merge "Add a 1000msec timeout for adb's USB control packets"
574ebc41f8aaaec25039b91b118d2dd98678c7d6 11-May-2011 Christopher Tate <ctate@google.com> Merge "Add 'adb backup' for pulling a full backup tarfile to the host"
8bbae239156cb51fd36300368588e9bf8d42613d 10-May-2011 Omari Stephens <xsdg@android.com> Add a 1000msec timeout for adb's USB control packets

Includes a version bump to make it possible to determine if a given
binary has this fix or not.

Bug: 4111855
Change-Id: I86d902a7fa0c4b906264141d2467b7bdddb61801
db.h
sb_linux.c
d2f5415c603f7d9961f7a0b05579a0768e071410 21-Apr-2011 Christopher Tate <ctate@google.com> Add 'adb backup' for pulling a full backup tarfile to the host

The direct command interfaces with the 'bu' binary in /system/bin
on the device.

Change-Id: I4cd69eedfe5144c47277573c5626c6ad8755d70b
ndroid.mk
db.h
ackup_service.c
ommandline.c
ervices.c
224f9485f15b0319440153e42532f71e0906abf4 27-Apr-2011 Mike Lockwood <lockwood%android.com@gtempaccount.com> am 81ce51da: am 55537c34: am 2f7995ee: Merge "adb: fix typo in helptext"

* commit '81ce51dae95deb0dc6b07cbd96bd07d08aad5178':
adb: fix typo in helptext
81ce51dae95deb0dc6b07cbd96bd07d08aad5178 27-Apr-2011 Mike Lockwood <lockwood%android.com@gtempaccount.com> am 55537c34: am 2f7995ee: Merge "adb: fix typo in helptext"

* commit '55537c347bb31d0e2b176ca2550d2054877f9d54':
adb: fix typo in helptext
6715a4390f482815f51577d25d464537f7e7b823 26-Apr-2011 Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> adb: fix typo in helptext

s/ocmmand/command

Change-Id: I4ed17e8df9dc71a28e1caef5a21f6351e92628af
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
ommandline.c
112445b8a752ce174f36cf853d5f1c356c3f5286 13-Apr-2011 JP Abgrall <jpa@google.com> adb: Don't allow a forced exit if data is still in the socket


Fixes the http://b/4271011 "adb shell cat /init.rc output gets truncated"


Change-Id: I6df64374b60789595fb18f96d429315dec032443
Signed-off-by: JP Abgrall <jpa@google.com>
ockets.c
0ffe483a6a9191fc6da031bbcdbdc50f6f64bdf0 11-Apr-2011 Mike Lockwood <lockwood%android.com@gtempaccount.com> am e4bcf830: am d37e0840: Merge "In serial, skip over port as well if numbers found after colon."

* commit 'e4bcf8305748e8799df9047fb0f6881553dd43b5':
In serial, skip over port as well if numbers found after colon.
e994f18c53673cac42ed45ccb3d427bd40000948 16-Mar-2011 Terence Haddock <thaddock@google.com> In serial, skip over port as well if numbers found after colon.

Change-Id: Icd45f570a9527790eb0cd614a3f77da1a72375b1
ockets.c
b40367e7bc3f89c3875d50b29fa98c3a541e33a3 29-Mar-2011 JP Abgrall <jpa@google.com> adb: keep mac build happy

Use FIONREAD instead of TIOCINQ

Change-Id: Ic9db0228a51c546a798c70f08f2e644a1a376120
devent.c
408fa57864c01113deaa213e5c1848a9c594ae92 16-Mar-2011 JP Abgrall <jpa@google.com> adb: fix subprocess exit handling, oom adjust fixes, extra debugging.

* Add support for correctly handling subprocess termination in shell service (b/3400254 b/3482112 b/2249397)
- have a waitpid() track the subprocess, then notify the fdevent via a socket
- force an eof on the pty master in fdevent's new subproc handler.
- modify fdevent to force-read the pty after an exit.
* Migrate the "shell:blabla" handling to "#if !ADB_HOST" sections, where it
belongs.
* Fix the race around OOM adjusting.
- Do it in the child before exec() instead of the in the parent as the
child could already have started or not (no /proc/pid/... yet).
* Allow for multi-threaded D() invocations to not clobber each other.
- Allow locks across object files.
- Add lock within D()
- Make sure sysdesp init (mutex init also) is called early.
* Add some missing close(fd) calls
- Match similar existing practices near dup2()
* Add extra D() invocations related to FD handling.
* Warn about using debugging as stderr/stdout is used for protocol.
* Fix some errno handling and make D() correctly handle it.
* Add new adb trace_mask: services.
* Make fdevent_loop's handle BADFDs more gracefully (could occur some subproc closed its pts explicitely).
* Remove obsolete commandline args reported in help. (b/3509092)


Change-Id: I928287fdf4f1a86777e22ce105f9581685f46e35
db.c
db.h
db_client.c
ommandline.c
devent.c
devent.h
ile_sync_client.c
ile_sync_service.c
utex_list.h
ervices.c
ockets.c
ysdeps.h
ransport.c
ransport.h
sb_linux.c
sb_linux_client.c
sb_vendors.h
sb_windows.c
28e1390e688f721e13a9877d3c41884bf151db60 16-Mar-2011 Terence Haddock <thaddock@google.com> In serial, skip over port as well if numbers found after colon.

Change-Id: Icd45f570a9527790eb0cd614a3f77da1a72375b1
ockets.c
e3aeeb4de34dbb93e832e6554f494122ba633f3b 08-Mar-2011 Ken Sumrall <ksumrall@android.com> Try to unmount writable filesystems when rebooting

Ext4 filesystems like to be unmounted before rebooting. The Android system
doesn't have a traditional Linux init setup, and shutting down the system
was not much more than calling sync(2) and reboot(2). This adds a new
function to libcutils called android_reboot(). By default, it calls sync()
and then remounts all writable filesystems as read-only and marks them clean.
There is a flag parameter in which the caller can ask for sync() not to be
called, or to not remount the filesystems as read-only. Then it will call
reboot(2) as directed by the other parameters. This change also updates
adb, init and toolbox to call the new android_reboot() function.
Fixes bugs 3350709 and 3495575.

Change-Id: I16d71ffce3134310d7a260f61ec6f4dd204124a7
ervices.c
0e7c4274c687446dbe30a814278d7a6b99da8c4e 24-Feb-2011 JP Abgrall <jpa@google.com> Revert "Fix adb hang when subprocess dies early."

This is for http://b/3482112 "adb interactions with device causing test harness failures".

This reverts commit 69c5c4c45bd4f1575ae8bdba13795297be7deb8c.

Change-Id: I630bf2e04d2ecf0223bd2af4e87136754ff880d3
db.c
db.h
db_client.c
ommandline.c
devent.c
utex_list.h
ervices.c
ockets.c
ysdeps.h
ransport.c
sb_linux.c
sb_linux_client.c
69c5c4c45bd4f1575ae8bdba13795297be7deb8c 18-Feb-2011 JP Abgrall <jpa@google.com> Fix adb hang when subprocess dies early.

* Handling of the subprocess and its FD.
This fixes http://b/3400254 "Many bugreports getting hung at the end in monkey"
- Start up a service thread that waits on the subprocess to terminate,
then closes the FD associated with it.
- Have the event handler select() with a timeout so that it can
detect the closed FD. Select() with no timeout does not return when an FD is closed.
- Have the event handler force a read on the closed FD to trigger the close sequence.
- Migrate the "shell:blabla" handling to "#if !ADB_HOST" sections.
* Fix the race around OOM adjusting.
- Do it in the child before exec() instead of the in the parent as the
child could already have started or not (no /proc/pid/... yet).
* Allow for multi-threaded D() invocations to not clobber each other.
- Allow locks across object files.
- Add lock within D()
* Add some missing close(fd) calls
- Match similar existing practices near dup2()
* Add extra D() invocations related to FD handling.
* Warn about using debugging as stderr/stdout is used for protocol.

Change-Id: Ie5c4a5e6bfbe3f22201adf5f9a205d32e069bf9d
Signed-off-by: JP Abgrall <jpa@google.com>
db.c
db.h
db_client.c
ommandline.c
devent.c
utex_list.h
ervices.c
ockets.c
ysdeps.h
ransport.c
sb_linux.c
sb_linux_client.c
0909af57d59422be672ad02e72837e773e1ddd4b 09-Feb-2011 Mathias Agopian <mathias@google.com> am c1fbf7c1: fix [3374821] Cannot take screenshot of HC preview

* commit 'c1fbf7c1638cb4f1f139edf74562fcfbaa6f3435':
fix [3374821] Cannot take screenshot of HC preview
c1fbf7c1638cb4f1f139edf74562fcfbaa6f3435 09-Feb-2011 Mathias Agopian <mathias@google.com> fix [3374821] Cannot take screenshot of HC preview

don't hardcode the pixelformat to RGBA_8888 when taking
screenshots.

Change-Id: I3a76b49275acfce9a2994436f521b76310cd8fb2
ramebuffer_service.c
67afaad585f327b1306ea840aacd19f16f19d7da 03-Feb-2011 Mike Lockwood <lockwood%android.com@gtempaccount.com> am d4894f4b: am 034117e4: Merge changes I8df51128,Ie922b3e7,I31f78419,I7e8df44d,I6067857b,Ifd35587c,Ie8d66740

* commit 'd4894f4be608c28ef0f39c7794ba865ac812dff9':
Fix adb leaking file descriptors to forked processes
adb: Fix command-line parser.
adb: Increase device descriptor buffer size in Linux host USB support
adb: improve debug traces readability.
adb: Don't report negative number of bytes after pushing file > 2 gigabytes
Adding Texas Instruments to the VID list.
Support an additional alias for 'adb shell.'
3b4a0c81c4f2af46e6075f1150dcde55d436c7a6 02-Feb-2011 Benoit Goby <benoit@android.com> Fix adb leaking file descriptors to forked processes

accept() creates a new file descriptor that should be closed on exec so
that forked processes don't keep a fd opened on the socket.

This also fixes b/3297070 where adb hangs after running adb on the
target.

Change-Id: I8df511289e5549ae49b4824c9dfb71a3bf85eae8
db.c
dwp_service.c
ervices.c
ysdeps.h
eb5df470e6e0402006030b76315f06bcb4f17882 31-Jan-2011 David 'Digit' Turner <digit@google.com> adb: Fix command-line parser.

This fixes the command-line parser to accept both "daemon server"
and "server nodaemon". Before the patch, the second string would
ignore the "nodaemon" flag.

Fixes b/2191598

Change-Id: Ie922b3e7bf57a6e334fc448cec33fb340ca6abc4
ommandline.c
a5d469484660513e47b074b9d7fff17475a68efc 08-Jan-2011 Mike Lockwood <lockwood@android.com> adb: Increase device descriptor buffer size in Linux host USB support

256 bytes wasn't big enough for some complicated USB configurations

Change-Id: I31f7841953d73b06958f44040f58166b159faff4
Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_linux.c
3e42db23fbbfdc2866f5ca035641444c5ab2ff78 06-Jan-2011 David 'Digit' Turner <digit@google.com> adb: improve debug traces readability.

This patch makes the traces easier to read. For example transports are
displayed by name/serial instead of their hex address.

Change-Id: I7e8df44ddbec19754d63d989bd56485998b4627b
db.c
ransport.c
487009ef5e723729d51b937d6844b8d12fb974a3 15-Dec-2010 Mike Lockwood <lockwood@android.com> adb: Don't report negative number of bytes after pushing file > 2 gigabytes

BUG: 3198322

Change-Id: I6067857b9490984a21b597f6ee338446a9decaf5
Signed-off-by: Mike Lockwood <lockwood@android.com>
ile_sync_client.c
1d3fbed34897e36ed0b55c68fe6b0a7f2dd2ec8e 13-Dec-2010 Alex Sakhartchouk <alexst@google.com> Adding Texas Instruments to the VID list.

Change-Id: Ifd35587c93ae7d5c8253f477a92cca2345dc8bb5
sb_vendors.c
9c73d17e870e448ea1f036bda70736ae0ae6bf2e 19-Aug-2010 Daniel Sandler <dsandler@google.com> Support an additional alias for 'adb shell.'

Change-Id: Ie8d667407fef8ee5a6c7ab86b30307fb61869170
ommandline.c
b596608f098937049fd98c5896cf72ebbf3584ae 08-Jan-2011 Mike Lockwood <lockwood@android.com> adb: Increase device descriptor buffer size in Linux host USB support

256 bytes wasn't big enough for some complicated USB configurations

Change-Id: I31f7841953d73b06958f44040f58166b159faff4
Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_linux.c
ee878753f915a0176ea411b71bdffde064e24ae0 15-Dec-2010 Mike Lockwood <lockwood@android.com> adb: Don't report negative number of bytes after pushing file > 2 gigabytes

BUG: 3198322

Change-Id: I6067857b9490984a21b597f6ee338446a9decaf5
Signed-off-by: Mike Lockwood <lockwood@android.com>
ile_sync_client.c
ffe55f760d269d19bd06dd39f60e1a042881082f 13-Dec-2010 Alex Sakhartchouk <alexst@google.com> Adding Texas Instruments to the VID list.

Change-Id: Ifd35587c93ae7d5c8253f477a92cca2345dc8bb5
sb_vendors.c
1c061b9ea952ebdf6093ca1e7c29bfff6332857e 09-Dec-2010 Ying Wang <wangying@google.com> dist for dist_files

Change-Id: I665572a2212f1239b02b7816e37ada210afbdb48
ndroid.mk
5fa7fcf89a978678bcf96730b89f9aad7b6ec97c 21-Oct-2010 Jean-Baptiste Queru <jbq@google.com> am 34961b26: am 6713a2e0: Merge "Fix USB endianness bugs on Linux."

Merge commit '34961b266773006ec6643446e7b5a1558d82e4f4'

* commit '34961b266773006ec6643446e7b5a1558d82e4f4':
Fix USB endianness bugs on Linux.
5985f6ceee15979beee6baa608098f80fc388ccd 21-Oct-2010 Jean-Baptiste Queru <jbq@google.com> am 89463984: am 81347d27: Merge "adb: Improved detection of big endian architecture"

Merge commit '89463984f5576d7ab61303e08f81eb9175afed59'

* commit '89463984f5576d7ab61303e08f81eb9175afed59':
adb: Improved detection of big endian architecture
34961b266773006ec6643446e7b5a1558d82e4f4 21-Oct-2010 Jean-Baptiste Queru <jbq@google.com> am 6713a2e0: Merge "Fix USB endianness bugs on Linux."

Merge commit '6713a2e0c659be9d992e75ab420da5680f522658' into gingerbread-plus-aosp

* commit '6713a2e0c659be9d992e75ab420da5680f522658':
Fix USB endianness bugs on Linux.
89463984f5576d7ab61303e08f81eb9175afed59 20-Oct-2010 Jean-Baptiste Queru <jbq@google.com> am 81347d27: Merge "adb: Improved detection of big endian architecture"

Merge commit '81347d2764b32ec7224d4e2ab3348103816400b2' into gingerbread-plus-aosp

* commit '81347d2764b32ec7224d4e2ab3348103816400b2':
adb: Improved detection of big endian architecture
12ddbea0fd87ff21da94d25f0ebe89cbfd004a3b 18-Oct-2010 Mike Lockwood <lockwood@google.com> am a8b8c0e2: am d02e521d: adb: Add support for Philips\'s USB vendor ID

Merge commit 'a8b8c0e21ac4bdb7838c8c1b8e7d60f632eda79b'

* commit 'a8b8c0e21ac4bdb7838c8c1b8e7d60f632eda79b':
adb: Add support for Philips's USB vendor ID
5ca7509f5b188231666973a66566e6de2e3d48db 16-Oct-2010 Xavier Ducrohet <xav@android.com> am fa5c690d: am 89aff1d2: Add Asus USB vendor ID to adb.

Merge commit 'fa5c690d93b92ccf57a0522c498ca2076a7ad98d'

* commit 'fa5c690d93b92ccf57a0522c498ca2076a7ad98d':
Add Asus USB vendor ID to adb.
6f703a2e85a3098b3546a0ce254349b72b440628 22-Sep-2010 Marcus Comstedt <marcus@mc.pp.se> Fix USB endianness bugs on Linux.

The fields device->idVendor and device->idProduct should not be
converted from little endian to native byteorder, because the
kernel has in fact done so already!

On the other hand, the descriptors read using raw ioctl:s in
register_device() do need to be converted.

Change-Id: I5fe08b626b14ead56a592b68d026690e343c2656
sb_linux.c
d340d2f57dc0d414ea66b1b556caaf8c98b1e967 22-Sep-2010 Marcus Comstedt <marcus@mc.pp.se> adb: Improved detection of big endian architecture

Instead of testing for the (compiler specific) define
__ppc__ explicitly, use the define HAVE_BIG_ENDIAN provided by
AndroidConfig.h. That way, it should work on all big endian
systems.

Change-Id: Ic4d62afcefce4c8ad5716178ebfcb2b055ac73ce
ile_sync_service.h
ransport_local.c
ransport_usb.c
a8b8c0e21ac4bdb7838c8c1b8e7d60f632eda79b 16-Oct-2010 Mike Lockwood <lockwood@google.com> am d02e521d: adb: Add support for Philips\'s USB vendor ID

Merge commit 'd02e521d79a49471b3f1dc3717e842948df64789' into gingerbread-plus-aosp

* commit 'd02e521d79a49471b3f1dc3717e842948df64789':
adb: Add support for Philips's USB vendor ID
d02e521d79a49471b3f1dc3717e842948df64789 16-Oct-2010 Mike Lockwood <lockwood@google.com> adb: Add support for Philips's USB vendor ID

Change-Id: Iaf2e3f6f111198740703b5c3581d95756f797224
Signed-off-by: Mike Lockwood <lockwood@google.com>
sb_vendors.c
3b5d79b78cfdeefccaa5b50c72fe2e5d0636178d 15-Oct-2010 Xavier Ducrohet <xav@android.com> am 1693c32f: am 6c263694: Fix KT Tech\'s usb vendor ID.

Merge commit '1693c32f42e69634b52df1bf827fd81dc3abda46'

* commit '1693c32f42e69634b52df1bf827fd81dc3abda46':
Fix KT Tech's usb vendor ID.
fa5c690d93b92ccf57a0522c498ca2076a7ad98d 15-Oct-2010 Xavier Ducrohet <xav@android.com> am 89aff1d2: Add Asus USB vendor ID to adb.

Merge commit '89aff1d22662c64cc2de384e7e2c699e4d1d5d47' into gingerbread-plus-aosp

* commit '89aff1d22662c64cc2de384e7e2c699e4d1d5d47':
Add Asus USB vendor ID to adb.
89aff1d22662c64cc2de384e7e2c699e4d1d5d47 15-Oct-2010 Xavier Ducrohet <xav@android.com> Add Asus USB vendor ID to adb.

Bug: 3099385

Change-Id: Ic068fbf58abd23f4bddfe13ae33854a8b4053cf8
sb_vendors.c
1693c32f42e69634b52df1bf827fd81dc3abda46 14-Oct-2010 Xavier Ducrohet <xav@android.com> am 6c263694: Fix KT Tech\'s usb vendor ID.

Merge commit '6c2636947c43c2950488d8d82bfc691cb907518d' into gingerbread-plus-aosp

* commit '6c2636947c43c2950488d8d82bfc691cb907518d':
Fix KT Tech's usb vendor ID.
6c2636947c43c2950488d8d82bfc691cb907518d 14-Oct-2010 Xavier Ducrohet <xav@android.com> Fix KT Tech's usb vendor ID.

Change-Id: I77a6de8c11d490e2427f704ff64e7c09874a5d14
sb_vendors.c
dff02374301f93860568c7805e20b55e2e04a179 07-Oct-2010 Benoit Goby <benoit@android.com> Don't build adb for sdk only builds

Change-Id: I0c56213e81a889fd3a7c5e72c4a6e63544a2a3bd
Signed-off-by: Benoit Goby <benoit@android.com>
ndroid.mk
cb56b712b559dc66d10a3993b60ee4886cebac73 07-Oct-2010 Benoit Goby <benoit@android.com> Don't build adb for simulator target

Change-Id: Ibe4ef6bb111dc7123e53262553deb8f5e25e9391
Signed-off-by: Benoit Goby <benoit@android.com>
ndroid.mk
c318833b359164f25d7a93f6395c0cad787bacd7 24-Sep-2010 John Michelau <john.michelau@motorola.com> Build adb for target-as-host

Added a new target for adb, so that the adb
host executable is built for the target as
well. This allows the target to connect to
any Android devices which are attached to it.

Bug: 3022194
Change-Id: Ib01983e70b75cec40a9ee161da7f4cf1343eecf2
ndroid.mk
db.h
579ca37361b2b1ea9aa62d6b450866e1f48db064 28-Sep-2010 Xavier Ducrohet <xav@android.com> am 1e3f8f27: am f62b23f2: Add new USB vendor IDs.

Merge commit '1e3f8f2769f9a227fe4d4abfe3d26083e4da91e9'

* commit '1e3f8f2769f9a227fe4d4abfe3d26083e4da91e9':
Add new USB vendor IDs.
1e3f8f2769f9a227fe4d4abfe3d26083e4da91e9 28-Sep-2010 Xavier Ducrohet <xav@android.com> am f62b23f2: Add new USB vendor IDs.

Merge commit 'f62b23f2c1540221621024c850fdf615dda0c903' into gingerbread-plus-aosp

* commit 'f62b23f2c1540221621024c850fdf615dda0c903':
Add new USB vendor IDs.
f62b23f2c1540221621024c850fdf615dda0c903 28-Sep-2010 Xavier Ducrohet <xav@android.com> Add new USB vendor IDs.

Change-Id: Ie3b1ee09c67c4c8fdb294cfc99fa28e4ebe8dfae
sb_vendors.c
0715f91223b2f7a91ea08bfa95998d846e7977cf 27-Sep-2010 Mathias Agopian <mathias@google.com> update adbd to use the new screencap command for taking screenshots.

Change-Id: I02c49240f9db9258824020f3f5f04463e17a537a
ramebuffer_service.c
9abea13a0a5015a401c15ad6a2a1db1b337d9cdf 28-Aug-2010 Nick Kralevich <nnk@google.com> am 4692599c: am 44db990d: Fix bug 2950316. Check return values.

Merge commit '4692599cf73240e34d8e3bf7f54e99ebb9c0aaf3'

* commit '4692599cf73240e34d8e3bf7f54e99ebb9c0aaf3':
Fix bug 2950316. Check return values.
4692599cf73240e34d8e3bf7f54e99ebb9c0aaf3 28-Aug-2010 Nick Kralevich <nnk@google.com> am 44db990d: Fix bug 2950316. Check return values.

Merge commit '44db990d3a4ce0edbdd16fa7ac20693ef601b723' into gingerbread-plus-aosp

* commit '44db990d3a4ce0edbdd16fa7ac20693ef601b723':
Fix bug 2950316. Check return values.
44db990d3a4ce0edbdd16fa7ac20693ef601b723 27-Aug-2010 Nick Kralevich <nnk@google.com> Fix bug 2950316. Check return values.

Change-Id: I687bb5fb8195d4c1fc863e32a5e233a8b9e74196
db.c
ff91ab855b84cdcf110f1a899320d3920e7c55a5 19-Aug-2010 Daniel Sandler <dsandler@google.com> Support an additional alias for 'adb shell.'

Change-Id: Ie8d667407fef8ee5a6c7ab86b30307fb61869170
ommandline.c
91c3853911ab23728728728276a21dc6fe5fd622 20-Jul-2010 Takeshi Kishimoto <kishimoto@google.com> Added Toshiba's USB VID (0x0930) upon their request.

Change-Id: I9f7fca6b98b0664ef9af4f7b86f0f5863e91e4c1
sb_vendors.c
81fbbc2d0b3db4eb9565fd8367db00a6dc1c9c66 18-Jun-2010 Takeshi Kishimoto <kishimoto@google.com> Added NEC and PMC's USB VIDs upon their request.

Change-Id: I332ee1e68ff960d41a365aeb96d012253056edd2
sb_vendors.c
deafd15f2c3ee7c7356634787c8463e1f5f937d3 21-Jul-2010 Xavier Ducrohet <xav@google.com> am 4309d602: Merge "Added Toshiba\'s USB VID (0x0930) upon their request." into gingerbread

Merge commit '4309d602b562eb9f181b0314837e6096577c6c18' into gingerbread-plus-aosp

* commit '4309d602b562eb9f181b0314837e6096577c6c18':
Added Toshiba's USB VID (0x0930) upon their request.
3c5581da1d58d0b7e3bac0f03d7ec1e63d71b86d 20-Jul-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I90bd618ff8c6bcbe1071468e0d75574feee58d27
02565fec8240bbff105f285e9e25aade52c15450 20-Jul-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: Ice679e12b8393621b21a8dafe640dd880a09d35e
29837f94b56c3eeaf39f447507324ecdb207ba96 20-Jul-2010 Takeshi Kishimoto <kishimoto@google.com> Added Toshiba's USB VID (0x0930) upon their request.

Change-Id: I9f7fca6b98b0664ef9af4f7b86f0f5863e91e4c1
sb_vendors.c
899913f8168b54e00971c0e8d4ae16d06a4651fe 16-Jun-2010 Viral Mehta <viral.vkm@gmail.com> print msg.command in human-readable format

to print msg.command as some odd decimal number is just not helping in debugging;
instead print msg.command as a string

Change-Id: Id1ec770c20c86b8bdae40a0262bf4b63c0213b0a
db.c
fdb13f793742bd981f45333f056e4baa5281e4b5 20-Jul-2010 Jean-Baptiste Queru <jbq@google.com> Merge "Fix ADB daemon file descriptor leak"
67e6fcd19533f54ca37cbe72425f55a40a7f0333 21-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from froyo-plus-aosp

Change-Id: Ie231effb4d9dfd63aa98ec08b269c31ce32aa1c0
8f5daadcc13a238344f5121a38345a18abc5aa9a 15-Feb-2010 Teddie Stenvi <teddie.xx.stenvi@stericsson.com> Fix ADB daemon file descriptor leak

The ADB (Android Debug Bridge) daemon suffers from a file descriptor leak.
When transfering file descriptors, opened by the adbd daemon, to a JDWP
process for debugging through sendmsg, the file descriptor is duplicated
by the kernel and a copy is transfered to the JDWP process.
Adbd neglects to close it's copy of the descriptor after the sendmsg call
which causes a file descriptor leak in the process.
Eventually this causes the daemon to hit its maximum roof of opened file
descriptors thus making it impossible for the process to serve any new
commands from the adb server.
Jdwp_service.c has been modified to close the file descriptor after the
send message call has succeded.
Also, the socket used for transfering the file descriptor is set to blocking
mode before the sendmsg call since the adbd processes needs to know when the
duplication has been completed by the kernel.
The flags are reset to its original state after the sendmsg call.

Change-Id: I76b15460301ac01e432f5ce8678ff58c658c16f2
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
dwp_service.c
2124afeee1f19423e71c52ede6f4926f5389e917 18-Jun-2010 Takeshi Kishimoto <kishimoto@google.com> Added NEC and PMC's USB VIDs upon their request.

Change-Id: I332ee1e68ff960d41a365aeb96d012253056edd2
sb_vendors.c
2ef569417d1136f9dcb8c2bbc6e3c3c59c4ea28d 15-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: Ia99df155e4abf0585ed46943b75a2a1569d0534f
ee0306b93386340c86d6ca9f70bd147fba16d901 15-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I183a933e96222f8c01516210cfa4be5f18e35b70
d9a1904d3f873f7733e3b7b91c70027781b463c5 15-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I14853c1f8a1d392d7ee9dfae3914d9ee3107794c
6f29e5a27b552297295f5570d2de6a8bc9e76738 15-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I2dacf7f8895debd0452c3601424e32a3b9e19059
07a804b83ae9aff836bf6e66eb4f2bbe8f88cc90 15-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: Ia8d41f96f3885bd7159571182d09c1da079e5bc9
83cb93b4016cbd6029a2d215a7b63fa716b103e4 03-Jun-2010 Michael Richardson <mcr@credil.org> added vendor ID for http://www.onthegovideo.com/

Change-Id: I38e3a6f252728d93177745778147e6f6ed45d5c5
sb_vendors.c
feff3a8b8d1da8aaeaf36a09adc44e0fb3789737 15-Jun-2010 Jean-Baptiste Queru <jbq@google.com> Merge "eliminate a compiler warning: signed/unsigned length"
eb558b9240743e24c87796191f54c99890641b14 03-Jun-2010 Michael Richardson <mcr@credil.org> eliminate a compiler warning: signed/unsigned length

Change-Id: I6139a1b3f9caa8fe3492e4850dcc58d8d5ff0cfb
sb_vendors.c
8182829ccb46fc5b043ea258672602dc2928dee2 12-Jun-2010 André Goddard Rosa <andre.goddard@gmail.com> adb: optimize socket-list-walking code

Change-Id: I8bbb8b671c1ce7a2ce736b60b0cdb7b21ccdc372
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
ockets.c
8e78dc64d2fedccc77966b0636f7530f452dc7d5 11-Jun-2010 André Goddard Rosa <andre.goddard@gmail.com> adb: remove unneeded assignment of id to zero

... as memory was already obtained zero'ed by calloc().

Change-Id: Ic73bad09b54cb778fd40bdf86bb40888ea504c5f
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
ockets.c
c419e2a210ad7e37a1f749f2ab4de7c7f95b90d7 11-Jun-2010 André Goddard Rosa <andre.goddard@gmail.com> adb: clean up 0 --> NULL for pointers

Change-Id: I9216fdf534d807a55dfbc6800b5c3ef5f8c83368
ockets.c
f7e148c1bc482fe7f8df49d216b1f9390f0638b9 03-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I9b051ebd6e785e4d68e148a005a0485e79aa55ea
cbbe79add1410b53ec65936cfb1b74cac68467f0 24-May-2010 Mike Lockwood <lockwood@android.com> adb connect and disconnect improvements:

Port number is now optional. Will use default port 5555 if not specified.
"adb disconnect" with no additional arguments will disconnect all TCP devices.

Change-Id: I7fc26528ed85e66a73b8f6254cea7bf83d98109f
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
ommandline.c
ransport.c
456688bfb4fa7817031a1d704e8353e1dd5efb3c 02-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I99ae03ba51ee185b9cfecf4f26e94a757f3815c2
5dc0f5db7152a604377af30f7d2139a84fd7b30c 02-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I9e7ebc99f0de12ed3ae38a3882481485a96f9680
c57a22c8561cc571d23cd7f321103b2b4d2c7cde 02-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I44bd527e51d102a56a1efe40cb6e634859b09461
705b37b84c0c13407963fb1cea0309b9c3081368 02-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I5f7880bec0c15ae7a42175107d8192ad44b847ca
c0b3ad16598a0cc30cfc2fcd3fc21ce1fd2b978f 02-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I71f2e47509695ba9ec626f4a6917a645b00a4e70
67d5358e2a870f9e9447517bfa49bf5c6b410a50 25-May-2010 Mike Lockwood <lockwood@android.com> adb: remove obsolete shell history support.

Change-Id: I85a7cda176ca3bb7cb9f96e18556d53daaac3023
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
ommandline.c
istory.h
hlist.c
hlist.h
7fe202f160ca1926bc0277e3c276ad7b3f9b9aeb 25-May-2010 Jack Palevich <jackpal@google.com> Use linenoise to add simple editing and history to the Android shell.

The linenoise library is from http://github.com/antirez/linenoise

This patch also disables command-line editing and history from adb. The
adb implementation was shadowing the Android shell's implementation.

The adb implementation was also shadowing the editing and history
implementation in alternative shells such as BusyBox's ash.

Change-Id: I7ebd4cb391d0ce966c0ce0e707d80ecd659f9079
ndroid.mk
d9d1ca47802395e9e42e7deb05b2683d9d306598 26-Apr-2010 Stefan Hilzinger <hilzinger@google.com> Let "adb connect" connect to emulators too

- adb can now connect to an emulator configured with an arbitrary
pair of <console port, adb port>. These two ports do not have to be
adjacent.
This can be done from the commandline at any time using
adb connect emu:<console_port>,<adb_port>
- Emulators running on ports outside the normal range
(5554/5555-5584/5585) register themselves on startup if they follow
the convention "console port+1==abd port".
- Emulators outside the normal port range will not be auto-detected on
adb startup as these ports are not probed.
- The index into local_transports[] array in transport_local.c does no
longer indicate the port number of the local transport. Use the altered
atransport struct to get the port number.
- I have chosen not to document the adb connect emu:console_port,adb_port
syntax on adb's help screen as this might be confusing to most readers
and useful to very few.
- I don't expect this to introduce any (backwards) compatibility issues.

Change-Id: Iad3eccb2dcdde174b24ef0644d705ecfbff6e59d
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
ransport_local.c
5762ec29056936decf23b498724cd38d4a702edc 07-May-2010 Colin Cross <ccross@android.com> Fix adb remount on non-MTD devices

Change-Id: If8e07502bcface53aaac81022f6183c6a147edc8
Signed-off-by: Mike Lockwood <lockwood@android.com>
emount_service.c
f1c03de74e56a82551c8d8165021bc23c6ac11a5 07-May-2010 Dima Zavin <dima@android.com> adb: Add Qualcomm USB id

Change-Id: I044a77f14d7a90e9dff191919e4aeb39723ea429
Signed-off-by: Dima Zavin <dima@android.com>
sb_vendors.c
e57d89186def9dfabe39cec7a91397079514dc2a 04-May-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: Ibc1c58aa757910f2b00acf6883127dd027f01d73
cd64315f72537359537c66eebe482495ffefba57 16-Feb-2010 Tim <tdhutt@gmail.com> Add documentation for some adb environmental variables.

The ADB_TRACE one is particularly important.

Change-Id: I125a5930c43065c8cf505eea40d20e3f209bc858
ommandline.c
9a22c68e8697a2ec86cd238a87a32ea42d7f8d39 28-Apr-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: Id824d3427cb4808a8768f14e7b46c0eaf5e02e73
26bb6e92ba392b28eb2edabb639f8750f859ce20 26-Apr-2010 Brian Carlstrom <bdc@google.com> Fixing spelling errors in adb docs

Change-Id: I9376717165a01e207034f84a31f85335d3740f18
VERVIEW.TXT
ERVICES.TXT
a84a42eb20d43ffa2695a69d583a6e09532b49d9 19-Apr-2010 Stefan Hilzinger <hilzinger@google.com> Make adb's daemon-port on the host machine configurable.

This is the first CL of a somewhat larger effort which, among other things,
will involve changing the emulator and ddms to talk to adb running on a
configurable port.

The port can be configured using environment variable ANDROID_ADB_SERVER_PORT.

Further CLs will also address the set of ports used for the local transport.

Change-Id: Ib2f431801f0adcd9f2dd290a28005644a36a780a
db.c
db.h
db_client.c
db_client.h
ommandline.c
ransport_local.c
23e64161be09ce26cb4d213a860f61e1fe77d975 15-Apr-2010 Mike Lockwood <lockwood@android.com> adb: remove obsolete adb.connected system property.

This was used for adb networking, which no longer exists.
This code also failed when adb was not running as root.

Change-Id: Ied86fb1930094d5ae5009684d25e15385fd31d03
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
4f660699bf3317e299f9fda780c711178f6ea932 31-Mar-2010 Xavier Ducrohet <xav@android.com> Add Pantech's USB vendor ID to adb.

Change-Id: I5334f46ee52ca1bd8067860701aef7b93296bedb
sb_vendors.c
c22b9bf1a8e9f1cc73a1407ccf12183f07736a04 12-Mar-2010 Takeshi Kishimoto <kishimoto@google.com> Added Kyocera's VID (0x0482), upon their request.

Change-Id: I8f2f2a02c22d618c0b42d4f287d88a98af3ac4fa
sb_vendors.c
505bd6e5fcc576eb3bea87ac86db8aeed86d9a0d 19-Feb-2010 Mike Lockwood <lockwood@android.com> adb: Add five second timeout for USB writes on Linux host.

This helps us recover when things go wrong during automated testing.

Change-Id: I006dbfaff7f70d51398ff12fbddcaee751453b78
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.h
sb_linux.c
805c4a70300ed918853eec2f67e7b45919e48e10 02-Mar-2010 Brian Carlstrom <bdc@google.com> Add missing newlines to adb usage message
ommandline.c
c519c00c367c9017eed70973022813e828448818 22-Sep-2009 Mike Lockwood <lockwood@android.com> adb: do not mix printf() with write() when writing to stdout.

Change-Id: I3598cc951778080bec9a21d646656d5aba57120a
Signed-off-by: Mike Lockwood <lockwood@android.com>
ommandline.c
16f1550b51a12187799bb9d577839f2812c949d6 22-Feb-2010 Takeshi Kishimoto <kishimoto@google.com> Added ZTE's USB Vendor ID (0x19D2) upon ZTE's request.
sb_vendors.c
17273091e960ba683a90974aa6f0629e1575350d 09-Feb-2010 Takeshi Kishimoto <kishimoto@google.com> Added USB vendor id of Sharp, based on Sharp's request.
Sharp's vendor id: 0x04dd
sb_vendors.c
a00a69e07d959f73495e42637fe1f493eb01193d 24-Apr-2010 Raphael <raphael@google.com> am b419c35c: Fix adb, fastboot to compile in Windows SDK under Linux.

Merge commit 'b419c35c660d7421e18a9efef38eca11966b44c7' into froyo-plus-aosp

* commit 'b419c35c660d7421e18a9efef38eca11966b44c7':
Fix adb, fastboot to compile in Windows SDK under Linux.
b419c35c660d7421e18a9efef38eca11966b44c7 14-Apr-2010 Raphael <raphael@google.com> Fix adb, fastboot to compile in Windows SDK under Linux.

(Merged from master Change I3d0e4cab)

Change-Id: Ib3fd566bdaf09d5893a6b0c66168c76c6b0d92eb
ndroid.mk
775a8df614d364fcb82e280069a3f533381240b4 21-Apr-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I686f28fcfcff1cca7cf254de9e4334cc4ea2fef7
05f202a94bd7c51db10f041bde6006b4e719929e 20-Apr-2010 Mike Lockwood <lockwood@android.com> Merge "adb: Add persistent system property for running adb in TCPIP mode"
8e2ceaeacf9fa1eb5ac41e4d3498836a6e2c7c97 20-Apr-2010 Mike Lockwood <lockwood@android.com> adb: Add persistent system property for running adb in TCPIP mode

In addition to service.adb.tcp.port, you can now set persist.adb.tcp.port
to specify the port number for adb to listen to instead of USB.
This allows the adb TCP configuration to persist across reboots.

Change-Id: I897ffcb019e8dd1785996d2f3c571cfc2f8ded38
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
3523412f43ec616775a73f5fb8a2615370a1ee3a 20-Apr-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: Ib9250bd9d73664b07facaef362beba57a1519411
705c944c0e2a50150ffb41707b6b3daebb45cf79 22-Feb-2010 Anthony Newnam <anthony.newnam@garmin.com> Add -l option to `adb sync`

Change-Id: I87c01663dff319dde24b70560e6fe5647ebf9d49
ommandline.c
ile_sync_client.c
ile_sync_service.h
8ac50107a21b96f6e9c77ab23820d164543c5bbe 16-Apr-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I7f30144c12c340501f161fba70a917eb62afc41f
457d81cec12fce6e38c0dcd94d33d06036c2618a 04-Jan-2010 Matt Fischer <matt.fischer@garmin.com> Allow 'adb pull' to pull symlinked files

Change-Id: I02f31334e4ee0c7b0e7b379016629a465e711905
ile_sync_client.c
7c19bbe086b3cd81499829c0a79ed0ed0ae4fb16 31-Mar-2010 Xavier Ducrohet <xav@android.com> Add Pantech's USB vendor ID to adb.

Change-Id: I5334f46ee52ca1bd8067860701aef7b93296bedb
sb_vendors.c
8d2f91db21271a253bfe1bbe7716ff59e88572bd 12-Mar-2010 Takeshi Kishimoto <kishimoto@google.com> Added Kyocera's VID (0x0482), upon their request.

Change-Id: I8f2f2a02c22d618c0b42d4f287d88a98af3ac4fa
sb_vendors.c
fe582b5d32d08d075be87f4c9193e24029963361 19-Feb-2010 Mike Lockwood <lockwood@android.com> adb: Add five second timeout for USB writes on Linux host.

This helps us recover when things go wrong during automated testing.

Change-Id: I006dbfaff7f70d51398ff12fbddcaee751453b78
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.h
sb_linux.c
6fcc801eadcccd09d92045f851f9fbf1ed0f25ea 02-Mar-2010 Brian Carlstrom <bdc@google.com> Add missing newlines to adb usage message
ommandline.c
bfb0477f1d0210e117f66f36128f9cc0ca962b6e 27-Feb-2010 Mike Lockwood <lockwood@android.com> Merge "adb: do not mix printf() with write() when writing to stdout."
1d01c295a9fa8cd543af046c4232d3430b73ac13 26-Feb-2010 Satoshi Kataoka <satok@google.com> Merge "Added ZTE's USB Vendor ID (0x19D2) upon ZTE's request."
dd6b36e334809e7a99f0bce45353cdd7e4dac4e1 22-Sep-2009 Mike Lockwood <lockwood@android.com> adb: do not mix printf() with write() when writing to stdout.

Change-Id: I3598cc951778080bec9a21d646656d5aba57120a
Signed-off-by: Mike Lockwood <lockwood@android.com>
ommandline.c
d969faa161310d0a3792766320daa3200b84bd74 24-Feb-2010 Mike Lockwood <lockwood@android.com> adb: Attempt to unmount the SD card before rebooting.

Change-Id: Idd4d96b4704f4e1bd324e72bca87611a23e30801
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
ervices.c
d6391c6aaaa40c20761b7a2a8d4be115163e4194 23-Feb-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master
01512aa3b0e3709e97054ffd1ff265a2d4193646 22-Feb-2010 Takeshi Kishimoto <kishimoto@google.com> Added ZTE's USB Vendor ID (0x19D2) upon ZTE's request.
sb_vendors.c
0ef3fd048aeaeb59467e43e543f66b96e4e6c7f5 19-Feb-2010 Mike Lockwood <lockwood@android.com> adb: add -s option to adb install for installing apps on SD card.

Change-Id: Ic6b24411e594d160ddcf862cc9f1283e1e17bb4d
Signed-off-by: Mike Lockwood <lockwood@android.com>
ommandline.c
5a912bf03e62a8d37624d6323d43253c76022130 01-Feb-2010 Raphael <raphael@google.com> ADB: Garmin-Asus's USB Vendor ID

Change-Id: I3249d629f59d40f291079fc214b643ac6c927f76
sb_vendors.c
2f6c2b04fbc0a3b1103b2c42ccdd2e4917fef455 21-Jan-2010 Erik Gilling <konkers@android.com> adb: add Nvidia's vendor id to adb

Signed-off-by: Erik Gilling <konkers@android.com>
sb_vendors.c
7eced2b86aa4ad91307b6531cae73ce1a4064b18 20-Jan-2010 Dan Egnor <egnor@google.com> make "adb bugreport" run "bugreport" (which invokes "dumpstate"
indirectly via system service) rather than "dumpstate", that way
even when adb is not running as root, dumpstate does run as root,
and can do things like collect VM traces.
ommandline.c
429c5ae4618a454120a0fa353a378916f38d2fd7 17-Jan-2010 Mike Lockwood <lockwood@android.com> adb: Fix problems detecting adb in more complicated USB configurations.

Change-Id: Ib5b13960a1c75efc97abeca46204c85bba905c71
Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_linux.c
8071a4bdb6e437baa4efcb8cf777d4caeaf069e4 05-Jan-2010 Joe Onorato <joeo@android.com> Make adb pull use . as the target file directory if you don't supply one.
ommandline.c
123331adeaed6c54e4869b0fd7001c5f1b19bdc4 09-Feb-2010 Takeshi Kishimoto <kishimoto@google.com> Added USB vendor id of Sharp, based on Sharp's request.
Sharp's vendor id: 0x04dd
sb_vendors.c
3332d6e69d3182a756c029e9d499a78f17c4b17a 02-Feb-2010 Raphael <raphael@google.com> resolved conflicts for merge of 190cabb3 to master
190cabb376d9a393b65a0d8c123196bf58ef7ab4 02-Feb-2010 Raphael <raphael@google.com> am 1873adc2: ADB: Garmin-Asus\'s USB Vendor ID

Merge commit '1873adc2b12d5a9045bae90650bb331c7c7aa3c7' into eclair-plus-aosp

* commit '1873adc2b12d5a9045bae90650bb331c7c7aa3c7':
ADB: Garmin-Asus's USB Vendor ID
1873adc2b12d5a9045bae90650bb331c7c7aa3c7 01-Feb-2010 Raphael <raphael@google.com> ADB: Garmin-Asus's USB Vendor ID

Change-Id: I3249d629f59d40f291079fc214b643ac6c927f76
sb_vendors.c
f71f068fb9082ad78c78493c1295074e88a5526c 22-Jan-2010 Xavier Ducrohet <xav@android.com> Add DELL's USB Vendor ID to adb - DO NOT MERGE

Change-Id: Ie1a6b6a81f50956362aee2a2d6d1b805f0e85b7a
sb_vendors.c
288c7cfe1b702dc669a8c4b7094035efc1cf7e30 22-Jan-2010 Dan Egnor <egnor@google.com> Merge "make "adb bugreport" run "bugreport" (which invokes "dumpstate" indirectly via system service) rather than "dumpstate", that way even when adb is not running as root, dumpstate does run as root, and can do things like collect VM traces."
6ac5e192997478ae166981ddf66136c865d21a40 21-Jan-2010 Erik Gilling <konkers@android.com> adb: add Nvidia's vendor id to adb

Signed-off-by: Erik Gilling <konkers@android.com>
sb_vendors.c
c130ea7c29b0149939c8fd6b8da2c981944636f9 20-Jan-2010 Dan Egnor <egnor@google.com> make "adb bugreport" run "bugreport" (which invokes "dumpstate"
indirectly via system service) rather than "dumpstate", that way
even when adb is not running as root, dumpstate does run as root,
and can do things like collect VM traces.
ommandline.c
37ddce736ce7700ee1e120f7371e6ee6a526f3ca 19-Jan-2010 Mike Lockwood <lockwood@android.com> adb: Add Dell's USB vendor ID.

Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_vendors.c
cc7a5dc770e50272f3c14dacf8b0d7ad5f68032d 19-Jan-2010 Mike Lockwood <lockwood@android.com> adb: Add Dell's USB vendor ID.

Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_vendors.c
07e8f7e8758d5ce44fe6cf3bacb670962750a92e 17-Jan-2010 Mike Lockwood <lockwood@android.com> adb: Fix problems detecting adb in more complicated USB configurations.

Change-Id: Ib5b13960a1c75efc97abeca46204c85bba905c71
Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_linux.c
00c0eeac6be1597ce24fccf8e2afaaffab223cb3 05-Jan-2010 Joe Onorato <joeo@android.com> Make adb pull use . as the target file directory if you don't supply one.
ommandline.c
a1871d2a72e0cdd8fefc658dec389f2945b4cf2f 22-Dec-2009 Mike Lockwood <lockwood@android.com> adb: Add USB vendor ID for Foxconn

Change-Id: I88e4051b6e5cd820cab7e3ec417a545f50925a33
Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_vendors.c
a48d43a0777494b3a686fa0c6d58f986547982eb 14-Dec-2009 Romain Guy <romainguy@android.com> Add adb reboot-bootloader to match fastboot reboot-bootloader.

Also fix the formatting of one of the options in the help message.
ommandline.c
a59387b508efd99031de2f23363092fdf4dfc130 28-Nov-2009 Mike Lockwood <lockwood@android.com> adb: fix -d and -e options for "adb forward" command.

Change-Id: I9166572a1c398ce5ef1423d19a30895385118ee5
Signed-off-by: Mike Lockwood <lockwood@android.com>
ommandline.c
6170404867631317ab57c67bf074494e6e775556 22-Dec-2009 Mike Lockwood <lockwood@android.com> adb: Add USB vendor ID for Foxconn

Change-Id: I88e4051b6e5cd820cab7e3ec417a545f50925a33
Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_vendors.c
311add489e4a1712d201c3b83fa364d5569e6788 14-Dec-2009 Romain Guy <romainguy@android.com> Add adb reboot-bootloader to match fastboot reboot-bootloader.

Also fix the formatting of one of the options in the help message.
ommandline.c
255ed555d692853ac9b343c94371862bdbe0ca31 29-Nov-2009 Mike Lockwood <lockwood@android.com> am 3c0c6dca: am 64e99545: adb: fix -d and -e options for "adb forward" command.

Merge commit '3c0c6dca1abc350035efedafa9ee9d705499c334'

* commit '3c0c6dca1abc350035efedafa9ee9d705499c334':
adb: fix -d and -e options for "adb forward" command.
3c0c6dca1abc350035efedafa9ee9d705499c334 29-Nov-2009 Mike Lockwood <lockwood@android.com> am 64e99545: adb: fix -d and -e options for "adb forward" command.

Merge commit '64e99545d4b5600bb5ca044fcad636ae8389b381' into eclair-mr2-plus-aosp

* commit '64e99545d4b5600bb5ca044fcad636ae8389b381':
adb: fix -d and -e options for "adb forward" command.
64e99545d4b5600bb5ca044fcad636ae8389b381 28-Nov-2009 Mike Lockwood <lockwood@android.com> adb: fix -d and -e options for "adb forward" command.

Change-Id: I9166572a1c398ce5ef1423d19a30895385118ee5
Signed-off-by: Mike Lockwood <lockwood@android.com>
ommandline.c
333a80cf9ffc975aee91d82bee2bb17cdfe458a7 15-Nov-2009 Jean-Baptiste Queru <jbq@google.com> merge from eclair
4b29fe640ae852c04d5d87d0f9527bdc32177ad1 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
ODULE_LICENSE_APACHE2
OTICE
db.c
db.h
ommandline.c
ramebuffer_service.c
et_my_path_darwin.c
dwp_service.c
ervices.c
ysdeps.h
ysdeps_win32.c
ransport.c
ransport_local.c
ransport_usb.c
sb_linux.c
sb_linux_client.c
sb_osx.c
sb_vendors.c
sb_windows.c
c923980e785c533e41e403e9644368643dbac952 09-Nov-2009 Jean-Baptiste Queru <jbq@google.com> am ef063fe3: merge from open-source master

Merge commit 'ef063fe3066153dab5389b6baba6cb4e36888106'

* commit 'ef063fe3066153dab5389b6baba6cb4e36888106':
Add support for Acer devices
FreeBSD support for usb-connected devices in adb
Make get_my_path() safer
Fix use of memset function
ef063fe3066153dab5389b6baba6cb4e36888106 09-Nov-2009 Jean-Baptiste Queru <jbq@google.com> merge from open-source master
3b01d5481931eae541afd9e429b6456b9487269d 02-Nov-2009 Xavier Ducrohet <xav@android.com> am 96f0d140: am df872bec: am 1b9f8c6a: am 23433b93: Add Sony-Ericsson to adb.

Merge commit '96f0d140df11c2efeecd8b0eed9ffad514456034'

* commit '96f0d140df11c2efeecd8b0eed9ffad514456034':
Add Sony-Ericsson to adb.
23433b93d1acb01650c9480d9bb5d5d869ba4f79 30-Oct-2009 Xavier Ducrohet <xav@android.com> Add Sony-Ericsson to adb.
sb_vendors.c
3b226f9e3b893a3e088d7b854b0e7c523e79063f 24-Oct-2009 Alexey Tarasov <tarasov@dodologics.com> FreeBSD support for usb-connected devices in adb

FreeBSD (and other systems as well) may use libusb to work with USB devices.
libusb is integrated in FreeBSD base system in recent builds (8.0+),
however in other systems it may need include libusb.h like <libusb/libusb.h>
and install library from devel/libusb port or other repository.

Submitted change not supports events (attach/detach) as libusb 1.0 lacks
such functionality and in order to make code more portable I've not used
workarounds as in earlier changeset.

Code was tested on FreeBSD 8.0-RC1, HTC Hero (1.0.0.A6288, Android 1.5)
ndroid.mk
et_my_path_freebsd.c
sb_libusb.c
3166410a82f43d39201be98a8d35c51baa86cb53 21-Oct-2009 Alexey Tarasov <tarasov@dodologics.com> Make get_my_path() safer

Adds maxLen parameter to get_my_path().
Some small cosmetic fixes.
db.c
db.h
ommandline.c
et_my_path_darwin.c
et_my_path_linux.c
et_my_path_windows.c
a01fdd534dd40865c966b5c5347cf74d0ff3116f 14-Oct-2009 Mike Lockwood <lockwood@android.com> am 96b6bf3e: am 8cf0d59f: adb: Add "adb disconnect" command for disconnecting TCP/IP devices.

Merge commit '96b6bf3e923e23d695c1322fc41a57c9346b3e90'

* commit '96b6bf3e923e23d695c1322fc41a57c9346b3e90':
adb: Add "adb disconnect" command for disconnecting TCP/IP devices.
74d7ff8cfd490852d3df1c4b9d8a21beed619caa 12-Oct-2009 Mike Lockwood <lockwood@android.com> adb: Add "adb disconnect" command for disconnecting TCP/IP devices.

Also check that device is not already connected in "adb connect"

Change-Id: I5f84b56b63d8c6932f23791cac319fd6bc39d36c
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
ommandline.c
dwp_service.c
ysdeps.h
ysdeps_win32.c
ransport.c
ransport_local.c
1fbf27bf22d9bc47caea7373e31d472dcbef345a 21-Sep-2009 Robert CH Chou <Robert_CH_Chou@acer.com.tw> Add support for Acer devices

Change-Id: I7045249f86e2b628c31c888e95eb5ba6f6c47251
sb_vendors.c
89f9a84af07292e71b209aaab91001132e137b63 21-Sep-2009 Mike Lockwood <lockwood@android.com> adb: Add USB Vendor IDs for LG and Huawei

Change-Id: Ib47e3e39609bac9cf34f2b9334aa95184b3db71d
Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_vendors.c
4a0da39db4b6a6062cfd1152ec3c9a266b907808 21-Sep-2009 Jean-Baptiste Queru <jbq@google.com> Add NOTICE file and license tag for adb

BUG=1716164
ODULE_LICENSE_APACHE2
OTICE
d6e3ecb70f0e6a037ea07f3f91a4c28988b8e434 19-Sep-2009 Mike Lockwood <lockwood@android.com> adb: Clean up argument passing for create_service_thread()

Change-Id: Id68b312e76215e8e217b42ca0301713dbddfee9e
Signed-off-by: Mike Lockwood <lockwood@android.com>
ervices.c
e5c8b6dd79787e74d7f6afd313352c19a001ab63 04-Sep-2009 Joe Onorato <joeo@android.com> Revert "adb: Another attempted workaround for the adb disconnect problem."

This reverts commit cc1de48dcdf06c76ee14abbe2a237aa51b5b3bad.

lockwood says to take this out.
ervices.c
8cf0d59f61ae0b8554ecf3fe051850508b761b79 12-Oct-2009 Mike Lockwood <lockwood@android.com> adb: Add "adb disconnect" command for disconnecting TCP/IP devices.

Also check that device is not already connected in "adb connect"

Change-Id: I5f84b56b63d8c6932f23791cac319fd6bc39d36c
Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
ommandline.c
dwp_service.c
ysdeps.h
ysdeps_win32.c
ransport.c
ransport_local.c
31dbed7b60d8237d6d05dc6bf230167a5854b77a 08-Oct-2009 Elliott Hughes <enh@google.com> Add adb's ANDROID_SERIAL to fastboot too.

We noticed this when trying to script on-device testing for the dalvik
continuous build.

Also fix a typo in adb's help.
ommandline.c
ff7d5835d91b979836b66dc42fac69adf2c6c3a3 24-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 26093 into eclair

* changes:
Add NOTICE file and license tag for adb
7953b89e8d68565d15791618146a712231683d09 21-Sep-2009 Robert CH Chou <Robert_CH_Chou@acer.com.tw> Add support for Acer devices

Change-Id: I7045249f86e2b628c31c888e95eb5ba6f6c47251
sb_vendors.c
6ae9256322053354c7d2badccc0ce5c24b37c243 21-Sep-2009 Mike Lockwood <lockwood@android.com> adb: Add USB Vendor IDs for LG and Huawei

Change-Id: Ib47e3e39609bac9cf34f2b9334aa95184b3db71d
Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_vendors.c
2fcdaf99070e69a73e76ac9b77135343aabb4dc4 21-Sep-2009 Jean-Baptiste Queru <jbq@google.com> Add NOTICE file and license tag for adb

BUG=1716164
ODULE_LICENSE_APACHE2
OTICE
b6b40079e6d5b32026cc2abfcb71adfd49e8d954 19-Sep-2009 Mike Lockwood <lockwood@android.com> adb: Clean up argument passing for create_service_thread()

Change-Id: Id68b312e76215e8e217b42ca0301713dbddfee9e
Signed-off-by: Mike Lockwood <lockwood@android.com>
ervices.c
154b7d7de4071ed73cde81eef3af47d1a24d7c6b 16-Sep-2009 Rebecca Schultz Zavin <rebecca@android.com> Add bitfields to header for screen shots. This will allow ddms to distinguish
between various 32 bit pixel formats. Also adds new version number for
future expansion.

Change-Id: Ia1d7d7485614e961a47ebb65493b19f4a16ded05
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
ramebuffer_service.c
8880093fe386ab0dcefec9ce41f8ce6f4e068b0e 11-Sep-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 24493 into eclair

* changes:
Fix several issues in framebuffer_service
04bee29ad979ca770677338e343869a0d5662cfb 10-Sep-2009 Rebecca Schultz Zavin <rebecca@android.com> Fix several issues in framebuffer_service

-supports fb's with x and y offsets
-dumps the front buffer (instead of just the low end of the buffer)
-switch from mmap to read/write, for fb's with very large offsets

Change-Id: Id560790c9661f7cc3b4350a44cc29f0104831e85
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
ramebuffer_service.c
91acb14877e7138879057f794a61ee2fd424a41d 04-Sep-2009 Joe Onorato <joeo@android.com> Revert "adb: Another attempted workaround for the adb disconnect problem."

This reverts commit cc1de48dcdf06c76ee14abbe2a237aa51b5b3bad.

lockwood says to take this out.
ervices.c
f56d1b5a76c6cb282a7689fc93f85de63bd205f6 03-Sep-2009 Mike Lockwood <lockwood@android.com> Revert "adb: "adb bugreport" now runs dumpstate via init rather than execing it in the shell."

This reverts commit be0045aafdbc2ec2ee448be86952082361f5d672.
This change broke compatibility with previous versions of adbd, so I will be implementing this
by modifying the bugreport command on the device instead.
ommandline.c
ervices.c
be0045aafdbc2ec2ee448be86952082361f5d672 03-Sep-2009 Mike Lockwood <lockwood@android.com> adb: "adb bugreport" now runs dumpstate via init rather than execing it in the shell.

This allows dumpstate to run as root even if adbd is not.

Change-Id: I04bda1ee0c8de91677149a2a9eda713c85067aa4
Signed-off-by: Mike Lockwood <lockwood@android.com>
ommandline.c
ervices.c
cef31a02544d91b85481a5fa032b6126dbb32365 26-Aug-2009 Mike Lockwood <lockwood@android.com> adb: Fix emulator support.

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
f71c71148cb65e61ab483b1b0351922c11d862d8 26-Aug-2009 Xavier Ducrohet <xav@android.com> Fix broken 'adb root' command.

Change-Id: I75bf01863e82967a7214d3e31b8db792690716c1
ommandline.c
2f38b699713dc2587a771bd5d4c6a47329728f5e 25-Aug-2009 Mike Lockwood <lockwood@android.com> adb: Improved support for running adb over TCP/IP

Added new commands:

adb connect <host>:<port> (to connect to a device via TCP/IP)
adb tcpip <port> (to restart adbd on the device to listen on TCP/IP)
adb usb (to restart adbd on the device to listen USB)

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
ommandline.c
ervices.c
ransport.c
ransport_local.c
26f3de6738c3e07e581e2f9c112a8b3086f88abb 11-Aug-2009 Raphael <raphael@google.com> BUG 2033924: Add AdbWinUsbApi.dll to prebuilt for Windows SDK
ndroid.mk
ecfb75d9e43116133aca5cf7adba36783de89817 11-Aug-2009 Mike Lockwood <lockwood@android.com> adb: Fix infinite loop in Linux host device discovery.

Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_linux.c
668cc771014380687936e79917e5e559262ad221 08-Aug-2009 Mike Lockwood <lockwood@android.com> adb: print better error message when there are insufficient permissions for a device.

Now, a command like "adb shell" will print "insufficient permissions for device"
instead of "device not found" if adb does not have permissions to communicate with the device.

Signed-off-by: Mike Lockwood <lockwood@android.com>
ransport.c
a8be72f6538676543448a7a6adfd0a3664b59484 08-Aug-2009 Mike Lockwood <lockwood@android.com> adb: update call to register_usb_transport in Mac and Windows builds.

Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_osx.c
sb_windows.c
95b837d38b730353af79f8669b5166007e038ac3 08-Aug-2009 Mike Lockwood <lockwood@android.com> adb: On Linux, detect USB devices for which adb does not have permissions to communicate with.

adb devices will now list devices without adequate file system permissions in /dev/bus/usb as:

List of devices attached
???????????? no permissions

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.h
ransport.c
ransport_usb.c
sb_linux.c
sb_linux_client.c
e64004d327c086eeb7a6ca32258d25bcbe7acb04 07-Aug-2009 Guang Zhu <guangzhu@google.com> adb: Use correct language ID when retrieving USB serial number.

Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_osx.c
63e61527481c679a75cda358825ed71b156ad778 06-Aug-2009 Mike Lockwood <lockwood@android.com> adb: Remove adbd from simulator build.

It no longer compiles without recent kernel headers.

Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
5f4b051235c3e9e9e5b34b4af885e42a1c711fc4 05-Aug-2009 Mike Lockwood <lockwood@android.com> adb: add "adb reboot" command.

This will allow rebooting the device via adb on any build, including user builds.
An optional argument can be provided
(for example, "adb reboot bootloader" or adb reboot recovery")

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
ommandline.c
ervices.c
3969080e232beed7c68a65cde7fdafc79ce55b0e 01-Jun-2009 Mathias Agopian <mathias@google.com> get rid of utils/executablepath.h, which now lives in the simulator
et_my_path_darwin.c
22048ef3257719a4e03e6a81a989b071abe7655c 07-May-2009 Nick Pelly <npelly@google.com> Allow adb to use ANDORID_SERIAL env variable to specify the device to talk to.

Overridden by -s.
ommandline.c
a3e8a6ad56d60d2ad6c580004f86920d73acc62c 26-Aug-2009 Mike Lockwood <lockwood@android.com> adb: Fix emulator support.

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
1bba53f7c851068c127d16ba160cd3074d6027db 26-Aug-2009 Xavier Ducrohet <xav@android.com> Fix broken 'adb root' command.

Change-Id: I75bf01863e82967a7214d3e31b8db792690716c1
ommandline.c
ff19670d485fd5ee296e23b00b035ac22975c647 25-Aug-2009 Mike Lockwood <lockwood@android.com> adb: Improved support for running adb over TCP/IP

Added new commands:

adb connect <host>:<port> (to connect to a device via TCP/IP)
adb tcpip <port> (to restart adbd on the device to listen on TCP/IP)
adb usb (to restart adbd on the device to listen USB)

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
ommandline.c
ervices.c
ransport.c
ransport_local.c
818806ad59ac09d5ee7de52891fa113ef614dbe0 12-Aug-2009 Raphael <raphael@google.com> am e3baafd8: BUG 2033924: Add AdbWinUsbApi.dll to prebuilt for Windows SDK

Merge commit 'e3baafd85a5fecd1714441455e3f75f26b5c381e'

* commit 'e3baafd85a5fecd1714441455e3f75f26b5c381e':
BUG 2033924: Add AdbWinUsbApi.dll to prebuilt for Windows SDK
e3baafd85a5fecd1714441455e3f75f26b5c381e 11-Aug-2009 Raphael <raphael@google.com> BUG 2033924: Add AdbWinUsbApi.dll to prebuilt for Windows SDK
ndroid.mk
d70dc73d8d17a24a2a6dcdaa38f31dce47dd92aa 11-Aug-2009 Mike Lockwood <lockwood@android.com> adb: Fix infinite loop in Linux host device discovery.

Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_linux.c
c52c602171cb29c4a4c38005f321cf95d50d3418 06-Aug-2009 Mike Lockwood <lockwood@android.com> DO NOT MERGE adb: Remove adbd from simulator build.

It no longer compiles without recent kernel headers.

Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
704aa833382a73f8e02d49b7e9c2aef9a49c65bd 05-Aug-2009 Mike Lockwood <lockwood@android.com> DO NOT MERGE cherry-pick "adb reboot" from master:

adb: add "adb reboot" command.

This will allow rebooting the device via adb on any build, including user builds.
An optional argument can be provided
(for example, "adb reboot bootloader" or adb reboot recovery")

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
ommandline.c
ervices.c
37d3111b1c1ce61c3d9b10ed3ccaed9e5fad1e06 08-Aug-2009 Mike Lockwood <lockwood@android.com> adb: print better error message when there are insufficient permissions for a device.

Now, a command like "adb shell" will print "insufficient permissions for device"
instead of "device not found" if adb does not have permissions to communicate with the device.

Signed-off-by: Mike Lockwood <lockwood@android.com>
ransport.c
5c93dba771f11bb2228e69d1585c9fe8339c9275 08-Aug-2009 Mike Lockwood <lockwood@android.com> adb: update call to register_usb_transport in Mac and Windows builds.

Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_osx.c
sb_windows.c
0927bf9690127bc45cf8837a1467759e9720399a 08-Aug-2009 Mike Lockwood <lockwood@android.com> adb: On Linux, detect USB devices for which adb does not have permissions to communicate with.

adb devices will now list devices without adequate file system permissions in /dev/bus/usb as:

List of devices attached
???????????? no permissions

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.h
ransport.c
ransport_usb.c
sb_linux.c
sb_linux_client.c
1a1f8189866196c5bd1ace378cf6b0ca69bff267 07-Aug-2009 Guang Zhu <guangzhu@google.com> adb: Use correct language ID when retrieving USB serial number.

Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_osx.c
781d041892d488b8e20fb66cdc367f894f5f8e15 06-Aug-2009 Mike Lockwood <lockwood@android.com> adb: Remove adbd from simulator build.

It no longer compiles without recent kernel headers.

Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
ee15662140632672a6878787a1ff26f5ebdc1e68 05-Aug-2009 Mike Lockwood <lockwood@android.com> adb: add "adb reboot" command.

This will allow rebooting the device via adb on any build, including user builds.
An optional argument can be provided
(for example, "adb reboot bootloader" or adb reboot recovery")

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
ommandline.c
ervices.c
1f4ff53517dc597e5cc902146558a613d9b339db 31-Jul-2009 Mike Lockwood <lockwood@android.com> am cc1de48d: adb: Another attempted workaround for the adb disconnect problem.

Merge commit 'cc1de48dcdf06c76ee14abbe2a237aa51b5b3bad'

* commit 'cc1de48dcdf06c76ee14abbe2a237aa51b5b3bad':
adb: Another attempted workaround for the adb disconnect problem.
cc1de48dcdf06c76ee14abbe2a237aa51b5b3bad 31-Jul-2009 Mike Lockwood <lockwood@android.com> adb: Another attempted workaround for the adb disconnect problem.

For adb shell commands (as well as shell based commands like logcat and bugreport) we now
batch USB writes into 4K chunks instead of sending small packets of data as they come in.
A timeout prevents us from blocking for more than 100ms when our 4K buffer is partially full.

Signed-off-by: Mike Lockwood <lockwood@android.com>
ervices.c
1fde31c8fbe746473e01238be652a9c29ebf37d9 25-Jul-2009 Xavier Ducrohet <xav@android.com> am de6f62a6: Add support for Samsung and Motorola devices.

Merge commit 'de6f62a609120c3d9e4e53689c3b309842ec874b'

* commit 'de6f62a609120c3d9e4e53689c3b309842ec874b':
Add support for Samsung and Motorola devices.
de6f62a609120c3d9e4e53689c3b309842ec874b 24-Jul-2009 Xavier Ducrohet <xav@android.com> Add support for Samsung and Motorola devices.

Also update the linux code. Some devices have more complex USB descriptors
which can't be parsed with the simple assumption of just skipping the
endpoint descriptors.
sb_linux.c
sb_vendors.c
dd8a23b774634880c49fbabd819cdc10397f4e43 10-Jul-2009 Mike Lockwood <lockwood@android.com> am 7bf68842: adb: Increment ADB_SERVER_VERSION

Merge commit '7bf68842d765ad7e6a51426b625d0de6d2331740'

* commit '7bf68842d765ad7e6a51426b625d0de6d2331740':
adb: Increment ADB_SERVER_VERSION
7bf68842d765ad7e6a51426b625d0de6d2331740 10-Jul-2009 Mike Lockwood <lockwood@android.com> adb: Increment ADB_SERVER_VERSION

It was pointed out that we should have done this when we added the "adb root" command.
And doing this will also force people to pick up the recent Linux USB serial number fix.

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.h
df3fb65e983bcad35e71ff28b70e774fafabbffc 08-Jul-2009 Kenny Root <kenny@the-b.org> am c989199c: Fix typo in adb commandline help

Merge commit 'c989199ccfbe745a7109f57d2aee2577d2f72b8d'

* commit 'c989199ccfbe745a7109f57d2aee2577d2f72b8d':
Fix typo in adb commandline help
c989199ccfbe745a7109f57d2aee2577d2f72b8d 08-Jun-2009 Kenny Root <kenny@the-b.org> Fix typo in adb commandline help

Android developers are not expected to have PDP-11s.
ommandline.c
5089bd0a6e575a9692d9beaab2f0306454a7c701 08-Jul-2009 Mike Lockwood <lockwood@android.com> am 3d9b265b: adb: Use correct language ID when retrieving USB serial number.

Merge commit '3d9b265b7d34d886a2f44e486c25e402d7df791b'

* commit '3d9b265b7d34d886a2f44e486c25e402d7df791b':
adb: Use correct language ID when retrieving USB serial number.
3d9b265b7d34d886a2f44e486c25e402d7df791b 08-Jul-2009 Mike Lockwood <lockwood@android.com> adb: Use correct language ID when retrieving USB serial number.

Fixes http://code.google.com/p/android/issues/detail?id=2609

Signed-off-by: Mike Lockwood <lockwood@android.com>
sb_linux.c
7490e4b170c7ca98146771ba72aab94131c33844 12-Jun-2009 Android (Google) Code Review <android-gerrit@google.com> am 34c34267: Merge change 3951 into donut

Merge commit '34c342677e4ffb57584d571d8996822bf4d879ef'

* commit '34c342677e4ffb57584d571d8996822bf4d879ef':
Revert "adb: Workaround for adb disconnect problem."
02d40b51c6d9f9dfc91f7d3b17a1f4f6db1ea972 11-Jun-2009 Mike Lockwood <lockwood@android.com> Revert "adb: Workaround for adb disconnect problem."

This reverts commit e38a31e305b0944c0cd1ae782e47e3145d731f0f.

This change had the unfortunate side effect of breaking ctrl-C
when executing "adb shell <command>"

Signed-off-by: Mike Lockwood <lockwood@android.com>
ervices.c
f4c94943a902550143027e0002bb569f9855c7b2 03-Jun-2009 Android (Google) Code Review <android-gerrit@google.com> am 87657782: Merge change 3008 into donut

Merge commit '876577823d7679fa18f175405ce77e5257161e3a'

* commit '876577823d7679fa18f175405ce77e5257161e3a':
adb: Workaround for adb disconnect problem.
e38a31e305b0944c0cd1ae782e47e3145d731f0f 03-Jun-2009 Mike Lockwood <lockwood@android.com> adb: Workaround for adb disconnect problem.

For non-interactive adb shell commands, batch USB writes into 4K chunks
instead of sending small packets of data as they come in.
Add a timeout so we do not block for more than 200ms when our 4K buffer is partially full.

Signed-off-by: Mike Lockwood <lockwood@android.com>
ervices.c
89ac364c54cca39892a342150f4f82c0636f959f 01-Jun-2009 Mathias Agopian <mathias@google.com> get rid of utils/executablepath.h, which now lives in the simulator
et_my_path_darwin.c
5b043d6182fef81adbd2858ea2fde649862cb3f7 26-May-2009 Mike Lockwood <lockwood@android.com> am 1f546e6d: adb: Allow enabling of device side adbd logging with a persistent system property.

Merge commit '1f546e6d1f6ccd1964336ddf0d8e8b3b11b1e945'

* commit '1f546e6d1f6ccd1964336ddf0d8e8b3b11b1e945':
adb: Allow enabling of device side adbd logging with a persistent system property.
1f546e6d1f6ccd1964336ddf0d8e8b3b11b1e945 26-May-2009 Mike Lockwood <lockwood@android.com> adb: Allow enabling of device side adbd logging with a persistent system property.

To enable logging, set the property persist.adb.trace_mask to a hex value
containing the bitmask for adb_trace_mask (see the TRACE_* enum values in adb.h).
This will result in adb writing log output to a file in /data/adb/
No logging will occur if persist.adb.trace_mask is not set or has a value
that cannot be parsed as a hex integer.
The property is read once only at startup, so you must reboot or restart adbd
for changes in the property to take effect.

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
db.h
64c6397b56a4290d5030694fb5134199066a6aa7 25-May-2009 Mike Lockwood <lockwood@android.com> am 6a3075c7: adb: Add adbd to the AID_SDCARD_RW group to allow writing to the SD card.

Merge commit '6a3075c78287ea5a7ee7a3c85cde58e894350822'

* commit '6a3075c78287ea5a7ee7a3c85cde58e894350822':
adb: Add adbd to the AID_SDCARD_RW group to allow writing to the SD card.
6a3075c78287ea5a7ee7a3c85cde58e894350822 25-May-2009 Mike Lockwood <lockwood@android.com> adb: Add adbd to the AID_SDCARD_RW group to allow writing to the SD card.

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
fc8e241871921584518bcfe75c3ed502164688e6 23-May-2009 Android (Google) Code Review <android-gerrit@google.com> am 0469d2c3: Merge change 2282 into donut

Merge commit '0469d2c37adddcb30cb0d88772bef33ac26c6500'

* commit '0469d2c37adddcb30cb0d88772bef33ac26c6500':
Support for 3rd party USB Vendor IDs in adb.
a481d096feba7cf6e61d54e416a68e2d46498df1 22-May-2009 Xavier Ducrohet <xav@android.com> Support for 3rd party USB Vendor IDs in adb.

Vendor IDs are read from ~/.android/adb_usb.ini. The format is very simple:
1 number per line. First number is ID count, followed by the ID themselves.
Lines starting with # are considered comments.

Other misc changes: moved VENDOR_ID_* to usb_vendors.c to prevent direct
access. Made transport_usb.c reuse the USB constant introduced in usb_osx
(moved them to adb.h)
db.c
db.h
db_client.c
ransport_usb.c
sb_osx.c
sb_vendors.c
sb_vendors.h
8a88939d6473e513cb3c38e74a53c0c5dbdfdded 21-May-2009 Xavier Ducrohet <xav@android.com> am a09fbd16: Preparation work for adb to support USB vendor Ids provided by SDK add-ons.

Merge commit 'a09fbd164d2e088bc5433d310e25640ae048d47d'

* commit 'a09fbd164d2e088bc5433d310e25640ae048d47d':
Preparation work for adb to support USB vendor Ids provided by SDK add-ons.
a09fbd164d2e088bc5433d310e25640ae048d47d 21-May-2009 Xavier Ducrohet <xav@android.com> Preparation work for adb to support USB vendor Ids provided by SDK add-ons.

Added usb_vendors.* which handles creating (and deleting) a list of vendor ids.
This list is meant to be used everywhere the built-in lists (usb_osx), or the
built-in vendor IDs (transport_usb) were used.

For now the list is only built with the built-in VENDOR_ID_*. Next step
is to read a small file created from all the SDK add-on.

Other misc changes: made is_adb_interface present only if ADB_HOST is true
to prevent accessing a list that doesn't exist (usb_vendors is only
compiled for the host version of adb).
ndroid.mk
db.c
db.h
ransport_usb.c
sb_osx.c
sb_vendors.c
sb_vendors.h
df849ca5f8cad85a86e586c878ce8782bbca8df3 21-May-2009 Android (Google) Code Review <android-gerrit@google.com> am a61755e5: Merge change 2077 into donut

Merge commit 'a61755e5fca065dfc89c7639bb672c20a4f9854e'

* commit 'a61755e5fca065dfc89c7639bb672c20a4f9854e':
move native_handle stuff from master_gl
adb: adbd no longer disables OOM and now sets children's OOM adjustment to zero
249ad57a887680538d1dc0195e746b1d877ebd6a 20-May-2009 Mike Lockwood <lockwood@android.com> adb: adbd no longer disables OOM and now sets children's OOM adjustment to zero

Signed-off-by: Mike Lockwood <lockwood@android.com>
db.c
ervices.c
342520f2ed0f06deaff4d9c227121c98581dd4a4 19-May-2009 Android (Google) Code Review <android-gerrit@google.com> am 1b154930: Merge change 1867 into donut

Merge commit '1b154930b2c2634dce9c04d5d5cec7acb229ccb0'

* commit '1b154930b2c2634dce9c04d5d5cec7acb229ccb0':
Cleaning up whitespace in adb sources. Nothing more, nothing less.
34c22c5ba951e4df7cc72d8d10da78064d5cfbe4 18-May-2009 David 'Digit' Turner <digit@google.com> am 414ff7d9: Move fdevent from libcutils into adb directory. ADB is the only client of this API, and I intend to modify it extensively to clean its codebase soon.

Merge commit '414ff7d98ac8d7610a26206335954ad15f43f3ac'

* commit '414ff7d98ac8d7610a26206335954ad15f43f3ac':
Move fdevent from libcutils into adb directory. ADB is the only client of this API, and I intend to modify it extensively to clean its codebase soon.
f6330a2eeb78c0971f33feee7fd1ee06472a7dba 18-May-2009 David 'Digit' Turner <digit@google.com> Cleaning up whitespace in adb sources. Nothing more, nothing less.
devent.c
devent.h
ile_sync_client.c
rotocol.txt
ysdeps.h
ysdeps_win32.c
sb_windows.c
414ff7d98ac8d7610a26206335954ad15f43f3ac 18-May-2009 David 'Digit' Turner <digit@google.com> Move fdevent from libcutils into adb directory. ADB is the only client of this API, and I intend to modify it extensively to clean its codebase soon.
ndroid.mk
devent.c
devent.h
ramebuffer_service.c
ysdeps.h
16b5d6e75c554905eedd822f6dde6928b7fdf782 10-May-2009 Dima Zavin <dima@android.com> am 3fd82b8: adb: osx: Match devices based on interface subclass and prot

Merge commit '3fd82b8861aa410fab7785074941b459d92220c1'

* commit '3fd82b8861aa410fab7785074941b459d92220c1':
adb: osx: Match devices based on interface subclass and protocol
3fd82b8861aa410fab7785074941b459d92220c1 09-May-2009 Dima Zavin <dima@android.com> adb: osx: Match devices based on interface subclass and protocol

Enumerating all vendor+product id combinations is not practical.
This modifies the matching algorithm to use the adb interface
subclass/protocol instead (0x42/0x1).

Signed-off-by: Dima Zavin <dima@android.com>
db.h
sb_osx.c
46f208e40d226b881736036088317c918cc5d5e7 08-May-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 1171

* changes:
Allow adb to use ANDORID_SERIAL env variable to specify the device to talk to.
db4492640313be9d3fd65ee5bd7648a9570411bb 07-May-2009 Nick Pelly <npelly@google.com> Allow adb to use ANDORID_SERIAL env variable to specify the device to talk to.

Overridden by -s.
ommandline.c
b9e966f56b217bfd90ac0a0ee0dda11b5425dbbb 01-May-2009 Marco Nelissen <marcone@google.com> adb seems to build in 64 bit mode these days, so it's safe to build for the simulator too.
While adb is not needed for the simulator, it's handy to have around when you're working with the simulator but need to look at a device.
ndroid.mk
e037fd7e193ecccbb5c0888e49f6d58c224bc11d 13-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake_rel/...@138607
db.c
ommandline.c
ervices.c
2015549667fb77706a9879e974a3875ebccd8198 11-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@137873
db.c
dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
ndroid.mk
VERVIEW.TXT
ERVICES.TXT
db.c
db.h
db_client.c
db_client.h
ommandline.c
onsole.c
ile_sync_client.c
ile_sync_service.c
ile_sync_service.h
ramebuffer_service.c
et_my_path_darwin.c
et_my_path_linux.c
et_my_path_windows.c
istory.h
dwp_service.c
og_service.c
utex_list.h
rotocol.txt
emount_service.c
ervices.c
hlist.c
hlist.h
ockets.c
ockets.dia
ysdeps.h
ysdeps_win32.c
est_track_devices.c
est_track_jdwp.c
ransport.c
ransport_local.c
ransport_usb.c
sb_linux.c
sb_linux_client.c
sb_osx.c
sb_windows.c
tils.c
tils.h
e54eebbf1a908d65ee8cf80bab62821c05666d70 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
ndroid.mk
VERVIEW.TXT
ERVICES.TXT
db.c
db.h
db_client.c
db_client.h
ommandline.c
onsole.c
ile_sync_client.c
ile_sync_service.c
ile_sync_service.h
ramebuffer_service.c
et_my_path_darwin.c
et_my_path_linux.c
et_my_path_windows.c
istory.h
dwp_service.c
og_service.c
utex_list.h
rotocol.txt
emount_service.c
ervices.c
hlist.c
hlist.h
ockets.c
ockets.dia
ysdeps.h
ysdeps_win32.c
est_track_devices.c
est_track_jdwp.c
ransport.c
ransport_local.c
ransport_usb.c
sb_linux.c
sb_linux_client.c
sb_osx.c
sb_windows.c
tils.c
tils.h
1b8e5a6b14ca850920e19b3dfae41e6494475c1a 13-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@131421
og_service.c
13f797da7f190e9ea52f2f3d235210b8a4963b21 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
sb_linux.c
5ae090ed949cea9d1e7ab1552b455a229f8f9757 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
ndroid.mk
ERVICES.TXT
db.c
ommandline.c
dbg.c
ervices.c
35237d135807af84bf9b0e5b8d7f8633e58db6f5 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
ndroid.mk
VERVIEW.TXT
ERVICES.TXT
db.c
db.h
db_client.c
ommandline.c
ile_sync_client.c
ile_sync_service.c
ramebuffer_service.c
et_my_path_windows.c
dwp_service.c
ockets.c
ysdeps_win32.c
ransport_local.c
ransport_usb.c
sb_linux_client.c
sb_osx.c
sb_windows.c
tils.c
tils.h
4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
ndroid.mk
db.c
db.h
db_client.c
db_client.h
ommandline.c
onsole.c
ile_sync_client.c
ile_sync_service.c
ile_sync_service.h
ramebuffer_service.c
et_my_path_darwin.c
et_my_path_linux.c
et_my_path_windows.c
istory.h
dwp_service.c
dbg.c
og_service.c
utex_list.h
rotocol.txt
emount_service.c
ervices.c
hlist.c
hlist.h
ockets.c
ockets.dia
ysdeps.h
ysdeps_win32.c
est_track_devices.c
est_track_jdwp.c
ransport.c
ransport_local.c
ransport_usb.c
sb_linux.c
sb_linux_client.c
sb_osx.c
sb_windows.c