Commit graph

57118 commits

Author SHA1 Message Date
Yurii Zubrytskyi
f8987c393d [cleanup] Fix a clang-tidy warning
const parameters can't be moved but only get copied -
removed const

Bug: 153704006
Test: builds & boots
Change-Id: If7e2250325bf1bc498afd3539f60bcb075a1d43b
2020-04-22 16:20:29 -07:00
Joshua Duong
8cab9b6b24 Merge changes from topic "adb-mdns-cmdline"
* changes:
  [adb client] Add "mdns services" command.
  [adb client] Add "adb mdns check" command.
2020-04-22 20:04:35 +00:00
Joshua Duong
13c639e0bb [adb client] Add "mdns services" command.
This command list all discovered mdns services, so we
can connect via service name later on.

Bug: 152521166

Test: 'adb mdns services'
Test: test_adb.py
Change-Id: I23d42a7933e67a65bd0c9924afd6abe5915c0a11
2020-04-22 08:43:15 -07:00
Joshua Duong
504d393176 [adb client] Add "adb mdns check" command.
This command will check if the mdns daemon is available on the host
machine.

Bug: 152510294

Test: pkill -9 mdnsd; adb mdns check; mdnsd; adb mdns check;
Test: test_adb.py
Change-Id: If644678a339763817a8a7adcbdc545626d161aba
2020-04-22 08:43:15 -07:00
Josh Gao
992f08e78d Merge changes I26f823e2,Iaff2b157,I82a0d54f,I7e4b6fda,I268367b8
* changes:
  adbd: improve coverage by compiling less code.
  adb: refactor and relocate coverage script.
  adbd: test TCP in coverage.
  adb: allow wait-for-disconnect to match offline for TCP devices.
  adbd: add unit tests to coverage report.
2020-04-22 03:27:47 +00:00
David Anderson
bca7d2c30a Merge "liblp: Fix tests for linear extent overlap." 2020-04-22 01:43:29 +00:00
Josh Gao
073c8d2394 adbd: improve coverage by compiling less code.
Test: ./coverage/gen_coverage.sh && ./coverage/report.sh
Change-Id: I26f823e2587435b7ec2c6ca05955adef5cfc23a0
2020-04-21 17:57:29 -07:00
Josh Gao
f099105f07 adb: refactor and relocate coverage script.
Test: ./coverage/gen_coverage.sh
Change-Id: Iaff2b1577e32ba4ec8647a418a2ff4a1e9a0835d
2020-04-21 17:57:19 -07:00
Josh Gao
79d4f148d6 adbd: test TCP in coverage.
Test: ./coverage.sh
Change-Id: I82a0d54fcc1e19585a27c2d049be40289bf15f60
2020-04-21 17:57:17 -07:00
Josh Gao
e3c62cc549 adb: allow wait-for-disconnect to match offline for TCP devices.
This fixes a bug in adb root/unroot where we always fail because we're
waiting for a TCP device to disappear.

Test: test_device.py over TCP
Change-Id: I7e4b6fdaa1070cee1f9b471de46ae00bf89b3089
2020-04-21 17:57:15 -07:00
Josh Gao
03bee48659 adbd: add unit tests to coverage report.
Test: ./coverage.sh
Change-Id: I268367b857efc2125c6714a1d0b0e874fa8d143d
2020-04-21 17:57:13 -07:00
Josh Gao
67095b28de Merge "adb: add helper binary to do a usb reset on a device." 2020-04-21 23:01:48 +00:00
David Anderson
9c66e53a82 liblp: Fix tests for linear extent overlap.
The "OwnsSector" tests did not work if one range fit completely inside
another range. The new OverlapsWith() methods address this case.

Bug: 154277287
Bug: 154646936
Test: liblp_test gtests
Change-Id: I1a59069db4ffe4f13c45963c4847cff7b3dd3dfc
2020-04-21 15:43:59 -07:00
Josh Gao
1b81360c9e Merge "adbd: add a script to generate coverage information." 2020-04-21 19:35:52 +00:00
Treehugger Robot
524bc1fdc6 Merge "adbd: add a log message on start." 2020-04-21 17:00:43 +00:00
Treehugger Robot
68a5b66b99 Merge "Add /mnt/androidwritable for MOUNT_EXTERNAL_ANDROID_WRITABLE apps" 2020-04-21 16:44:41 +00:00
Ricky Wai
a4c163d734 Add /mnt/androidwritable for MOUNT_EXTERNAL_ANDROID_WRITABLE apps
Bug: 153540919
Test: Able to boot without errors
Change-Id: If206e5e3d76a7919b7468bc2d9666b3aff296b3b
Merged-In: If206e5e3d76a7919b7468bc2d9666b3aff296b3b
2020-04-21 12:16:43 +01:00
Josh Gao
c0d8686053 adbd: add a script to generate coverage information.
Test: ./coverage.sh
Change-Id: I1a3608063e4c4e3af5ec01680f0255d8c69e7127
2020-04-20 17:37:50 -07:00
Josh Gao
98419f738b adbd: add a log message on start.
Make it easier to identify adbd's PIDs for coverage purposes by adding
an explicit log message to grep for.

Test: manual
Change-Id: I47e13417c0d9adb7d427414fd70c218f988909f5
2020-04-20 16:45:55 -07:00
Christopher Ferris
126b010f15 Merge "Create minimal remap table for symbol binary search." 2020-04-20 23:42:22 +00:00
Christopher Ferris
cec90ea2da Merge "Optimize Memory::ReadString" 2020-04-20 23:35:42 +00:00
Ryan Prichard
7481072fbe Merge "DO NOT MERGE - x86: Switch get_pc_thunk to comdat" 2020-04-20 23:02:10 +00:00
Treehugger Robot
916320eb7b Merge "liblog: remove more unneeded #define's" 2020-04-20 22:31:27 +00:00
Nikita Ioffe
d1940a2c38 Merge "PrepareZramBackingDevice: use loop_control.h" 2020-04-20 21:51:40 +00:00
Tom Cherry
576e83429c liblog: remove more unneeded #define's
Test: build
Change-Id: I44f1d051e5438e38d7c14f79a7e72dd18cd3df83
2020-04-20 13:17:02 -07:00
Nikita Ioffe
bcaeb70d80 PrepareZramBackingDevice: use loop_control.h
loop_control.h already provides loop device management APIs that we need
here. In addition, this change fixes a subtle race condition between
uevented creating a loop device node in userspace and
PrepareZramBackingDevice accessing it without waiting for it to be
created.

Test: device boots
Test: adb reboot userspace
Bug: 154500256
Change-Id: If80f18c8c337210030a6caf2aec6f7a47472b6fb
Merged-In: If80f18c8c337210030a6caf2aec6f7a47472b6fb
(cherry picked from commit c8313adf88)
2020-04-20 21:08:25 +01:00
Treehugger Robot
4a0a6faa08 Merge "[adb data server] Initialize variable" 2020-04-20 18:51:23 +00:00
Yifan Hong
96174857f2 Merge changes from topics "sm_mock", "sm_stub"
* changes:
  libsnapshot: Add MockSnapshotManager and MockDeviceInfo.
  libsnapshot: Add GetSnapshotMergeStatsInstance
  libsnapshot: Add SnapshotManagerStub.
  libsnapshot: Add ISnapshotManager.
2020-04-20 18:50:01 +00:00
Greg Kaiser
89fe376d13 [adb data server] Initialize variable
servingComplete_ was left uninitialized and only set to 'true'
in the code.  We initialize it to the 'false' state to avoid
uninitialized references in SkipToRequest().

Bug: 150865433
Test: TreeHugger
Change-Id: Ia8a4d7135c432eb657543c5498fc9dbe8f4718b6
Merged-In: Ia8a4d7135c432eb657543c5498fc9dbe8f4718b6
2020-04-20 11:06:13 -07:00
Elliott Hughes
6b9b468dcb Merge "Fix unzip formatting." 2020-04-20 04:49:29 +00:00
Treehugger Robot
1ff09f4726 Merge "Fix liblp imported both as static and dynamic lib" 2020-04-19 19:47:09 +00:00
Alessio Balsini
0c27fb8c5d Fix liblp imported both as static and dynamic lib
In vts_libsnapshot_test, liblp was explicitly imported as static
library, but due to the importing of libsnapshot_defaults, it also
inherited the shared importing.
The import in libsnapshot_default, is not required, drop it.

Test: manual inspection with ldd
Bug: 148889015
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: I12ba0516a482dc917848b5f34cccc659a60a4803
2020-04-19 18:34:32 +00:00
Ryan Prichard
82a0841468 DO NOT MERGE - x86: Switch get_pc_thunk to comdat
Switch the __x86.get_pc_thunk.bx functions from .gnu.linkonce to comdat
section groups. lld doesn't implement .gnu.linkonce and will instead
discard the input sections. It might produce a faulty binary that has
no get_pc_thunk function in it, which would crash.

Normally, these functions are generated by GCC and are present in many
object files compiled with PIC. Clang doesn't use them, and instead
initializes the PIC base register with a "call 1f; 1: pop %ebx" pair.

I also added cfi_startproc / cfi_endproc to be consistent with current
GCC output.

I marked this CL with do-not-merge because the code it touches has been
removed in the next release, so it won't merge. I reviewed the
automerger graph, and this do-not-merge CL:
 - will be applied to qt-qpr1-dev-plus-aosp (which needs the CL)
 - won't be applied to rvc-dev-plus-aosp (which doesn't need the CL)

https://android-build.googleplex.com/builds/automerger/graph/project/googleplex-android/platform/system/core

Bug: http://b/154376560
Bug: https://bugs.llvm.org/show_bug.cgi?id=45594
Test: VM boots
Change-Id: I681c4c46503aff65f32a22c9da15397a42b67183
2020-04-18 14:07:19 -07:00
Josh Gao
ff08a51a72 Merge "adbconnection: silence logspam." 2020-04-18 02:47:11 +00:00
Treehugger Robot
22cc277bfe Merge "adb: change mdns tls service names (RFC 6763)." 2020-04-18 01:37:41 +00:00
Joshua Duong
81f2db4d6a adb: change mdns tls service names (RFC 6763).
Even though mdnsresponder seems to allow us to use _adb_secure_connect
and _adb_secure_pairing as service names, these names violate the syntax
outlined in RFC6763, and may not be compatible with other dns-sd
implementations.

Also address some comments from a previous CL.

Bug: 154268895

Test: atest adbd_test
Change-Id: Ia872e976fc4276587b500a827a41d46d9dc755dd
2020-04-17 16:38:34 -07:00
Josh Gao
d81a805a4c adbconnection: silence logspam.
Userdebug devices enable JDWP for every process, so if adbd is turned
off manually, we get an error message for every single process on the
system.

Bug: http://b/154319466
Test: manual
Change-Id: Ia702974d371e35497573c31e22cfb2b572334590
2020-04-17 16:35:01 -07:00
Treehugger Robot
04e9d07490 Merge "adbconnection: delete unnecessary darwin workaround." 2020-04-17 23:28:40 +00:00
Elliott Hughes
6f5913511c Fix unzip formatting.
Test: toybox tests, plus the ziptool tests
Change-Id: I31fd36c1bdb015b7b5062b53874143eb28b20d24
2020-04-17 16:07:01 -07:00
Josh Gao
4a1da79208 adbconnection: delete unnecessary darwin workaround.
This shouldn't be compiling for the mac.

Test: none
Change-Id: I9aea1861365c0da041c665e14e3e86cb802ad697
2020-04-17 14:46:41 -07:00
Peter Collingbourne
b416a925ab Merge "libunwindstack: Add Memory::ReadTag() function for reading memory tags." 2020-04-17 18:16:05 +00:00
Nikita Ioffe
1e98e552c6 Merge "Cleanup logic in KillZramBackingDevice" 2020-04-17 15:03:56 +00:00
Nikita Ioffe
a3be996673 Cleanup logic in KillZramBackingDevice
Since this function is used in userspace reboot, we need to be more
diligent with error handling, e.g.:

* If init fails to read /sys/block/zram0/backing_dev, then fail and
fallback to hard reboot.
* Always call swapoff.
* Always reset zram.
* Tear down loop device only if zram is backed by a loop device.

Test: adb reboot userspace
Bug: 153917129
Change-Id: I4709da1d08cf427ad9c898cfb2506b6a29f1d680
Merged-In: I4709da1d08cf427ad9c898cfb2506b6a29f1d680
(cherry picked from commit a840d405eb)
2020-04-17 12:28:25 +01:00
Josh Gao
10f8f5e363 Merge "adb: fix feature sets on devices that don't have them." 2020-04-17 04:43:16 +00:00
Josh Gao
fb4616b200 adb: fix feature sets on devices that don't have them.
Previously, we weren't distinguishing between nonexistent devices and
devices that don't support features, resulting in lots of stuff being
broken for pre-N devices.

Bug: http://b/154272158
Test: adb shell on a JB emulator
Change-Id: I0058b2a60678e1ad0503f5abac30157be976c9c4
2020-04-16 19:39:05 -07:00
Yifan Hong
7b28054c05 Merge "libsnapshot clients: Add missing dep." 2020-04-16 23:57:06 +00:00
David Srbecky
a17c2b694c Optimize Memory::ReadString
This function is responsible for majority of CPU time in prefetto.

Reduce the number of memory reads (don't read strings byte-by-byte).

Update all calls of ReadString to include the third parameter to have
a max read.

Add an Elf creation benchmark since this function is on the elf
creation path.

Test: libunwindstack_unit_test
Change-Id: Ia36e1f1a5ba76c9e9f13c43fb9e3691dde7897f2
2020-04-16 15:03:19 -07:00
Tom Cherry
6b76de04f7 Merge "liblog: return -EPERM if a log_is_loggable() returns false" 2020-04-16 20:13:04 +00:00
Yifan Hong
2dcca52457 libsnapshot: Add MockSnapshotManager and MockDeviceInfo.
For testing.

Bug: 153555889
Test: vts_libsnapshot_test
Test: update_engine_unittests
Change-Id: Id92f7372ef408625f2ef1120c99d0b4058ed488c
2020-04-16 13:12:41 -07:00
Yifan Hong
66f0115b05 libsnapshot clients: Add missing dep.
libsnapshot* uses update_metadata-protos. This
used to be optimized out, but now that SnapshotManager is
virtual, CreateUpdateSnapshots can no longer be optimized out.

Bug: 148956645
Test: compiles
Change-Id: Ib67cafd156308bf5a477996ec32eb786f8e896db
2020-04-16 13:12:41 -07:00