Fixes libcutils multi-buffer write interface to be more friendly and
hooks into it from the fastboot Socket class.
Bug: http://b/26558551
Change-Id: Ibb3a8428fc379755602de52722c1260f9e345bc0
Unix and Windows both have functions to write multiple buffers to a
socket with a single call but they have very different signatures. This
CL creates some cross-platform functions to be able to perform these
operations in a uniform way, which will be required for upcoming
fastboot functionality.
This CL also fixes some inconsistent spacing in the touched files.
Bug: http://b/26558551
Change-Id: I8f14d52d3a1de1f3b464267666d6cd3b54263238
Tests that require a local server currently hardcode a test value,
which can run into conflicts depending on what's currently running on
the machine.
This CL adds socket_get_local_port(), which lets us pass 0 so the
system picks an open port and we can query which port it chose.
Bug: http://b/26236380
Change-Id: I01d1558884e7636081d9a357db6faa86929934f6
Now that cutils has cross-platform socket functionality, we can
restructure fastboot to remove platform-dependent networking code.
This CL adds socket_set_receive_timeout() to libcutils and combines the
fastboot socket code into a single implementation. It also adds TCP
functionality to fastboot sockets, but nothing uses it yet except for
the unit tests. A future CL will add the TCP protocol which will use
this TCP socket implementation.
Bug: http://b/26558551
Change-Id: If613fb348f9332b31fa2c88d67fb1e839923768a
This CL moves Windows networking code from fastboot to libcutils so
that it can be shared with other host programs such as adb.
Not all libcutils networking functions have been implemented for
Windows, just those necessary for fastboot. In the next CL I will do
the same for adb, adding any additional required functions.
Unit tests have also been added to test the functions using a loopback
connection.
Bug: http://b/26236380.
Change-Id: Ibc51a67030fe69a04c23512eefa9d19b055c7c12
This allows someone to stream the data out of a zip archive
instead of extracting to a file or to memory.
Included in this change is a small cleanup of the makefile.
Change-Id: I8b679a679c3502ff4ea0bc4f9e918303657fa424
-metrics_collector and metricsd gather and upload device metrics.
-webservd is part of the Weave (Brillo remote setup and management) stack.
Bug: 26337609
Change-Id: Icf6ce75e64293adbe773f2ee65e80629f2eeb737
In libraries relying on binder it is useful to be able to obtain an
existing copy of BinderWrapper or create one if it doesn't exist.
This allows to abstract the actual RPC (binder) from clients who have
no other dependencies on this RPC.
BUG: 23782171
Change-Id: Ie775d3d8ab83d75e38abc7e1385eb39a363555ef
* Added new kernel GID named "wakelock" (AID_WAKELOCK = 3010)
* Changed the group access for /sys/power/wake_lock and
/sys/power/wake_unlock from "system" to "wakelock"
* Added "wakelock" to the list of groups for the healthd process/service
Bug: 25864142
Change-Id: Ieabee9964cccec3107971a361a43aa9805164aa9
Shared namespaces are used for bundled app classloaders.
Bug: http://b/22548808
Bug: http://b/26165097
Change-Id: I163033f70c50ef9ddb4164676c033ab30748964e
(cherry picked from commit ef4639c1a5)
* changes:
logger.h: reduce maximum payload so sum is page size
liblog: test for maximum payload can not survive change
liblog: logprint use uid name if length less then 5
liblog: logprint add uid format modifier
liblog: readlog apps get logger_entry_v4 for pstore
logd: readlog apps get logger_entry_v4
logger.h: Add definition for logger_entry_v4
Reduce maximum log payload so that the sum with the maximum
length header logger_entry_v4 is a page size. This is a
performance measure.
Expect side effects, truncates messages 8 bytes earlier. The
length has a long history (2008) so there may be non-C code
somewhere that has it hard-coded rather than reflecting this
header. CTS tests may need to be adjusted.
Bug: 25996918
Change-Id: I598c8c5cc78f6b0afc2c1f30cc6f3c18eb8c4c9d
Extends logger_entry_v3 to add an uid field and moves some fields to
unsigned (easier to have zero'd bit-field for future adjustments).
Still no version field, not crossing that bridge, historical reasons.
Bug: 25996918
Change-Id: I18b7291666c3a5b170d6771a012363a41f2c5847
Return non-zero if ro.device_owner is set and not false
and persist.logd.security is true.
Bug: 26029733
Change-Id: Ie82ae11ae35e9c79017b6e873fefb39d79a1d4fe
If ANDROID_LOG_WRAP is specified, add timeout=3600 to the reader
request. logd will comply by going to sleep with the socket open.
If the start time is about to wrap or get pruned in the specified log
buffers, then wakeup and dump the logs; or wakeup on timeout,
whichever comes first.
Bug: 25929746
Change-Id: I531b4317a20abcf3ba87d78c68fa2f268a4488ab
Extracted native loader to separate library in order to
be able to reuse it for NativeActivities related native code
in libandroid_runtime.so
Bug: http://b/22548808
Change-Id: Ibcf5ddcdc5aba22e32e4b72887840e9c171c1986
android_log_timestamp returns the property leading letter,
it is better to return a clockid_t with android_log_clockid()
Bug: 23668800
Change-Id: I38dee773bf3844177826b03a26b03215c79a5359
android_log_timestamp returns the property leading letter,
it is better to return a clockid_t with android_log_clockid()
Bug: 23668800
Change-Id: I3c4e3e6b87f6676950797f1f0e203b44c542ed43
Although ever present, an increased regression introduced with
commit b6bee33182 (liblog: logd:
support logd.timestamp = monotonic).
A signal handler can interrupt in locked context, if log is written
in the signal handler, we are in deadlock. To reduce the contention
and chances for this problem separate out timestamp lock from is
loggable lock to reduce contention situations. Provide a best-guess
response if lock would fail in timestamp path.
Use a common lock() inline within each module, with a comment speaking
to the issues surrounding calling a function that has a mutex within
a signal handler.
ToDo: Hold off signals temporarily in mainline, restart when unblock.
Can not use pthread_sigmask(SIG_BLOCK,,) as it breaks AtCmd.
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 25563384
Change-Id: I47e2c87c988c3e359eb9eef129c6a3a08e9eedef
Although ever present, an increased regression introduced with
commit b6bee33182 (liblog: logd:
support logd.timestamp = monotonic).
A signal handler can interrupt in locked context, if log is written
in the signal handler, we are in deadlock. Block signals while we
are locked. Separate out timestamp lock from is loggable lock to
reduce contention situations. Provide a best-guess response if
lock would fail in timestamp path.
Bug: 25563384
Change-Id: I6dccd6b99ebace1c473c03a785a35c63ed5c6a8a
We use this specifically in situations where we expect to read
an object from a Parcel, but fail because the object is null.
Bug: 25617251
Change-Id: Id0b6118b19a932998b5028e30dc15d70e4d7f9c3
Add the following mount options to the /proc filesystem:
hidepid=2,gid=3009
This change blocks /proc access unless you're in group 3009
(aka AID_READPROC).
Please see
https://github.com/torvalds/linux/blob/master/Documentation/filesystems/proc.txt
for documentation on the hidepid option.
hidepid=2 is preferred over hidepid=1 since it leaks less information
and doesn't generate SELinux ptrace denials when trying to access
/proc without being in the proper group.
Add AID_READPROC to processes which need to access /proc entries for
other UIDs.
Bug: 23310674
Change-Id: I22bb55ff7b80ff722945e224845215196f09dafa