Commit graph

3201 commits

Author SHA1 Message Date
Josh Gao
3f06c2ba19 adb: fdevent: move run queue to fdevent_context.
am: 95eef6b097

Change-Id: I131984a407220281364c016f832aef45e0f9a457
2019-07-09 13:37:20 -07:00
Josh Gao
8935c1c89f adb: implement fdevent_reset by constructing a new context.
am: 7adca93fe9

Change-Id: Iefd84fb5453ed757feb3b8431c7b31f99e39541e
2019-07-09 13:36:59 -07:00
Josh Gao
e62c2c2485 adb: move fdevent implementation out to a separate file.
am: 95068bbd9a

Change-Id: I4000e495ab9f73863fa7cf8ce5d4742e43a4b020
2019-07-09 13:36:44 -07:00
Josh Gao
b0168bcb04 adb: de-globalize fdevent context.
am: c2cf121174

Change-Id: Ic01cd85b2742ff73399007431f696b0dc372ef50
2019-07-09 13:36:04 -07:00
Josh Gao
261569d533 adb: move fdevent to its own folder.
am: 57e09b16ca

Change-Id: I1f9e0da9a94c8889c378e8ca9dd9b37a48dca58b
2019-07-09 13:35:38 -07:00
Justin Yun
6069891e84 Merge "Rename product_services to system_ext"
am: 5ffffb4f30

Change-Id: I4bdddd6074461f1db7f6be85120ad5f32f45fbb3
2019-07-09 02:15:04 -07:00
Justin Yun
5d0ac62995 Rename product_services to system_ext
Update adb, fastboot and mount point

Bug: 134359158
Test: build and check if system_ext.img can be flashed
Change-Id: I6219f72242c5fe42a508008c0b1fd218d74da5b6
2019-07-09 08:56:53 +00:00
Josh Gao
95eef6b097 adb: fdevent: move run queue to fdevent_context.
Make the run queue logic reusable between implementations of fdevent by
moving it to the abstract base class.

Test: adb_test
Change-Id: If2f72e3ddc8007304bca63aa75446fa117267b25
2019-07-08 18:05:47 -07:00
Josh Gao
7adca93fe9 adb: implement fdevent_reset by constructing a new context.
Test: adb_test
Change-Id: Ie67afafe2b73fb2a8fc08568560adac6f456eb9a
2019-07-08 17:32:14 -07:00
Alex Buynytskyy
339fcd996a Merge "Refactorings to match adb_abb to adb_shell code."
am: 463773b733

Change-Id: Ia4724a38e8474bbae94c640ccd9cb3cf7d8f1915
2019-07-08 17:19:47 -07:00
Josh Gao
95068bbd9a adb: move fdevent implementation out to a separate file.
Test: mma
Change-Id: I8af945b9ae0accac75fa93c538e44cbab357bb5d
2019-07-08 16:03:27 -07:00
Josh Gao
c2cf121174 adb: de-globalize fdevent context.
Test: adb_test
Test: adbd_test
Change-Id: If711257d831b9090b38412821466c1d358d53d2d
2019-07-08 14:37:27 -07:00
Josh Gao
57e09b16ca adb: move fdevent to its own folder.
Preparatory refactoring for platform-specific implementations.

Test: mma
Change-Id: I0f600122ac89241788c5f3300f362fd9ef02ddcd
2019-07-08 14:37:27 -07:00
Josh Gao
2d03ad42ed adb: add superfluous include.
Resolve a merge conflict between internal and aosp by making aosp look
like internal.

Test: none
Change-Id: I7bea6ab61ad45ff20a3d07abf3f73903a7c05585
Merged-In: If73b81ca73ba4d64763cf49c1bbe42de81fa1cb6
2019-07-08 14:37:27 -07:00
Alex Buynytskyy
cc2f124070 Refactorings to match adb_abb to adb_shell code.
Test: Build, flash and boot, use `adb abb` to verify

Change-Id: I30eb6e8a4fd43b1548a9398376c72e2cb31223a4
2019-07-08 18:30:26 +00:00
Josh Gao
22c98da7e7 Merge "adbd: move jdwp listening logic into ART." am: d194013097
am: 56d33633c2

Change-Id: I40666175760849bd27a94437422559f7b9caba7f
2019-06-28 12:17:22 -07:00
Josh Gao
d194013097 Merge "adbd: move jdwp listening logic into ART." 2019-06-28 19:01:38 +00:00
Josh Gao
5f2c5bbd04 adbd: move jdwp listening logic into ART.
Test: manually use jdwp
Change-Id: Ia09a5c643cba9ec5f343c9767d43d72b077bc247
2019-06-25 12:37:20 -07:00
Dan Albert
134c98814a Revert "adb: daemon: Assign valid fd to usb_handle ep0 file descriptor"
am: ba4684c2b2

Change-Id: I030ce911424f7315cd3b9c4f299b4232ee81e9aa
2019-06-25 08:01:04 -07:00
Dan Albert
38bdc11d4b Revert "adb: turn CHECKs into an error + transport restart."
am: 2547f740ea

Change-Id: I6855ae62f61d9d1cc234dd15de5ce4a3b39d6faf
2019-06-25 08:01:00 -07:00
Elliott Hughes
7d9841a07c Merge "Revert "Reland "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND.""" am: 12794c039a
am: 6c79fd22be

Change-Id: Iafcc88c0441225d9279ff145c718be77851d639b
2019-06-24 23:34:54 -07:00
Elliott Hughes
12794c039a Merge "Revert "Reland "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND.""" 2019-06-25 05:56:53 +00:00
Elliott Hughes
fab9f30f6f Revert "Reland "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND.""
This reverts commit b00e66f754.

Reason for revert: http://b/135753060

Change-Id: I30f472427f52076b64902420f9538b4a880a2cbe
2019-06-25 05:42:55 +00:00
Dan Albert
ba4684c2b2 Revert "adb: daemon: Assign valid fd to usb_handle ep0 file descriptor"
This reverts commit b2d79c5e48.

Bug: http://b/135753060
Test: treehugger
Change-Id: I2b1b2b7dfb7bab783e4ed40e295329525ceaa0dd
2019-06-24 14:36:43 -07:00
Dan Albert
2547f740ea Revert "adb: turn CHECKs into an error + transport restart."
This reverts commit b41d7ae1a9.

Bug: http://b/135753060
Test: treehugger
Change-Id: Ib7cd7b7eaffa55ec2884a096a1c11739b12af6d1
2019-06-24 14:36:41 -07:00
Dan Albert
782036b7af Revert "Reland "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND.""
This reverts commit c33aee8ac1.

Bug: http://b/135753060
Test: treehugger
Change-Id: Ic83a44e7c8f860a6c044ca20ec81f365a8a6ba4b
2019-06-24 14:36:31 -07:00
Josh Gao
c33aee8ac1 Reland "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND."
Read until we receive FUNCTIONFS_BIND after every USB descriptor setup,
instead of only after initial creation of the control fd, so we properly
handle a rebind caused by a change of the USB configuration.

This reverts commit 55b31933f41b1c550b788fa2054010c51f56111b.

Bug: http://b/133132986
Bug: http://b/135155652
Test: manually enabled/disabled MTP with nonblocking_ffs enabled and disabled
Change-Id: Ibb3f46b8f84854ede47a669a85e07e16a5dd6008
Merged-In: Ibb3f46b8f84854ede47a669a85e07e16a5dd6008
(cherry picked from commit b00e66f754)
2019-06-21 14:29:21 -07:00
Josh Gao
b2e5ca2328 Merge "Reland "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND."" am: 2a6ec6c332
am: 5c7c698a97

Change-Id: I94222297a504954ddca5f6ec9b3f7a077e4d0647
2019-06-20 20:02:58 -07:00
Josh Gao
2a6ec6c332 Merge "Reland "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND."" 2019-06-21 02:36:56 +00:00
Josh Gao
b41d7ae1a9 adb: turn CHECKs into an error + transport restart.
These CHECKs are expected to happen if the client does the wrong thing,
so we probably shouldn't be aborting in adbd.

Bug: http://b/133872605
Bug: http://b/134695864
Test: treehugger
Change-Id: I875b87a06ba9d399db26f8af1ad47ccf34e9445a
Merged-In: I875b87a06ba9d399db26f8af1ad47ccf34e9445a
(cherry picked from commit fc0f80ae49)
2019-06-19 15:01:02 -07:00
Josh Gao
b2ea09115c Merge "adb: turn CHECKs into an error + transport restart." am: ad0f27fe72
am: 7373282999

Change-Id: I60415fb9fefb59585e27ba4181a9a69168709758
2019-06-18 21:28:08 -07:00
Treehugger Robot
ad0f27fe72 Merge "adb: turn CHECKs into an error + transport restart." 2019-06-19 00:11:49 +00:00
Josh Gao
b00e66f754 Reland "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND."
Read until we receive FUNCTIONFS_BIND after every USB descriptor setup,
instead of only after initial creation of the control fd, so we properly
handle a rebind caused by a change of the USB configuration.

This reverts commit 55b31933f41b1c550b788fa2054010c51f56111b.

Bug: http://b/133132986
Bug: http://b/135155652
Test: manually enabled/disabled MTP with nonblocking_ffs enabled and disabled
Change-Id: Ibb3f46b8f84854ede47a669a85e07e16a5dd6008
2019-06-18 15:00:15 -07:00
Josh Gao
7c3b87ffd2 Merge "Revert "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND."" am: a6f90ce599
am: 099fc95530

Change-Id: Iaa1d67735ed8a4c582c42b630cf90c2c384fd2f6
2019-06-14 16:55:35 -07:00
Josh Gao
9dba0f5824 Revert "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND."
We're only reading FUNCTIONFS_BIND on creation upon the first creation
of the control fd, which results in an abort when rebind happens (e.g.
when MTP is enabled) and we unexpectedly read FUNCTIONFS_BIND in the
second instantiation of the connection.

This reverts commit 2b668d3906.

Bug: http://b/135155652
Test: manually enabled MTP
2019-06-14 16:21:21 -07:00
Josh Gao
fc0f80ae49 adb: turn CHECKs into an error + transport restart.
These CHECKs are expected to happen if the client does the wrong thing,
so we probably shouldn't be aborting in adbd.

Bug: http://b/133872605
Bug: http://b/134695864
Test: treehugger
Change-Id: I875b87a06ba9d399db26f8af1ad47ccf34e9445a
2019-06-13 13:16:57 -07:00
Hemant Kumar
b2d79c5e48 adb: daemon: Assign valid fd to usb_handle ep0 file descriptor
Bug: http://b/129283234
Test: treehugger
Change-Id: I2d005e17ccb45af95351c074cc53f6cfc53b5fdd
Merged-In: I2d005e17ccb45af95351c074cc53f6cfc53b5fdd
(cherry picked from commit 1cbe5edbc3)
2019-06-13 12:38:19 -07:00
Josh Gao
db51d08cc8 Merge "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND." am: cb2352a75d
am: b965eea9c6

Change-Id: I81d74942931f8ede3e0c29d1ecef08d3f4f8149c
2019-06-12 07:53:09 -07:00
Treehugger Robot
cb2352a75d Merge "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND." 2019-06-12 14:34:14 +00:00
Josh Gao
2b668d3906 adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND.
Rework the functionfs logic to avoid rebinding the USB interface
repeatedly.

Bug: http://b/133132986
Test: treehugger
Change-Id: I7f75874efd197764d40b66800a117ff4726d793b
2019-06-11 20:33:16 -07:00
Josh Gao
bcb3f13d00 Merge "adb: avoid freeing argv entries on Windows." am: 5b63cff411
am: c62f2aca24

Change-Id: Icbb6320d1399efe48efaa8c7a45789b42f63b049
2019-06-10 19:00:44 -07:00
Josh Gao
e72c44b24a adb: avoid freeing argv entries on Windows.
We assign string literals directly to argv[0], which leads to fun
explosions when we attempt to free  when the runtime can detect that
a bad free happened, which seems to happen reliably with lld.

Bug: http://b/110800681
Test: `adb shell true` on windows
Change-Id: Ica81e472c31686d80b58c41ff6d2b825baef06fb
2019-06-10 12:54:14 -07:00
Tao Bao
73a810993d Merge "adb: Allow adb rescue getprop." am: 8eea2cae86
am: a04d17174d

Change-Id: Iedcc4f3337e2c77bd21a8a8ac9f302a20f568660
2019-06-05 14:12:51 -07:00
Tao Bao
8eea2cae86 Merge "adb: Allow adb rescue getprop." 2019-06-05 20:43:55 +00:00
Josh Gao
8e707dede9 Merge changes I2d005e17,If2eec162,Icfd642e6 am: 2683d0a2ca
am: 961b03661a

Change-Id: I8a6957e1944389d2d6b162fdc8d97b430f353fbe
2019-06-04 19:31:37 -07:00
Josh Gao
a00228b646 Merge "adbd: provide MS OS descriptors for WinUSB." am: a891ffddd3
am: 91aa2ef730

Change-Id: I6c6e0675358e748c1228ce87626726fdccb2f533
2019-06-04 19:25:24 -07:00
Tao Bao
599eee1f37 adb: Allow adb rescue getprop.
Which will dump all the allowed properties, similar to `adb shell
getprop`.

Bug: 134027350
Test: Run the command under rescue mode.
Change-Id: Id668224098006d71ee192c8c2bea5d791d2423c1
2019-06-04 14:59:58 -07:00
Josh Gao
2683d0a2ca Merge changes I2d005e17,If2eec162,Icfd642e6
* changes:
  adb: daemon: Assign valid fd to usb_handle ep0 file descriptor
  adbd: respond to device-to-host control transfers.
  adbd: read, print, and ignore USB control transfers.
2019-06-04 19:22:08 +00:00
Josh Gao
a891ffddd3 Merge "adbd: provide MS OS descriptors for WinUSB." 2019-06-04 19:22:00 +00:00
Mohammad Samiul Islam
361a99a3c4 Merge "Allow adb to handle single paramter with install-multi-package flag" am: d877a96656
am: c625e74d88

Change-Id: Ibbe33e4a9290b5e3b40898f7c75e58982ce47ae7
2019-06-03 16:04:00 -07:00