The former `minadbd` module is now built as a shared library
(`libminadbd_services.so`) that serves sideloading under recovery, with
a dynamic dependency on `libadbd.so`.
This allows sharing and reusing libadbd code on device (both of `adbd`
and `recovery` now uses `libadbd.so`). As a result, it reduces the size
of `recovery` binary from 1407360-byte to (1272880 + 33032)-byte
(aosp_marlin-userdebug).
Bug: 78793464
Test: `m -j bootimage` with aosp_marlin-userdebug
Test: Run minadbd_test on marlin.
Test: Boot into recovery and verify that sideloading still works.
Change-Id: I6c2bc3d351d5af71220a9b9f956c8c039e52c781
We used to statically link the device-specific recovery UI extension
(`TARGET_RECOVERY_UI_LIB`) into `recovery`. Such a logic can't be easily
migrated to Soong, as modules specified by `TARGET_RECOVERY_UI_LIB` may
not be built with Soong.
Instead of porting all the device-specific codes over, this CL builds
and installs the UI lib as a shared library with Android.mk. `recovery`
dlopen(3)'s and dlsym(3)'s `make_device` to invoke the device-specific
UI lib on start.
Note that in order to make dlopen(3) actually working, we have to switch
`recovery` to be dynamically linked (we will make the move later
anyway).
Bug: 110380063
Test: Build and boot into marlin recovery image. Check that
device-specific recovery UI is successfully loaded.
Change-Id: Ia9861c7559a95f3f50676534540c0cb87cae4574
The new command is part of the transfer.list and allows us to compute the hash
tree on non-ab devices.
The required arguments for the hash_tree computation are:
hash_tree_ranges
source_ranges
hash_algorithm
salt_hex
root_hash
Bug: 25170618
Test: unit tests pass; run simulator with compute_hash_tree
Change-Id: I8ff0d582cc8adabb8a060db7845f38b35b28e62c
Note that although libminui says "shared_libs" in Android.bp file,
`recovery` binary will still statically link the libs, until we drop the
`LOCAL_FORCE_STATIC_EXECUTABLE := true` flag from `recovery` module.
Bug: 110380063
Test: `mmma -j bootable/recovery` with aosp_taimen-userdebug
Test: Boot into recovery and `Run graphics test`.
Change-Id: I48785d161dfe52eb01667e938d9c3f0a497b61a2
This CL removes the use of the following build time macros, and uses the
runtime property values instead.
- TARGET_RECOVERY_PIXEL_FORMAT
- TARGET_RECOVERY_OVERSCAN_PERCENT
- TARGET_RECOVERY_DEFAULT_ROTATION
Bug: 110380063
Test: Set up taimen with `TARGET_RECOVERY_DEFAULT_ROTATION := ROTATION_LEFT`.
Build and check recovery UI.
Test: Set up taimen with `TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888`.
Build and check recovery UI.
Change-Id: I4439556a03fde4805a18011ef72eff1373f31d47
This CL uses scoped enum for GRRotation. It also refactors the previous
comparisions to improve readability -- it was hard to tell the meaning
of `if (rotation % 2)` unless by checking the exact values.
It also temporarily adds STRINGFY to expand the macro of
DEFAULT_ROTATION. This will be removed once minui is changed from
reading build time vars to runtime properties.
Test: Build and boot into recovery image on marlin.
Test: Set `TARGET_RECOVERY_DEFAULT_ROTATION := ROTATION_LEFT` and check
the display under recovery with `Run graphics test`.
Change-Id: Ieb08b1cd13c284f8dcf906cb2a1430c6bae2835b
The matching change to build system now writes these values as build
properties for recovery image. This allows us dropping the dependency on
Android.mk (as well as having more flexibility to do UI customization).
Also rename a few constant names, as the naming doesn't fully follow the
style guide (which reads "whose value is fixed for the duration of the
program").
Bug: 110380063
Test: Build and flash recovery image on taimen, which uses custom margin
height. Check the UI and choose `Run graphics test`.
Change-Id: I2c50326123639cb36022f51b62cdeed925d77ba7
Normally calling a UI method will block
indefinitely until the UI is actually
used. This creates a method to interrupt
the UI, causing waitKey to return -2. This
in turn, will cause ShowMenu to return -2.
This allows switching between recovery and
fastbootd via usb commands.
Test: adb shell /data/nativetest64/recovery_unit_test/recovery_unit_test
Bug: 78793464
Change-Id: I4c6c9aa18d79070877841a5c9818acf723fa6096
Previously, we were relying on linker ordering pulling in minadbd's
copy of services_to_fd instead of libadbd's, which breaks when we
switch to dynamically linking. Separate out libadbd's services into a
separate function that's in a file that isn't built into libadbd, so
that we can provide our own here.
Bug: http://b/111831478
Test: mma
Change-Id: I2479947b2d81db5e750020fffc2c2c770cb31a78
Executables should be in /system/bin
rather than sbin.
Bug: 78793464
Test: boot into recovery, try adb sideload
Change-Id: I194589119a099d29e56b0648f0906a5ae2aa6770
Switching to the protobuf format helps to make the care_map more
extensible. As we have such plans in the future, add the support to
parse the protobuf message in the update_verifier.
Bug: 77867897
Test: unit tests pass, update_verifier successfully verifies a care_map.pb
Change-Id: I9fe83cb4dd3cc8d6fd0260f2a47338fe142d3938
And uses the shared lib version of libbase and libfs_mgr.
Bug: 78793464
Test: `m dist`
Test: Run recovery_{unit,component}_test on marlin.
Change-Id: I750c02d0bfccd6e58fb01f641de02532ace52e00