Commit graph

6411 commits

Author SHA1 Message Date
Tianjie Xu
7e520d24fe Add a python binary to generate the protobuf for care_map
This binary parses the legacy care_map text in the input file and writes
the generated protobuf message into the output file. For test purpose,
it also has a "--parse_proto" option to reverse the process and convert
a protobuf message file into plain text.

The build script will then call the binary to generate the care_map.txt
in the new format.

Bug: 77867897
Test: Run the binary to convert a care_map.txt, run update_verifier
Change-Id: I3ca65e19027404806132aa8d51e9bff766630c99
2018-08-16 15:09:32 -07:00
Tianjie Xu
c8e0292b61 Merge "Further compress the recovery animation file" 2018-08-15 22:30:55 +00:00
Tianjie Xu
e45f359e9c Further compress the recovery animation file
The res/images/loop.*png can be further compressed with "pngquant
--quality 0-10"; and the difference is not noticeable to humans
under recovery. And This reduces the animation pictures under res-xxxhdpi
from 2.7M to 1.2M.

Note that the *_text.png files can't be compressed this way because they
requires lossless compression to keep the embedded locales intact.

Bug: 112494634
Test: Run recovery graphic tests.
Change-Id: I2cefaea8e037cb09cb4e4735d1b86e82da9e6875
2018-08-15 19:07:08 +00:00
Tao Bao
b1ff1bc43b Merge "tests: Move to Android.bp." 2018-08-15 17:56:19 +00:00
Tao Bao
ef5e38fef0 tests: Move to Android.bp.
Also separate libupdater_defaults out to be shareable.

It turns out the `data` property in `cc_test` doesn't follow symlinks as
LOCAL_TEST_DATA does in Android.mk. This CL creates a filegroup in
top-level Android.bp in order to pick up the testdata for ResourcesTest.

Test: `mmma -j bootable/recovery` with aosp_marlin-userdebug
Test: Run recovery_{unit,component,manual}_test on marlin.
Test: Run recovery_host_test.
Change-Id: I4532ab25aeb83c0b0baa8051d5fe34ba7b910a35
2018-08-14 21:46:45 -07:00
Tao Bao
97de9c3d3e Merge "Track the change to update_engine_sideload path." 2018-08-15 01:46:31 +00:00
Treehugger Robot
19a5316412 Merge "Add fastboot mode to recovery" 2018-08-14 21:25:50 +00:00
Yifan Hong
ce2f0d85fb Merge "recovery uses IHealth::getService" 2018-08-14 21:06:58 +00:00
Tao Bao
2cc9bbb1ec Track the change to update_engine_sideload path.
Bug: 112494634
Test: Build and boot into recovery image on taimen. Verify that
      `Apply updates from ADB` keeps working.
Test: Run recovery_component_test on marlin.

Change-Id: I9ee8834053fda79a4fd77bfa83eab3cc51a90dff
2018-08-14 12:34:46 -07:00
Tao Bao
c205dd9d43 Merge "updater: Move libupdater to Soong." 2018-08-14 16:43:15 +00:00
Tao Bao
19d002d33f Merge "recovery: Drop the dependency on libcrypto_utils.so and libsparse.so." 2018-08-14 16:42:37 +00:00
Tianjie Xu
c0195801dc Merge "Add the hash_tree_info class in Command" 2018-08-14 16:33:10 +00:00
Tao Bao
b0f132e244 recovery: Drop the dependency on libcrypto_utils.so and libsparse.so.
They're only needed in past when we statically linked libs that had
dependencies on them. Dropping them doesn't affect the recovery image
size, as there're still other users of the libs. But this would avoid
the false dependencies on them.

Test: `mmma -j bootable/recovery`
Change-Id: Ib43cc42221edde9efea1f12357cfc2f2232ec520
2018-08-13 23:02:17 -07:00
Hridya Valsaraju
20c81b308d Add fastboot mode to recovery
Add a fastboot mode to recovery that can be
entered with command line args or with the ui.

Add usb property triggers to switch between
fastboot and adb configurations.

Allow switching between fastboot and adb through
usb commands by opening a unix socket. adbd/fastbootd
writes to this socket, which interrupts the ui and
switches to the new mode.

Test: Use fastboot mode
Bug: 78793464
Change-Id: I7891bb84427ec734a21a872036629b95ab3fb13c
2018-08-13 21:18:18 -07:00
Tianjie Xu
8f64bf635f Add the hash_tree_info class in Command
Add hash_tree_info to represent the hash tree computation arguments in
the transfer commands 'compute_hash_tree'. Also add its parsing code in
the Command class.

Bug: 25170618
Test: unit tests pass
Change-Id: Ie8607968377968e8fb3e58d1af0b8ca315e145be
2018-08-13 17:27:30 -07:00
Yifan Hong
056538c0a9 recovery uses IHealth::getService
recovery is_battery_ok function uses get_health_service(),
which calls IHealth::getService("default") then
IHealth::getService("backup").

- An OEM can provide the default instance by installing
  android.hardware.health@2.0-impl-<device>.so to recovery
  partition.

- If that's not found, the "backup" instance is provided
  to the recovery partition by default.

Test: call is_battery_ok() in recovery, successfully
  get battery information.

Bug: 80132328

Change-Id: Ibfee80636325a07bc20b24d044d007a60b3dd7c2
2018-08-13 16:16:18 -07:00
Tao Bao
337bd80b78 Merge "Reland "Build and use minadbd as a shared library."" 2018-08-13 22:52:56 +00:00
Tao Bao
7d2a63afe1 Reland "Build and use minadbd as a shared library."
This relands the previously reverted CL in commit
c70446ce7b ("Build and use minadbd as a
shared library."). `recovery` has been built with Soong, so the previous
concern (unintentionally installing `libminadbd_services.so` to normal
system image) no longer holds.

Note that `reocvery` can't use `libminadbd_services.a`, as functions
like `daemon_service_to_fd()` (needed by `libadbd.so`) won't be linked
into `recovery`.

This CL moves the dependency of `libminadbd_services` from `librecovery`
into `recovery`, as only the latter actually relies on it (via
`recovery_main.cpp`). Note that we no longer need to list the transitive
dependency on `libadbd` or `libasyncio`.

Bug: 112494634
Test: `mmma -j bootable/recovery`
Test: Build and boot into recovery with aosp_taimen-userdebug. Verify that
      sideloading keeps working.
Test: `build/soong/build_test.bash --dist`
Change-Id: Ic086470b86d6770bede317e0f5534f608fa7b7d2
2018-08-13 14:09:58 -07:00
Colin Cross
1914bd0f4b Merge "Remove TODO for b/112462307" 2018-08-13 21:02:58 +00:00
Colin Cross
f27ca7eff6 Remove TODO for b/112462307
b/112462307 is fixed now, remove the TODO.

Bug: 112462307
Test: dexlist out/soong/.intermediates/bootable/recovery/updater_sample/SystemUpdaterSample/android_common/dex/classes.dex | grep getUpdaterState
Change-Id: I19cb93a74b714967e4bab2964e229a0ab0a15676
2018-08-13 12:38:28 -07:00
Tao Bao
673bb6f051 updater: Move libupdater to Soong.
Test: mmma -j bootable/recovery
Test: Run recovery_unit_test and recovery_component_test on marlin.
Change-Id: I2617b87d13c585addf0ed2fbae8c3ce443ea7200
2018-08-13 09:44:48 -07:00
Tao Bao
df264e0186 Merge "Build recovery with Soong." 2018-08-13 16:25:48 +00:00
Tao Bao
2cc6211165 Merge "tests: Create res-testdata for testdata pickup." 2018-08-13 15:35:09 +00:00
Tao Bao
13f9816e14 tests: Create res-testdata for testdata pickup.
It doesn't change the functionality of the test, but allows easier
conversion to Soong.

Test: Run recovery_component_test on marlin.
Change-Id: Ic7419dc86c6b220531ae44e49ab4657394a5d7fa
2018-08-12 21:57:08 -07:00
Treehugger Robot
bbe881693a Merge "Build boot control HAL with Android.bp" 2018-08-10 22:48:19 +00:00
Tao Bao
5fc72a103b Build recovery with Soong.
Fixes: 110380063
Test: `mmma -j bootable/recovery` with aosp_taimen-userdebug
Test: Build and boot into recovery on taimen. Check the basic
      functionalities (`Apply update from ADB`, `View recovery logs`,
      `Run graphics test`).
Test: Run recovery_unit_test and recovery_component_test on marlin.
Test: Modify `recovery.cpp` locally to trigger the call to
      is_battery_ok(). Check that the battery info is reported
      correctly.
Test: `build/soong/build_test.bash --dist`
Change-Id: I391eb201d57c760e457ba2bf2410ceb72596795c
2018-08-10 14:43:27 -07:00
Tao Bao
afa16480aa Merge "updater_sample: Move to Soong." 2018-08-10 18:10:31 +00:00
Tao Bao
3c5e2c1c7e Merge "recovery uses more shared libraries." 2018-08-10 18:10:16 +00:00
Tao Bao
d2be7fc29a updater_sample: Move to Soong.
Test: Follow the steps in "Running tests" in updater_sample/README.md.
Change-Id: I70c3239e3daea0dcdadf02f68abe7d6aafa67a2e
2018-08-10 09:05:56 -07:00
Hridya Valsaraju
c53dad20d0 Build boot control HAL with Android.bp
Bug: 78793464
Test: make
Change-Id: Id5efceda0f5e93bbaf33c2dc3e203fd39ef44e28
2018-08-09 22:15:01 -07:00
Tao Bao
818f938188 recovery uses more shared libraries.
Bug: 110380063
Test: `m -j installclean && mmma -j bootable/recovery` with
      aosp_taimen-userdebug
Test: Build (`m -j bootimage`) and boot into recovery. Check that
      `adb sideload` and `Run graphics test` both work.
Test: Run recovery_unit_test and recovery_component_test on marlin.
Change-Id: Ie6ed0e7cafa352d5faff9d1b6ccef724a0415e65
2018-08-08 14:26:27 -07:00
Tao Bao
08cf9ccb2f Merge "Revert "Build and use minadbd as a shared library."" 2018-08-08 16:36:20 +00:00
Tao Bao
c70446ce7b Revert "Build and use minadbd as a shared library."
This reverts commit 4fd4f89591.

The reverted CL has a side effect that unintentionally installs
a copy of libminadbd_services.so to the system image. This breaks the
check with `build/soong/build_test.bash --dist` which detects and
prevents vendor modules from installing files to the system image.

Prior to fully converting `recovery` to be built with Soong, we have to
statically link recovery-specific modules into `recovery`.

Bug: 110380063
Test: `m -j bootimage` with aosp_marlin-userdebug
Test: Run minadbd_test on marlin.
Test: Boot into recovery and verify that sideloading still works.
Test: `build/soong/build_test.bash --dist`
Change-Id: I290d55c82e17aa60a5afdf2ff7f896afc4dae8b3
2018-08-07 20:44:39 -07:00
Tao Bao
60924fa89a Merge "minui: Track libsync module name change." 2018-08-08 00:26:38 +00:00
Tao Bao
1e4f9c0477 Merge "Fix the DRM_FORMAT match with corresponding PixelFormat" 2018-08-07 19:49:14 +00:00
Tao Bao
1c4d4bf4f4 minui: Track libsync module name change.
Needs the matching change to libsync_recovery.

Test: `mmma -j bootable/recovery`
Change-Id: I69b5c978e9b4d16957ffecd360796b29cd95865c
2018-08-07 11:04:27 -07:00
Tao Bao
ea38c4160a Merge "Build and use minadbd as a shared library." 2018-08-07 17:50:45 +00:00
tangrobin
13bec76662 Fix the DRM_FORMAT match with corresponding PixelFormat
The DRM_FORMAT settings in DrmCreateSurface should match with the
correct PixelFormat

Bug: 112245291
Test: build and flash boot image to device.
Change-Id: I3ee0de38256d1109cd5174b666e2f47dceb637e6
2018-08-07 10:10:33 -07:00
Xin Li
9791b21c1f Merge "Merge Android Pie into master" 2018-08-07 16:51:25 +00:00
Tom Cherry
aceb244401 Merge "ueventd is now at /system/bin/ueventd" 2018-08-07 16:08:55 +00:00
Tao Bao
4fd4f89591 Build and use minadbd as a shared library.
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
2018-08-06 17:06:43 -07:00
Xin Li
8ab68527b8 Merge Android Pie into master
Bug: 112104996
Change-Id: I3256ec97f091b367c5a2c0b31430a975073a2c1b
2018-08-06 16:50:00 -07:00
Tianjie Xu
b5bc978432 Merge "Add an updater function to compute hash tree"
am: dbe4420325

Change-Id: If426801d3494be02404c8e4f6d4f064fd6540a4d
2018-08-06 15:36:55 -07:00
Tao Bao
75acf24207 Merge "Dynamically load device-specific recovery UI lib."
am: 9cf9b689d9

Change-Id: I73e3fdc01ff4b51fd18272980ce1360b0bc069f7
2018-08-06 15:32:57 -07:00
Tianjie Xu
dbe4420325 Merge "Add an updater function to compute hash tree" 2018-08-06 22:19:04 +00:00
Tao Bao
9cf9b689d9 Merge "Dynamically load device-specific recovery UI lib." 2018-08-06 21:46:10 +00:00
Tao Bao
42c45e2b66 Dynamically load device-specific recovery UI lib.
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
2018-08-06 12:35:23 -07:00
Tianjie Xu
69ffa15338 Add an updater function to compute hash tree
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
2018-08-06 12:17:50 -07:00
Tao Bao
ea105889a5 Merge "minui: Move to Soong."
am: f2bc68cfe1

Change-Id: Iab9a892a3d4d691884e4709c288de1d122d67473
2018-08-06 10:58:16 -07:00
Tao Bao
f2bc68cfe1 Merge "minui: Move to Soong." 2018-08-06 17:29:50 +00:00