Commit Graph

23928 Commits

Author SHA1 Message Date
Elliott Hughes 43c2aea0ca Merge \\"Add timestamps to libbase\\'s stderr logging.\\" am: 55d20a7632
am: dc1c4261f4

Change-Id: I18a9c1b10450cfee9531091be4c18a2484c9a2cd
2016-06-22 15:34:39 +00:00
Elliott Hughes dc1c4261f4 Merge \"Add timestamps to libbase\'s stderr logging.\"
am: 55d20a7632

Change-Id: Ia53ca3012594e57d2df6068314d0b2cfb99bd1dc
2016-06-22 15:31:56 +00:00
Elliott Hughes 55d20a7632 Merge "Add timestamps to libbase's stderr logging." 2016-06-22 15:27:51 +00:00
David Turner 6ab5cc6336 Merge \\"Remove qemu_tracing dependency.\\" am: ed5fd6fd5c
am: 23b9da5fce

Change-Id: I82654633e6f0d2dde528130caaa757b516a1b9ef
2016-06-22 08:15:14 +00:00
David 'Digit' Turner 23b9da5fce Merge \"Remove qemu_tracing dependency.\"
am: ed5fd6fd5c

Change-Id: I57bcff07288ff9210a0c27d264f587590ed44895
2016-06-22 08:12:36 +00:00
David Turner ed5fd6fd5c Merge "Remove qemu_tracing dependency." 2016-06-22 08:10:07 +00:00
Josh Gao 83cb3032d2 DO NOT MERGE: adb: use asocket's close function when closing.
close_all_sockets was assuming that all registered local sockets used
local_socket_close as their close function. However, this is not true
for JDWP sockets.

Backport of 53eb31d8 and 9b587de.

Bug: http://b/28347842
Change-Id: I05e071b3d5c7e55c7a59400c5c9bb0635eeef29f
2016-06-21 16:28:29 -07:00
Josh Gao 5218ad36ad DO NOT MERGE: adb: use asocket's close function when closing.
close_all_sockets was assuming that all registered local sockets used
local_socket_close as their close function. However, this is not true
for JDWP sockets.

Backport of 53eb31d8 and 9b587de.

Bug: http://b/28347842
Change-Id: I13ec6fd87a0691c72608baf6038adcc0f03dca9f
2016-06-21 16:28:21 -07:00
Elliott Hughes 4e5fd111d8 Add timestamps to libbase's stderr logging.
adb is the client that wants this, but I'm not aware of any client that
doesn't.

Bug: http://b/28467098
Test: tested manually with cat.
Change-Id: I82c3f7ddf466a67aedfbb9010e0939a44b71d3e5
2016-06-21 14:27:16 -07:00
David 'Digit' Turner ecc1972fb0 Remove qemu_tracing dependency.
The feature is not implemented anymore (and has been for a very long time).
Moreover, this will allow us to cleanup hardware/ from any QEMU-specific
items.

BUG=25875346

Change-Id: I71488f4128c737dedf2b28433499fa6ffd29dcb5
2016-06-21 20:24:55 +02:00
David Turner 6bcf0cf1e7 Merge \\"[qemu]: Move qemu_pipe.h from include/system/ directory.\\" am: 44b7339aa2
am: 1c01bae82a

Change-Id: I15159159b9e5d30c3e931db9bb35641dc82052b3
2016-06-21 08:08:03 +00:00
David 'Digit' Turner 1c01bae82a Merge \"[qemu]: Move qemu_pipe.h from include/system/ directory.\"
am: 44b7339aa2

Change-Id: I59b9a896058dea76f69b9ba757890d4a42952a66
2016-06-21 08:05:18 +00:00
David Turner 44b7339aa2 Merge "[qemu]: Move qemu_pipe.h from include/system/ directory." 2016-06-21 07:38:02 +00:00
Elliott Hughes 95bafa7cdd Merge \\"Use __ with attribute __noreturn__ to avoid colliding with noreturn.\\" am: e0dfd2a00e
am: a1d9edfbf3

Change-Id: I32e787af63a109c5ef27e6420e34936480706f51
2016-06-21 02:08:58 +00:00
Elliott Hughes a1d9edfbf3 Merge \"Use __ with attribute __noreturn__ to avoid colliding with noreturn.\"
am: e0dfd2a00e

Change-Id: I93779cd1785db5d277df21dffe1896edd40df7fb
2016-06-21 02:02:25 +00:00
Treehugger Robot e0dfd2a00e Merge "Use __ with attribute __noreturn__ to avoid colliding with noreturn." 2016-06-21 01:52:04 +00:00
Elliott Hughes 665051ca63 Use __ with attribute __noreturn__ to avoid colliding with noreturn.
Change-Id: I5a73ec69b580b2e70b2c68177078fa56b8353c19
2016-06-20 17:21:59 -07:00
Josh Gao dd0862800b adb: fix fd double close, Subprocess lifetime issue.
am: 69d2f98197  -s ours

Change-Id: I89cb249305f86d7ded312119e1981d64f227ce68
2016-06-20 23:53:10 +00:00
Josh Gao 69d2f98197 adb: fix fd double close, Subprocess lifetime issue.
This commit fixes two somewhat related issues in shell_service.

  - The fd returned by StartSubprocess is owned by a unique_fd
    contained in the Subprocess object, but also gets closed by the
    caller. Resolve this by duping the returned file descriptor.

  - A Subprocess object can be destroyed immediately after its initial
    construction in StartSubprocess if we're sufficiently unlucky.
    Split up the fork/exec and "start management thread" steps, so that
    we can safely do everything we need to do on the Subprocess before
    handing it over to the thread that'll eventually destroy it.

Also includes squashed patches from AOSP master that allow for use of
unique_fd inside adb.

Bug: http://b/29254462
Change-Id: Id9cf0b7e7a7293bee7176919edc758597691c636
(cherry picked from commit c0e6e40cc9)
(cherry picked from commit 54c72aaccc)
(cherry picked from commit 2c5d1d7cd9)
(cherry picked from commit 2a7b86337f)
(cherry picked from commit 13ea01db45)
(cherry picked from commit 344778da41)
2016-06-20 14:51:05 -07:00
Josh Gao 48915ad5e0 Merge changes from topic \\'debuggerd_client\\' am: abf88685e3
am: 88347e1430

Change-Id: I81a54d4f0c017090f8d9f31459181c537842ff7c
2016-06-20 20:49:40 +00:00
Josh Gao 85f9d7c686 Merge \\"adb: fix fd double close, Subprocess lifetime issue.\\" am: b23e5729a8
am: 34c6ca01ff

Change-Id: I7f0287759f138096f810324e3e55031e9b92a042
2016-06-20 20:49:37 +00:00
Michael Scott 3953bade4b resolve merge conflicts of a617e33 to stage-aosp-master
am: 9f6b80c9c8

Change-Id: I474aa2da34cc0ec798292d27f9e139dabb983924
2016-06-20 20:49:34 +00:00
Josh Gao 88347e1430 Merge changes from topic \'debuggerd_client\'
am: abf88685e3

Change-Id: I2a61e4e8b5ec5a4ab6566ab4f8eb31653255fbc5
2016-06-20 20:47:18 +00:00
Josh Gao 34c6ca01ff Merge \"adb: fix fd double close, Subprocess lifetime issue.\"
am: b23e5729a8

Change-Id: I96db140e4316b767fb632307a435bc3e22cbfb36
2016-06-20 20:47:17 +00:00
Treehugger Robot abf88685e3 Merge changes from topic 'debuggerd_client'
* changes:
  adb: use libdebuggerd_client.
  debuggerd: add libdebuggerd_client.
2016-06-20 20:22:18 +00:00
Treehugger Robot b23e5729a8 Merge "adb: fix fd double close, Subprocess lifetime issue." 2016-06-20 20:15:59 +00:00
Dmitry Shmidt 9f6b80c9c8 resolve merge conflicts of a617e33 to stage-aosp-master
Change-Id: I0d1e6b1771eebc38f7eea5a942395c5f8ff6a5ac
2016-06-20 12:58:37 -07:00
Treehugger Robot a617e336dc Merge "batterymonitor: simplify readFromFile and use std::string buffers" 2016-06-20 19:31:12 +00:00
Josh Gao 344778da41 adb: fix fd double close, Subprocess lifetime issue.
This commit fixes two somewhat related issues in shell_service.

  - The fd returned by StartSubprocess is owned by a unique_fd
    contained in the Subprocess object, but also gets closed by the
    caller. Resolve this by duping the returned file descriptor.

  - A Subprocess object can be destroyed immediately after its initial
    construction in StartSubprocess if we're sufficiently unlucky.
    Split up the fork/exec and "start management thread" steps, so that
    we can safely do everything we need to do on the Subprocess before
    handing it over to the thread that'll eventually destroy it.

Bug: http://b/29254462
Change-Id: Id9cf0b7e7a7293bee7176919edc758597691c636
2016-06-20 11:40:16 -07:00
Michael Scott 3217c5c7d9 batterymonitor: simplify readFromFile and use std::string buffers
In readFromFile() when a newline is not found in the data, we reset
the initial character of the buffer to \0, but leave the count as is
(something >0 in this case).

Later in getBooleanField() we could erroneously treat a response as
"true" because count would be >0 and the initial value of buf would
be != '0' (set to \0 in this case).

To fixup error paths such as this, we can simplify readFromFile
by using android::base functions: ReadFromFileString() and Trim().

NOTES:
- Converted char * buffers used with readFromFile to std::string
- Removed unused variable btech from BatteryMonitor::update

Testing Done:
- Build healthd and recovery for angler device
- Confirm that known values are being read correctly from kernel
  sysfs.

Change-Id: I238bbff097543767f352aa084bf0acbc1324baca
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2016-06-20 15:01:02 +00:00
Christopher Ferris 942c77793f Merge \\"Fix race condition updating local map data.\\" am: 863d8e11b9
am: e1eb2272d6

Change-Id: Ic7553354081f2bc2f578b30db9719ce7a6acc255
2016-06-18 00:12:16 +00:00
Christopher Ferris e1eb2272d6 Merge \"Fix race condition updating local map data.\"
am: 863d8e11b9

Change-Id: I00899ce500c2ae8bc58b6eb42c01d8688dd232c0
2016-06-18 00:05:26 +00:00
Christopher Ferris 863d8e11b9 Merge "Fix race condition updating local map data." 2016-06-17 23:57:14 +00:00
Josh Gao 809607ae28 adb: use libdebuggerd_client.
Bug: http://b/24414818
Change-Id: I177708877488e5c4f99c453498485a2daa9b79b0
2016-06-17 13:11:29 -07:00
Josh Gao 9c02dc5916 debuggerd: add libdebuggerd_client.
Bug: http://b/24414818
Change-Id: I079c534d2c952b6975bf0428eb86cc7a55525737
2016-06-17 13:11:29 -07:00
David 'Digit' Turner c7b098ceb5 [qemu]: Move qemu_pipe.h from include/system/ directory.
The <hardware/qemu_pipe.h> header isn't related to any loadable
hardware module, this patch thus relocates it to <system/qemu_pipe.h>
which is a much more logical location.

Note the following changes:

  - The pipe name must begin with the 'pipe:' prefix to avoid an
    un-necessary snprintf() and buffer copy.

  - Does not probe for the obsolete /dev/goldfish_pipe device, i.e.
    only use /dev/qemu_pipe instead.

  - Use QEMU_PIPE_DEBUG() instead of D() as the debugging macro.

+ Update ADB to use the newest <system/qemu_pipe.h>

+ Add qemu_pipe_frame_send() and qemu_pipe_frame_recv() utility
  functions which replace the obsolete qemud_channel_send() and
  qemud_channel_recv() from the defunct <hardware/qemud.h>
  header.

BUG=25875346

Change-Id: Ic290a5b79d466c2af64b49bd9134643277c11bfd
2016-06-17 09:21:59 +02:00
Christopher Ferris 3a14004c7f Fix race condition updating local map data.
If the underlying local map changes, it's possible for multiple
threads to try and modify the map data associated with the UnwindLocalMap
object. Add a lock when generating the local map to avoid this problem.

In addition, add a read lock whenever any caller gets the maps iterator.
Updated all iterator callers to make this lock.

Bug: 29387050
Change-Id: Ie34822c3d8fd3bdb3dd126aeeb399969c36508c1
2016-06-16 23:28:11 -07:00
Elliott Hughes 5534d11498 Merge \\"init: report createProcessGroup failure.\\" am: 2d690a920f
am: 32cc6c9908

Change-Id: Ie03d3c49e64ed2de4980c92db2cf12a5e56e5c39
2016-06-17 04:24:49 +00:00
Elliott Hughes 32cc6c9908 Merge \"init: report createProcessGroup failure.\"
am: 2d690a920f

Change-Id: I4ec8df459aefa4aebb3cdf9ec5aa40bc4e727f39
2016-06-17 04:16:21 +00:00
Treehugger Robot 2d690a920f Merge "init: report createProcessGroup failure." 2016-06-17 04:12:17 +00:00
Josh Gao 483d68ece4 Merge \\"adb: make adb root not wait-for-device.\\" am: 81e59ca5a7
am: ba7aea829b

Change-Id: I9c2a95c51aa40e61180e87df84d77db258bffb81
2016-06-16 22:44:03 +00:00
Josh Gao ba7aea829b Merge \"adb: make adb root not wait-for-device.\"
am: 81e59ca5a7

Change-Id: I231ad44c7b6293256f33eb3fd617b4e5da728ca1
2016-06-16 22:41:08 +00:00
Treehugger Robot 81e59ca5a7 Merge "adb: make adb root not wait-for-device." 2016-06-16 22:26:41 +00:00
Josh Gao 05824734ac adb: make adb root not wait-for-device.
`adb root` would hang for devices connected over TCP/IP, because they
never come back. Unfortunately, there doesn't seem to be an easy way to
find out what we're talking to, so replace it with a long sleep for now.

Bug: http://b/27836058
Change-Id: Icd6e6bf817ca9e2124c2961665c37b2f31f7ef29
2016-06-16 14:02:01 -07:00
Ruchi Kandoi 457ca14c59 Merge \"logd: logcat -L takes longer causing vold to timeout.\" into nyc-dev
am: b02819e2af  -s ours

Change-Id: Id403d4ce398b7a9ecc604001469dc28d7d07b59e
2016-06-16 18:06:23 +00:00
Ruchi Kandoi b02819e2af Merge "logd: logcat -L takes longer causing vold to timeout." into nyc-dev 2016-06-16 17:44:30 +00:00
Vitalii Tomkiv b20a94398b Merge \\"Set zygote process priority to -20 to speed up VM startup time.\\" am: 92774329dd
am: bf5f0fae07

Change-Id: I510a476fe26d9df94249a4f91422db13eaffb896
2016-06-16 17:12:38 +00:00
Vitalii Tomkiv bf5f0fae07 Merge \"Set zygote process priority to -20 to speed up VM startup time.\"
am: 92774329dd

Change-Id: I3c70a90e4d4e07f7c733a3a2738b0067ac09b6dd
2016-06-16 17:09:36 +00:00
Vitalii Tomkiv 92774329dd Merge "Set zygote process priority to -20 to speed up VM startup time." 2016-06-16 16:54:43 +00:00
Elliott Hughes 5a4ab064ec Merge \\"Better diagnostics from \\"adb sideload\\".\\" am: edd401e24e
am: c63439ae7f

Change-Id: Iba368cdb974292d8e2cce1cfac7a96ef93809e1f
2016-06-15 23:31:47 +00:00