Commit Graph

2300 Commits

Author SHA1 Message Date
Josh Gao 43c02b27cd Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp."
This reverts commit 4fba3d2638.
2016-12-05 13:15:55 -08:00
Josh Gao d5286d376b adb: move adb_strerror to sysdeps/win32/errno.cpp.
am: 4fba3d2638

Change-Id: Ibdfa8ebbcfee5baf459f82fd13e1a0e8167c5053
2016-12-05 20:35:41 +00:00
Josh Gao 4733b631ed adb: extend sync protocol's stat support.
am: d6d5c38469

Change-Id: I26a1518bba4f65c0fdcc7c75d751badd9a3563d3
2016-12-05 20:35:36 +00:00
Josh Gao 97e228e903 Merge changes I9df4d6fa,I841123de
* changes:
  adb: move adb_strerror to sysdeps/win32/errno.cpp.
  adb: extend sync protocol's stat support.
2016-12-05 20:31:55 +00:00
Elliott Hughes 32ca0ab616 Merge "Remove unused adb_set_transport."
am: b898ce00fa

Change-Id: Ia428922f1a0241b8d7ec97517d360b02596a9781
2016-12-03 04:23:10 +00:00
Elliott Hughes de80be39aa Remove unused adb_set_transport.
Bug: N/A
Test: builds
Change-Id: I0824d29c080c47e1002abf3520ebed8996bcbcc6
2016-12-02 12:53:09 -08:00
Josh Gao 4fba3d2638 adb: move adb_strerror to sysdeps/win32/errno.cpp.
Bug: none
Test: mma
Change-Id: I9df4d6faf9883a78f50ca6b2b7c35f095d06ae20
2016-11-30 13:23:21 -08:00
Josh Gao d6d5c38469 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
2016-11-30 13:23:21 -08:00
Josh Gao b6e9e5ddde adb: be more permissive in test_push_error_reporting.
am: 79ce3fe7db

Change-Id: I1239b5af85edca9ae6fa1a38f755b5707bbc614b
2016-11-29 18:18:49 +00:00
Josh Gao 68fd28e334 adb: make sure that file mode macros match linux.
am: 05a3abfef3

Change-Id: I39a6938adc8b9b1da0185d36a1891f755bf2ca38
2016-11-29 18:18:44 +00:00
Josh Gao 79ce3fe7db 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
2016-11-21 18:39:21 -08:00
Josh Gao 05a3abfef3 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
2016-11-21 18:39:21 -08:00
Josh Gao c2102a7b8f Merge "adb: fix progress percentage when pulling symlinks."
am: 453db013b0

Change-Id: I3789390531b46c7dc5ac6796e62e6e43bba3bcca
2016-11-18 02:17:56 +00:00
Treehugger Robot 453db013b0 Merge "adb: fix progress percentage when pulling symlinks." 2016-11-18 02:13:19 +00:00
Josh Gao da1f279509 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
2016-11-17 16:17:07 -08:00
Elliott Hughes 8e5fb5a0e7 Merge "Remove dead code."
am: 3bde05d928

Change-Id: Ib748fef3e54687c2da1818a7cd738f31e30b79ac
2016-11-17 20:39:22 +00:00
Treehugger Robot 3bde05d928 Merge "Remove dead code." 2016-11-17 20:29:10 +00:00
Elliott Hughes 284f07bd9d 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
2016-11-17 10:32:16 -08:00
Josh Gao 27bbe8bfb2 Merge "adb: add sysdeps/chrono.h for chrono literals on Win32."
am: e631e470e0

Change-Id: Ie62e995d9790bf7539f3f9fca05de7b4b359dc7c
2016-11-16 22:29:30 +00:00
Josh Gao 4602adbcd3 adb: add sysdeps/chrono.h for chrono literals on Win32.
Bug: http://b/32878766
Test: mma
Change-Id: Iaa89d4eadf07e63d6d7205057435a6c7fb5d4ec5
2016-11-16 12:14:59 -08:00
Elliott Hughes 2278b50f24 Merge "Switch adb over to <chrono>."
am: 59826ddee5

Change-Id: I673ce3c9f4a104df3197ec7120a126155e18918e
2016-11-16 20:14:20 +00:00
Elliott Hughes dbe91eee26 Switch adb over to <chrono>.
Clearer code, and lets us lose some more portability cruft.

Bug: http://b/32878766
Test: manual
Change-Id: Ie44928bbf8d68a74127aaf76e7e0060e25fa2cc8
2016-11-16 09:12:12 -08:00
Jin Qian c6fbcd7579 Merge "Set file capabilities after writing file data"
am: dd4e5ae943

Change-Id: I135c6ebf4fc9b11a7ed9798be1ce0a88862386a5
2016-11-03 17:29:31 +00:00
Jin Qian d0515e7165 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
2016-11-02 16:37:11 -07:00
Josh Gao 1d51d6d6aa Merge "adb: add `adb reconnect offline` to reconnect offline devices."
am: 0945380e36

Change-Id: I832f5c97f455b2b38b4bcd734759cb9561ec9b31
2016-10-31 21:33:19 +00:00
Josh Gao 0945380e36 Merge "adb: add `adb reconnect offline` to reconnect offline devices." 2016-10-31 21:26:23 +00:00
Josh Gao 22d2b3e1c2 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
2016-10-27 17:13:23 -07:00
Elliott Hughes a4f497e0a2 Merge "Make "adb logcat" pass $ANDROID_LOG_TAGS through again."
am: b838ff65d9

Change-Id: I29acb11ca837c1824e4530c1e6315f04c7a25648
2016-10-27 01:10:07 +00:00
Elliott Hughes 90390302d5 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
2016-10-26 15:12:14 -07:00
Elliott Hughes 66321bc889 Merge "Improve "adb install" diagnostics."
am: a16ae8717c

Change-Id: Ia3a8b9cfce4d5e939a8a894e959731874d1f2fd0
2016-10-26 18:37:34 +00:00
Treehugger Robot a16ae8717c Merge "Improve "adb install" diagnostics." 2016-10-26 18:25:59 +00:00
Elliott Hughes 02ee1725ae Merge "Make "adb bugreport"'s .zip check case-insensitive."
am: da6fe65000

Change-Id: I34d95b38bec230729b3707c698b347c9a5908831
2016-10-26 15:39:50 +00:00
Elliott Hughes 7acce1b0ab Make "adb bugreport"'s .zip check case-insensitive.
Bug: TODO
Test: manual
Change-Id: I0ece7d8dcb708e3755477f7df5ff03807fd227f2
2016-10-25 17:24:54 -07:00
Elliott Hughes 7288478443 Improve "adb install" diagnostics.
Bug: http://b/32094640
Test: manual testing
Change-Id: I661936eabd3bdd8aa7ee8cc0e398a7cc7d4ddbbb
2016-10-25 17:23:40 -07:00
Elliott Hughes e060cdadc8 Merge "Allow multiple tcp adb connection to same device."
am: 4818194a25

Change-Id: Id2b6bc99479e94cd94154ca194985f65df7e2afa
2016-10-24 23:36:44 +00:00
Elliott Hughes 4818194a25 Merge "Allow multiple tcp adb connection to same device." 2016-10-24 23:31:14 +00:00
Josh Gao 8baf1198ee adb: fix test_sighup.
am: 470622f064

Change-Id: I342cbd04804e3d8d92d04ab088c6980d67bbc8e8
2016-10-24 21:18:58 +00:00
Josh Gao a06580956e adb: fix race condition in test_non_interactive_sigint.
am: e76b9f3dde

Change-Id: Ib2b6c1118cb48c337c12efbd223c87fee76837f2
2016-10-24 21:18:51 +00:00
Josh Gao 63660add3f Merge changes I34ba5757,Ie65a762a
* changes:
  adb: fix test_sighup.
  adb: fix race condition in test_non_interactive_sigint.
2016-10-24 21:13:18 +00:00
Josh Gao 470622f064 adb: fix test_sighup.
Bug: http://b/32336914
Test: python test_device.py
Change-Id: I34ba5757b5e650d79327dc6779064acd850ce28e
2016-10-24 13:34:20 -07:00
Josh Gao e76b9f3dde 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
2016-10-24 13:34:17 -07:00
Tao Wu 043912ec11 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>
2016-10-22 12:54:30 -07:00
Elliott Hughes f58d06a918 Merge "Move "adb shell" over to getopt(3), and allow -tt on old devices."
am: 620469a4ac

Change-Id: I4849d18fcd2afe0c1e5d3b2bdf3a3a755e557e91
2016-10-22 18:11:44 +00:00
Elliott Hughes cabfa1177f 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
2016-10-21 14:22:40 -07:00
Ting-Yuan Huang e02e11835d Merge "adb: fix undefined behavior"
am: 1edd61ce5d

Change-Id: I35cbda2fa031dc8627aaaffb5e50be98ddb20430
2016-10-20 04:38:12 +00:00
Ting-Yuan Huang ef57d54f80 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
2016-10-19 19:39:44 -07:00
Mark Salyzyn 8648bddf24 adb: use __android_log_is_debuggable()
am: 97787a00e6

Change-Id: I326735c9b0e6163ab5b2215a6bed44ea710409d2
2016-10-18 16:46:15 +00:00
Mark Salyzyn 97787a00e6 adb: use __android_log_is_debuggable()
Test: compile and months of adb functionality use
Bug: 27566046
Bug: 31456426
Change-Id: I6568eea0eda8dc67dec2ba34cd4c3f56fb0ff0e9
2016-10-14 11:12:24 -07:00
Elliott Hughes 19340be9fe Merge "Rely on the platform -std default." am: 955648a915 am: 4594f50635
am: f1dffe0501

Change-Id: Ibbffb45d50ad038d55a4d435a250b59b64547227
2016-10-14 02:56:09 +00:00
Elliott Hughes f1dffe0501 Merge "Rely on the platform -std default." am: 955648a915
am: 4594f50635

Change-Id: I459e76bcada6d849eccca73a470a910e335482bf
2016-10-14 02:47:44 +00:00
Elliott Hughes 4594f50635 Merge "Rely on the platform -std default."
am: 955648a915

Change-Id: Ic4e9a7fbc7d13cc18ebb84801bf2f2f9a1d04470
2016-10-14 02:45:03 +00:00
Treehugger Robot 955648a915 Merge "Rely on the platform -std default." 2016-10-14 02:28:38 +00:00
Tao Wu 4b9774fe97 Merge "Fallback to IPv6 when IPv4 is not available in adb" am: c32d7fd66f am: 5b7c6772b0
am: 27c6c4cf04

Change-Id: I2ceb40b4589dfc2721197065ae5a85e9dc83b907
2016-10-14 01:51:54 +00:00
Elliott Hughes a4398c1abe Merge "Move off std::sto* function which abort on failure." 2016-10-14 01:51:10 +00:00
Tao Wu 27c6c4cf04 Merge "Fallback to IPv6 when IPv4 is not available in adb" am: c32d7fd66f
am: 5b7c6772b0

Change-Id: I63e945622d47ab1cbcbdd82d00cfdf3d51c95564
2016-10-14 01:46:26 +00:00
Tao Wu 5b7c6772b0 Merge "Fallback to IPv6 when IPv4 is not available in adb"
am: c32d7fd66f

Change-Id: I21efa80874bfffb88cc63098e0a402a3e8d1c122
2016-10-14 01:43:55 +00:00
Elliott Hughes da46b392f1 Move off std::sto* function which abort on failure.
Bug: http://b/31403370
Test: builds, boots, libbase tests pass
Change-Id: I89cd7ca3d8f1c8a1bad0ddf3043439449d19a293
2016-10-13 15:34:05 -07:00
Tao Wu 7b700763f5 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>
2016-10-13 08:54:43 -07:00
Elliott Hughes fc485e4488 Merge "Start retiring socket_loopback_client." am: 58f7f61266 am: cd0e8cfd33
am: aa509a3e9d

Change-Id: Iea3a25f193b9249ba93d49514b2a409d693121e1
2016-10-13 15:00:24 +00:00
Elliott Hughes aa509a3e9d Merge "Start retiring socket_loopback_client." am: 58f7f61266
am: cd0e8cfd33

Change-Id: Ibd76fcb2aa9abb35a11f3b1e3f771a168f6d96de
2016-10-13 14:50:50 +00:00
Elliott Hughes cd0e8cfd33 Merge "Start retiring socket_loopback_client."
am: 58f7f61266

Change-Id: I2b3d6ae5e90fb99163eb639e185b93cd55ff724a
2016-10-13 14:43:05 +00:00
Elliott Hughes 58f7f61266 Merge "Start retiring socket_loopback_client." 2016-10-13 14:38:48 +00:00
Lingfeng Yang 7bdbbfb0ef Merge "Fix adb flakiness on reboot" am: f7a1c476ff am: d0dead710b
am: e93241e377

Change-Id: Icd024ed6896a1989f67beb512a399cd0979b2cf1
2016-10-12 00:49:27 +00:00
Lingfeng Yang e93241e377 Merge "Fix adb flakiness on reboot" am: f7a1c476ff
am: d0dead710b

Change-Id: I7b966be541d89b2f13a9c39218627884e001cc21
2016-10-12 00:44:48 +00:00
Lingfeng Yang d0dead710b Merge "Fix adb flakiness on reboot"
am: f7a1c476ff

Change-Id: If74046384b04c8bae587c3194c85e1a1865e3cbb
2016-10-12 00:36:30 +00:00
Lingfeng Yang 1197952e71 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 edaedfd5da)

Change-Id: Id1201dc59c70825881dad80925c2e5bcc13dbd5e
2016-10-11 23:19:51 +00:00
Elliott Hughes 139b372fab Start retiring socket_loopback_client.
Bug: http://b/31537253
Test: can still talk to adb
Change-Id: Icfd7f00d35cf963befc139e81904790b4b8b67c0
2016-10-11 13:45:03 -07:00
Josh Gao f369babcb8 Merge "Remove useless arguments from is_adb_interface." am: bd6c6eb0e4 am: db50d1d6ef
am: 0a629b4bdd

Change-Id: I54e47bf9d8e056255335e809b9733e2597b3e532
2016-10-11 17:51:40 +00:00
Josh Gao 0a629b4bdd Merge "Remove useless arguments from is_adb_interface." am: bd6c6eb0e4
am: db50d1d6ef

Change-Id: I4a21f8296643bbe185ac79df8888eec07c88ca78
2016-10-11 17:42:47 +00:00
Josh Gao db50d1d6ef Merge "Remove useless arguments from is_adb_interface."
am: bd6c6eb0e4

Change-Id: I1390870da63506df411dbd94f2b19d147d90009c
2016-10-11 17:36:09 +00:00
Mark Salyzyn 144abd8cb2 Merge "liblog: adb: move security interfaces to private" am: 09dac589f1 am: 586c6985cf
am: 4b5456eacc

Change-Id: Id78628d7e7abfa16f1ada16f894f9616a2dc469b
2016-10-10 23:34:54 +00:00
Mark Salyzyn 4b5456eacc Merge "liblog: adb: move security interfaces to private" am: 09dac589f1
am: 586c6985cf

Change-Id: I8c54bdc1a3582be1fc7c4a9be83b555624fcb0a3
2016-10-10 23:29:55 +00:00
Treehugger Robot bd6c6eb0e4 Merge "Remove useless arguments from is_adb_interface." 2016-10-10 22:50:13 +00:00
Mark Salyzyn 586c6985cf Merge "liblog: adb: move security interfaces to private"
am: 09dac589f1

Change-Id: I05ad9cee5ffe00e842120aa960d6652517b94a16
2016-10-10 22:04:39 +00:00
Elliott Hughes 36e0d390a2 Rely on the platform -std default.
Bug: http://b/32019064
Test: builds
Change-Id: I18a1d816d63b64601485045070851f32d44e85eb
2016-10-10 14:31:12 -07:00
Josh Gao 30186df0f0 Remove useless arguments from is_adb_interface.
Test: mma
Change-Id: I8b7b411d7d5ec9d401b61ed8f817b98c61114d4f
2016-10-10 13:44:00 -07:00
Mark Salyzyn 6debf985aa liblog: adb: move security interfaces to private
Test: Compile & adb functioning
Bug: 19235719
Bug: 26552300
Bug: 31289077
Bug: 31456426
Change-Id: I7ad8963bcca3d8b5c37b547c11d163b652d35556
2016-10-10 15:15:45 +00:00
Josh Gao f883e2f65c Merge "adb: rationalize types." am: 8caf4e7443 am: e335bea277
am: 010818f313

Change-Id: I1edebee150c7b36cfa3ca58626eaebf5e9ce647f
2016-10-07 20:48:19 +00:00
Josh Gao 010818f313 Merge "adb: rationalize types." am: 8caf4e7443
am: e335bea277

Change-Id: I045ccbebbc1005a501768da3222a211e49821895
2016-10-07 20:44:43 +00:00
Josh Gao e335bea277 Merge "adb: rationalize types."
am: 8caf4e7443

Change-Id: I2e363c31a22b57964688f170c6f96cd8764959e0
2016-10-07 20:41:16 +00:00
Josh Gao 06d61d4d96 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
2016-10-06 14:50:02 -07:00
Josh Gao e1afd17d75 Merge "adb: split up adb_auth.cpp." am: 4a8b178c97 am: 4546c8ac3d
am: 58a5e5a50b

Change-Id: Ibb499732491fc584be2b1e61f95bb9375fad16ec
2016-10-06 19:54:06 +00:00
Josh Gao 58a5e5a50b Merge "adb: split up adb_auth.cpp." am: 4a8b178c97
am: 4546c8ac3d

Change-Id: Idb9ed3e21524893943ecd176d9abe6a1e3b5493b
2016-10-06 19:50:37 +00:00
Josh Gao 4546c8ac3d Merge "adb: split up adb_auth.cpp."
am: 4a8b178c97

Change-Id: I846a06ca04aad456c6659dd6db4c8d0666fc6707
2016-10-06 19:47:11 +00:00
Treehugger Robot 4a8b178c97 Merge "adb: split up adb_auth.cpp." 2016-10-06 19:37:31 +00:00
Josh Gao 3bd2879d8e 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
2016-10-06 12:36:26 -07:00
Tao Bao 4fa6e4855b Merge "adb: Remove the obsolete include path to ext4_utils." am: 9f828a5383 am: a00020317e
am: 9766909149

Change-Id: I1059d176220327d6f1ecb5c56dde2bebf31c371f
2016-10-06 06:29:57 +00:00
Tao Bao 9766909149 Merge "adb: Remove the obsolete include path to ext4_utils." am: 9f828a5383
am: a00020317e

Change-Id: I474494405de42c794af3160898a867e766c558b1
2016-10-06 06:26:25 +00:00
Tao Bao a00020317e Merge "adb: Remove the obsolete include path to ext4_utils."
am: 9f828a5383

Change-Id: Ia833226376111a0ead4f0c5b5d79768a8b8dbeb2
2016-10-06 06:23:27 +00:00
Tao Bao fee161d189 adb: Remove the obsolete include path to ext4_utils.
Since commit 8ad80763e4 has removed
'#include "ext4_sb.h"', there's no more reference to ext4_utils headers.

Test: `mmma system/core/adb`

Change-Id: I7ca1a6e91f1e0de84238c2a7facbebe9600a3d87
2016-10-05 18:06:03 -07:00
Mark Salyzyn 9f6b98dec0 system/core Replace log/log.h with android/log.h am: ff2dcd9af9 am: cac331afd9
am: 0308b0eabd

Change-Id: I4d631d53b4fc27e1a02d412bae21fffad6635258
2016-09-30 22:18:18 +00:00
Mark Salyzyn 0308b0eabd system/core Replace log/log.h with android/log.h am: ff2dcd9af9
am: cac331afd9

Change-Id: I95c6a64bc35a041688303fcee4d506865d0a19a4
2016-09-30 22:13:00 +00:00
Mark Salyzyn cac331afd9 system/core Replace log/log.h with android/log.h
am: ff2dcd9af9

Change-Id: I3c47cb42639d56740ecf7e4fe61ea49982d69fed
2016-09-30 22:09:28 +00:00
Mark Salyzyn ff2dcd9af9 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
2016-09-30 12:47:05 -07:00
Elliott Hughes a6d5587f78 resolve merge conflicts of b40756a to nyc-dev-plus-aosp
am: fe807214ef

Change-Id: Ibcfd7f5c9c67084c754b2b60ff1e9eed976e3249
2016-09-30 17:07:03 +00:00
Elliott Hughes fe807214ef resolve merge conflicts of b40756a to nyc-dev-plus-aosp
Change-Id: Ic1aa6fd6ab66ca8fb7cf434a3d0679a41288e4a7
2016-09-30 10:00:02 -07:00
Elliott Hughes b40756ac28 resolve merge conflicts of 50cb973 to stage-aosp-master
Change-Id: Idf0d02687cc47f64acfdd3da623c7a7a62043651
2016-09-30 09:08:23 -07:00
Elliott Hughes 4bf9bc1ac7 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
2016-09-28 15:29:19 -07:00
David Pursell 5cab7cc637 Merge "adb: fix host-side serial number parsing for IPv6." am: b1c4d90215 am: 94c652ed31
am: dde69001c2

Change-Id: I869720698bb91b0e968c51740b916ab58ea89d5a
2016-09-28 17:46:46 +00:00
David Pursell dde69001c2 Merge "adb: fix host-side serial number parsing for IPv6." am: b1c4d90215
am: 94c652ed31

Change-Id: I87e3bbc33077830ca95e06807cb9863f42b87bf4
2016-09-28 17:41:16 +00:00
David Pursell 94c652ed31 Merge "adb: fix host-side serial number parsing for IPv6."
am: b1c4d90215

Change-Id: I62454f520192df9b600280b59704e7c0fe55687f
2016-09-28 17:35:47 +00:00
Treehugger Robot b1c4d90215 Merge "adb: fix host-side serial number parsing for IPv6." 2016-09-28 17:30:29 +00:00
Josh Gao a539d4c04c Merge "adb: fix IOKit handle leaks on OS X." am: a2aff3f809 am: 279a1ea5b0
am: dbb34a87b4

Change-Id: I18ab725e1895f58519cab7f2bd29065058d70700
2016-09-27 20:52:26 +00:00
Josh Gao dbb34a87b4 Merge "adb: fix IOKit handle leaks on OS X." am: a2aff3f809
am: 279a1ea5b0

Change-Id: Ia45f5ae1943a0d5292da230e902751e127702be4
2016-09-27 20:45:55 +00:00
Josh Gao 279a1ea5b0 Merge "adb: fix IOKit handle leaks on OS X."
am: a2aff3f809

Change-Id: I24587b122c3d4d57eef137456c3628e4010d7b5c
2016-09-27 20:43:24 +00:00
Josh Gao a2aff3f809 Merge "adb: fix IOKit handle leaks on OS X." 2016-09-27 20:38:37 +00:00
Josh Gao b6a2f59515 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
2016-09-27 12:36:58 -07:00
Elliott Hughes 9daaf229d0 Merge "Switch adb to <android-base/properties.h>." am: d9a23b5733 am: 5dc7e6a79a
am: 8b7751d360

Change-Id: Ie02bbd139d522d930649ecb06da3f853d6995034
2016-09-26 22:25:21 +00:00
Elliott Hughes 8b7751d360 Merge "Switch adb to <android-base/properties.h>." am: d9a23b5733
am: 5dc7e6a79a

Change-Id: Ie2718d9f843b11feca003805569bb35acde62463
2016-09-26 22:22:48 +00:00
Elliott Hughes 5dc7e6a79a Merge "Switch adb to <android-base/properties.h>."
am: d9a23b5733

Change-Id: I09a1832143d9f54cd67128602c9e518a1b398b5c
2016-09-26 22:19:04 +00:00
Elliott Hughes ffdec18017 Switch adb to <android-base/properties.h>.
Bug: http://b/23102347
Test: manual
Change-Id: Iffa66258c01f84f41b9af99ab5e768a0a2669106
2016-09-26 13:14:14 -07:00
Tao Wu 0e0cf74c52 Merge "Ignore setsid error in some cases." am: 3562fd0fa8 am: 324acdce69
am: f7756b89e9

Change-Id: I7bc3c1f46fec39fb8fd2fe597633b067ad0a8bda
2016-09-22 22:53:08 +00:00
Josh Gao 6d317aca93 Merge "adb: kill adb_mutex_t, adb_cond_t." am: 7e4d1db957 am: 72c679d6d0
am: 71970fc473

Change-Id: I77f0221da27abb337ce7d8896cd6ad94c04548cf
2016-09-22 22:52:16 +00:00
Tao Wu f7756b89e9 Merge "Ignore setsid error in some cases." am: 3562fd0fa8
am: 324acdce69

Change-Id: I330be058b8c0d7b175845b30d59f091432d62f6c
2016-09-22 11:55:23 +00:00
Josh Gao 71970fc473 Merge "adb: kill adb_mutex_t, adb_cond_t." am: 7e4d1db957
am: 72c679d6d0

Change-Id: I3b726d03c8dc299191a68488e28fe83c3bd89a77
2016-09-22 11:54:05 +00:00
Tao Wu 324acdce69 Merge "Ignore setsid error in some cases."
am: 3562fd0fa8

Change-Id: I8ff768ce0e4ddd5e2810e40302bf597e2f39387b
2016-09-22 08:22:14 +00:00
Josh Gao 72c679d6d0 Merge "adb: kill adb_mutex_t, adb_cond_t."
am: 7e4d1db957

Change-Id: I3e10b6e3039e3aeb966f8ca27df69b61fa8aa0cc
2016-09-22 08:21:30 +00:00
Treehugger Robot 3562fd0fa8 Merge "Ignore setsid error in some cases." 2016-09-22 06:28:51 +00:00
Treehugger Robot 7e4d1db957 Merge "adb: kill adb_mutex_t, adb_cond_t." 2016-09-22 02:15:00 +00:00
Josh Gao 0cd3ae1c28 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
2016-09-21 17:22:22 -07:00
Josh Gao 88e36027ed Merge "adb: parse tcp socket specs with base::ParseNetAddress." am: efee71c2de am: 67ed583564
am: 837f2cef9a

Change-Id: I4d7da8197397c2ab84f46733eeb3cd0eba82a01f
2016-09-21 20:38:59 +00:00
Josh Gao 837f2cef9a Merge "adb: parse tcp socket specs with base::ParseNetAddress." am: efee71c2de
am: 67ed583564

Change-Id: Ia820151b0c5fae600adb204421759b9cc5c92ad7
2016-09-21 20:31:28 +00:00
Josh Gao 67ed583564 Merge "adb: parse tcp socket specs with base::ParseNetAddress."
am: efee71c2de

Change-Id: I911b1bed18e1d1d55c585d78479a85d4d8ba2875
2016-09-21 20:28:57 +00:00
Josh Gao efee71c2de Merge "adb: parse tcp socket specs with base::ParseNetAddress." 2016-09-21 20:26:36 +00:00
David Pursell 73d55aaab2 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
2016-09-21 13:00:32 -07:00
Tao Wu c8fab89f1b 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>
2016-09-20 18:15:22 -07:00
Josh Gao 11a172e5b7 Merge "base: rename unique_fd::clear() to unique_fd::reset()." am: 14d3a1ac9d am: 8c9ecb9c2c
am: bac29cb665

Change-Id: I078430bfdd43d3fa14a220debc7623f4931158e8
2016-09-21 01:12:57 +00:00
Josh Gao bac29cb665 Merge "base: rename unique_fd::clear() to unique_fd::reset()." am: 14d3a1ac9d
am: 8c9ecb9c2c

Change-Id: I9e4a3f5b303464fe7c3c162446c72157015ffec2
2016-09-21 01:10:23 +00:00
Josh Gao 8c9ecb9c2c Merge "base: rename unique_fd::clear() to unique_fd::reset()."
am: 14d3a1ac9d

Change-Id: Ic00aaca61c8e9eb68c30de00b825fc73d8b3cace
2016-09-21 01:07:18 +00:00
Josh Gao 14d3a1ac9d Merge "base: rename unique_fd::clear() to unique_fd::reset()." 2016-09-21 01:03:06 +00:00
Josh Gao 1099215e30 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
2016-09-20 13:55:43 -07:00
Tao Wu 502231b6be Merge "Fix bug: Doesn't respect ANDROID_ADB_SERVER_PORT" am: 4159568548 am: bcc419edad
am: 18b1a9901e

Change-Id: If85d3cf002bde9ee29b9aa4062e360646a1ebff0
2016-09-20 00:56:43 +00:00
Tao Wu 18b1a9901e Merge "Fix bug: Doesn't respect ANDROID_ADB_SERVER_PORT" am: 4159568548
am: bcc419edad

Change-Id: Ib9ea8fb0b2a571417a1bfd0c1e5a6fd75eb08ef4
2016-09-19 21:02:24 +00:00
Tao Wu bcc419edad Merge "Fix bug: Doesn't respect ANDROID_ADB_SERVER_PORT"
am: 4159568548

Change-Id: I8f2b4b1a5914642790e18e58d376ffcd37311d1f
2016-09-19 20:53:48 +00:00
Treehugger Robot 4159568548 Merge "Fix bug: Doesn't respect ANDROID_ADB_SERVER_PORT" 2016-09-19 20:35:11 +00:00
Josh Gao 5d1b1a8b91 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
2016-09-19 11:24:58 -07:00
Tao Wu 135f4ab3dd 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>
2016-09-16 17:13:48 -07:00
Pirama Arumuga Nainar 48b0a6b471 Merge "Use <condition_variable> and <mutex.h> from MinGW" am: a3d7b240f1 am: 331ec060ca
am: 11836956bc

Change-Id: I9317665b9cf3f415b3c3e64e95a5ee4f2e3c2798
2016-09-16 22:24:27 +00:00
Pirama Arumuga Nainar 11836956bc Merge "Use <condition_variable> and <mutex.h> from MinGW" am: a3d7b240f1
am: 331ec060ca

Change-Id: I8205259a82445aa6ff50509c58c58bb1429f3c49
2016-09-16 22:21:24 +00:00
Pirama Arumuga Nainar 331ec060ca Merge "Use <condition_variable> and <mutex.h> from MinGW"
am: a3d7b240f1

Change-Id: I319a164694fe67a008915249811dc39567184d08
2016-09-16 22:15:21 +00:00
Pirama Arumuga Nainar a3d7b240f1 Merge "Use <condition_variable> and <mutex.h> from MinGW" 2016-09-16 21:59:35 +00:00
Josh Gao 264b3465dd adb: let `adb push` follow symlinks. am: 94dc19ff57 am: 30ecda227c
am: 3e64efbced

Change-Id: Ifbedcf881b2724f6203059037b37032b7a2d3ddd
2016-09-15 02:32:35 +00:00
Josh Gao 3e64efbced adb: let `adb push` follow symlinks. am: 94dc19ff57
am: 30ecda227c

Change-Id: I10dfdd0265403628c2ef163771cdb576c90419c6
2016-09-15 02:29:35 +00:00
Josh Gao 30ecda227c adb: let `adb push` follow symlinks.
am: 94dc19ff57

Change-Id: I408ebb7b3091e67bd7025b3a6404f57c7f3af377
2016-09-15 02:27:33 +00:00
Josh Gao 94dc19ff57 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
2016-09-14 17:08:22 -07:00
Pirama Arumuga Nainar 7eaef8a494 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
2016-09-06 13:49:07 -07:00
Eyal Lezmy cdf8fba6a1 Merge "Precise command constants on adb/protoxol.txt" am: 85a78f19b1 am: f8188895a1
am: 7bcc5bd0d0

Change-Id: Ic9d0fd2fc6336ac0c2883e32983c855e10dc4a95
2016-09-06 05:19:15 +00:00
Eyal Lezmy 7bcc5bd0d0 Merge "Precise command constants on adb/protoxol.txt" am: 85a78f19b1
am: f8188895a1

Change-Id: Iaf6f8f2b7a13f733d8a9612ada75876031938a9d
2016-09-06 05:15:45 +00:00
Eyal Lezmy f8188895a1 Merge "Precise command constants on adb/protoxol.txt"
am: 85a78f19b1

Change-Id: Ied63c7e5fe798a646d5428aba4fdfa94cf1c53f1
2016-09-06 05:12:47 +00:00
Treehugger Robot 85a78f19b1 Merge "Precise command constants on adb/protoxol.txt" 2016-09-06 05:04:13 +00:00