Commit Graph

20248 Commits

Author SHA1 Message Date
Christopher Wiley 2a7b86337f Don't include android-base/macros.h from android-base/unique_fd.h
This prevents a ton of macro collisions when libfoo includes libbinder
includes unique_fd.h.

Bug: 27804373
Change-Id: Ide834afb1052b32e86fad3fcba10cff3dafeb899
2016-04-19 14:45:48 -07:00
Raja M a2f37e4fd7 More secure and compiler warning fix for sprintf into snprintf
To fix GCC WARNINGS while building.
or
To support error free -D_FORTIFY_SOURCE=2 strict mode compilation.

Change-Id: I999bd83785456a77247e5e1d708e2bdde2eb057b
2016-04-20 02:20:50 +05:30
Yabin Cui 09c5fcf760 Merge "adb: use a custom thread to poll for usb devices on mac." 2016-04-19 20:22:13 +00:00
Yabin Cui 48d4c0c42a adb: use a custom thread to poll for usb devices on mac.
On mac, if the adb server kicks a transport on some error, mac usb driver
will not report a new usb device. So instead of relying on mac usb driver
to report new usb devices, this CL uses a loop to search for usb devices
not exist before. Note that this is also the behavior on windows and linux
host.
`adb reconnect` can be used to verity this CL.

Bug: 25935458
Change-Id: I890e0eb1fae173f2e7a0c962ededa294d821e015
2016-04-19 11:26:44 -07:00
Chih-hung Hsieh 603df0e875 Merge "Fix google-runtime-int warnings." 2016-04-19 16:14:10 +00:00
Treehugger Robot 7ed5194278 Merge "Define LIKELY and UNLIKELY in a vendor friendly way" 2016-04-19 15:24:14 +00:00
Yabin Cui a960864355 Merge "Fix kick_transport test." 2016-04-19 02:29:29 +00:00
Treehugger Robot 0d4661d549 Merge "liblog: android_log_isloggable failing apct" 2016-04-18 23:22:40 +00:00
Christopher Wiley ec9ea66a2b Define LIKELY and UNLIKELY in a vendor friendly way
This prevents macro conflicts with vendor code.

Bug: 27804373
Change-Id: I759c2b7b611203d0afdc35ddd5c2adb8f942ea17
Test: Compiles when libbinder include path changes to include libbase.
2016-04-18 16:08:19 -07:00
Josh Gao c4f3546e9f Merge changes Iaf0efc0c,Ia4a2ff77
* changes:
  adb: disable tests that are expected to fail on Win32.
  adb: increase the FD table size on Win32.
2016-04-18 22:39:34 +00:00
Chih-Hung Hsieh ec2ff8c176 Fix google-runtime-int warnings.
Bug: 28220065
Change-Id: I6b8e121ddf98355d1c1ac034c2e3522b2b49e14b
2016-04-18 14:45:46 -07:00
Josh Gao 68c63d75c9 adb: disable tests that are expected to fail on Win32.
Bug: http://b/28247676
Change-Id: Iaf0efc0c12835c0915a752a365651eb9bc78b3b8
2016-04-18 14:33:38 -07:00
Josh Gao b31e17107c adb: increase the FD table size on Win32.
128 maximum FDs is a pretty low limit, which can easily be exhausted by
port forwarding. Bump the maximum up to 2048, and add a test that checks
whether we can actually use a few hundred sockets.

Bug: https://code.google.com/p/android/issues/detail?id=12141
Bug: http://b/28246942
Change-Id: Ia4a2ff776e8e58ec13378756f19d80392679ece9
2016-04-18 14:33:38 -07:00
Josh Gao 3009b7cbe0 Merge "adb: bump the server version to 36." 2016-04-18 20:05:42 +00:00
Yabin Cui 7f27490e7f Fix kick_transport test.
Fix broken kick_transport test, and make it not access atransport
internal variables.

Bug: 25935458
Change-Id: I91b4d32a222b2f369f801bbe3903acac9c8ea4f7
2016-04-18 11:22:34 -07:00
Elliott Hughes b1393e93ad Merge "Remove toolbox iftop." 2016-04-18 17:38:36 +00:00
Christopher Wiley c2241b9c5d Merge "Export libbinder headers from libhealhd.default" 2016-04-18 17:04:49 +00:00
Treehugger Robot a87467d767 Merge "logpersist: incorporate size and buffer tunables" 2016-04-18 16:48:33 +00:00
Christopher Wiley 8ac71c7fc6 Export libbinder headers from libhealhd.default
Consumers of libhealthd.default will need these headers.

Bug: 27804373
Change-Id: I59e8526e3491f0db528d1277b8e2f4b68ce85805
Test: Compiles.
2016-04-18 09:33:53 -07:00
Mark Salyzyn 2e210e4650 logpersist: incorporate size and buffer tunables
- Add hidden -n and -b flags that propagate to the underlying
  logcat command. Publish aliases in help as --size and --buffer.
- Add --clear for start command so it clears before starting
- shell script bloating up to deal with option validation and
  provide ERROR: and WARNING: advice.

ToDo:

- Deprecate shell script and replace with Eng and Userdebug
  only Developer Options, before it becomes too powerful
  or bloated to force us to rewrite an expendable like this
  into C++.

Bug: 28120456
Change-Id: I0dff8acaa1e5c929454760cfa2801924956bc25d
2016-04-18 08:54:39 -07:00
Elliott Hughes 72886ce0af Remove toolbox iftop.
It's nothing like the real iftop, and there's no evidence anyone uses it.
In particular, it hasn't been touched since it was first checked in, back
in 2008. So it's either perfect or unused. Let's find out...

Change-Id: I941adbb67f0166b9b3bd796291060bd67eafa867
2016-04-16 09:08:05 -07:00
Yabin Cui 643bc369ef Merge "adb: add reconnect command." 2016-04-16 01:50:54 +00:00
Yabin Cui 005bf1e05b adb: fix adb usb operations on device.
Problem: For devices using /dev/usb-ffs/adb, Run
`while true; do adb reconnect device; sleep 1; done`. And the
device soon becomes offline. The adbd log shows that calling
adb_read(h->bulk_out) in usb_ffs_read() gets EOVERFLOW error.

Reason: When kicking a transport using usb-ffs, /dev/usb-ffs/adb/ep0
is not closed, and the device will not notify a usb connection reset
to host. So the host will continue to send unfinished packets even
if a new transport is started on device. The unfinished packets may
not have the same size as what is expected on device, so adbd on
device gets EOVERFLOW error. At the worst case, adbd has to create new
transports for each unfinished packet.

Fixes:
The direct fix is to make the usb connection reset when kicking transports,
as in https://android-review.googlesource.com/#/c/211267/1. And I think
we can make following improvements beside that.
1. Close a file that is used in other threads isn't safe. Because the file
descriptor may be reused to open other files, and other threads may operate
on the wrong file. So use dup2(dummy_fd) to replace close() in kick function,
and really close the file descriptor after the read/write threads exit.

2. Open new usb connection after usb_close() instead of after
usb_kick(). After usb_kick(), the transport may still exist and
reader/writer for the transport may be still running. But after
usb_close(), the previous transport is guaranteed to be destroyed.

Bug: 25935458
Change-Id: I1eff99662d1bf1cba66af7e7142f4c0c4d82c01b
2016-04-15 18:18:16 -07:00
Treehugger Robot ba430e3634 Merge "Fix include-what-you-use problem in android-pubkey.c." 2016-04-16 00:01:39 +00:00
Colin Cross 5d35ce649c Update sanitize property format
Change-Id: I81c299609ece7a1c7f27093f563d5df08efe989b
2016-04-15 16:33:21 -07:00
Josh Gao 057095d207 adb: bump the server version to 36.
The recent `adb root` changes are incompatible with older versions of
the server. Bump the version number to force the server to restart.

Bug: http://b/28194507
Change-Id: I970806e3b68c1f8e3273a4b1f0ecc4aca5086be9
2016-04-15 14:54:43 -07:00
David Benjamin 2257f6baf5 Fix include-what-you-use problem in android-pubkey.c.
This fixes a problem building against BoringSSL master.

Change-Id: Ib052c6a59454126a83e32e9a43391470aca7356a
2016-04-15 17:44:05 -04:00
Mark Salyzyn efe8ecc1d9 liblog: android_log_isloggable failing apct
- periodic failures in apct, dropped second serial test
  in refresh_cache, trusting check_cache or global.
- The retry loop to see if is_loggable recovers of 1000
  was hiding subsequent tests, drop to 10 retries.
- On the whole, the average performance remains the same.

Bug: 25792367
Change-Id: I4110440ef46671d7a1c128689bde623808bed04f
2016-04-15 11:04:24 -07:00
James Hawkins 1607ea64cb Merge "bootstat: Calculate and log the time_since_last_boot metric." 2016-04-15 16:46:52 +00:00
James Hawkins 2d8b3e66c6 bootstat: Calculate and log the time_since_last_boot metric.
Bug: 28163811
Change-Id: I2e1350531f6a0fc891c270cfdfca6c8ad63f8040
2016-04-15 08:44:01 -07:00
Yabin Cui f20e4b1b71 Merge "libbacktrace: only build libbacktrace_offline static library." 2016-04-14 21:14:55 +00:00
Yabin Cui 51e607056d libbacktrace: only build libbacktrace_offline static library.
As device may not have libbacktrace_offline shared library, simpleperf
no longer rely on it. So there is no reason to keep libbacktrace_offline
shared library.

Bug: 28152982
Change-Id: If8e31b1434646dbbfed60264eb25f034bc5d6946
2016-04-14 10:31:08 -07:00
Treehugger Robot 9a3e238a60 Merge "logd: switch from android_ids to getpwuid" 2016-04-14 16:06:08 +00:00
Elliott Hughes d93e7cacef Merge "Remove libmincrypt." 2016-04-14 15:19:06 +00:00
Mark Salyzyn b8a95bd3c9 logd: switch from android_ids to getpwuid
Bug: 27999086
Change-Id: I7f4e68b21f58789b4dcada04f9c27f5722940c02
2016-04-14 15:14:46 +00:00
Daniel Rosenberg e99283103b Merge "Add nofail fstab option" 2016-04-14 00:12:44 +00:00
Mark Salyzyn df7c1ed3a0 Merge changes I7ebb6146,I0b42736c,I5331acde
* changes:
  logcat: expand -n, -r and -b
  logcat: allow comma-separate list of buffers
  logcat: Adjust help to make it more meaningful
2016-04-13 21:32:48 +00:00
Treehugger Robot 3e0eaa4103 Merge changes Ibc8038b1,I1876ecd7,I57d70f8b
* changes:
  adb: after `adb root`, wait for the device in any state.
  adb: add support for 'wait-for-any'.
  adb: make 'wait-for-{recovery,sideload,bootloader} work.
2016-04-13 20:25:53 +00:00
Josh Gao 48a348183f adb: after `adb root`, wait for the device in any state.
Otherwise, `adb root` while the device is in recovery will hang.

Bug: http://b/28168212
Change-Id: Ibc8038b1745139fb505e466c74c605b9df474c8c
2016-04-13 12:28:04 -07:00
Josh Gao 86441c31fe adb: add support for 'wait-for-any'.
Allow waiting for a device in any state.

Bug: http://b/28168212
Change-Id: I1876ecd70089ca88f2da5de4182e13724ec50501
2016-04-13 12:28:04 -07:00
Josh Gao 08881e72f4 adb: make 'wait-for-{recovery,sideload,bootloader} work.
The help for wait-for-* documents this as working, but we only had a
special case for 'wait-for-device'. Make the others work as well.

Bug: http://b/28170823
Change-Id: I57d70f8b9a383947c4f761919bfbd8515a013520
2016-04-13 12:28:04 -07:00
Mark Salyzyn 33c262513f logcat: expand -n, -r and -b
- Add property expansion to the -n/--rotate-count,
  -r/--rotate-kbytes and -b/--buffer parameters.
  e.g. -r '${logcat.rotate-count:-6}' will expand the property
  logcat.rotate-count, and if not present will default to 6
- Add gtest to confirm mid-stream expansion
- No longer support ",:;<whitespace>" for buffer tokenization,
  settling on only supporting ",".

Bug: 28120456
Change-Id: I7ebb6146f72047631536c457952fa50d0abb98ab
2016-04-13 11:43:03 -07:00
Mark Salyzyn 4517773296 logcat: allow comma-separate list of buffers
- Add parsing to support comma+ separated list of buffers.
- Move get_size test into a standalone get_groups function
- add some additional tests for this feature, leveraging
  get_groups to confirm buffer selection.

Bug: 28120456
Change-Id: I0b42736c08cf4b2a435cb74cda540dc163a26bd1
2016-04-13 11:42:57 -07:00
Mark Salyzyn 378f4745a2 logcat: Adjust help to make it more meaningful
It is not clear about the long option aliases, list
them comma separate first for clarity. Squash lines
of help content if possible. Lock to 3 indents, one
for options, another for text on same line as options
and another for next line or continuation.

Bug: 28120456
Change-Id: I5331acde3ac0fd3b87f6699ba108f6cef46a1563
2016-04-13 11:42:52 -07:00
Treehugger Robot 4888d79a94 Merge "Remove undocumented functionality from init." 2016-04-13 15:43:03 +00:00
Elliott Hughes bdeac39a42 Remove undocumented functionality from init.
(cherry-pick of a3cc6026301db08285028c760af2665a66b3cc44.)

Bug: http://b/28151340
Change-Id: I5360502c79d9113a13055bf017b39c099033e947
2016-04-13 07:56:51 -07:00
Elliott Hughes 6b11c13aed Remove libmincrypt.
Bug: http://b/27287913
Change-Id: Ie85a7d8fecc3577a16c0a79d5f95379ec3ecc15b
2016-04-12 16:20:23 -07:00
Elliott Hughes 52eb93ca57 Merge changes from topic 'boringssl_conversion'
* changes:
  Switch fs_mgr and adb to libcrypto_utils.
  Add libcrypto_utils.
2016-04-12 23:12:35 +00:00
Treehugger Robot 90c2e75db9 Merge "logcat: apct test failures" 2016-04-12 23:11:56 +00:00
Mattias Nissler 097b6bbc76 Switch fs_mgr and adb to libcrypto_utils.
Update code and dependencies to use BoringSSL + libcrypto_utils
instead of mincrypt.

Change-Id: Ic75164bd50c84b81b6310e27a67d4b3c174984f9
2016-04-12 23:04:11 +00:00