Commit Graph

38707 Commits

Author SHA1 Message Date
Josh Gao d550ab0c16 Merge "adb: don't abort when connecting to the same address twice."
am: 60c6023902

Change-Id: I9fb8dd78288e4f5a3c6cc1ddb8a2cae8f2b81fce
2018-04-04 00:10:12 -07:00
Josh Gao 60c6023902 Merge "adb: don't abort when connecting to the same address twice." 2018-04-04 07:02:00 +00:00
Josh Gao c251ec55d3 adb: don't abort when connecting to the same address twice.
When connecting to an address, we construct a transport first, and then
check whether we've already connected to that address. The consequent
destruction of the BlockingConnectionAdapter attempts to join threads
that haven't been started, which aborts.

Make it safe to destruct a BlockingConnectionAdapter without calling
Start on it first, to solve this.

Bug: http://b/69137547
Test: nc -l 12345 & (adb connect localhost:12345; adb connect localhost:12345)
Test: python test_adb.py
Change-Id: I6cb968a62dbac6332907e06575893d764905ee62
2018-04-03 13:58:21 -07:00
Hridya Valsaraju 0f217b52b4 Merge "Add a header-version argument to fastboot"
am: a10d40e2b2

Change-Id: I1fc1ed567bd269c9ab32d810ba63489457416ab2
2018-04-03 11:45:44 -07:00
Treehugger Robot a10d40e2b2 Merge "Add a header-version argument to fastboot" 2018-04-03 18:33:57 +00:00
Josh Gao 606c83bcab Merge changes Iff1ec14b,I32123c51,I517dbcba,Ic215c7fe
am: b9b967e2fc

Change-Id: Ia0c1c07dcc2ddfae072cb43a20960efe0de7e951
2018-04-02 18:53:43 -07:00
Josh Gao b9b967e2fc Merge changes Iff1ec14b,I32123c51,I517dbcba,Ic215c7fe
* changes:
  adb: try harder to fill our test sockets.
  adb: don't set has_write_error on success.
  adb: move ownership of the fdevent thread into FdeventTest.
  adb: guarantee that fdevent_run_on_main_thread happens last.
2018-04-03 01:44:14 +00:00
Elliott Hughes 3cdbced862 Merge "Improve fastboot verbose output."
am: be5332d236

Change-Id: I16cb4351bf9f9e6aa9f8de3b28bfff63a82c3f6a
2018-04-02 18:10:55 -07:00
Elliott Hughes be5332d236 Merge "Improve fastboot verbose output." 2018-04-03 00:58:33 +00:00
Hridya Valsaraju 7d824136ae Add a header-version argument to fastboot
The argument would set the boot header
version for flash:raw and boot
commands when they are used for boot
image creation.

Bug: 77154616
Test: Dumped the created boot image and checked
the header version using unpack_bootimg

Change-Id: I2c458996817615f4351db102b4234984108d47c0
Merged-In: I2c458996817615f4351db102b4234984108d47c0
(cherry picked from commit 88de5556ec)
2018-04-02 16:00:59 -07:00
Elliott Hughes 855cdf82f5 Improve fastboot verbose output.
Move some verbose messages so they're only output with -v.

Remove some misleading verbose messages altogether (such as "wiping
userdata...").

Properly log all the commands sent and responses received. Example:

  $ fastboot -v flashall
  ...
  Sending sparse 'system' 2/2 (443712 KB)
  fastboot: verbose: sending command "download:1b1500d0"
  fastboot: verbose: received DATA 1b1500d0
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (165596160 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (267762688 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (20978688 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (7168 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (3072 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (3072 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (3072 bytes)
  fastboot: verbose: sending data (208 bytes)
  fastboot: verbose: received OKAY
  OKAY [ 13.871s]
  Writing sparse 'system' 2/2
  fastboot: verbose: sending command "flash:system"
  fastboot: verbose: received OKAY
  OKAY [  3.228s]
  Rebooting
  fastboot: verbose: sending command "reboot"
  fastboot: verbose: received OKAY

  Finished. Total time: 36.939s

Bug: http://b/30953083
Bug: http://b/74444116
Test: `fastboot -v flashall`
Change-Id: I2cca198daa062fd1fb732218343263803b111e38
2018-04-02 14:28:18 -07:00
Josh Gao 7651eb9ef7 adb: try harder to fill our test sockets.
On platforms that implement sockets via underlying sockets (e.g. Wine),
a socket can appear to be full, and then become available for writes
again without read being called on the other end. Add a sleep after
each write to give the underlying implementation time to flush.

This doesn't help us if the buffer size is smaller than MAX_PAYLOAD,
but at least in the case of Wine, that doesn't seem to be the case.

Test: adb_test
Test: wine adb_test.exe
Change-Id: Iff1ec14bbf318b9742ec7e2fb72e34e3d6bbe6ad
2018-04-02 14:18:50 -07:00
Josh Gao 954e1280d7 adb: don't set has_write_error on success.
Whoops.

Test: adb_test
Change-Id: I32123c51446a22d4423eef0753b0a0b00b500a90
2018-04-02 14:18:27 -07:00
Elliott Hughes a6905f79b7 Merge "Modernize fastboot output format."
am: 194e27bf5e

Change-Id: Ibeb6efa19597998c8b391b22f97fc336f242c193
2018-04-02 21:04:37 +00:00
Elliott Hughes 194e27bf5e Merge "Modernize fastboot output format." 2018-04-02 20:47:53 +00:00
Elliott Hughes f238d8751b Modernize fastboot output format.
After:

  --------------------------------------------
  Bootloader Version...: 0.5
  Baseband Version.....: 0.5
  Serial Number........: serialv1.0
  --------------------------------------------
  Checking product                                   OKAY [  0.032s]
  Sending 'boot' (9962 KB)                           OKAY [  0.350s]
  Writing 'boot'                                     OKAY [  0.143s]
  Sending 'dts' (14 KB)                              OKAY [  0.068s]
  Writing 'dts'                                      OKAY [  0.048s]
  Sending sparse 'system' 1/2 (460796 KB)            OKAY [ 14.383s]
  Writing sparse 'system' 1/2                        OKAY [  4.138s]
  Sending sparse 'system' 2/2 (443712 KB)            OKAY [ 13.871s]
  Writing sparse 'system' 2/2                        OKAY [  3.246s]
  Rebooting
  Finished. Total time: 36.962s

For a failure:

  extracting android-info.txt (0 MB) to RAM...
  --------------------------------------------
  Bootloader Version...: 0.5
  Baseband Version.....: 0.5
  Serial Number........: serialv1.0
  --------------------------------------------
  Checking product                                   FAILED

  Device product is 'hikey960'.
  Update requires 'marlin' or 'sailfish'.

  fastboot: error: requirements not met!

This change also adds a -v/--verbose flag, but doesn't make much use of
it yet (http://b/30953083 will need it).

Bug: N/A
Test: manual
Change-Id: I7d19f5775859ffad5f3be5707b37dcb6e180917f
2018-04-02 11:01:48 -07:00
Tao Bao 30dcecc170 Merge "Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr."
am: b7ba61ffc5

Change-Id: I1d8bc6b6a7854af694c9eb642953c40d7521a2d0
2018-03-31 17:15:51 +00:00
Tao Bao b7ba61ffc5 Merge "Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr." 2018-03-31 17:03:25 +00:00
Jayant Chowdhary 478c7c1eaf Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr.
Bug: 74763691

Test: m -j libmkbootimg creates libmkbootimg.so.lsdump.

Test: make -j64

Change-Id: I8d716c560467aaf090f4f7ee9cfbc53a9405f05d
(cherry picked from commit 4cc755dce5)
2018-03-31 07:13:33 -07:00
Josh Gao 7ab55713cc adb: move ownership of the fdevent thread into FdeventTest.
Previously, each of the tests was spawning the fdevent thread manually,
in order to be able to set up listeners and such before running
fdevent_loop. Now that we have a way to run arbitrary code on the
fdevent thread, switch to having a generic fdevent thread and running
setup code via fdevent_run_on_main_thread.

Test: adb_test
Test: wine adb_test.exe
Change-Id: I517dbcbad31067b45087d9fbed67a75b75a75aec
2018-03-30 14:57:09 -07:00
Josh Gao 3504d5a535 Merge changes I06ccca30,Iee86b058
am: e6ae06e687

Change-Id: Ie3ee46a42b05b9bfda3eb5233fe57721635baed9
2018-03-30 21:49:23 +00:00
Josh Gao fa30bf3932 adb: guarantee that fdevent_run_on_main_thread happens last.
Make it so that we handle run_on_main_thread calls after regular socket
events, so that we can use it as a way to ensure we've processed all
pending socket events.

Test: adb_test
Test: wine adb_test.exe
Change-Id: Ic215c7fed19a8e1699e759970658b3775aa08c45
2018-03-30 14:38:25 -07:00
Josh Gao e6ae06e687 Merge changes I06ccca30,Iee86b058
* changes:
  adb: fix FdeventTest.invalid_fd on Windows.
  adb: extract the sleep in socket_test to its own function.
2018-03-30 21:38:16 +00:00
Paul Crowley 1df4cee2d1 Merge "Support Speck encryption."
am: 14da8f607f

Change-Id: I3914b1d09fbb3ba234b0f56488e5aacd622280b0
2018-03-30 21:03:09 +00:00
Treehugger Robot 14da8f607f Merge "Support Speck encryption." 2018-03-30 20:51:14 +00:00
Paul Crowley e640bc1b88 Support Speck encryption.
Test: Modified Pixel to support and use Speck encryption, booted.
Bug: 77227248
Change-Id: I6ec272db5e4f16e9dd4f759203c14ad2a8772cd1
Merged-In: I6ec272db5e4f16e9dd4f759203c14ad2a8772cd1
2018-03-30 10:18:46 -07:00
Logan Chien 1cf05129c0 Merge "Allow VNDK-SP extensions to use vendor lib"
am: 602af1c488

Change-Id: Ieb4175ab866b48d6b0474066329891020ebe6563
2018-03-30 08:32:45 +00:00
Logan Chien 602af1c488 Merge "Allow VNDK-SP extensions to use vendor lib" 2018-03-30 07:14:51 +00:00
Jaekyun Seok 63e16c228e Merge "Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode"
am: a5bf7bad2c

Change-Id: I804fb0889f947d041be38ca2138eab99296536de
2018-03-29 22:08:17 +00:00
Ajit Kumar 57b06ffb3d Merge "Enabled SYS_MODULE capability for wifi@1.0-service"
am: 61896fc0ee

Change-Id: I094569ea9db01288af4501c4d16c0d915ca24484
2018-03-29 22:00:55 +00:00
Josh Gao 05fb45be17 adb: fix FdeventTest.invalid_fd on Windows.
Bail out immediately in our poll emulation if we have any invalid file
descriptors, instead of actually calling WSAPoll (which might block
forever).

Test: wine adb_test.exe
Change-Id: I06ccca305783ee7a1721b1585ddf73e022bd02d7
2018-03-29 14:24:03 -07:00
Treehugger Robot a5bf7bad2c Merge "Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode" 2018-03-29 21:12:46 +00:00
Treehugger Robot 61896fc0ee Merge "Enabled SYS_MODULE capability for wifi@1.0-service" 2018-03-29 20:57:42 +00:00
Josh Gao a7a66f40fd Merge "adbd: spawn login shell when run without a command."
am: 31ed2a5c04

Change-Id: I133b09a0a153cb660186126106bceca76b0cba24
2018-03-29 20:35:27 +00:00
Josh Gao 1919289d12 Merge "adbd: increase oom_score_adj for `adb shell`"
am: db9671090d

Change-Id: I728eb8d2ab2e2fe1e06e5aa5681ef57c655184b1
2018-03-29 20:34:54 +00:00
Josh Gao b0d408f2f3 Merge "adb: restore adb/adb.exe in the list of artifacts."
am: 8043633922

Change-Id: I911bcee4317a7854a1e694923f7f35415931e2a2
2018-03-29 20:34:30 +00:00
Josh Gao fd7486fb42 adb: extract the sleep in socket_test to its own function.
Make it easier to replace the sleep with something that actually waits
for the event loop to quiesce.

Test: adb_test
Change-Id: Iee86b058abbb607256dbfce43d8c70252b6bb0f6
2018-03-29 13:21:58 -07:00
Josh Gao 31ed2a5c04 Merge "adbd: spawn login shell when run without a command." 2018-03-29 20:19:27 +00:00
Josh Gao db9671090d Merge "adbd: increase oom_score_adj for `adb shell`" 2018-03-29 20:19:03 +00:00
Josh Gao 8043633922 Merge "adb: restore adb/adb.exe in the list of artifacts." 2018-03-29 20:18:58 +00:00
Ajit Kumar b0fc2d743b Enabled SYS_MODULE capability for wifi@1.0-service
Add sys_module capability to enabled insmod operation.

Merged-In: I6436c3297e5318bd00ae3582549a11cb82ccbafd
Change-Id: I6436c3297e5318bd00ae3582549a11cb82ccbafd
(cherry picked from commit c2a059fbf0)
2018-03-29 19:34:06 +00:00
Christopher Ferris 3b9e1866c4 Merge "Cache DWARF location rules for a given pc."
am: 95a524460a

Change-Id: I8374f20b4e20b01347023ea2703d5d8cf522fe26
2018-03-29 14:56:43 +00:00
Christopher Ferris 95a524460a Merge "Cache DWARF location rules for a given pc." 2018-03-29 14:47:35 +00:00
David Srbecky 3386ebade2 Cache DWARF location rules for a given pc.
Decoding the DWARF opcodes is expensive so make sure we cache it.

This speeds unwinding in simpleperf by over a factor of 3x.

Add unit tests for this new behavior.

Bug: 77258731

Test: libbacktrace/libunwindstack unit tests on host and target.
Test: Ran debuggerd -b on various processes on target.
Change-Id: Ia516c0fa5d3e5f76746190bb4b6fdf49fd1c9388
2018-03-29 14:47:13 +00:00
Logan Chien 8667747a0e Allow VNDK-SP extensions to use vendor lib
This commit adds a wildcard linker namespace link between the "vndk"
namespace and the "sphal" namespace of the system processes.  This is
created for VNDK-SP-Ext to load vendor libs in "sphal" namespace.

Bug: 77249955
Test: lunch aosp_walleye-userdebug && make -j8  # runs unit tests
Test: lunch aosp_sailfish-userdebug && make -j8  # runs unit tests
Test: Create a VNDK-SP-Ext, link to vendor libs, and run it.
Change-Id: I71b0fb604a84272156aa119130c272f891847008
2018-03-29 17:18:40 +08:00
Jaekyun Seok 1f90ccefb6 Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode
ro.board.platform and sys.boot_from_charger_mode are already
public-readable, but they should be used as action triggers as well for
some products including Android Go devices.

Bug: 75987246
Test: succeeded building and tested with taimen
Change-Id: I140a8f7ef3fa9823ceced94b00a413800518c240
2018-03-29 14:54:51 +09:00
Christopher Ferris 80e8231a0b Merge "Fix null pointer dereference in RegsArm."
am: 85d9e67361

Change-Id: Ic560cfe4af12ad43ba6a03bacb54e25ebd60e31f
2018-03-29 03:31:40 +00:00
Christopher Ferris 85d9e67361 Merge "Fix null pointer dereference in RegsArm." 2018-03-29 03:22:57 +00:00
Elliott Hughes 4531d73c0a Merge "OWNERS for system/core/mkbootimg."
am: 77a61d3e6e

Change-Id: I8950d17b8fef16ada60e279fb549cd50c71b13e5
2018-03-29 01:37:56 +00:00
Treehugger Robot 77a61d3e6e Merge "OWNERS for system/core/mkbootimg." 2018-03-29 00:46:36 +00:00