Commit graph

21468 commits

Author SHA1 Message Date
Nick Kralevich
c61a896f20 ensure /data/tombstones exists on all Android device. DO NOT MERGE
am: 9c0ed66313

* commit '9c0ed663138138bb40396bfd350f137e5057277b':
  ensure /data/tombstones exists on all Android device. DO NOT MERGE
2016-02-24 19:11:38 +00:00
Josh Gao
99b8a56616 Don\'t create tombstone directory.
am: cb9625cbe5

* commit 'cb9625cbe54f009c216a1f50fcaee15ee3478357':
  Don't create tombstone directory.
2016-02-24 19:05:34 +00:00
Nick Kralevich
9660c6759e ensure /data/tombstones exists on all Android devices
am: e2796207ee

* commit 'e2796207ee5a1ff2ebea30bdcf6d2c2553546b86':
  ensure /data/tombstones exists on all Android devices
2016-02-24 19:05:12 +00:00
Glenn Kasten
6bceddcaee Merge "Restore audio tee sink" into nyc-dev 2016-02-24 16:40:23 +00:00
William Luh
5cb3200b5c Add macro to call event logger for errors. DO NOT MERGE am: 769cba57e4 -s ours am: 43c0f28c11 am: ec0d1037ab am: 785f82c09d
am: 041cb4aa55  -s ours

* commit '041cb4aa55a3a1dee488dfa954772d67103a5566':
  Add macro to call event logger for errors. DO NOT MERGE
2016-02-24 04:29:31 +00:00
William Luh
041cb4aa55 Add macro to call event logger for errors. DO NOT MERGE am: 769cba57e4 -s ours am: 43c0f28c11 am: ec0d1037ab
am: 785f82c09d

* commit '785f82c09d113126e6575d257df2bbf8b0823afe':
  Add macro to call event logger for errors. DO NOT MERGE
2016-02-24 03:01:13 +00:00
William Luh
785f82c09d Add macro to call event logger for errors. DO NOT MERGE am: 769cba57e4 -s ours am: 43c0f28c11
am: ec0d1037ab

* commit 'ec0d1037ab53465734934f2c91a5e0c015881633':
  Add macro to call event logger for errors. DO NOT MERGE
2016-02-24 02:54:36 +00:00
William Luh
ec0d1037ab Add macro to call event logger for errors. DO NOT MERGE am: 769cba57e4 -s ours
am: 43c0f28c11

* commit '43c0f28c1135bd1f1640441e3fa259be04aa04b0':
  Add macro to call event logger for errors. DO NOT MERGE
2016-02-24 02:46:27 +00:00
William Luh
43c0f28c11 Add macro to call event logger for errors. DO NOT MERGE
am: 769cba57e4  -s ours

* commit '769cba57e446be099c792516486a304a18ee2952':
  Add macro to call event logger for errors. DO NOT MERGE
2016-02-24 02:39:45 +00:00
Josh Gao
7b84c9bf93 Merge changes from topic 'adb_cherrypick' into nyc-dev
* changes:
  adb: sysdeps_test: improve smoke test.
  adb: check for an error response from adbd between each write.
  adbd: restore the old error handling behavior.
  adb: change unsigned to uint32_t in sync struct definitions.
  adb: detect when the client disconnects in wait-for-device.
  adb: make fdevent_test, socket_test compile on Windows.
  adb: add fd exhaustion test, fix errno reporting in sysdeps_win32.
  adb: move win32 fd base to 2048, fix fd allocation.
  adb: don't emulate fdevent or socketpair on Windows.
  adb: fix clang-format for access modifier dedent.
  Add missing liblog dependency
  adb: sysdeps_win32: actually change ExitThread to _endthreadex.
  adb: make adb_thread_func_t return void, add adb_thread_exit.
  adb: redact reference to secret internal time machine.
  adb: mkdirs fixes
  adb: sysdeps: add support for joining threads.
  adb: allow wine's output for sysdeps_win32 strerror test.
  adb: setsid() for adb host server.
  adb: make ctrl-c when spawning a daemon not kill the daemon.
  adb: fix mkdirs test.
2016-02-24 00:50:36 +00:00
Jesse Hall
2f9cd05c47 Merge "native_loader: add libvulkan.so to public native library list" into nyc-dev 2016-02-24 00:50:10 +00:00
Jesse Hall
dee3d96c01 native_loader: add libvulkan.so to public native library list
Change-Id: I2228af5ec4b815631a9c5ca745718807d58028a3
2016-02-23 16:16:47 -08:00
William Luh
769cba57e4 Add macro to call event logger for errors. DO NOT MERGE
Bug:23180694
Change-Id: I566a290334345f48013029534efef3e08e726e40
2016-02-23 16:04:34 -08:00
Glenn Kasten
845a4ffef8 Restore audio tee sink
Bug: 27323882
Change-Id: I1131c0537942c8f7cbf9ff6cc6847ab7e93e6187
2016-02-23 15:23:46 -08:00
Mohamad Ayyash
5dac46ac94 Merge "Revert "Revert "Update make_ext4fs_internal param-list to match new implementation""" into nyc-dev 2016-02-23 22:54:27 +00:00
Yabin Cui
959dea3585 Merge "healthd: support reading charge status from BatteryMonitor." into nyc-dev 2016-02-23 22:42:58 +00:00
Dimitry Ivanov
f44ecde588 nativeloader: Export FindNamespaceByClassLoader
Bug: http://b/27189432
Change-Id: Ib80dcce949276ee620f601c47b20f783708e8e85
(cherry picked from commit 0cd10d83e4)
2016-02-23 11:50:44 -08:00
Dimitry Ivanov
c914ebd484 nativeloader: refactor FindNamespaceByClassLoader method
FindNamespaceByClassLoader returns android_namespace_t* to make
it suitable for exporting this functionality.

Bug: http://b/27189432
Change-Id: Ifef3de753192178e0184fb114596fe956fde2826
(cherry picked from commit 34fa704df4)
2016-02-23 11:50:28 -08:00
Dimitry Ivanov
32912090e6 Merge "Move libnativeloader headers into libnativeloader." into nyc-dev 2016-02-23 19:45:22 +00:00
Yabin Cui
b0580d710f healthd: support reading charge status from BatteryMonitor.
recovery needs to know whether the battery is charged.

Bug: 26879394
Change-Id: Ie2a1d06e81878efa3ff432c2015d409a625e473e
(cherry picked from commit aedf6038dc)
2016-02-23 11:01:21 -08:00
Yabin Cui
126f4d65ca Merge "healthd: separate libbatterymonitor for use in recovery." into nyc-dev 2016-02-23 18:55:54 +00:00
James Hawkins
85def183bd Merge "bootstat: Record metrics for factory_reset and time_since_factory_reset." into nyc-dev 2016-02-23 18:52:55 +00:00
Yabin Cui
f6dbc6d4b8 healthd: separate libbatterymonitor for use in recovery.
Bug: 26879394

Change-Id: I97b5b4994c42988ce43f5085b8b4b25e9e80c9fa
(cherry picked from commit e98e177a34)
2016-02-23 10:52:43 -08:00
Yabin Cui
ac3387b71b healthd: init members of BatteryMonitor.
Bug: 26879394
Change-Id: I09a6c78137f91a0c88bf4ba1e8890b4ec31dcf2c
(cherry picked from commit db04a49a6f)
2016-02-23 10:46:38 -08:00
Mark Salyzyn
9dd6510dd0 liblog: event log list logging handler
(cherry pick from commit bd1ad049b2)

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-23 07:45:49 -08:00
Josh Gao
fa3e0bc67f 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
(cherry picked from commit 2275f7da73)
2016-02-22 15:57:09 -08:00
Josh Gao
da8119596f 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
(cherry picked from commit afcdcd703e)
2016-02-22 15:57:09 -08:00
Josh Gao
4d74811cd4 adbd: restore the old error handling behavior.
Restore the previous file sync error handling behavior of reporting
failure, and then consuming packets from the other end until receiving a
DONE packet.

Bug: http://b/26816782
Change-Id: I9708f2a36c072547e191fa0b6b42dffc31f8a2f2
(cherry picked from commit 20a96c7d79)
2016-02-22 15:57:09 -08:00
Josh Gao
8d68591c46 adb: change unsigned to uint32_t in sync struct definitions.
Change-Id: I9757ab853cfad1a2e1393ef32bcab222ab84acef
(cherry picked from commit 69469c4e9f)
2016-02-22 15:57:09 -08:00
Josh Gao
cd2039e484 adb: detect when the client disconnects in wait-for-device.
Avoid leaking a thread and its associated resources when a user cancels
wait-for-device.

Bug: http://b/26966721
Bug: https://code.google.com/p/android/issues/detail?id=199088
Change-Id: Idac80a24e9739ddd24e500fe14826a78f350c018
(cherry picked from commit 09855472f4)
2016-02-22 15:57:08 -08:00
Josh Gao
b582fa3bd8 adb: make fdevent_test, socket_test compile on Windows.
Switch pthread_* to use the adb_thread_* abstractions to allow the fdevent
and socket tests to compile on Win32.

Bug: http://b/27105824
Change-Id: I6541bb1398780b999837e701837d7f86a5eee8ca
(cherry picked from commit 022d447e9e)
2016-02-22 15:57:08 -08:00
Josh Gao
c1d252bec2 adb: add fd exhaustion test, fix errno reporting in sysdeps_win32.
Add a test for FD exhaustion, and fix cases where we weren't properly
setting errno.

Change-Id: I486055bb9ead31089ce76b210c11de9e973f3256
(cherry picked from commit 6487e74a59)
2016-02-22 15:57:08 -08:00
Josh Gao
8443fd994a adb: move win32 fd base to 2048, fix fd allocation.
Windows has a maximum fd limit of 2048, so we can avoid collision with
real file descriptors by starting from there. Also, fds would be
previously be allocated by a linear walk from the last allocated FD,
instead of the lowest available FD, as required by POSIX. Keep track of
the lowest available file descriptor to make things feel more familiar.

Change-Id: Id6ac1c54f4f7964a6cdfa8d3f4f96262e4881964
(cherry picked from commit b6232b96dd)
2016-02-22 15:57:08 -08:00
Josh Gao
addab3d84d adb: don't emulate fdevent or socketpair on Windows.
Change-Id: I16cf7d4427eb79f36db39e91f85402a268fa72f5
(cherry picked from commit 3777d2ecc0)
2016-02-22 15:57:08 -08:00
Josh Gao
0b57ef735a adb: fix clang-format for access modifier dedent.
It was previously -1 (the default from Google style, since it uses 2
space indentation), instead of -2.

Change-Id: I1865505ce17a2cc13b85de58bda55c3b1dfcf08c
(cherry picked from commit 5da522ec45)
2016-02-22 15:57:08 -08:00
Dimitry Ivanov
8b642e42b4 Add missing liblog dependency
Bug: http://b/27171986
Change-Id: Ia7f03c72de9a8e5d61896bde6b4b1af396376f54
(cherry picked from commit 01f21da732)
2016-02-22 15:57:08 -08:00
Josh Gao
2674cd922e adb: sysdeps_win32: actually change ExitThread to _endthreadex.
Forgot to amend this into b5fea14e.

Change-Id: Id04e639eb87043901681db789d7a7925300fa867
(cherry picked from commit d7b3749202)
2016-02-22 15:57:08 -08:00
Josh Gao
d9db09c315 adb: make adb_thread_func_t return void, add adb_thread_exit.
Windows restricts the return value of threads to 32-bits, even on 64-bit
platforms. Since we don't actually return meaningful values from thread,
resolve this inconsistency with POSIX by making adb's thread abstraction
only take void functions.

Change-Id: I5c23b4432314f13bf16d606fd5e6b6b7b6ef98b5
(cherry picked from commit b5fea14e13)
2016-02-22 15:57:08 -08:00
Josh Gao
7e76c89544 adb: redact reference to secret internal time machine.
Change-Id: Ic6744cc7c858576d7e6172460b32902e007b6fd3
(cherry picked from commit 6b42a2bfd5)
2016-02-22 15:57:08 -08:00
Spencer Low
a1071c6924 adb: mkdirs fixes
Fix pathological case where the directory to be created can't be created
because there is already a file there. This was previously returning
success because the wrong var was passed to directory_exists().

Fix test to exercise this situation. Also clarify tests.

Change-Id: I0dc0f14084e0eda4e1498874d4ab2a6445d322ac
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
(cherry picked from commit 85c45bd5a1)
2016-02-22 15:57:08 -08:00
Josh Gao
d302a15a60 adb: sysdeps: add support for joining threads.
Bug: http://b/27105824
Change-Id: I44e4edbb2a59565c35f1f3e6a6394ac258591f95
(cherry picked from commit 3b3e10d046)
2016-02-22 15:57:08 -08:00
Josh Gao
32a2b60c4e adb: allow wine's output for sysdeps_win32 strerror test.
Change-Id: Ia5d04a2347df1bcd8c7efcc1da9cec9725007a58
(cherry picked from commit 22554c9167)
2016-02-22 15:57:08 -08:00
Yabin Cui
65f7080c66 adb: setsid() for adb host server.
To create a daemon for adb host server, we should call setsid()
for the daemon process. However, previously we call setsid() for
the adb client process, which results in nothing but EPERM error.

Bug: 26982628
Change-Id: I2763ae3d5a243706927d7ef6af5095138c0ce2d8
(cherry picked from commit 6bf323b97a)
2016-02-22 15:57:08 -08:00
Josh Gao
9ad736a637 adb: make ctrl-c when spawning a daemon not kill the daemon.
Previously, using ctrl-c in a command that needs to spawn a daemon
because one isn't already available would kill the daemon along with the
foreground process.

Bug: http://b/26982628
Change-Id: I7fefc531c3e4895423e7b466322b5426d01dc9ef
(cherry picked from commit b72b3f8c92)
2016-02-22 15:57:08 -08:00
Josh Gao
db262ffa62 adb: fix mkdirs test.
The behavior of mkdirs was changed a while ago, without updating the
test.

Change-Id: I2aaa73818933b281e911c42a14e3c843d8bd972a
(cherry picked from commit 1172b2ec71)
2016-02-22 15:57:07 -08:00
Mark Salyzyn
ac460fc6de Merge "liblog: deal with warning messages" into nyc-dev 2016-02-22 23:47:07 +00:00
Mark Salyzyn
b7a0166b00 liblog: deal with warning messages
(cherry pick from commit b525884edb)

- Fix bug in fake_log_devices when it can not allocate memory
  failing to use the full on-stack buffer as backup.
- remove superfluous code.

Bug: 27265662
Change-Id: I97b6cca5f4ce8ecad9beb3a08353de596d6a4ad1
2016-02-22 15:46:22 -08:00
Elliott Hughes
2a7f7e0090 Move libnativeloader headers into libnativeloader.
Change-Id: I227676276da1b08a84486f29fb0e1502c8dbdf4a
(cherry picked from commit e2b4e1e00c)
2016-02-22 15:23:22 -08:00
Sami Tolvanen
0bdad0f231 logd: enforce policy integrity
If a SELinux policy change or a switch to permissive mode is detected
on a user build, restart the device into safe mode, and keep it there
until an OTA is applied or user data is wiped.

This change deprecates the ro.logd.auditd property.

Needs matching changes from
  I781c3059ea8d4fb2f0c923e4488b1932d69678d3
  Ica825cf2af74f5624cf4091544bd24bb5482dbe7
  Id3ca7889ede30b54b7af73dd50653ca1a20d59aa

Bug: 26902605
Change-Id: Idcdc5bff133f13c1267f0ec0a75cc8cf1ddbda0d
(cherry picked from commit d122ee65b6)
2016-02-22 14:00:43 -08:00
James Hawkins
35349148e1 bootstat: Record metrics for factory_reset and time_since_factory_reset.
Bug: 25448351
Change-Id: I9b3a557317bc256a078f76e2b65d16bc071e4a6a
(cherry picked from commit 500d71566a)
2016-02-22 13:30:11 -08:00