bootable/recovery/applypatch/imgpatch.cpp:57:3: error: comparison of integers of different signs: 'unsigned int' and 'int' [-Werror,-Wsign-compare]
CHECK_GT(expected_target_length, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bootable/recovery/applypatch/freecache.cpp:145:50: error: comparison of integers of different signs: 'long' and '__fsblkcnt64_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
if (sf.f_bsize == 0 || free_space / sf.f_bsize != sf.f_bavail) {
~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
bootable/recovery/applypatch/freecache.cpp:190:16: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
if (free_now >= bytes_needed) {
~~~~~~~~ ^ ~~~~~~~~~~~~
bootable/recovery/applypatch/freecache.cpp:233:18: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
if (free_now >= bytes_needed) {
~~~~~~~~ ^ ~~~~~~~~~~~~
Test: `mmma -j bootable/recovery/applypatch` with -Wsign-compare
Test: Run recovery_unit_test on marlin.
Change-Id: I4aa1fd0f9b7205b9e4e50874fc4bccb62951e7fe
After we generate the localized confirmation text images for certain dpi,
we can now load these images and display them under recovery. Devices that
cannot load the images will use the backup text strings as before.
Bug: 74397117
Test: check the menu with multiple locales, and check all the images locally
with locale test, check the fall back strings.
Change-Id: Ic31a55670026c909ec7a05cb0bb4a0fc1d5d15c7
Seems they're racing with SurfaceFlinger in acquiring the display, which
occasionally takes down the device and leads to test failures.
Bug: 120601844
Test: Run recovery_unit_test on marlin. ScreenRecoveryUITest not
triggered.
Change-Id: I80b21595247a87fc1f2f95aa68df59f58bdf0257
Previously it considered a match if the given path (i.e. path to an
update package) fully equals to a mount_point. For example, `uncrypt
/data block.map` or `uncrypt /vendor block.map` would exit successfully,
without producing a block map.
Test: `uncrypt /path/to/package.zip block.map`
Test: `uncrypt /vendor block.map` fails.
Change-Id: Id946ab1c0b158b623013f89463cbb1960141d8b5
Also use android::base::{Dirname,Realpath,StartsWith}.
Test: Run uncrypt on device (`uncrypt package block.map`).
Change-Id: Ifacd01d6b35d85ea4afcb93a0dbc0235bb765a75
Some language variants have the duplicated translations. Therefore,
we can compare the translated string for each locale to the default
text string for that language. And the duplicated ones will be skipped
to save some space.
Bug: 74397117
Test: generate and check the image
Change-Id: If51fa8fe700350c06f084f0e74d3698b82d6f177
In specific, the apostrophe appears as "\'"; and a new line appears as
"\n\n". We need to handle these two cases accordingly.
Bug: 74397117
Test: generate and check the image
Change-Id: I67b1ebce7494e4a685a0c7334da58dc6df2ccb29
Add a get_system_root() function in roots.cpp
which returns / or /system based on fstab.
This factors out the 'if' check from recovery.cpp
and fsck_unshare_blocks.cpp.
Test: boot recovery, mount system
Bug: 118634720
Change-Id: If4947cba3a3f08dbe695fd2b50a9354cd302ee03
The icu library takes care of the line boundary, so that we don't need
to worry about if the given language is logogram.
Bug: 74397117
Test: Generate and check the image
Change-Id: I1447f51b178c0fca83c5497d2f5b8e4009ca7f64
The `ResourceTest` mentioned in the doc has been moved into
recovery_component_test in commit
6b28f05c5b.
Since Q, `/sbin/adbd` has been relocated to `/system/bin/adbd`. And `adb
shell` no longer requires mounting /system first, because
`/system/bin/sh` has been included in recovery image.
Test: N/A
Change-Id: I72029a6c8bfaac7a17c0a526a3c511de19356baa
GRSurface::Create() doesn't need to rely on caller specifying the buffer
size, as it can compute that info based on the given args.
This CL also uses `size_t` for all the parameters in
GRSurface::Create().
Test: Run recovery_unit_test on marlin.
Test: Build and boot into blueline recovery. `Run graphics test`.
Test: Build and boot into blueline charger mode.
Change-Id: Idec9381079196abf13553a475006fefcfca10950
This is a bug introduced while refactoring init_display_surface(), in
[1]. As a result, user of res_create_multi_display_surface(), which is
effectively `charger` right now, crashes due to buffer overrun.
This CL fixes the wrong arg and adds a sanity test for
res_create_multi_display_surface(). The testdata (battery_scale.png) is
copied from system/core/healthd/images/battery_scale.png.
[1] commit 44820ac1e3.
Bug: 119122296
Test: Run recovery_unit_test on marlin.
Test: Build and boot into charger mode on blueline. Verify that
`charger` no longer crashes.
Change-Id: Ib6d083e1512a9c3c6eb63874d26d22658921d693
A smaller list of locales helps to reduce the size of the generated
images; and mitigate the additional space requirement on the tight boot
image for some devices. The caller of the program will be responsible
for providing the locale list.
Also add a verbose option and switch to logger.
Bug: 74397117
Test: generate and check the image
Change-Id: I7b7cee681ccdc6e13fdd0575cf02f8add2ad9a2d
The word "Android" is not translated. As a result, some locales fail to
render this word and some punctuations, leading to holes in the middle
of the text. In these cases, we will need to fall back to the default font
and re-measure the text width.
For now, we haven't handled the mix of latin and logogram languages; and
we can blacklist the problematic ones first.
Bug: 74397117
Test: generate and inspect the image
Change-Id: I07d22c0dae2e31eb74f2954e354cd39a42c22f14
We need a write permission to set a flag in the file.
Change-Id: I4896ecbe0fc04374e01d006b1c8acdb932e5d16d
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
We can adjust the image width with respect to the maximum width of the
wrapped text. This will remove some black margins and reduce the final
size of the images, especially for those with short strings, e.g.
"recovery_error".
Also, add an option to centrally align the text; and fix a boundary
check in the recovery resource test.
Bug: 74397117
Test: Generate and check the image
Change-Id: Ib6cf61a9c99c4aeede16751dc0adfa23ce3f5424
Bug: http://b/119560349
Bug: http://b/112277682
Currently, any binary links in a PGO-enabled static library also needs
to opt into PGO. With b/119560349, this should be done automatically by
the build system. Until then, use the non-PGO version of libhwbinder in
recovery_component_test.
Test: m ANDROID_PGO_INSTRUMENT=all
Change-Id: Ic6e44c1cb6d6f13e60e11a46fd7e5ef54238942b