Commit graph

2517 commits

Author SHA1 Message Date
Elliott Hughes
d59c04eb8b Merge "Set $HOSTNAME in adbd." am: 2364d7ccc5 am: 510552149c
am: 3ef8d2abca

Change-Id: Ib5fa7548a2ef15d3d78fdcabb2b66ce3e3a947f1
2017-10-03 22:46:17 +00:00
Elliott Hughes
510552149c Merge "Set $HOSTNAME in adbd."
am: 2364d7ccc5

Change-Id: I40ef480380f250540d6c2856721540400c599111
2017-10-03 22:32:13 +00:00
Elliott Hughes
ba4d9fd933 Set $HOSTNAME in adbd.
bash sets this itself, but mksh doesn't.

This also makes interactive and non-interactive adb shells more similar,
because when we set this in mkshrc that wouldn't affect non-interactive
shells. (I'm not sure whether this is an improvement or not.)

This is certainly _cheaper_ than doing this in mkshrc by calling out to
getprop though.

Bug: N/A
Test: `adb shell printenv` and `adb shell`, `printenv`
Change-Id: I3ff724f19a5098313df83836253f1f7e7872d6a4
2017-10-03 08:44:27 -07:00
Josh Gao
3f9db04479 Merge "adb: remove SendConnectOnHost." am: 5eaa5bc081 am: 86a919041f
am: c2bf22f58e

Change-Id: Iff7993e9fc1ee932497f190e04a71d05784397eb
2017-10-02 23:37:08 +00:00
Josh Gao
86a919041f Merge "adb: remove SendConnectOnHost."
am: 5eaa5bc081

Change-Id: I899558eb51cda69d9c53288db86cada87a4a0e85
2017-10-02 23:32:49 +00:00
Treehugger Robot
5eaa5bc081 Merge "adb: remove SendConnectOnHost." 2017-10-02 23:27:23 +00:00
Josh Gao
4b5d4da6f6 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: http://b/32952319
Test: python test_device.py
Change-Id: I392198af3d72c524b893e5056afa2b4617cea49c
2017-10-02 14:38:03 -07:00
Josh Gao
56406c49c9 Merge "adbd: improve thread names." am: 39071a5177 am: bc3d3625d5
am: 3b140f2081

Change-Id: I7ffbccc51da291fa81d2e86ca7671fc077c5ddb9
2017-09-30 01:14:48 +00:00
Josh Gao
bc3d3625d5 Merge "adbd: improve thread names."
am: 39071a5177

Change-Id: Id41804332dfb81a2bcfd07d3a7180f16e7412bc0
2017-09-29 18:34:17 +00:00
Josh Gao
bcadc77550 adbd: improve thread names.
Name each service thread specifically to improve debuggability.

Bug: http://b/65648324
Test: adb shell debuggerd -b `adb shell pidof adbd` during a sync
Change-Id: I644e25fc2f14a26eafd19f596e4e8f3c2bb79967
2017-09-28 16:45:24 -07:00
Josh Gao
294a3e42f4 Merge "adb: partially revert b5e11415." am: ef9426d883 am: d3f7956f2f
am: e8526de60b

Change-Id: I079da0c338d18191182ad93d31c93d00ec11db64
2017-09-27 18:51:19 +00:00
Josh Gao
d3f7956f2f Merge "adb: partially revert b5e11415."
am: ef9426d883

Change-Id: I3f7fa1577bc79b5bdcacbeacc7b5141cc9c73cb9
2017-09-27 18:45:18 +00:00
Treehugger Robot
ef9426d883 Merge "adb: partially revert b5e11415." 2017-09-27 18:38:28 +00:00
Tom Cherry
99de249cf5 Merge "Reland "Remove comments and code about ro.boot.slot"" am: dea5e081ac am: 9bc2a967cf
am: 687cb99e96

Change-Id: I1d3a43ae6c7faeb9830e64ff6ba2da18965b9c34
2017-09-26 00:13:27 +00:00
Tom Cherry
9bc2a967cf Merge "Reland "Remove comments and code about ro.boot.slot""
am: dea5e081ac

Change-Id: Idf32e9600b6a3b93a6a2b4c414cc0193d5d65fb9
2017-09-26 00:08:55 +00:00
Tom Cherry
211a4a5d5a Reland "Remove comments and code about ro.boot.slot"
This reverts commit c5f5fd430a.

Dependencies are now merged.

Bug: 37663204
Bug: 66437505
Change-Id: I84284b6bc37f6aae4096dec73f45ebd85d28ca9d
2017-09-25 16:04:30 +00:00
Tom Cherry
b616ea4068 Merge "Revert "Remove comments and code about ro.boot.slot"" am: eb00b1f3aa am: 0ff5f16f7b
am: aea4f28852

Change-Id: Ia2959362f8a48e1d3638a76e9c72f04d276cd5bc
2017-09-21 18:51:15 +00:00
Tom Cherry
0ff5f16f7b Merge "Revert "Remove comments and code about ro.boot.slot""
am: eb00b1f3aa

Change-Id: If6b511a19009e28a63b52e6701dbc8f7b1f514f7
2017-09-21 18:46:44 +00:00
Tom Cherry
c5f5fd430a Revert "Remove comments and code about ro.boot.slot"
This reverts commit f4ec2c50a3.

Dependencies hadn't been merged yet.

Bug: 66437505
Change-Id: I7551b7f2f184a6fefc39e184a42dc8d323c58b89
2017-09-21 18:37:22 +00:00
Tom Cherry
897fab0545 Merge "Remove comments and code about ro.boot.slot" am: 7dcf076700 am: bf6168fd53
am: 26d09e3b7c

Change-Id: I08a4e0ea745f9471e7aabdc579c423528e60103b
2017-09-20 19:31:17 +00:00
Tom Cherry
bf6168fd53 Merge "Remove comments and code about ro.boot.slot"
am: 7dcf076700

Change-Id: Ic28c5bd369d45489150741b1c1cf2b4c00c4eb52
2017-09-20 19:27:43 +00:00
Tom Cherry
f4ec2c50a3 Remove comments and code about ro.boot.slot
ro.boot.slot_suffix is the correct parameter.

Bug: 37663204
Test: boot sailfish
Change-Id: I72f94b3c611a2280d0732321dd8de88b0530a3cd
2017-09-20 10:14:44 -07:00
Josh Gao
2b97b03ba1 Merge changes I0ed00441,I12d46493,Ib484f701 am: 0a01830612 am: 1425641300
am: da20ef4684

Change-Id: I0f5508a13fcf46cd51ca556c13fc43798d4a6fe7
2017-09-14 20:42:30 +00:00
Josh Gao
1425641300 Merge changes I0ed00441,I12d46493,Ib484f701
am: 0a01830612

Change-Id: I8b4566f0daea2181227facea12d82ffd566889b5
2017-09-14 20:35:31 +00:00
Josh Gao
0a01830612 Merge changes I0ed00441,I12d46493,Ib484f701
* changes:
  Revert "adb: fix deadlock between transport_unref and usb_close."
  adb: add lock to remove_socket.
  adb: reformat comments.
2017-09-14 20:04:42 +00:00
Mark Salyzyn
9c017432de Merge changes from topic "b/63736262" am: 1f666a6be9 am: 6818f80dbb
am: 7a5c52f78f

Change-Id: I13577d905dc6c0e6d873e23663c4da01531b2267
2017-09-14 00:52:10 +00:00
Mark Salyzyn
6818f80dbb Merge changes from topic "b/63736262"
am: 1f666a6be9

Change-Id: I2586aac3d6fe8252ee6728de64fb37102accf0da
2017-09-13 22:45:52 +00:00
Josh Gao
33d14b8748 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.

Test: python test_devices.py
Change-Id: Ie7c958799c93cad287c32d6bbef30c07f40c2d51
2017-09-13 15:09:40 -07:00
Josh Gao
e48ecce671 Revert "adb: fix deadlock between transport_unref and usb_close."
This reverts commit 7e197ef833.

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
Test: python test_device.py
Change-Id: I0ed0044129b1671b2c5dd1b9fa2e70a9b4475dc5
2017-09-13 14:31:14 -07:00
Josh Gao
62c92f0c05 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
Test: python test_device.py
Change-Id: I12d464933936b2a210a827ccf19ea201020d8d78
2017-09-13 14:05:39 -07:00
Josh Gao
55c8b34f14 adb: reformat comments.
Test: none
Change-Id: Ib484f701f66cdb57f303dbd6d5eb2e5a15abdc0e
2017-09-13 14:05:21 -07:00
Mark Salyzyn
277eca138b adb: reboot: last boot command default
For reboot [reboot_arg] requests via either reboot or adb reboot,
if reboot_arg is empty then report "shell" or "adb" respectively.

Test: boot_reason_test.sh shell_reboot adb_reboot
Bug: 63736262
Change-Id: Ie613d9e62db6a705885e4e7520aede27af3aa1b9
2017-09-12 12:24:02 -07:00
Bowgo Tsai
149f9b7696 Merge "Revert "adbd: lessen security constraints when the device is unlocked"" am: 9638729a9d am: 08a8c4209f
am: 0bf9c716bd

Change-Id: I6611368010a2cad55acbbb43fd4b6de12235f83c
2017-08-31 08:33:34 +00:00
Bowgo Tsai
08a8c4209f Merge "Revert "adbd: lessen security constraints when the device is unlocked""
am: 9638729a9d

Change-Id: I25eab992b0a4c2f144454cd5865fad1a762cfc61
2017-08-31 08:27:33 +00:00
Treehugger Robot
9638729a9d Merge "Revert "adbd: lessen security constraints when the device is unlocked"" 2017-08-31 08:21:08 +00:00
Bowgo Tsai
0603ec4294 Revert "adbd: lessen security constraints when the device is unlocked"
This reverts commit f1d3dbc32f.

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
2017-08-31 14:30:51 +08:00
Bowgo Tsai
f390f04381 Merge "Move adbd from root to system"
am: 3d6f85167e

Change-Id: I3b89a7a8e98252319f850a225ef7ba2080e54879
2017-08-31 06:30:48 +00:00
Treehugger Robot
3d6f85167e Merge "Move adbd from root to system" 2017-08-31 06:22:16 +00:00
Jerry Zhang
1171607b60 Merge "adb: Use kernel aio for functionfs." am: aaa90cfe06 am: 6fe5cda8aa
am: 9c5679caf0

Change-Id: Ic43aef9fac9cf1d82168c3fbb0c7b53328358b2e
2017-08-29 03:47:54 +00:00
Jerry Zhang
6fe5cda8aa Merge "adb: Use kernel aio for functionfs."
am: aaa90cfe06

Change-Id: Ia89f076b94c8974544923b64ea53dffd6b8c8397
2017-08-29 03:38:26 +00:00
Treehugger Robot
aaa90cfe06 Merge "adb: Use kernel aio for functionfs." 2017-08-29 03:28:26 +00:00
Josh Gao
151c4adb28 Merge "adb: improve CHECKs." am: 9f38e19b88 am: f628362478
am: 3c186bc32c

Change-Id: I4c30f4f9cd8ac92f38e6640a747227211e7fe528
2017-08-28 23:49:54 +00:00
Josh Gao
f628362478 Merge "adb: improve CHECKs."
am: 9f38e19b88

Change-Id: Icc50ced0faeda5653288922ec787311e30c5085d
2017-08-28 23:40:23 +00:00
Treehugger Robot
9f38e19b88 Merge "adb: improve CHECKs." 2017-08-28 23:35:44 +00:00
Josh Gao
e46720938d adb: improve CHECKs.
Use CHECK_LT(foo, 1234) instead of CHECK(foo < 1234) so that failing
checks have the values emitted.

Bug: http://b/65063965
Test: adb server nodaemon
Change-Id: I094287f7c4d2d177ea216568d06e9e425a28dd96
2017-08-28 14:43:24 -07:00
Josh Gao
ca5f86e084 Merge "adbd: don't spin if file sync read fails." am: 32d2eae8b9 am: 4dc1892491
am: 43898a6add

Change-Id: Icc7d13bc5e7ff2aaf63f95f046734fb77db6d72e
2017-08-28 21:26:43 +00:00
Josh Gao
4dc1892491 Merge "adbd: don't spin if file sync read fails."
am: 32d2eae8b9

Change-Id: Ie104bb8ea8d67b5a7ce896d2237a44cc8ea1ab4f
2017-08-28 21:16:13 +00:00
Josh Gao
1d6c01b53d adbd: don't spin if file sync read fails.
Bug: http://b/64508974
Test: mma
Change-Id: Ifba6a9dea3138b6d2a62c91cc0532f63986c048a
2017-08-28 11:21:31 -07:00
Bowgo Tsai
7b9a4d5bcd 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
Merged-In: I1b27910c06a4172ca718b3344736ec8e3429f477
(cherry picked from commit 93defc17f3)
2017-08-24 14:22:07 +08:00
Elliott Hughes
22d9a9a249 Merge "Fix adb tcpip tests." am: d865b655d5 am: 37f256423b
am: 7096d47858

Change-Id: I090e1011627ce618623b132e2624cc1008d2ea1f
2017-08-24 00:59:13 +00:00