Commit graph

57411 commits

Author SHA1 Message Date
Tom Cherry
0b01ff0f39 logd: use RAII locks and thread annotations
Test: unit tests
Change-Id: I38623130a96f17a47ed79753e24b25efa9e38279
2020-05-21 11:07:04 -07:00
Tom Cherry
0a6c83e7d0 Merge "logd: add tests for log deduplication" 2020-05-21 16:06:30 +00:00
Treehugger Robot
4ea509e25d Merge "adb: only submit USB writes on the worker thread." 2020-05-20 23:34:37 +00:00
Tom Cherry
b398a7c85e logd: add tests for log deduplication
Fix a subtle bug that liblog event messages have a payload of int32_t,
not uint32_t, so they should only be summed to int32_t max.

Make a bunch of test improvements as well to support these.

Test: these tests
Change-Id: I4069cc546240bfffec5b19f34ebec913799674e8
2020-05-20 14:39:26 -07:00
Josh Gao
962551000b adb: only submit USB writes on the worker thread.
After USB disconnection, io_submit will block until the endpoint comes
back up. We handle this in the worker thread by sending it a signal to
break it out of io_submit when we notice that USB has gone down, but
opportunistic writes from the main thread can get stuck in this scenario
as well. Submitting the writes only on the worker thread doesn't have a
measurable impact on performance, so avert this scenario by only
submitting writes from the worker thread.

Bug: http://b/157078255
Test: test_device.py
Change-Id: I1118f2e2a70d13f15592eb996e7084033ed5cb9d
2020-05-20 21:03:18 +00:00
Josh Gao
b27365510d Merge "adb: fix flakiness in PTY shell protocol." 2020-05-20 21:01:23 +00:00
Treehugger Robot
fc4e54ecb0 Merge "adb: fix abb test." 2020-05-20 16:25:45 +00:00
Baligh Uddin
3b55f75706 Merge "Migrate system/core/base to system/libbase." 2020-05-20 12:22:54 +00:00
Josh Gao
be41ae5666 adb: fix flakiness in PTY shell protocol.
When a subprocess closes its PTY slave, the master fd will report
POLLHUP when polled. This leads to us prematurely tearing everything
down, without reading out output that's been written to the PTY.

Resolve this by waiting until the fd no longer reports POLLIN.

Bug: http://b/156551485
Bug: http://b/156552734
Test: `adb shell 'X=0; while /data/nativetest64/adbd_test/adbd_test --gtest_filter="ShellServiceTest.*Pty*" >/dev/null 2>&1; do X=$((X+1)); echo $X; done'` for 1000 iterations (failed within 20, previously)
Test: test_device.py
Change-Id: Ie591e0cafb532cd6cebdf6f356dc967565b5a2d9
2020-05-19 20:54:40 -07:00
Josh Gao
8f83498cbd adb: fix abb test.
Don't hardcode cmd's output.

Bug: http://b/157092201
Test: python3 -m unittest test_device.AbbTest
Change-Id: I7145e8d2a31b1c1b459c1e55af3670b95e653eee
2020-05-19 20:12:52 -07:00
Rick Yiu
9ada65c0c6 Merge "Add choice for changing sched policy when setting thread priority" 2020-05-20 03:03:18 +00:00
Christopher Ferris
1fbb1b8718 Merge "Add new reparse benchmarks." 2020-05-19 23:12:27 +00:00
Baligh Uddin
28d0f1a3af Migrate system/core/base to system/libbase.
Add Symlink to ensure hardcoded references do not break build.
BUG: 148941208
test: TH

Change-Id: Ia2b69de1af6e07be2aab3ba4fe1493de80269c40
Merged-In: I1134f1e9e968b9273748e2483bea8d25e5c9e994
2020-05-19 21:32:42 +00:00
David Anderson
984aa655df Merge "libsnapshot_test: Fix running on DSUs." 2020-05-19 18:47:32 +00:00
Christopher Ferris
5990a9d442 Add new reparse benchmarks.
Test: Ran benchmarks on host and device.
Change-Id: I41b7d29bfa3468b9b9b8cbdfe94aca830d14f98e
2020-05-19 10:31:53 -07:00
Tom Cherry
0e95c2108f Merge changes I85e6c989,Ie4ecc502,I1f8cfbb7
* changes:
  logd: build liblogd and its test on host
  logd: add LogBufferTest.cpp
  liblog: remove unused log_time functions, inline the others
2020-05-19 14:37:46 +00:00
Treehugger Robot
1b1ac36214 Merge "Migrate platform/system/core/libziparchive to p/system/libziparchive" 2020-05-19 12:45:51 +00:00
Baligh Uddin
db6e6038d0 Migrate platform/system/core/libziparchive to p/system/libziparchive
BUG: 149737100
Test: Forrest Run and TH
Change-Id: Id0872496eb9fcfb5075ddec22956a9a35d1514d4
Merged-In: I357a8c655855949bb0957675510bbaa26b47bc3c
2020-05-19 11:55:59 +00:00
Treehugger Robot
bd05d33ce7 Merge "Optimizing install-multi-package to use ABB." 2020-05-19 06:27:46 +00:00
David Anderson
0d2bcd4afe libsnapshot_test: Fix running on DSUs.
Because DSUs mount userdata via a fiemap, libfiemap has trouble creating
additional fiemaps on top of it. The complex stacking of dm-linear is
not supported. For other libfiemap tests we've hacked around this
limitation. If LpMetadata is in a folder named "test", we allow the
backing device search to stop at a dm node, whereas otherwise it would
need to stop at a physical device.

However this was not quite enough for vts_libsnapshot_test, because (1)
the test folder was not included in the pattern match, and (2)
CreateLogicalPartition() could not handle device-mapper names, as it
expects a named physical partition. Addressing both of these allows the
tests to pass on DSUs.

Bug: 156713441
Test: vts_libsnapshot_test on DSU
Change-Id: Ie7ee70e31dff0809a5f0c402ed132d80dd03d9b1
2020-05-19 06:02:37 +00:00
Treehugger Robot
3eb41352c5 Merge "Incremental install mode for install-multi." 2020-05-19 06:00:40 +00:00
Alex Buynytskyy
a64d4f81a4 Optimizing install-multi-package to use ABB.
Bug: 150803885
Test: atest adb_test adbd_test
Test: adb install-multi-package Picsart_9.30.5.apk Pinterest_6.54.0.apk
Change-Id: I2fcd093e61afdd16d481194e1d5f8f66acf6a66c
2020-05-19 04:29:34 +00:00
Alex Buynytskyy
c06d01e2d9 Incremental install mode for install-multi.
Bug: 150803885
Test: atest adb_test adbd_test fastdeploy_test
Change-Id: I242104267273bac21ab41390d3e77a434ffa565d
2020-05-19 04:29:27 +00:00
Joshua Duong
7ce4a267f5 Merge changes from topic "adb-mdns"
* changes:
  adb pair: allow passing password as command-line argument.
  Change adb auto-connect to use mdns instance name.
  'adb pair' by mdns instance name.
  'adb connect' by mDNS service name.
  Add mDNS service instance name parser.
2020-05-19 00:30:06 +00:00
Treehugger Robot
64979d3726 Merge "base: delete abi compatibility shims." 2020-05-18 22:59:39 +00:00
Tom Cherry
a515197266 logd: build liblogd and its test on host
Plus the various fixups needed for building on host.

Test: run these tests on host
Change-Id: I85e6c989068f80c5a80eaf5ad149fdad0a045c08
2020-05-18 15:54:06 -07:00
Tom Cherry
43f3f761f0 logd: add LogBufferTest.cpp
Add a standalone test of log buffers that does not interact with the
logd running on the device.

Test: this new test
Change-Id: Ie4ecc50289ef164aa47cc72ddeeb9b28e776db94
2020-05-18 15:51:08 -07:00
Tom Cherry
bd80e5678f liblog: remove unused log_time functions, inline the others
One of the reasons that logcat and logd statically include liblog is
to access the symbols in log_time.cpp, which we do not expose
otherwise.  Except for strptime(), which will be handled in a separate
CL, these symbols are either small enough to inline in the header or
unused and can be removed.

Test: logging unit tests
Change-Id: I1f8cfbb779aef79fc7d5b6d0050438fe5f0e0e2c
2020-05-18 15:40:26 -07:00
Elliott Hughes
0314dbaecf Merge "libsparse: use memory-mapping on Windows too." 2020-05-18 22:33:57 +00:00
Tom Cherry
ff3be3155d Merge "logd: make liblogd just the core logd functionality" 2020-05-18 22:06:42 +00:00
Joshua Duong
dcba5c9257 adb pair: allow passing password as command-line argument.
Bug: 155194845

Test: adb pair <host>
Test: adb pair <host> <pairing code>
Change-Id: I9813b5812a98524109a4c90cb089eab652da06fa
2020-05-18 14:24:10 -07:00
Joshua Duong
04d207d315 Change adb auto-connect to use mdns instance name.
This change will fix reconnects when the ip address and port changes for
the same mdns instance name.

Bug: 152886765

Test: 'adb pair <mdns_instance>' and wait for auto-connect.
'adb devices' | grep <mdns_instance
On device, toggle wireless debugging off/on. Client should be able to
reconnect with the different port.

Change-Id: I9ad486534019ee70fb54c9f26ce028951eca8566
2020-05-18 14:23:01 -07:00
Joshua Duong
beac509301 'adb pair' by mdns instance name.
Bug: 152886765

Test: Turn on wireless debugging > "Pair with Pairing Code". On client,
> adb pair <mdns_instance>

Change-Id: I8f15c3ea17f3ac02205064f64aca0167bf5d2ad5
2020-05-18 14:23:01 -07:00
Joshua Duong
7ebc595736 'adb connect' by mDNS service name.
Bug: 152886765

Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test
Test: test_adb.py

Change-Id: I7e93ceca7cdf913060bbc5afe824593a9922c6d9
2020-05-18 14:22:52 -07:00
Treehugger Robot
7cd7b68f5d Merge "adb: don't cache failure to get features." 2020-05-18 21:12:28 +00:00
Josh Gao
3dc6710974 base: delete abi compatibility shims.
It's been a year, so references to these in master's vendor blobs
should be gone by now.

Test: treehugger
Change-Id: I090145e69f82e7ee78d66b0b92141bda56250837
2020-05-18 14:07:36 -07:00
Yifan Hong
1dc4e19f2a Merge changes from topic "libsnapshot_fuzzer_test"
* changes:
  libsnapshot_fuzzer: Properly unmap images
  Reland "libsnapshot_fuzzer: Add tests"
2020-05-18 20:18:07 +00:00
Tom Cherry
73953968fe logd: make liblogd just the core logd functionality
liblogd: LogBuffer classes and their support, LogReaderList and
LogReaderThread
logd: liblogd + the socket code that connects liblogd to liblog and
therefore the world.

The goal here is to test liblogd offline of the socket connections or
the device.

Also, convert libaudit.c -> libaudit.cpp and modernize a bit.

Test: build
Change-Id: If5adf5e775a251d9a703c0583be0988f48017347
2020-05-18 13:03:48 -07:00
Treehugger Robot
f3a570b891 Merge "Add fuzzers for libutils classes" 2020-05-18 17:49:57 +00:00
Treehugger Robot
25a96e44ca Merge "init_kill_services_test: also reboot after" 2020-05-18 17:42:29 +00:00
Treehugger Robot
4222040bd5 Merge "fastbootd: Support TCP protocol." 2020-05-18 17:05:43 +00:00
Tom Cherry
e82dcdcdf0 Merge "logd: don't use libcutils properties" 2020-05-18 15:37:03 +00:00
Tom Cherry
00d490e0fa Merge "logd: remove class LogCommand, rename LogCommand.cpp to LogPermissions.cpp" 2020-05-18 15:36:55 +00:00
Treehugger Robot
fba5028d56 Merge "init: support wait timeout with more precision" 2020-05-18 13:14:36 +00:00
Treehugger Robot
cc20ae7733 Merge "add API to get hash descriptor" 2020-05-18 07:02:12 +00:00
Jiyong Park
747eb1a6b7 Merge "Set apex_available property" 2020-05-18 05:46:22 +00:00
Jiyong Park
16a932a4ef Set apex_available property
The marked library(ies) were available to the APEXes via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: 150999716
Test: m
Merged-In: I54db09314c7236a227f04281a439c1d5dc56ef2c
Change-Id: I54db09314c7236a227f04281a439c1d5dc56ef2c
(cherry picked from commit a2606921b2)
2020-05-18 13:30:25 +09:00
Jooyung Han
6ee70c0dd3 Merge "backtrace: Set min_sdk_version" 2020-05-18 03:35:19 +00:00
Steve Muckle
a90bfdd874 add API to get hash descriptor
The GKI verification VTS test will need to examine the boot partition's
hash descriptor, so add support to access this descriptor.

Bug: 148800209
Test: atest AvbTest#Boot
Change-Id: I92e32f61a265671ae0940c44147391f73776e66a
2020-05-17 17:06:59 -07:00
Treehugger Robot
f464e6e0ac Merge "Remove /default.prop" 2020-05-16 08:39:56 +00:00