Commit graph

29896 commits

Author SHA1 Message Date
Josh Gao
66ca192ac3 Merge changes I8e8e0963,I3c714f63,Id157412e,Ib7c26fbd
am: 55ddb99527

Change-Id: If947b8e8efd9ad873defabe3f6fea3caacf394ed
2017-05-15 20:51:16 +00:00
Josh Gao
55ddb99527 Merge changes I8e8e0963,I3c714f63,Id157412e,Ib7c26fbd
* changes:
  adb: libusb: recognize devices with multiple interfaces.
  adb: libusb: wait for devices to become accessible.
  adb: libusb: switch to hotplug for device detection.
  adb: silence noise.
2017-05-15 20:45:06 +00:00
Mark Salyzyn
daae7558e8 Merge "logd: logcat --clear respect pruneMargin"
am: 3d0186b97e

Change-Id: If4e8c488530dc4ef20129806c5c84ffb68d0a40b
2017-05-15 20:35:17 +00:00
Treehugger Robot
3d0186b97e Merge "logd: logcat --clear respect pruneMargin" 2017-05-15 20:27:06 +00:00
Dmitry Shmidt
0f0ee1beeb Merge "fastboot: Add DTS partition support for 'flashall' command"
am: b8e428110b

Change-Id: I80bd3be921d7091ad9d5d7e1b3f1cb4cc03084a6
2017-05-15 19:35:41 +00:00
Treehugger Robot
b8e428110b Merge "fastboot: Add DTS partition support for 'flashall' command" 2017-05-15 19:28:29 +00:00
Dmitry Shmidt
de8c08c612 fastboot: Add DTS partition support for 'flashall' command
Hikey960 has DTS partiton for DT image

Test: Manual
Bug: 38310807

Change-Id: I9f8e9b27ed40ebdd225f3c4e4b30f53e7cdb5ee7
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2017-05-15 10:25:31 -07:00
Mark Salyzyn
0878a7c167 logd: logcat --clear respect pruneMargin
While a reader is present, consider it a success, and not busy, if a
buffer is pruned down to pruneMargin plus one second of additional
margin of logspan.  If not busy, no need to trigger any mitigations
regarding the readers, or to report any errors.

Side Effects are we no longer mitigate the reader when performing
chatty filtration. This is a positive side effect because we were
getting --wrap wakeups that seemed premature.

Add kickMe() and isBusy() methods to ease maintenance and uniformity
of actions.

Test: gTest liblog-unit-tests, logd-unit-tests & logcat-unit-tests
Test: manual: 'logcat -b all -c' repeat in a loop, at various logging
      load levels, simultaneously 'logcat -b' all in another session.
Bug: 38046067
Change-Id: I3d0c8a2d416a25c45504eda3bfe70b6f6e09ab27
2017-05-15 07:01:42 -07:00
Elliott Hughes
dce08d5572 Merge "Add libkeyutils."
am: 81824ebf1f

Change-Id: I096f8f0333313ca1425d6d285b07b9c199c1d90e
2017-05-13 00:32:08 +00:00
Elliott Hughes
81824ebf1f Merge "Add libkeyutils." 2017-05-13 00:28:28 +00:00
Josh Gao
425aefdcf0 adb: libusb: recognize devices with multiple interfaces.
A bug was introduced by commit 8bf37d7a wherein we accidentally only
look at the first interface of a device when checking whether a USB
device was an ADB device or not.

Bug: http://b/38201318
Test: none
Change-Id: I8e8e0963c77cd2cb03538d926ab735f4b57e52b7
2017-05-12 17:08:50 -07:00
Josh Gao
3f60a968e3 adb: libusb: wait for devices to become accessible.
Android's host linux libusb uses netlink instead of udev for device
hotplug notification, which means we can get hotplug notifications
before udev has updated ownership/perms on the device.

When detecting a new device, poll the device file for a while until we
can access it, before trying to open it.

Bug: http://b/38170349
Test: manually incrased timeout and chmodded a device betwen 0 and 664
Change-Id: I3c714f630940df02b407442592301e2bbb3d9653
2017-05-12 17:08:50 -07:00
Josh Gao
6da1cd49b5 adb: libusb: switch to hotplug for device detection.
Switch from polling in a loop to using libusb's hotplug API to detect
when devices arrive and leave. Use this to remove devices that were
inaccessible when they're unplugged.

Bug: http://b/38170349
Test: plugged in device
Change-Id: Id157412eb46834debecb0cd45b47b1ced50c2274
2017-05-12 17:08:50 -07:00
Josh Gao
723258a4c7 adb: silence noise.
Remove logging statements that don't provide any benefit.

Test: none
Change-Id: Ib7c26fbdb019f4d6bbce2b7fb192cb5e6066e53f
2017-05-12 17:08:50 -07:00
Mark Salyzyn
236daaf478 Merge "liblog: tests: crashes in logcat.descriptive"
am: f218210f6e

Change-Id: I4efdd4e727d32f06f2c352c0c211cc51b5bbe0e9
2017-05-12 22:11:53 +00:00
Treehugger Robot
f218210f6e Merge "liblog: tests: crashes in logcat.descriptive" 2017-05-12 21:58:22 +00:00
Mark Salyzyn
f7690d9196 liblog: tests: crashes in logcat.descriptive
scanTagLine has some loops that do not check for a terminating nul,
problematic for responses from the logger via __getEventTag.

Test: gTest logcat-unit-tests --gtest_filter=*.descriptive
Bug: 37791296
Change-Id: Ib4e900b765b407bdee43e009d6625fe289863ddc
2017-05-12 13:07:08 -07:00
Tom Cherry
ee178d6976 Merge "Enable libprocessgroup on host bionic"
am: 44673da3eb

Change-Id: I88fed3b3b93d3102fa6322b2254e18fffe350d51
2017-05-12 02:31:39 +00:00
Treehugger Robot
44673da3eb Merge "Enable libprocessgroup on host bionic" 2017-05-12 02:28:06 +00:00
David Zeuthen
fb4d8b0bac Merge "fs_mgr: Update for new libavb API."
am: 5ed7d39857

Change-Id: Iaccfaae0cc8884ef6352c4c338690a31a8d18f75
2017-05-12 01:36:19 +00:00
Treehugger Robot
5ed7d39857 Merge "fs_mgr: Update for new libavb API." 2017-05-12 01:17:45 +00:00
Tom Cherry
efa81080fd Enable libprocessgroup on host bionic
Bug: 31559095

Test: Build
Change-Id: I1ee9fb492137c6c16f0d02586393837616127972
2017-05-11 17:55:04 -07:00
Elliott Hughes
c9d545855a Merge "Fix "fastboot oem"."
am: dbe9ab1074

Change-Id: I71c0d2eceaf4153f853196d07688558b3979a033
2017-05-12 00:42:37 +00:00
Treehugger Robot
dbe9ab1074 Merge "Fix "fastboot oem"." 2017-05-11 23:40:59 +00:00
Mark Salyzyn
1423041905 Merge "logd: validate and fill in socket credentials"
am: 17254f59a2

Change-Id: I987d058e7245f5cb9a3603b3f52f7fa947d5dea7
2017-05-11 22:14:10 +00:00
Mark Salyzyn
ed1e53fc77 Merge "logcat: test: inject for *.event_tag_filter"
am: 2841b4efe0

Change-Id: Ic1fb5ed5bb304ab4a6fa3e55414a07e73c5d546b
2017-05-11 22:13:48 +00:00
Elliott Hughes
29d5d7d718 Fix "fastboot oem".
Broken by d6365a7052.

Bug: https://issuetracker.google.com/38216236
Test: "fastboot oem uart enable"
Change-Id: I672d5b96bb16fd77e7af61115b8a38606c691ea8
2017-05-11 15:05:13 -07:00
Treehugger Robot
17254f59a2 Merge "logd: validate and fill in socket credentials" 2017-05-11 21:49:30 +00:00
Treehugger Robot
2841b4efe0 Merge "logcat: test: inject for *.event_tag_filter" 2017-05-11 21:48:38 +00:00
Renaud Paquay
9cf71d784e Merge "Fix uninitialized member variable"
am: 46bb1ffa8a

Change-Id: I102f6414d6846186327f68b5dae2e23eadfa0502
2017-05-11 21:04:41 +00:00
Mark Salyzyn
1961eab662 Merge "logd: test: check sepolicy background rate before testing"
am: 5a40c42877

Change-Id: I785965cc1c27d598f3293493d133e7b865c98d59
2017-05-11 21:04:16 +00:00
Siarhei Vishniakou
04daed4793 Merge "Adding 'uhid' permission for access to /dev/uhid."
am: cecbc9993d

Change-Id: I0cfcdaac7685f10a6f2b5e9bfc54a83cc5385da2
2017-05-11 20:48:04 +00:00
Mark Salyzyn
c4e4823b00 logd: validate and fill in socket credentials
- android::pidToUid() additional checking.  Make sure if we have to
  convert a PID to an UID that the parse of /proc/<pid>/status
  requires a trailing space after the number
- android::tidToPid() added, in the same vein as android::pidToUid().
- stats.tidToPid() added
- If no credentials, set PID to 0 and UID to DEFAULT_OVERFLOWUID
- If credentialed PID is 0, use stats.tidToPid()
- If credentialed UID is DEFAULT_OVERFLOWUID, use stats.pidToUid()

Test: remove +passcred from logd.rc for daemon and confirm very few
      UID=65534 or PID=0 cases actually show up
Bug: 37985222
Change-Id: I7d20506e70e67beb3043d1537cf9450ab58dc278
2017-05-11 12:21:02 -07:00
Treehugger Robot
46bb1ffa8a Merge "Fix uninitialized member variable" 2017-05-11 19:17:21 +00:00
Mark Salyzyn
24b79ce2bc logcat: test: inject for *.event_tag_filter
Inject a message for event_tag_filter and bucket tests. The former
registered an occasional failure.

Switch order of EXPECT checks so that constant is on the right so
that error reports make more sense.

Test: gTest logcat-unit-tests --gtest_filter=*.event_tag_filter
Test: gTest logcat-unit-tests
Bug: 37791296
Change-Id: Ic2536e6e4c95e3a913ad0ea4c22219aa3c5c01eb
2017-05-11 12:16:06 -07:00
Treehugger Robot
5a40c42877 Merge "logd: test: check sepolicy background rate before testing" 2017-05-11 19:13:52 +00:00
Siarhei Vishniakou
cecbc9993d Merge "Adding 'uhid' permission for access to /dev/uhid." 2017-05-11 19:02:32 +00:00
Renaud Paquay
b7a4f0b9e2 Fix uninitialized member variable
The default constructor of FileMap was missing an initializer for the
mFileMapping variables. This results in CloseHandle being called with
a "random" value, which can cause havoc in Win32 process over time (e.g.
in the case of libaapt2_jni.dll, which is loaded in a JVM process).

Also, update the code to use "NULL" for invalid file map handle
and "INVALID_HANDLE_VALUE" for invalid file handle.

Bug: 38197857
Test: Stress testing on (Windows) machine
Change-Id: Ibd769219d601fbafcfcee89e848b31cc5137826c
2017-05-11 10:30:52 -07:00
Mark Salyzyn
c51ecf9238 logd: test: check sepolicy background rate before testing
logd.sepolicy_rate_limiter_* tests can fail individually so join them
together into one test.  The new test logd.sepolicy_rate_limiter
fails as a group if the background sepolicy activity is too high, so
check it and report a warning that the test can fail as a result so it
can be forgiven during unit testing.  The failure remains as a VTS
performance threshold that requires investigation.

The test takes a total of 45 seconds to run, it was split up as this
approaches the 60 second test timeout on go/apct.

Test: gTest logd-unit-tests --gtest_filter=logd.sepolicy_rate_limiter
      (run in loop ensuring passes do not interfere with eachother)
Bug: 37791296
Change-Id: Ia865241f684c6b0de428702cbd5110dc17927c66
2017-05-11 17:16:30 +00:00
Siarhei Vishniakou
0729dd1edb Adding 'uhid' permission for access to /dev/uhid.
This CL is in support of another CL c/2048848, topic
'Refactor hid command in /frameworks/base/cmds' in
internal master. Adding the permissions for
shell here to access uhid_node as part of the
new 'uhid' group.

Bug: 34052337
Test: Tested on angler, bluetooth mouse works OK.

Change-Id: If9e100aa1262d689fb8adc5c0ce93f157c96399e
2017-05-11 01:28:53 +00:00
Josh Gao
162ec283cf Merge changes I0ff1fc5c,I7a23d3bf
am: 7d199de8e2

Change-Id: I6f47c2f66d79b8d26c239c974dcea34e4e8fef67
2017-05-10 23:54:41 +00:00
Chih-Hung Hsieh
4a926efc49 Merge "Work around clang-tidy segmentation fault."
am: d761dd747e

Change-Id: I51913166b123b41e31c23da8c0def798057dd556
2017-05-10 23:54:12 +00:00
Josh Gao
7d199de8e2 Merge changes I0ff1fc5c,I7a23d3bf
* changes:
  libdebuggerd: print the build fingerprint in fallback.
  libdebuggerd: implement fallback register dumping on arm/aarch64.
2017-05-10 23:24:38 +00:00
Treehugger Robot
d761dd747e Merge "Work around clang-tidy segmentation fault." 2017-05-10 23:11:19 +00:00
Josh Gao
8016a0aa11 Merge "adb: fix darwin build break."
am: a0661237e1

Change-Id: If89dd3fa27da4316122802af234b6104c2a8ef58
2017-05-10 22:08:44 +00:00
Josh Gao
a0661237e1 Merge "adb: fix darwin build break." 2017-05-10 21:58:10 +00:00
Josh Gao
362b4041f3 adb: fix darwin build break.
Fix the following build breakage:

    system/core/adb/client/usb_osx.cpp:433:13: error: static declaration of 'usb_cleanup' follows non-static declaration
    static void usb_cleanup() NO_THREAD_SAFETY_ANALYSIS {
                ^
    system/core/adb/usb.h:48:5: note: previous declaration is here
        ADB_USB_INTERFACE(native::usb_handle*);

Bug: http://b/38203892
Test: mma on linux, darwin
Change-Id: I1c042e4d64ddcc0713f329202bc2037e590a9b4f
2017-05-10 13:58:51 -07:00
David Zeuthen
7ea2c2814d fs_mgr: Update for new libavb API.
In https://android-review.googlesource.com/#/c/392873/ we slightly
changed the libavb API. This CL updates fs_mgr to use the new API.

Bug: 38157502
Test: Manually tested.
Change-Id: Ia3371e11fcd81fcc1d147f030cd62af67943aad5
2017-05-10 15:45:12 -04:00
Josh Gao
b7f3707cd3 Merge changes I394f5782,I9475f5d0,I59707186
am: 44f6592b0d

Change-Id: Ic1a62436b98f986e129a6b08d1ab939b70d5f3e6
2017-05-10 19:01:57 +00:00
Josh Gao
44f6592b0d Merge changes I394f5782,I9475f5d0,I59707186
* changes:
  adb: move all cleanup to a function with defined ordering.
  adb: make `adb kill-server` wait for the server to die.
  adb: libusb: replace sleep with timed CV wait.
2017-05-10 18:42:14 +00:00