graphics.h uses size_t, but doesn't pull in a declaration. This results
in compile errors if code that includes graphics.h (such as
hardware/hardware.h) doesn't happen to have a size_t declaration from
elsewhere.
Change-Id: I0f3882c3dce20425697d25366d49930b2251ef7f
- collect st_rdev on open, or when required, for /dev/ashmem.
- check in all cases if fd is a character device and matches rdev.
- requires that we have open, read and write access to /dev/ashmem
to check, assumption being that if we can not, then we have no
right playing with the associated misdirected file descriptor.
NB: ashmem libcutil library entry points can no longer be called in
signal context.
Bug: 26871259
Change-Id: I9a17e33317a9be795131473a51c16f761b5f7407
Fixes SocketMock::ExpectSendFailure() to allow unit testing of errors
during send, and adds tests for ExpectSendFailure() and
AddReceiveFailure().
Also adds missing tests to make sure ReceiveAll() continues to read
until failure or all bytes have been read.
Bug: http://b/26157893
Change-Id: I67e7d6de8e8ec4a3b62a6b7d7217f7530862edf7
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
and print a warning message containing the type
when the battery monitor fails to recognize a power supply.
Change-Id: I02ebd89736f7444f8bf7f28550afeec82d57e107
strdup to a static pointer is unnecessary, strlcpy into a static buffer
instead. Avoids allocations in the ALOG* path, allowing liblog to be
used by libmemleak.
Change-Id: Ie0986da27c1fc5eb8ce4ebb076b513be8e1ee676
- sort header order and in groups
- remove all tabs, use only spaces
- use TEMP_FAILURE_RETRY in system calls
- preserve errno for -1 return
Bug: 26871259
Change-Id: I94fffbcaeba01fcc18a3ed07c02389c06c54d3b7
(This code was originally part of a huge fastboot CL but has been split
out to try to make the CLs a little more manageable).
More prep for fastboot TCP and UDP implementations. This CL adds a
SocketMock class that makes it easy to mock out network behavior so we
can unit test the TCP and UDP protocols.
Also uses the new libcutils socket_get_local_port() to avoid hardcoding
a server port in unit tests.
Bug: http://b/26157893.
Change-Id: I1ba10f31e98d7349313fc15f240383d63378a8db
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
Note that with this change the linker will ignore
icu libraries provided by an app because public
libraries are always provided by system. At this point
it does not affect any apps because before Marshmallow
all of them were getting platform version of icu4c
libs anyways (they will be getting their own copy of the
library only in Marshmallow release).
Bug: http://b/26217329
Bug: http://b/26929349
Change-Id: I681cab43c9f28ec22319d9f0424bd3df00743a5f