Simplifications/changes:
(1) We remove the bufPos field and track the end of the buffer using
only the size field.
(2) We rename put_<type>() functions to append_<type>() to signify that the
value will be placed at the end of the buffer. We also move the
increment of event->size to within the append_<type>() functions;
this improves readability of the write_<type>() functions.
(3) We immediately write the timestamp and atom id to the buffer in
order to simplify stats_event_build().
(4) We never check for null pointers; checking for null pointers
delays errors and obfuscates the root problem.
(5) We change the the annotationId and numPairs parameters to be
uint8_t's. This helps signify to clients that these values must fit
in 1 byte.
(6) Clients no longer have to pass in the length of strings. Instead, we
expect them to pass in null-terminated strings, and we will
calculate the length outselves using strnlen.
Test: m -j libstatssocket
Change-Id: I6d192768876a23d7016173bcdaf59f8b7e92b182
Merged-In: I0173f8bc76ef25118379dce5d2481f5f7a9b7519
Encoding of key-value pairs follows strategy described in
go/statsd-socket-doc.
Fixed bug where timestamp and atom id were not contributing to the
number of fields in the buffer.
Note: Similar to ag/9603344, which was abandoned because of git rebasing
issues.
Test: m -j libstatssocket compiles
Bug: 143079361
Change-Id: I15abdf13ad8debf83ae1f6c372676db4fe390289
Merged-In: I8d23ddf2dbfee518ad970894ac09ba3ad5b5b4ad
This allows the parsing code within statsd to access the type ids.
Also, we move stats_event.h to the include directory for consistency.
Test: m -j libstatssocket
Change-Id: I7030416872677f3a523c2baf7bf6bcb4ca0ae6a4
Merged-In: I1db7fc9e9d0efd2225612353a8fc49bb13220ff0
We use /data/incremental to keep all the directories that are mounted on
the Incremental File System.
Since system_server does not have permission to dynamically create dirs
directly under /data, we create /data/incremental in init.rc.
Test: boots
BUG: 136132412
Change-Id: Ic90cc8f652672a8d4459c0cd38db9c0872217af4
These weak symbols are no longer necessary because we no longer
need to statically link libvndksupport.
Furthermore, these symbols are not really optional when libvndksupport is
dynamically linked. When the library is linked with --as-needed the linker
may drop the reference to libdl_android.so, which leads to a failure to boot.
Bug: 146456667
Change-Id: I4d2290d8d0206e0d89665d4d872a7c53b3e1531b
This fixes two bugs in how we use fallocate(). First, using ZERO_RANGE
is a mechanism to allocate holes, not blocks. Instead we should be
passing no flags.
The reason this code worked is because of our explicit writes to the
file, which is intended to defeat lazy block allocation. This is not
necessary for F2FS with proper file pinning support, so we now skip this
when possible.
Together, these fixes improve the speed of "adb remount" when backed
by libfiemap.
Bug: 134949511
Test: adb remount when backed by /data
Change-Id: I746053d183e0c83d56979d9c3fa6d96b40b5e478
d77c99ebc3 changed MappedFile to return a
bogus zero-length mapping on failure rather than nullptr. None of the
calling code was changed, though, and it seems like doing so would be a
bad idea. Revert that part of the change.
Add missing tests, and tidy up some of the logging. Also remove
single-use or obfuscatory constants from the tests.
The new "empty.zip" was created by using zip(1) to create a zip file
with one entry, then using `zip -d` to remove it.
The new "zero-size-cd.zip" was created by using zip(1) to create a zip
file containing a single empty file, and then hex editing the two byte
"size of the central directory" field in the "end of central directory
record" structure at the end of the file. (This is equivalent to, but
much smaller than, the example zip file provided by the bug reporter.)
Bug: http://b/145925341
Test: treehugger
Change-Id: Iff64673bce7dae886ccbc9dd6c2bbe18de19f9d2
This reverts commit 5d53bfce2d.
Reason for revert: for consistency, we've decided that for now, all code will have the same view of /storage: FUSE. Will address the TODO here later.
Change-Id: Ia75e23c91fb098f6309c160de2889f06507c3717
This reverts commit b20aa434a3.
Bug: 146403375
Reason for revert: broken build 6078429 on git_master on walleye-user
Change-Id: Idc3b1c0ad5228d63298ce84811624b23d0cea434
When bind-mounting flattened APEX, use the apex name found in
apex_manifest.pb as the mount point, instead of the directory name which
might be different from apex name in case when the apex is overridden.
This allowed us to remove the special casing for the ART apex since we
/system/apex/com.android.art.release will be mounted to
/apex/com.android.art instead of /apex/com.android.art.release.
Bug: N/A
Test: m
Test: OVERRIDE_TARGET_FLATTEN_APEX=true m, device is bootable
Change-Id: Ibdde7002b9078db390e6672b0eb82c474925451d
Add an API that does not initiate the merge, but only waits for it to
finish. It is different from ProcessUpdateState API in that it also
blocks when state == UNVERIFIED and booting from the new slot.
(ProcessUpdateState immediately returns in this case).
This is useful for android.os.UpdateEngine.CleanupSuccessfulUpdate().
Bug: 138808328
Test: libsnapshot_test
Change-Id: I7cc59fcaf69616e7ec7ebe6101991b5106845b65
Factor out obscure logic that reads boot indicator path.
GetCurrentSlot() returns three states:
- None (read failure)
- Old (before reboot)
- New (after reboot)
Use these "logical" slot values for simpler code.
Test: libsnapshot_test
Change-Id: I1fa2ce4916c5a1652d25682ec1f11e101c858822
A few times we have wanted to stash small bits of information in the
super header, but we haven't had any bits to do so. This patch addresses
future needs in two ways:
1. A "flags" field has been added for miscellanious bits that do not
need a version bump.
2. The header struct has been padded to 256 bytes to allow for future
expansion without complicating the struct-parsing code.
This is the first time we've materially changed the format, so this
patch needs some extra explanation.
In all the places we rely on sizeof(LpMetadataHeader), we now need to
use the |header_size| field instead. To make newer versions of liblp
compatible with older headers, we read the minimum required header size
and fill in the extra bytes as needed. To make the validation and
reading logic more clear, it is now combined into a single function,
ReadMetdataHeader.
MetadataBuilder will still emit 1.0-compatible headers, to avoid
changing the on-disk format of existing devices. The new header will
only be emitted as-needed.
Bug: 134949511
Test: liblp_test gtest
retrofit DAP device boots
launch DAP device boots
Change-Id: I6221123768ff0057a73967ecb2ff9b006c17af88