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
adb is going to start using shiny new C++17 features like
std::optional in headers that minadbd includes.
Test: mma
Change-Id: I7eb100c48abbf2364d6ff5f30aa223480e2466a6
Format the file with google-java-format --aosp. This makes the presubmit
hook happy.
Bug: 74397117
Test: mma
Change-Id: Ie342ed11449414b63f2d1ae781023e940b136bcb
WEXITSTATUS only gives meaningful value if WIFEXITED is true. So we may
see a slightly confusing message of "E:Error in /path/to/package (Status
0)" for a killed updater process (e.g. updater calling abort(3)). This
CL dumps the signal number for such a case.
Test: abort() in child process. Check the output.
Change-Id: I72e6654a6499d65155085de658062efb9f1e36ac
[platform/bootable/recovery] tools/image_generator/ImageGenerator.java:36: Wrong order for java.util.StringTokenizer import. Use Ctrl+Shift+O (Eclipse) or Ctrl+Alt+O (Intellij) to sort imports. https://source.android.com/setup/code-style#order-import-statementsERRORS:
[platform/bootable/recovery] tools/image_generator/ImageGenerator.java:43: Wrong order for org.apache.commons.cli.CommandLine import. Use Ctrl+Shift+O (Eclipse) or Ctrl+Alt+O (Intellij) to sort imports. https://source.android.com/setup/code-style#order-import-statementsERRORS:
[platform/bootable/recovery] tools/image_generator/ImageGenerator.java:50: Extra separation in import group before 'org.w3c.dom.Document'
Test: `mmma -j bootable/recovery`
Test: `repo upload` no longer gives warnings.
Change-Id: If24c6b7ca33b9223b3e326a48885c24c35b5fa68
For any patching command, the resulting data should always exactly fill
up the given target range.
Test: Run recovery_component_test on marlin.
Change-Id: Ib3cc1fc5c11094e2eab3fe370753db51c7c4135c
testdata/jarsigned.zip and testdata/unsigned.zip became dead since
commit 432918603f ("Refactor existing
tests to use gtest").
testdata/patch.bsdiff became dead when applypatch/applypatch.sh was
deleted (commit c3ef089dfa).
Test: Run recovery_unit_test and recovery_component_test.
Change-Id: Ie1a7f8850878593fcb7d4554759a539271ffb207
Encode the width, height and locale of the localized image as pixels so
that recovery can locate the correct range of the image from a
concatenated png file.
Also address a few todoes including wrapping the CJK text, making a
catch-all type for all languages.
Test: view the generated image under locale test
Change-Id: Icd3997eb4e992e76ef72526787d64c406f606970