Commit Graph

19375 Commits

Author SHA1 Message Date
Mark Salyzyn 5cecedc6e8 liblog: test: __android_log_error_write accuracy
Add a test to confirm exact expected content using the testframe
setup for the events log handler. Remove dependency on 512 truncation
in liblog->
android_errorWriteWithInfoLog__android_logger_list_read__data_too_large
to something more liberal.

Bug: 27356456
Change-Id: I8a53ad3a16cf16b14856efe5b95417e857c7e09b
2016-02-25 12:29:32 -08:00
Mark Salyzyn 67d7eafd56 liblog: add android_log_write_string8_len
android_log_write_string8_len(android_log_context ctx,
                              const char *value, size_t maxlen)

Caps the supplied string to a maxlen length. Alter API to handle
a NULL pointer for the value string for this and
android_log_write_string8() and instead of returning -EINVAL,
act like a null string "" was supplied to preserve the list
location. API is also changed to report the number of characters
actually placed into the android_log_context.

Bug: 27356456
Bug: 19235719
Change-Id: I6a03d405eac1d741555dd05555513ec691e7a46e
2016-02-25 12:29:32 -08:00
Steve Fung 2681515100 Merge "crash_reporter: Fix product_id in kernel crash reports" 2016-02-25 20:20:25 +00:00
Yusuke Sato 37c90df931 Merge "Use ro.debuggable instead of ro.build.type" 2016-02-25 19:32:57 +00:00
James Hawkins 9336b613ca libpixelflinger: Fix -Woverloaded-virtual warnings.
GGLAssembler inherits a reset method from two parent classes, but it
provides a separate reset method with a different signature, thus hiding
the inherited reset methods.

The fix is to explicitly hide the inherited reset methods as private.

Bug: 27346663
Change-Id: Ic64b00acb6d77fb791cfdeade9ef7e20148817c1
2016-02-25 10:59:30 -08:00
Yusuke Sato 246b0fd0d9 Use ro.debuggable instead of ro.build.type
Change-Id: I4d7c8c353ff47fbeee065b2c4fdd984768d0da00
2016-02-25 10:53:55 -08:00
Josh Gao 4e5b292299 Merge "adb: bail out if wait_for_device fails in send_shell_command." 2016-02-25 18:43:42 +00:00
Josh Gao 77dc40f2fa Merge "adb: fix leak of framework_fd." 2016-02-25 18:43:34 +00:00
Mattias Nissler 511e943855 Merge "Prepare mincrypt tools for move to recovery repo." 2016-02-25 14:55:09 +00:00
Steve Fung b3a48e1863 crash_reporter: Fix product_id in kernel crash reports
Move the bdk_version, product_id, and product_version metadata
population into the base crash_collector class so that all
colletors correctly report those fields in crash reports.

BUG=27344416
TEST=crash_reporter_tests passes.

Change-Id: I050053055f197d01661a1442e3cdcccc53c1c8fe
2016-02-25 03:37:33 -08:00
Josh Gao 9f48611554 adb: fix leak of framework_fd.
Move the fdevent for the framework authentication connection out of
atransport into its own static variable in adb_auth_client, since its
lifetime is completely unrelated to that of the USB connection.

Bug: http://b/27297963
Change-Id: Ie6180d0b59d133120c5755e239e76ab33ed3cc1d
2016-02-24 17:56:12 -08:00
Dimitry Ivanov 0f8753c6f0 Merge "Add PreloadPublicNativeLibraries function" 2016-02-25 01:05:56 +00:00
Dimitry Ivanov 6f80022908 Add PreloadPublicNativeLibraries function
Shift responsibility of preloading native libraries to the user
of the library. This lets applications that do not use jni but
depend on libnative_loader.so to avoid unnecessary preloads of
public libraries which could be expensive.

Bug: http://b/27245894
Change-Id: I12a8100de5da639c068769bca21ecebff2b2d538
(cherry picked from commit 426799d770)
2016-02-24 16:45:26 -08:00
Josh Gao f56c39194f adb: bail out if wait_for_device fails in send_shell_command.
Bug: http://b/27166186
Change-Id: Ib7e9d7e6b909d67a3af94c3517a6a0b54cf17db7
2016-02-24 15:22:14 -08:00
Jorge Lucangeli Obes d458730b64 Merge "adbd: Remove explicit capability bounding set code." 2016-02-24 22:13:09 +00:00
Jorge Lucangeli Obes 21dd6feb1c Merge "Add more first-party Brillo system users." 2016-02-24 22:12:46 +00:00
Jorge Lucangeli Obes 1c13c3d388 Add more first-party Brillo system users.
Brillo is converging on a set of mandatory system services to be
included in all Brillo builds. We'd like these services to run as
separate users just like other native Android/Brillo system services.

Add users for these services:
-Firewalld: Brillo has more granular firewall requirements (think e.g.
  Brillo-powered router.) Firewalld exposes a (currently) D-Bus/
  (soon to be) Binder API to broker access to IPTables rules.
-Trunksd: Some Brillo product configs will require TPMs. Trunksd
  manages TPMs in Chrome OS and Brillo.

Bug: 27299198

Change-Id: Ibe3303acdd9398ea52da0a37dbef73e5c5a948f7
2016-02-24 13:38:01 -08:00
James Hawkins 4a630ee0d3 Merge "bootstat: Record the time since factory reset on init." 2016-02-24 20:48:00 +00:00
Jorge Lucangeli Obes c5972cda6c Merge "Sync internal<->AOSP user list." 2016-02-24 19:07:04 +00:00
James Hawkins 53684ea625 bootstat: Record the time since factory reset on init.
Bug: 25448351
Change-Id: I71905a598e74f41c18a96d469c7a6ddd5a2e07fb
2016-02-24 11:01:03 -08:00
Mark Salyzyn 5c77ad55d0 logd: sock_alloc_send_pskb starves pruning
Allow socket send syscall to terminate after 32 seconds if reader
stalled because of memory pressure allocating new network buffers

Add a gTest to catch regressions, add security buffer to log_dump

Bug: 27242723
Change-Id: Idaa6699d9d284e7f5f723ae0e76b3d6aa3371489
2016-02-24 10:15:32 -08:00
Mark Salyzyn 2ad0bd0a9b logd: Allow (some) headers to be individually importable
LogReader.h needs to be individually importable.

Fix a few others, drop includes of local includes, let them be
included in source instead and allow headers to be included
alphabetically. Was not a complete audit since goal was to
separate LogReader.h out from the pack.

Bug: 27242723
Change-Id: Ic7759ef90995e5bd285810706af33550c73cf5b5
2016-02-24 10:15:22 -08:00
Mattias Nissler 3436bb4bd8 Prepare mincrypt tools for move to recovery repo.
This adds a conditional build guard to enable a smooth move of the
dumpkey tool to the bootable/recovery project without breaking the
build during the transition period.

BUG:27326256
Change-Id: Ia23b31bb559a668273b5c0548b7bd1797049a224
2016-02-24 16:06:32 +01:00
Chien-Yu Chen 0836c9e386 Sync internal<->AOSP user list.
Bug: 27299198

Cherry-picked from:

Restart cameraserver

Bug: 24511454
Change-Id: Ia27f4ef0eb71f891c789f637a21b04afe0b1c4e9
2016-02-23 15:56:55 -08:00
Dan Willemsen 978cda5cc6 Merge "Remove duplicate fdevent.cpp entry" 2016-02-23 23:36:10 +00:00
Dan Willemsen 582c8fe1d4 Remove duplicate fdevent.cpp entry
Fixes the following warnings:

build/core/binary.mk:894: warning: overriding commands for target
`out/target/product/bullhead/obj/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: ignoring old commands for target
`out/target/product/bullhead/obj/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: overriding commands for target
`out/target/product/bullhead/obj_arm/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'
build/core/binary.mk:894: warning: ignoring old commands for target
`out/target/product/bullhead/obj_arm/STATIC_LIBRARIES/libadbd_intermediates/fdevent.o'

Change-Id: Id4b13574e568284cefbc3a763d40843e73ddbd3d
2016-02-23 14:28:20 -08:00
Bernhard Rosenkränzer c434cf82d5 Allow building with Python 3.x
Allow the scripts to run with both python 2.x and 3.x

Change-Id: I911118bcf370d09bdb2fb46afa21af64257f1ffb
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
2016-02-23 21:39:35 +00:00
Jorge Lucangeli Obes 4d186ad964 adbd: Remove explicit capability bounding set code.
Minijail supports dropping capabilities from the bounding set.
Use that code instead.

This cleans up one small loose end in the work started with
https://android-review.googlesource.com/#/c/187775/

Final diff: fewer lines, more unit-tested code.
"""
$ git diff --stat 52cf4fa6aa3e8d13f61b1 adb/daemon/main.cpp
 adb/daemon/main.cpp | 56
 1 file changed, 27 insertions(+), 29 deletions(-)
"""

Bug: 27314096
Change-Id: I238975920b85fae376522eb26f5ad6d9fee0762a
2016-02-23 13:39:11 -08:00
Elliott Hughes 72d6269b6e Merge "Clean up CLOEXEC in qtaguid." 2016-02-23 18:41:47 +00:00
Elliott Hughes ed83cfba68 Merge "Clean up CLOEXEC in SocketListener." 2016-02-23 18:41:46 +00:00
Elliott Hughes f405d245eb Merge "Clean up CLOEXEC in debuggerd." 2016-02-23 18:40:56 +00:00
Ruchi Kandoi 08c8b53800 Merge "healthd: Remove warning by clang compiler." 2016-02-23 17:34:33 +00:00
David Pursell bfd9503d1d adb: use TCP keepalive.
Currently adb only realizes a TCP transport has gone away when it tries
to send a packet, which caused problems in particular for `adb reboot`
since no packets are sent, leading to the client hanging until Ctrl+C.

This CL turns on TCP keepalive packets to send 1 packet every second,
allowing up to 10 failures before disconnecting. Using built-in TCP
functionality turns out to be much cleaner in this case than trying to
implement our own keepalive packets at the application layer, and
should be more lightweight since it's all done in the TCP stack.

Bug: http://b/23093474

Change-Id: Ifb41cbb85b9752a9f394e1eed3c6ac4da47a4e4d
2016-02-23 09:11:18 -08:00
Mark Salyzyn cec3964f65 Merge "liblog: event log list logging handler" 2016-02-23 15:43:34 +00:00
Dimitry Ivanov 51c38147f8 Merge changes Ib80dcce9,Ifef3de75
* changes:
  nativeloader: Export FindNamespaceByClassLoader
  nativeloader: refactor FindNamespaceByClassLoader method
2016-02-23 05:33:22 +00:00
Mark Salyzyn bd1ad049b2 liblog: event log list logging handler
Based off an initial request and effort by williamluh@google.com

- Added the following functions:

* Composing and Writing:

android_log_context create_android_logger(uint32_t tag)

int android_log_write_list_begin(android_log_context ctx)
int android_log_write_list_end(android_log_context ctx)

int android_log_write_int32(android_log_context ctx, int32_t value)
int android_log_write_int64(android_log_context ctx, int64_t value)
int android_log_write_string8(android_log_context ctx, const char *value)
int android_log_write_float32(android_log_context ctx, float value)

int android_log_write_list(android_log_context ctx, log_id_t id)

* Reading and Interpreting:

android_log_context create_android_log_parser(const char *msg, size_t len)

android_log_list_element android_log_read_next(android_log_context ctx)
android_log_list_element android_log_peek_next(android_log_context ctx)

* Destroy context used above:

int android_log_destroy(android_log_context *ctx);

- Added unit gTests

We moved implemented android_log_buffer_to_string() to the test since
it is an alternate for already existing logprint functionality.
Please move into liblog should it be of some common use, otherwise
as is it is a good means of stessing the reading and interpreting
handlers.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 19235719
Change-Id: I4aa1927e8e6a75f0a129d15a27c891cf1ccd4f5c
2016-02-22 16:04:41 -08:00
Mark Salyzyn 806bb17e76 Merge "liblog: deal with warning messages" 2016-02-22 23:43:01 +00:00
Ruchi Kandoi e9320b7c92 healthd: Remove warning by clang compiler.
Bug: 27265206
Change-Id: I8f2ec1391952de4a9cdefce0433535608a1e9b59
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-02-22 13:59:31 -08:00
Dimitry Ivanov 0cd10d83e4 nativeloader: Export FindNamespaceByClassLoader
Bug: http://b/27189432
Change-Id: Ib80dcce949276ee620f601c47b20f783708e8e85
2016-02-22 13:48:22 -08:00
Dimitry Ivanov 34fa704df4 nativeloader: refactor FindNamespaceByClassLoader method
FindNamespaceByClassLoader returns android_namespace_t* to make
it suitable for exporting this functionality.

Bug: http://b/27189432
Change-Id: Ifef3de753192178e0184fb114596fe956fde2826
2016-02-22 13:15:28 -08:00
Yabin Cui d633106d3e Merge "healthd: support reading charge status from BatteryMonitor." 2016-02-22 18:34:15 +00:00
Josh Gao 0fc006685c Merge "adb: sysdeps_test: improve smoke test." 2016-02-20 02:39:51 +00:00
Josh Gao 2275f7da73 adb: sysdeps_test: improve smoke test.
Make sure that adb_poll sets revents for all of the structs passed in.
Also, zero initialize all of the adb_pollfd structs in the tests.

Change-Id: Ia639679a7e6f77483655f1552e89081c4673aa87
2016-02-19 18:36:09 -08:00
Josh Gao 44b08c722d Merge changes I4a8aa840,I9708f2a3
* changes:
  adb: check for an error response from adbd between each write.
  adbd: restore the old error handling behavior.
2016-02-20 02:28:22 +00:00
Elliott Hughes fcd7295962 Clean up CLOEXEC in SocketListener.
Change-Id: I9811573a4b64ef2e38f1e4ba17158911b05a5f34
2016-02-19 18:14:22 -08:00
Elliott Hughes b4de99c6dd Clean up CLOEXEC in qtaguid.
Change-Id: Ie14579b6c42340789b8b99009acc136dc4d1be4a
2016-02-19 18:13:51 -08:00
Elliott Hughes 17ba68d0cd Clean up CLOEXEC in debuggerd.
Change-Id: I1cd75f6a8f98e99f4a4fedfc706103ce34035765
2016-02-19 18:13:02 -08:00
Josh Gao 2e70b2d5d8 Merge changes I9757ab85,Idac80a24
* changes:
  adb: change unsigned to uint32_t in sync struct definitions.
  adb: detect when the client disconnects in wait-for-device.
2016-02-20 02:11:07 +00:00
Yabin Cui aedf6038dc healthd: support reading charge status from BatteryMonitor.
recovery needs to know whether the battery is charged.

Bug: 26879394
Change-Id: Ie2a1d06e81878efa3ff432c2015d409a625e473e
2016-02-19 18:03:23 -08:00
Josh Gao afcdcd703e adb: check for an error response from adbd between each write.
When sending a file, do a 0-timeout poll to check to see if an error has
occurred, so that we can immediately report failure.

Bug: http://b/26816782
Change-Id: I4a8aa8408a36940bfda7b0ecfa5d13755f4aa14d
2016-02-19 18:01:09 -08:00