Commit Graph

20604 Commits

Author SHA1 Message Date
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
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 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
Treehugger Robot 2d690a920f Merge "init: report createProcessGroup failure." 2016-06-17 04:12:17 +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
Vitalii Tomkiv 92774329dd Merge "Set zygote process priority to -20 to speed up VM startup time." 2016-06-16 16:54:43 +00:00
Treehugger Robot edd401e24e Merge "Better diagnostics from "adb sideload"." 2016-06-15 23:18:52 +00:00
Treehugger Robot 35151f49ca Merge "Minor adb style fixes." 2016-06-15 22:41:57 +00:00
Elliott Hughes 14415142c9 Better diagnostics from "adb sideload".
Well, slightly less bad diagnostics, anyway.

Change-Id: Idf5612f7dcb9bdbd7252163889e2612ba197426d
2016-06-15 15:09:47 -07:00
Elliott Hughes ad8e94e017 init: report createProcessGroup failure.
Also directly kill the initial pid for safety, like other libprocessgroup
users.

Change-Id: Ib28936aea19cceaeaa54734759d5ae0c252c7905
2016-06-15 14:49:57 -07:00
Elliott Hughes ffc73a39fd Minor adb style fixes.
Change-Id: Ic4b45828dfdf88ef6c0fc468f66df3e62d2fbe51
2016-06-15 14:46:56 -07:00
Mattias Nissler ab8fe428db trusty: Add nvram-wipe utility.
This adds a small utility which is useful to trigger access-controlled
NVRAM wipes from recovery and to disable wiping functionality after
boot.

BUG: 29260086
Change-Id: I131d400ab2643ce91d7838a2bb770afd48f83b5f
2016-06-15 14:09:53 +02:00
Tao Bao 4d34653720 Merge "fs_mgr: Track the bootloader_message struct change." 2016-06-14 16:09:16 +00:00
Elliott Hughes 0f5b6c160c Merge "Lose top to toybox." 2016-06-14 15:45:50 +00:00
Elliott Hughes 4558428ae8 Lose top to toybox.
Change-Id: I625fad2c45a02bbc39125a4a10def8d74dd32cf7
2016-06-13 18:54:01 -07:00
Elliott Hughes 62cc17de8c Merge "Fix the sense of a test in "adb sideload"." 2016-06-13 23:21:29 +00:00
Elliott Hughes 356fd364ad Fix the sense of a test in "adb sideload".
Change-Id: I516a2ad2d74d9322ff9eb2e4cd3c3829e5cbda99
2016-06-13 15:01:13 -07:00
Sami Tolvanen 4824e794b2 Merge "fs_mgr: validate corrected signatures" 2016-06-13 15:04:17 +00:00
Mark Salyzyn 2546a7f8fd Merge "logcatd: add stop and clear actions" 2016-06-10 21:43:58 +00:00
Mark Salyzyn cd5118bf1e logcatd: add stop and clear actions
- add stop and clear (and stop) actions to logcatd.rc
- use stop and clear actions in logpersist script

Bug: 28936216
Change-Id: Id05118fb51e40609fd7b3a934cf9302f67ef6d1d
2016-06-10 21:43:16 +00:00
Mark Salyzyn 0dbe899d98 Merge "logcatd: Do not su for setprop" 2016-06-10 21:43:01 +00:00
Mark Salyzyn 8d2a65572b logcatd: Do not su for setprop
sepolicy now permits setting persist.logd.logpersistd in shell

Bug: 28936216
2016-06-10 21:42:47 +00:00
Treehugger Robot c91fbfee48 Merge "logcat: clear when specifying file output" 2016-06-10 21:38:33 +00:00
Mark Salyzyn b7d059bb2f logcat: clear when specifying file output
If -c and -f are both specified, clear the files rather
than notifying the logger to clear its data. The -f then
acts like a switch between clearing the in-memory log
data, or the on-disk logrotate data.

Bug: 28936216
Change-Id: Ib1d1fb46ea09f81a2fd9bebb6c8f0f9f2355f6e8
2016-06-10 18:10:01 +00:00
Tao Bao 96c9f2d047 fs_mgr: Track the bootloader_message struct change.
A/B-specific info (slot_suffix) has been moved into struct
bootloader_message_ab.

Bug: 29193360
Change-Id: Ic655e23a2d74366e713807add15a6e9d04535cf5
2016-06-09 15:13:15 -07:00
Treehugger Robot 95428817d6 Merge "ueventd: only relabel devices if there's a delta" 2016-06-09 19:07:27 +00:00
Mark Salyzyn 8c60f2dcfe Merge "Revert "logcat: expand -n, -r and -b"" 2016-06-08 22:54:28 +00:00
Tom Cherry 86cd314af3 Merge "init: expand arguments of services when they start" 2016-06-08 22:42:11 +00:00
Vitalii Tomkiv 14b00baaae Merge "Add process priority to service definition." 2016-06-08 21:33:40 +00:00
Vitalii Tomkiv 081705c258 Add process priority to service definition.
This change allows to set prioirrity of the process to be set through
*.rc file.

Bug: 28866384
Change-Id: If0108ef05c8a151749c43d2d7de1187653255ce8
2016-06-08 13:22:14 -07:00
Vitalii Tomkiv 372e5474d4 Set zygote process priority to -20 to speed up VM startup time.
Tests for Nexus9 device shows 450ms boot time speedup, 180ms for Nexus
5X.

Bug: 28866384

Change-Id: Icefd130d4bfe5538dae5b9518250807351b0789e
2016-06-08 10:54:03 -07:00
Treehugger Robot a500cf9cdf Merge "Set file capabilities on adb sync/push." 2016-06-08 17:19:41 +00:00
Sami Tolvanen 98f1ea00e5 fs_mgr: validate corrected signatures
If signature verification fails and we have an error corrected
signature available, attempt to verify that instead.

Needs changes from
  Ie913c21ba1d07d6df4c6feeb7226b2ec963f4d19

Bug: 28943429
Change-Id: I7d48701916fe430b17aa05acb120f22a1802733d
(cherry picked from commit 830126637a)
2016-06-08 09:42:59 -07:00
Elliott Hughes 32c60b4ced Set file capabilities on adb sync/push.
Bug: http://b/29180022
Change-Id: Ia21ebf0972af41b0a3becc1189ed836fd74ae5c8
2016-06-08 09:16:28 -07:00
Mark Salyzyn 1325ebfab2 Revert "logcat: expand -n, -r and -b"
This reverts commit 33c262513f.

Bug: 28120456
Bug: 22654233
Change-Id: I2a13f009d9e08dc2389b9872e45e95e0563af22f
2016-06-08 08:22:19 -07:00
Elliott Hughes 6bf8d26c82 Merge "Allow multiple (sequential) adb users on Linux." 2016-06-08 14:24:59 +00:00
Elliott Hughes d89a6c2285 Allow multiple (sequential) adb users on Linux.
Before this, adb will fail to start for the second user who tries because
/tmp/adb.log already exists and isn't writable by the second user.

Also allow $TMPDIR to override the use of /tmp.

Bug: https://code.google.com/p/android/issues/detail?id=211420
Change-Id: Ic53da981ac0fa45bfed62e7b351d75dca0540235
2016-06-07 14:53:21 -07:00
Mattias Nissler 35d84096e9 Merge "fs_mgr: Remove incorrect free() on error paths in load_key()" 2016-06-07 21:00:03 +00:00
Treehugger Robot 04045fd4d1 Merge "libnetutils: Add synchronization per socket full operation" 2016-06-07 19:13:48 +00:00
Treehugger Robot 4ab7548406 Merge "init: Add support for ${x.y:-default} expansion" 2016-06-07 19:03:41 +00:00
Tom Cherry bac3536cc9 init: expand arguments of services when they start
Arguments of commands are expanded based on properties if they contain
${property.name}, however this is not currently done for arguments of
services.

This patch makes it that arguments of services are expanded each time
that the service starts at the point immediately before execve().

Change-Id: Iba581a8377e25a6478d4d2ec2e8b29e181d8640c
2016-06-07 11:22:00 -07:00
Mark Salyzyn 4b56162a33 init: Add support for ${x.y:-default} expansion
commit 00ede7d262 (init: do
expand_props before calling the builtins) broke logpersist

Bug: 28120456
Bug: 22654233
Change-Id: Ib4d8231665b26ac083b02243177493fab41c8978
2016-06-07 18:09:17 +00:00